Commit 8ab1f30
committed
Fix three critical metrics backend bugs
Bug 1 (high): Fix constructor tags being dropped when per-call tags are empty dict
- In DatadogMetricsBackend, the condition 'if tags else None' was falsy for empty dict {}
- BufferedMetricsBackend always passes a dict (possibly empty), causing constructor tags to be lost
- Fixed by calling _combine_tags first, then checking if the result is truthy
- Added test to verify constructor tags are preserved with empty dict
Bug 2 (medium): Fix ignored period_sec parameter in LogMetricsBackend
- LogMetricsBackend accepted period_sec but never used it
- configure_metrics always used hardcoded METRICS_FREQUENCY_SEC (10s)
- Fixed by removing unused parameter from LogMetricsBackend constructor
- Added throttle_interval_sec parameter to configure_metrics
- Updated runner.py to pass period_sec to configure_metrics
- Updated all test calls to remove period_sec parameter
Bug 3 (high): Fix unpicklable Datadog backend in multiprocessing initializer
- get_inner_metrics() returned DatadogMetricsBackend with unpicklable thread/socket
- Multiprocessing with spawn context cannot pickle threads or sockets
- Fixed by creating serializable MetricsConfig dataclass
- Pass config to initializer instead of backend instance
- Initializer recreates backend from config in each subprocess
- Updated runner.py to create and store MetricsConfig
- Updated rust_arroyo.py to use get_metrics_config() and pass config to initializer1 parent 0b31c9a commit 8ab1f30
6 files changed
Lines changed: 124 additions & 23 deletions
File tree
- sentry_streams
- sentry_streams
- adapters/arroyo
- metrics
- tests/pipeline
Lines changed: 11 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
45 | 49 | | |
46 | 50 | | |
47 | 51 | | |
| |||
79 | 83 | | |
80 | 84 | | |
81 | 85 | | |
82 | | - | |
83 | | - | |
84 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
85 | 90 | | |
86 | 91 | | |
87 | 92 | | |
| |||
194 | 199 | | |
195 | 200 | | |
196 | 201 | | |
| 202 | + | |
197 | 203 | | |
198 | 204 | | |
199 | 205 | | |
| |||
202 | 208 | | |
203 | 209 | | |
204 | 210 | | |
205 | | - | |
| 211 | + | |
206 | 212 | | |
207 | 213 | | |
208 | 214 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
159 | 160 | | |
160 | 161 | | |
161 | 162 | | |
| 163 | + | |
162 | 164 | | |
163 | 165 | | |
164 | 166 | | |
165 | | - | |
| 167 | + | |
166 | 168 | | |
167 | 169 | | |
168 | 170 | | |
| 171 | + | |
169 | 172 | | |
170 | 173 | | |
171 | 174 | | |
172 | | - | |
| 175 | + | |
173 | 176 | | |
174 | 177 | | |
175 | 178 | | |
| 179 | + | |
176 | 180 | | |
177 | 181 | | |
178 | 182 | | |
179 | | - | |
| 183 | + | |
180 | 184 | | |
181 | 185 | | |
182 | 186 | | |
| |||
186 | 190 | | |
187 | 191 | | |
188 | 192 | | |
189 | | - | |
| 193 | + | |
190 | 194 | | |
191 | 195 | | |
192 | | - | |
193 | 196 | | |
194 | 197 | | |
195 | 198 | | |
| |||
384 | 387 | | |
385 | 388 | | |
386 | 389 | | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
387 | 424 | | |
388 | 425 | | |
| 426 | + | |
389 | 427 | | |
390 | 428 | | |
391 | 429 | | |
392 | | - | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
393 | 436 | | |
394 | 437 | | |
395 | 438 | | |
| |||
398 | 441 | | |
399 | 442 | | |
400 | 443 | | |
| 444 | + | |
401 | 445 | | |
402 | 446 | | |
403 | 447 | | |
404 | 448 | | |
405 | 449 | | |
406 | 450 | | |
407 | 451 | | |
408 | | - | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
409 | 455 | | |
410 | 456 | | |
411 | 457 | | |
| |||
415 | 461 | | |
416 | 462 | | |
417 | 463 | | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
418 | 472 | | |
419 | 473 | | |
420 | 474 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
| 110 | + | |
109 | 111 | | |
110 | 112 | | |
111 | 113 | | |
| |||
116 | 118 | | |
117 | 119 | | |
118 | 120 | | |
119 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
120 | 129 | | |
121 | 130 | | |
122 | 131 | | |
| |||
129 | 138 | | |
130 | 139 | | |
131 | 140 | | |
132 | | - | |
133 | 141 | | |
134 | 142 | | |
135 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
136 | 153 | | |
137 | 154 | | |
138 | 155 | | |
139 | | - | |
| 156 | + | |
| 157 | + | |
140 | 158 | | |
141 | 159 | | |
142 | 160 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
141 | 162 | | |
142 | 163 | | |
143 | 164 | | |
| |||
248 | 269 | | |
249 | 270 | | |
250 | 271 | | |
251 | | - | |
| 272 | + | |
252 | 273 | | |
253 | 274 | | |
254 | 275 | | |
| |||
261 | 282 | | |
262 | 283 | | |
263 | 284 | | |
264 | | - | |
| 285 | + | |
265 | 286 | | |
266 | 287 | | |
267 | 288 | | |
| |||
274 | 295 | | |
275 | 296 | | |
276 | 297 | | |
277 | | - | |
| 298 | + | |
278 | 299 | | |
279 | 300 | | |
280 | 301 | | |
| |||
297 | 318 | | |
298 | 319 | | |
299 | 320 | | |
300 | | - | |
| 321 | + | |
301 | 322 | | |
302 | 323 | | |
303 | 324 | | |
| |||
321 | 342 | | |
322 | 343 | | |
323 | 344 | | |
324 | | - | |
| 345 | + | |
325 | 346 | | |
326 | 347 | | |
327 | 348 | | |
| |||
337 | 358 | | |
338 | 359 | | |
339 | 360 | | |
340 | | - | |
| 361 | + | |
341 | 362 | | |
342 | 363 | | |
343 | 364 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments