Commit bb46325
kafka_consumer: cap total broker_timestamps history by a per-cluster memory budget (DataDog#24508)
* kafka_consumer: cap broker_timestamps retained history by a per-cluster budget
The DSM broker_timestamps cache grows unbounded with partition count (up to
timestamp_history_size samples for every partition), reaching multiple GiB on
large clusters. Bound it to a fixed entry budget (~0.5 GiB/cluster): the
per-partition history depth is scaled down as partition count grows
(budget // num_partitions, clamped to [2, timestamp_history_size]). Small
clusters keep full history; large clusters shrink to a shallow depth, so total
memory stays bounded.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Add changelog entry
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 1385ff7 commit bb46325
3 files changed
Lines changed: 39 additions & 2 deletions
File tree
- kafka_consumer
- changelog.d
- datadog_checks/kafka_consumer
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 13 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
24 | 28 | | |
25 | 29 | | |
26 | 30 | | |
| |||
297 | 301 | | |
298 | 302 | | |
299 | 303 | | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
300 | 310 | | |
301 | 311 | | |
| 312 | + | |
302 | 313 | | |
303 | 314 | | |
304 | 315 | | |
305 | 316 | | |
306 | 317 | | |
307 | 318 | | |
308 | 319 | | |
309 | | - | |
| 320 | + | |
310 | 321 | | |
311 | 322 | | |
312 | 323 | | |
313 | | - | |
| 324 | + | |
314 | 325 | | |
315 | 326 | | |
316 | 327 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
528 | 529 | | |
529 | 530 | | |
530 | 531 | | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
531 | 556 | | |
532 | 557 | | |
533 | 558 | | |
| |||
0 commit comments