Skip to content

Emit messaging exceptions as logs under the opt-in preview#18891

Merged
laurit merged 5 commits into
open-telemetry:mainfrom
trask:trask/messaging-exception-events
Jun 9, 2026
Merged

Emit messaging exceptions as logs under the opt-in preview#18891
laurit merged 5 commits into
open-telemetry:mainfrom
trask:trask/messaging-exception-events

Conversation

@trask

@trask trask commented Jun 3, 2026

Copy link
Copy Markdown
Member

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.

@trask trask force-pushed the trask/messaging-exception-events branch from 52c7a24 to b6893a5 Compare June 3, 2026 18:38
@trask trask force-pushed the trask/messaging-exception-events branch from b6893a5 to ef1b24d Compare June 3, 2026 20:05
@trask trask changed the title Add messaging exception event extractor helpers Add messaging exception event extractor wiring Jun 3, 2026
@trask trask changed the title Add messaging exception event extractor wiring Emit messaging exceptions as logs under the opt-in preview Jun 3, 2026
@trask trask force-pushed the trask/messaging-exception-events branch from ef1b24d to 1e5a537 Compare June 3, 2026 21:08
@trask trask requested a review from Copilot June 3, 2026 22:08

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

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 MessagingExceptionEventExtractors utility to apply messaging-specific exception log event name + severity to InstrumenterBuilders.
  • 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.

@trask trask force-pushed the trask/messaging-exception-events branch from 1e5a537 to 23a0233 Compare June 3, 2026 22:49
@trask trask requested a review from Copilot June 3, 2026 23: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 12 out of 12 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 15 out of 15 changed files in this pull request and generated 1 comment.

@trask trask force-pushed the trask/messaging-exception-events branch from 70287df to 68a8372 Compare June 5, 2026 00:10
@trask trask requested a review from Copilot June 5, 2026 00:22

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 15 out of 15 changed files in this pull request and generated 1 comment.

@trask trask force-pushed the trask/messaging-exception-events branch from 68a8372 to aafe54c Compare June 5, 2026 15:16
@trask trask requested a review from Copilot June 5, 2026 16:34

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 15 out of 15 changed files in this pull request and generated 1 comment.

@trask trask force-pushed the trask/messaging-exception-events branch 2 times, most recently from 1e1eeb8 to 9e88e64 Compare June 5, 2026 23:43
@trask trask requested a review from Copilot June 6, 2026 00:19

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 17 out of 17 changed files in this pull request and generated no new comments.

@trask trask marked this pull request as ready for review June 6, 2026 00:53
@trask trask requested a review from a team as a code owner June 6, 2026 00:53
@trask trask force-pushed the trask/messaging-exception-events branch from 9e88e64 to 67d5bbb Compare June 6, 2026 18:45
@trask trask requested a review from Copilot June 6, 2026 22:09

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 15 out of 15 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 15 out of 15 changed files in this pull request and generated no new comments.

@laurit laurit merged commit 8c34534 into open-telemetry:main Jun 9, 2026
186 of 188 checks passed
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.

3 participants