fix(confluent): add kafka_cluster_id to DSM backlog and checkpoints#7570
Draft
robcarlan-datadog wants to merge 1 commit intorob.carlan/DSMON-1226/kafkajs-dsm-backlog-cluster-idfrom
Conversation
The confluent-kafka-javascript instrumentation never called getKafkaClusterId, so cluster_id was missing from both DSM checkpoints (edge tags) and backlog offset tracking. This causes incorrect pathway hashes and cross-cluster offset mixing for lag metrics. Changes: - Extract getKafkaClusterId/isPromise to shared helpers/kafka.js - Update kafkajs instrumentation to use shared helper - Add cluster ID retrieval to confluent KafkaJS producer and consumer - Thread clusterId through producer ctx, consumer extractedArgs, and offset tracking (updateLatestOffset key includes clusterId) Note: The native module path (Producer/Consumer classes) does not yet support cluster ID retrieval as it lacks an admin API. DSMON-1226 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Overall package sizeSelf size: 4.68 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 2.0.6 | 81.92 kB | 813.08 kB | | dc-polyfill | 0.1.10 | 26.73 kB | 26.73 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
This comment has been minimized.
This comment has been minimized.
BenchmarksBenchmark execution time: 2026-02-18 20:35:06 Comparing candidate commit 4919b10 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 233 metrics, 27 unstable metrics. |
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.
Summary
Builds on #7569 (kafkajs backlog cluster_id fix).
The
@confluentinc/kafka-javascriptinstrumentation never calledgetKafkaClusterId, sokafka_cluster_idwas missing from both DSM checkpoints (edge tags) and backlog offset tracking — a worse version of the kafkajs bug.getKafkaClusterIdandisPromiseto sharedhelpers/kafka.js(used by both kafkajs and confluent instrumentations)clusterIdthrough producerctx, consumerextractedArgs, and offset tracking (updateLatestOffsetkey now includesclusterIdto prevent cross-cluster mixing)Not addressed
The native module path (
Producer/KafkaProducer/Consumer/KafkaConsumerclasses) does not yet support cluster ID retrieval since it lacks a KafkaJS-style admin API. This could be added in a follow-up using librdkafka'sgetMetadata().Test plan
kafka_cluster_idDepends on: #7569
🤖 Generated with Claude Code