Commit 733ffda
kafka_consumer: always fetch highwater offsets when cluster monitoring is enabled (#24149)
* kafka_consumer: always fetch highwater offsets when cluster monitoring is enabled
When enable_cluster_monitoring is true the consumer context count can easily
exceed the default max_partition_contexts (500), causing the check to skip
highwater offset collection entirely. This silently zeros out
kafka.topic.message_rate and stops kafka.broker_offset from being emitted,
because _collect_topic_metadata receives an empty highwater_offsets dict.
Bypass the context limit guard when cluster monitoring is active so that
highwater offsets are always fetched; the existing per-metric context caps in
report_highwater_offsets and report_consumer_offsets_and_lag still apply.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* kafka_consumer: add changelog entry for PR #24149
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* kafka_consumer: bypass context reporting limit when cluster monitoring is enabled
When enable_cluster_monitoring is true, report all consumer lag and highwater
offset metrics without capping at max_partition_contexts. Cluster monitoring
users need full cluster visibility by design, so capping metric reporting makes
no sense in that mode.
Uses float('inf') as the reporting limit, which works correctly with the
existing int comparisons in report_highwater_offsets and
report_consumer_offsets_and_lag (int == inf is False, int >= inf is False,
int < inf is True). Also suppresses the misleading "narrow your target" warning
in cluster monitoring mode.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 9b2a03c commit 733ffda
2 files changed
Lines changed: 10 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 9 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
71 | 73 | | |
72 | 74 | | |
73 | 75 | | |
| |||
100 | 102 | | |
101 | 103 | | |
102 | 104 | | |
103 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
104 | 109 | | |
105 | 110 | | |
106 | 111 | | |
| |||
113 | 118 | | |
114 | 119 | | |
115 | 120 | | |
116 | | - | |
| 121 | + | |
117 | 122 | | |
118 | 123 | | |
119 | 124 | | |
120 | | - | |
| 125 | + | |
121 | 126 | | |
122 | 127 | | |
123 | 128 | | |
| |||
0 commit comments