Skip to content

feat(kafka): add MessageBroker/Kafka/Cluster/{id}/Topic/{topic} metrics#1747

Draft
shashank-reddy-nr wants to merge 1 commit into
newrelic:mainfrom
shashank-reddy-nr:feat/kafka-cluster-id
Draft

feat(kafka): add MessageBroker/Kafka/Cluster/{id}/Topic/{topic} metrics#1747
shashank-reddy-nr wants to merge 1 commit into
newrelic:mainfrom
shashank-reddy-nr:feat/kafka-cluster-id

Conversation

@shashank-reddy-nr

@shashank-reddy-nr shashank-reddy-nr commented Jun 1, 2026

Copy link
Copy Markdown

What

Adds per-cluster, per-topic throughput metrics using the Kafka cluster UUID.

New metrics:

  MessageBroker/Kafka/Cluster/{cluster_id}/Topic/{topic}/Produce
  MessageBroker/Kafka/Cluster/{cluster_id}/Topic/{topic}/Consume

NRQL

SELECT sum(newrelic.timeslice.value) FROM Metric
WHERE metricTimesliceName LIKE 'MessageBroker/Kafka/Cluster%'
FACET appName, metricTimesliceName SINCE 30 minutes ago

Before contributing, please read our contributing guidelines and code of conduct.

Overview

Describe the changes present in the pull request

Related Github Issue

Include a link to the related GitHub issue, if applicable

Testing

The agent includes a suite of tests which should be used to
verify your changes don't break existing functionality. These tests will run with
Github Actions when a pull request is made. More details on running the tests locally can be found in our
testing guidelines,
For most contributions it is strongly recommended to add additional tests which
exercise your changes.

@shashank-reddy-nr shashank-reddy-nr requested a review from a team as a code owner June 1, 2026 10:44
@shashank-reddy-nr shashank-reddy-nr marked this pull request as draft June 1, 2026 10:52
@mergify mergify Bot added the tests-failing Tests failing in CI. label Jun 1, 2026
@codecov-commenter

codecov-commenter commented Jun 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 72.43590% with 43 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.02%. Comparing base (949339a) to head (455ec7b).
⚠️ Report is 37 commits behind head on main.

Files with missing lines Patch % Lines
newrelic/hooks/messagebroker_confluentkafka.py 63.51% 17 Missing and 10 partials ⚠️
newrelic/hooks/messagebroker_kafkapython.py 80.48% 9 Missing and 7 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1747      +/-   ##
==========================================
- Coverage   82.08%   82.02%   -0.06%     
==========================================
  Files         215      215              
  Lines       26309    26742     +433     
  Branches     4150     4241      +91     
==========================================
+ Hits        21596    21936     +340     
- Misses       3301     3341      +40     
- Partials     1412     1465      +53     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mergify mergify Bot removed the tests-failing Tests failing in CI. label Jun 1, 2026
@hmstepanek hmstepanek self-requested a review June 1, 2026 22:10
@mergify mergify Bot added tests-failing Tests failing in CI. and removed tests-failing Tests failing in CI. labels Jun 4, 2026
@shashank-reddy-nr shashank-reddy-nr marked this pull request as ready for review June 15, 2026 17:10
@mergify mergify Bot added the tests-failing Tests failing in CI. label Jun 21, 2026
Records per-cluster Kafka metrics (MessageBroker/Kafka/Cluster/{clusterId}/Topic/{topic}/Produce
and MessageBroker/Kafka/Cluster/{clusterId}/Topic/{topic}/Consume) to let customers track
throughput broken out by Kafka cluster, not just by topic. The cluster ID is fetched
once per unique broker set via a background AdminClient call; the hot produce/consume path
has no additional overhead. The feature is always-on and best-effort — it does not inject
anything into Kafka wire headers and does not add span or custom attributes.

Assisted-by: Claude Sonnet 4.6 <noreply@anthropic.com>
@shashank-reddy-nr shashank-reddy-nr marked this pull request as draft June 22, 2026 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests-failing Tests failing in CI.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants