Report Cluster Ids in Kafka Metrics - #3054
Draft
kanderson250 wants to merge 7 commits into
Draft
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3054 +/- ##
============================================
+ Coverage 70.92% 70.93% +0.01%
- Complexity 10681 10683 +2
============================================
Files 871 871
Lines 43006 43006
Branches 6503 6503
============================================
+ Hits 30501 30508 +7
+ Misses 9557 9549 -8
- Partials 2948 2949 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Resolves #2984
This fulfills a spec change request to add per-cluster produce/consume metrics to the agent.
Details
According to the spec change, we need to add optional capture of per-cluster, per-topic metrics for Kafka clients. These are meant to exist as a supplement to the existing per-node, per-topic client metrics and will be used by the backend to build entity relationships.
MessageBroker/Kafka/Node/{server_address}/{Produce | Consume}/{topic_name}MessageBroker/Kafka/Cluster/{cluster_id}/{Produce | Consume}/{topic_name}What's changed
The cluster topic metric has been added to all eight kafka clients metrics modules that currently report the analogous Node Topic Metric.
The implementation is slightly different between
kafka-clients-metricsandkafka-clients-node-metrics, but it is exactly the same across different versions of the same module (I had to backport it to all versions due to current adoption rates for earlier modules being high). It follows the implementation of the analagousNodeTopicRegistryas closely as possible.For all versions, the bulk of the logic for fetching the cluster id and building the metric names lives in
ClusterTopicRegistry.Important requirements
These changes MUST:
kafka.metrics.cluster.metrics.enabledwhich defaults tofalse.Background (why this change was necessary)
Prior to this change, entity relationships were based on the combination of server address + topic from the Node Topic Metric. However, for self-hosted Kafka instances utilizing VPCs, it is possible for separate clusters to report the same broker address AND same topic name, in which case their identities will be conflated.
This change allows a new relationship to be formed based on clusterId + topic. Since cluster ids are always unique to the cluster, this prevents NR from mixing up identities.