Commit af6c81e
UN-3159 [MISC] Add improved logging for retrieval operations (#1747)
* UN-3159 [FEAT] Add improved logging for retrieval operations
- Add cache statistics logging to variable_replacement lru_cache (logs every 50 calls with hit rate, cache size)
- Move retry logging in simple retriever to only log when actually retrying (not for initial attempts)
- Optimize json_repair_helper with heuristic to skip double parsing when unnecessary
- Add detailed retrieval metrics logging to services/retrieval.py for better observability
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Revert json_repair_helper.py changes
Remove the heuristic optimization - keeping only logging improvements in this PR.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Praveen Kumar <praveen@zipstack.com>1 parent 2a433ea commit af6c81e
File tree
3 files changed
+67
-17
lines changed- prompt-service/src/unstract/prompt_service
- core/retrievers
- helpers
- services
3 files changed
+67
-17
lines changedLines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | 12 | | |
16 | 13 | | |
17 | 14 | | |
| |||
21 | 18 | | |
22 | 19 | | |
23 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
Lines changed: 26 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
164 | 169 | | |
165 | | - | |
166 | | - | |
167 | | - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
168 | 191 | | |
169 | 192 | | |
170 | 193 | | |
| |||
Lines changed: 37 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
| |||
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
35 | 47 | | |
36 | 48 | | |
37 | 49 | | |
38 | 50 | | |
39 | 51 | | |
40 | 52 | | |
41 | | - | |
| 53 | + | |
42 | 54 | | |
43 | 55 | | |
44 | 56 | | |
| |||
101 | 113 | | |
102 | 114 | | |
103 | 115 | | |
104 | | - | |
105 | | - | |
106 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
107 | 124 | | |
108 | 125 | | |
109 | 126 | | |
| |||
113 | 130 | | |
114 | 131 | | |
115 | 132 | | |
116 | | - | |
| 133 | + | |
| 134 | + | |
117 | 135 | | |
118 | | - | |
119 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
120 | 141 | | |
121 | 142 | | |
122 | | - | |
| 143 | + | |
123 | 144 | | |
124 | 145 | | |
125 | 146 | | |
126 | 147 | | |
127 | | - | |
128 | | - | |
129 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
130 | 156 | | |
0 commit comments