Fix missing consumer_group and topic tags in DSM Kafka 3.8+ metrics by johannbotha · Pull Request #10464 · DataDog/dd-trace-java
The kafka-clients-3.8 instrumentation was calling Optional.get() without checking isPresent(), causing NoSuchElementException when consumer group is null. This resulted in missing consumer_group and topic tags in data_streams.kafka.lag_seconds metrics. Changes: - Replace .get() with .orElse(null) in DDOffsetCommitCallback and ConsumerCoordinatorAdvice to safely handle empty Optionals - Fix incorrect null checks in ConstructorAdvice and LegacyConstructorAdvice to use isPresent() instead of checking if the Optional object itself is null Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
johannbotha
deleted the
jj.botha/fix-kafka-38-dsm-missing-consumer-group-tags
branch
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