🍒 12007 - Fix NoSuchElementException from unchecked Optional.get() in Kafka consumer instrumentation#12066
🍒 12007 - Fix NoSuchElementException from unchecked Optional.get() in Kafka consumer instrumentation#12066PerfectSlayer wants to merge 2 commits into
Conversation
…sumer instrumentation extractGroup, extractClusterId, and extractBootstrapServers called Optional.get() without checking isPresent()/using orElse(), which threw NoSuchElementException when the underlying consumer group, metadata, or bootstrap servers were not captured. Introduced in 1.64 and observed in production error telemetry. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> (cherry picked from commit e20ee61)
Covers the null/empty-Optional cases for extractGroup, extractClusterId, and extractBootstrapServers to prevent regressions of the previously fixed NoSuchElementException. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> (cherry picked from commit 6291883)
There was a problem hiding this comment.
More details
The helper now safely maps absent consumer-group, metadata, and bootstrap-server optionals to null while preserving present values, and the callback path already uses the same safe behavior. No diff-only behavioral regression was identified; local execution was blocked before compilation by the unavailable Java 25 toolchain.
🤖 Datadog Autotest · Commit 220be5d · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest
|
🎯 Code Coverage (details) 🔗 Commit SHA: 220be5d | Docs | Datadog PR Page | Give us feedback! |
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
Kafka / producer-benchmarkParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 3 metrics, 0 unstable metrics. See unchanged results
|
Kafka / consumer-benchmarkParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 3 metrics, 0 unstable metrics. See unchanged results
|
Backport #12007 to release/v1.64.x