Skip to content

Migrate Kafka core messaging telemetry to v1.43 preview#19270

Draft
trask wants to merge 4 commits into
open-telemetry:mainfrom
trask:messaging-v1-43-kafka-core
Draft

Migrate Kafka core messaging telemetry to v1.43 preview#19270
trask wants to merge 4 commits into
open-telemetry:mainfrom
trask:messaging-v1-43-kafka-core

Conversation

@trask

@trask trask commented Jul 19, 2026

Copy link
Copy Markdown
Member

Depends on #19268.

Dependency baseline: 9b5ec57607668f417ce57a15c2281897fcb3f774.
Review only: 9b5ec57607668f417ce57a15c2281897fcb3f774..cd9360e14660d61ce7739ca4a41d9e4de17e6bd6.

Exactly one Kafka core/Connect commit. Explicit receive opt-outs are preserved; producer span kind follows actual configured trace-context propagation and per-send injection; abandoned iterator cleanup is suppression-strategy independent. Kafka Connect stable assertions ignore only scheduler-dependent standalone poll traces while keeping all application/status/DB/HTTP traces exact.

Validated: complete Kafka library/javaagent stable suites, including stable receive-disabled coverage; Kafka Connect preview (Mongo/Postgres single/multi); propagator and leak-cleanup tests; full Kafka clients javaagent check; and Spotless.

@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Jul 19, 2026

Copy link
Copy Markdown

Pull request dashboard status

Status last refreshed: 2026-07-22 16:49:35 UTC.

  • Waiting on: Author
  • Next step: Move out of draft to request review.

This automated status or its linked feedback items may be incorrect. If something looks wrong, please report it with the result you expected.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Migrates Kafka core messaging telemetry to the v1.43 preview semantic conventions while preserving legacy and dual-emission modes.

Changes:

  • Adds v1.43 messaging attributes, span names/kinds, metrics, and topology support.
  • Migrates Kafka clients and Connect instrumentation.
  • Expands compatibility bridges and preview-mode tests.

Reviewed changes

Copilot reviewed 53 out of 53 changed files in this pull request and generated no comments.

Show a summary per file
File Description
testing-common/.../SemconvMessagingStabilityUtil.java Adds test key compatibility.
.../testing/AgentSpanTestingInstrumenter.java Includes new span keys.
.../ContextBridgeTest.java Tests new bridged keys.
.../SpanKeyBridging.java Bridges optional new keys.
.../PostgresKafkaConnectSinkTaskTest.java Updates Connect assertions.
.../MongoKafkaConnectSinkTaskTest.java Updates Connect assertions.
.../KafkaConnectSinkTaskBaseTest.java Adds preview test helpers/configuration.
kafka-connect-2.6/testing/build.gradle.kts Adds preview test task.
.../KafkaConnectSingletons.java Uses v1.43 messaging extractors.
.../TracingIterator.java Cleans leaked process parents.
.../KafkaReceiveAttributesExtractor.java Emits current consumer-group attribute.
.../KafkaInstrumenterFactory.java Migrates Kafka instrumenters and topology.
.../KafkaConsumerContextUtil.java Adds leaked-span cleanup.
.../KafkaConsumerAttributesExtractor.java Migrates consumer-group attributes.
.../WrapperTest.java Tests preview wrapper telemetry.
.../WrapperSuppressReceiveSpansTest.java Reuses shared preview assertions.
.../WrapperSendExceptionTest.java Updates send-span naming.
.../WrapperPropagationDisabledTest.java Updates preview span names.
.../InterceptorsSuppressReceiveSpansTest.java Tests preview interceptor attributes.
.../AbstractInterceptorsTest.java Updates interceptor topology assertions.
.../KafkaConsumerTelemetry.java Changes receive/process parenting.
kafka-clients-2.6/library/build.gradle.kts Adds v3-preview tests.
.../KafkaClientBaseTest.java Adds dual-mode attribute assertions.
.../KafkaClientDefaultTest.java Tests links, parenting, and cleanup.
.../KafkaConsumerInstrumentation.java Migrates poll/process contexts.
kafka-clients-0.11/javaagent/build.gradle.kts Adds preview test variants.
.../SemconvStabilityTest.java Tests messaging selection modes.
.../SpanKey.java Adds create and settle keys.
.../SemconvStability.java Clarifies messaging preview behavior.
.../MessagingSpanNameExtractorTest.java Expands v1.43 naming tests.
.../MessagingSpanKindExtractorTest.java Tests operation span kinds.
.../MessagingProducerMetricsTest.java Tests producer metrics migration.
.../MessagingProcessMetricsTest.java Tests process-duration metrics.
.../MessagingMetricsAdviceTest.java Tests cardinality filtering.
.../MessagingConsumerMetricsTest.java Tests consumer preview metrics.
.../MessagingAttributesExtractorTest.java Tests new attributes and keys.
.../MessagingProcessInstrumenterFactoryTest.java Tests process topology selection.
.../MessagingProcessContextCustomizerTest.java Tests process parent selection.
.../MessagingSpanNameExtractorBuilder.java Adds configurable operation names.
.../MessagingSpanNameExtractor.java Implements v1.43 span naming.
.../MessagingSpanKindExtractor.java Implements v1.43 span kinds.
.../MessagingProducerMetrics.java Adds preview producer metrics.
.../MessagingProcessMetrics.java Adds process-duration metric.
.../MessagingOperationType.java Defines v1.43 operation types.
.../MessagingMetricsAdvice.java Defines metric attribute advice.
.../MessagingConsumerMetrics.java Adds preview consumer metrics.
.../MessagingAttributesGetter.java Adds error-type extraction.
.../MessagingAttributesExtractorBuilder.java Supports operation type/name configuration.
.../MessagingAttributesExtractor.java Emits v1.43 messaging attributes.
.../MessageOperation.java Maps legacy operations to new types.
.../MessagingProcessInstrumenterFactory.java Centralizes process instrumenter topology.
.../MessagingProcessContextCustomizer.java Preserves ambient or producer context.
instrumentation-api-incubator/build.gradle.kts Enables messaging preview test modes.

