Emit messaging exceptions as logs under the opt-in preview#18891
Merged
laurit merged 5 commits intoJun 9, 2026
Conversation
52c7a24 to
b6893a5
Compare
b6893a5 to
ef1b24d
Compare
ef1b24d to
1e5a537
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Updates messaging-related instrumentations to customize exception-log event naming/severity when otel.semconv.exception.signal.preview=logs is enabled, aligning emitted exception logs with messaging operation semantics (send/receive/process) instead of the generic "exception" event name.
Changes:
- Add
MessagingExceptionEventExtractorsutility to apply messaging-specific exception log event name + severity toInstrumenterBuilders. - Wire the new extractor utility into multiple messaging instrumentations (Kafka, JMS, RabbitMQ, Pulsar, RocketMQ, NATS, Spring messaging) for send/receive/process instrumenters.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| instrumentation/spring/spring-rabbit-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/rabbit/v1_0/SpringRabbitSingletons.java | Apply messaging process exception event extractor to the consumer instrumenter builder. |
| instrumentation/spring/spring-pulsar-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/pulsar/v1_0/SpringPulsarSingletons.java | Apply messaging process exception event extractor to the Spring Pulsar consumer instrumenter builder. |
| instrumentation/spring/spring-integration-4.1/library/src/main/java/io/opentelemetry/instrumentation/spring/integration/v4_1/SpringIntegrationTelemetryBuilder.java | Apply messaging process/send exception event extractors for consumer/producer instrumenters. |
| instrumentation/rocketmq/rocketmq-client-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rocketmqclient/v5_0/RocketMqInstrumenterFactory.java | Apply messaging exception event extractors for producer send, consumer receive, and consumer process instrumenters. |
| instrumentation/rocketmq/rocketmq-client-4.8/library/src/main/java/io/opentelemetry/instrumentation/rocketmqclient/v4_8/RocketMqInstrumenterFactory.java | Apply messaging exception event extractors for producer send and consumer process instrumenters. |
| instrumentation/rabbitmq-2.7/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rabbitmq/v2_7/RabbitSingletons.java | Apply messaging exception event extractors to publish/send, receive, and deliver/process instrumenters. |
| instrumentation/pulsar/pulsar-2.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/pulsar/v2_8/telemetry/PulsarSingletons.java | Apply messaging exception event extractors to receive, process, and send instrumenters. |
| instrumentation/nats/nats-2.17/library/src/main/java/io/opentelemetry/instrumentation/nats/v2_17/internal/NatsInstrumenterFactory.java | Apply messaging exception event extractors to producer send and consumer process instrumenters. |
| instrumentation/kafka/kafka-connect-2.6/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/kafkaconnect/v2_6/KafkaConnectSingletons.java | Apply messaging process exception event extractor to the Kafka Connect process instrumenter builder. |
| instrumentation/kafka/kafka-clients/kafka-clients-common-0.11/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/common/v0_11/internal/KafkaInstrumenterFactory.java | Apply messaging exception event extractors to producer send, consumer receive, consumer process, and batch-process instrumenters. |
| instrumentation/jms/jms-common-1.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jms/common/v1_1/JmsInstrumenterFactory.java | Apply messaging exception event extractors to producer send, consumer receive, and consumer process instrumenters. |
| instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/messaging/MessagingExceptionEventExtractors.java | New utility to configure messaging exception log event names and severities via Experimental.setExceptionEventExtractor. |
1e5a537 to
23a0233
Compare
70287df to
68a8372
Compare
68a8372 to
aafe54c
Compare
1e1eeb8 to
9e88e64
Compare
9e88e64 to
67d5bbb
Compare
laurit
approved these changes
Jun 9, 2026
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.
Under
otel.semconv.exception.signal.preview=logs(introduced in #16259), messaging instrumentations now emit their exceptions as log records instead of span events.Part of follow-up work after #16259.