Commit e39f14d
authored
[tailsamplingprocessor] Replace misleading policy latency metric (open-telemetry#43510)
#### Description
This PR removes the metric
otelcol_processor_tail_sampling_sampling_decision_latency. It adds a
pair of metrics as replacement called
`processor_tail_sampling_sampling_policy_cpu_time` and
`processor_tail_sampling_sampling_policy_executions`. It is an
implementation of the feedback received in
open-telemetry#42620
Originally reported in
open-telemetry#38502,
this metric does not measure the latency of a particular policy.
Instead, it measures the latency since policy evaluation began which is
mostly not a useful signal.
To make matters worse, profiling shows that recording this metric
accounts for >20% of cpu time spent evaluating policies. Since the
tailsamplingprocessor is bottlenecked on the single threaded decision
loop, this 20% is much better spent on making decisions rather than
measuring a misleading metric.
As a replacement, I've added a metric to track total time spent on each
policy as well as count total executions. This allows slow policies to
still be identified by checking their total or average execution time
without the heavy CPU / gc pressure / synchronization cost of recording
a histogram in the inner loop.
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes open-telemetry#38502 - closed on accident, and I am not otel enough to reopen it1 parent 29092fa commit e39f14d
File tree
9 files changed
+219
-69
lines changed- .chloggen
- processor/tailsamplingprocessor
- internal
- metadatatest
- metadata
9 files changed
+219
-69
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | 78 | | |
87 | 79 | | |
88 | 80 | | |
| |||
107 | 99 | | |
108 | 100 | | |
109 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
110 | 130 | | |
111 | 131 | | |
112 | 132 | | |
| |||
Lines changed: 14 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 32 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 8 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | 86 | | |
97 | 87 | | |
98 | 88 | | |
| |||
102 | 92 | | |
103 | 93 | | |
104 | 94 | | |
| 95 | + | |
105 | 96 | | |
106 | 97 | | |
107 | 98 | | |
| |||
121 | 112 | | |
122 | 113 | | |
123 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
124 | 136 | | |
125 | 137 | | |
126 | 138 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
272 | | - | |
| 272 | + | |
273 | 273 | | |
274 | 274 | | |
| 275 | + | |
275 | 276 | | |
276 | 277 | | |
277 | | - | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
278 | 287 | | |
279 | 288 | | |
280 | 289 | | |
281 | 290 | | |
282 | | - | |
| 291 | + | |
283 | 292 | | |
| 293 | + | |
284 | 294 | | |
285 | 295 | | |
286 | 296 | | |
287 | | - | |
| 297 | + | |
288 | 298 | | |
289 | 299 | | |
290 | 300 | | |
291 | 301 | | |
292 | 302 | | |
293 | 303 | | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
294 | 311 | | |
295 | 312 | | |
296 | 313 | | |
| |||
380 | 397 | | |
381 | 398 | | |
382 | 399 | | |
383 | | - | |
| 400 | + | |
384 | 401 | | |
| 402 | + | |
385 | 403 | | |
386 | 404 | | |
387 | 405 | | |
| |||
396 | 414 | | |
397 | 415 | | |
398 | 416 | | |
399 | | - | |
400 | | - | |
| 417 | + | |
401 | 418 | | |
402 | 419 | | |
403 | 420 | | |
| |||
413 | 430 | | |
414 | 431 | | |
415 | 432 | | |
416 | | - | |
| 433 | + | |
417 | 434 | | |
418 | 435 | | |
419 | 436 | | |
420 | 437 | | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
421 | 442 | | |
422 | 443 | | |
423 | 444 | | |
424 | 445 | | |
425 | 446 | | |
426 | 447 | | |
427 | 448 | | |
| 449 | + | |
| 450 | + | |
428 | 451 | | |
429 | 452 | | |
430 | 453 | | |
| |||
437 | 460 | | |
438 | 461 | | |
439 | 462 | | |
440 | | - | |
| 463 | + | |
441 | 464 | | |
442 | 465 | | |
443 | 466 | | |
| |||
449 | 472 | | |
450 | 473 | | |
451 | 474 | | |
452 | | - | |
453 | 475 | | |
454 | 476 | | |
455 | 477 | | |
| 478 | + | |
456 | 479 | | |
457 | | - | |
458 | | - | |
| 480 | + | |
459 | 481 | | |
460 | 482 | | |
461 | 483 | | |
| |||
0 commit comments