@trask
trask force-pushed the messaging-v1-43-kafka-core branch from 28f4d0b to 3751ed8 Compare July 21, 2026 02:01
@trask
trask requested a review from Copilot July 21, 2026 02:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 53 out of 53 changed files in this pull request and generated 3 comments.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 53 out of 53 changed files in this pull request and generated no new comments.

@trask
trask force-pushed the messaging-v1-43-kafka-core branch from 9d30879 to 93a5642 Compare July 21, 2026 04:20
@trask
trask requested a review from Copilot July 21, 2026 04:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 53 out of 53 changed files in this pull request and generated 1 comment.

@trask
trask force-pushed the messaging-v1-43-kafka-core branch from 93a5642 to b8da039 Compare July 21, 2026 04:39
@trask
trask requested a review from Copilot July 21, 2026 04:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 55 out of 55 changed files in this pull request and generated 1 comment.

@trask
trask force-pushed the messaging-v1-43-kafka-core branch from b8da039 to 8569cb1 Compare July 21, 2026 04:56
@trask
trask requested a review from Copilot July 21, 2026 04:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 55 out of 55 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

instrumentation/kafka/kafka-clients/kafka-clients-common-0.11/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/common/v0_11/internal/KafkaInstrumenterFactory.java:117

  • [General] producerPropagationEnabled is not the full condition used by the javaagent to inject the send span context. KafkaProducerInstrumentation.java:83-86 also requires KafkaPropagation.shouldPropagate(apiVersions), which is false when the broker only supports record magic below v2. In that supported configuration no creation context is injected, but this fixed extractor still emits a stable PRODUCER span instead of the v1.43-required CLIENT span. Carry the per-send propagation decision into KafkaProducerRequest (the advice already has apiVersions before starting the span) and derive the kind from that actual decision.

@trask
trask force-pushed the messaging-v1-43-kafka-core branch from 8569cb1 to dd3c636 Compare July 21, 2026 05:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 58 out of 58 changed files in this pull request and generated 2 comments.

@trask
trask force-pushed the messaging-v1-43-kafka-core branch from c87b7cf to 54b2e58 Compare July 21, 2026 13:47
@trask
trask requested a review from Copilot July 21, 2026 13:59
@trask
trask force-pushed the messaging-v1-43-kafka-core branch from 54b2e58 to d4e1597 Compare July 21, 2026 14:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 60 out of 60 changed files in this pull request and generated no new comments.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 60 out of 60 changed files in this pull request and generated no new comments.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 60 out of 60 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

instrumentation/kafka/kafka-clients/kafka-clients-common-0.11/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/common/v0_11/internal/KafkaConsumerContextUtil.java:49

  • [General] This replaces only the context's current span; it leaves SpanKey.CONSUMER_PROCESS pointing at the abandoned process span. With the default semconv suppression strategy, any process instrumenter that calls shouldStart() against this returned context still sees an active process key and is incorrectly suppressed. Restore or clear the process span key together with the ambient span (while preserving an outer process key if the original parent had one).

@trask
trask force-pushed the messaging-v1-43-kafka-core branch from d4e1597 to 247edef Compare July 21, 2026 14:49
@trask
trask requested a review from Copilot July 21, 2026 14:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 61 out of 61 changed files in this pull request and generated no new comments.

@trask
trask force-pushed the messaging-v1-43-kafka-core branch from 247edef to e197acc Compare July 21, 2026 16:34
@trask
trask requested a review from Copilot July 21, 2026 16:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 61 out of 61 changed files in this pull request and generated no new comments.

@trask
trask force-pushed the messaging-v1-43-kafka-core branch from e197acc to 4ab6c6e Compare July 21, 2026 17:42
@trask
trask requested a review from Copilot July 21, 2026 17:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 61 out of 61 changed files in this pull request and generated no new comments.

@trask
trask force-pushed the messaging-v1-43-kafka-core branch from 4ab6c6e to cd9360e Compare July 22, 2026 01:53
@trask
trask requested a review from Copilot July 22, 2026 02:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 62 out of 62 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants