[pull] master from DataDog:master - #662
Merged
Merged
Conversation
#24552) * kafka_consumer: reuse AdminClient and Consumer across runs Recreating the librdkafka AdminClient (close_admin_client defaulted to true) and opening/closing a Consumer on every run tore down and respawned librdkafka's per-broker threads each collection. On high-core hosts that spreads allocations across many glibc arenas whose freed memory is never reused or returned, so agent RSS climbs unbounded. Keep both clients alive (default close_admin_client to false, make open_consumer idempotent, and stop closing the consumer used for cluster-id detection) so the same threads and arenas are reused each run. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Add changelog entry for connection reuse Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Drop inline rationale comments (kept in PR/changelog) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Guard consumer reuse under close_admin_client flag close_admin_client now controls reuse of both clients: when false (default) the AdminClient and Consumer are both reused across runs; when true, both are closed each run (previous behavior). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Drop explanatory comment on consumer close guard Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Keep close_admin_client default unchanged (true) Reuse of both clients is opt-in via close_admin_client: false; the default behavior (closing clients each run) is unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Reword changelog: reuse is opt-in via close_admin_client Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…24515) * kafka_consumer: cache earliest offsets across collection intervals Log start offsets only move via the broker's log-cleaner cycle (log.retention.check.interval.ms), so refetching them on every check run is unnecessary broker load. Cache the result with a TTL derived from that broker config, clamped to a sane range. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * Add changelog entry Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * kafka_consumer: trim redundant comments, add earliest-offsets cache test Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * Address review feedback: avoid an undocumented metric and refetch missing partitions on a fresh cache log.retention.check.interval.ms is now read from broker config data purely to derive the earliest-offsets cache TTL, without being added to the metric emission list. fetch_earliest_offsets also now refetches from the broker when a fresh cache doesn't cover every requested partition (e.g. newly added partitions), while keeping the cache's original expiration. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )