Skip to content

feat(otel): Add OpenTelemetry distributed tracing support#1769

Open
jbonofre wants to merge 2 commits into
apache:mainfrom
jbonofre:add-opentelemetry-support
Open

feat(otel): Add OpenTelemetry distributed tracing support#1769
jbonofre wants to merge 2 commits into
apache:mainfrom
jbonofre:add-opentelemetry-support

Conversation

@jbonofre

Copy link
Copy Markdown
Member

New activemq-opentelemetry module that instruments the broker using the OpenTelemetry API. The plugin traces send (PRODUCER), dispatch (CONSUMER), and acknowledge (INTERNAL) operations with W3C TraceContext propagation and standard OTel messaging semantic conventions.

Depends on opentelemetry-api only; users bring their own SDK and exporter at runtime. Included in the distribution with example configuration. Maybe we should add a default SDK/exporter in the ActiveMQ distribution, just wondering 😄

@jbonofre
jbonofre requested a review from jeanouii March 13, 2026 16:34
@jbonofre jbonofre linked an issue Mar 13, 2026 that may be closed by this pull request
@jbonofre jbonofre changed the title Add OpenTelemetry distributed tracing support feat(otel): Add OpenTelemetry distributed tracing support Mar 13, 2026
@jbonofre
jbonofre force-pushed the add-opentelemetry-support branch from 0e1e69d to 176f5f5 Compare March 26, 2026 05:08

@jeanouii jeanouii 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.

Great PR and a good start.
I've added a couple of notes and questions.

It's been a while since I worked with this.

@jbonofre
jbonofre force-pushed the add-opentelemetry-support branch from 176f5f5 to b55e0a6 Compare July 9, 2026 15:16
@jbonofre
jbonofre requested a review from jeanouii July 9, 2026 15:18
jbonofre added 2 commits July 16, 2026 14:00
New activemq-opentelemetry module that instruments the broker using the
OpenTelemetry API. The plugin traces send (PRODUCER), dispatch (CONSUMER),
and acknowledge (INTERNAL) operations with W3C TraceContext propagation
and standard OTel messaging semantic conventions.

Depends on opentelemetry-api only; users bring their own SDK and exporter
at runtime. Included in the distribution with example configuration.
- Fix OTel semantic convention attribute names:
  messaging.system -> messaging.system.name
  messaging.operation -> messaging.operation.type
  messaging.client_id -> messaging.client.id (dot notation)
- Initialize propagator and tracer once in constructor instead of per-invocation
- Bound dispatchSpans map to prevent unbounded growth / span leaks;
  oldest span is ended and evicted when the limit is exceeded
- Add comment explaining setMarshalledProperties(null) in TextMapSetter
- Replace Thread.sleep() in tests with Wait.waitFor() pattern
- Document topic fan-out span behavior in class Javadoc
@jbonofre
jbonofre force-pushed the add-opentelemetry-support branch from b55e0a6 to 225e05a Compare July 16, 2026 12:06
@jbonofre
jbonofre requested a review from cshannon July 16, 2026 12:06
@jbonofre

Copy link
Copy Markdown
Member Author

@cshannon wdyt about this one for 6.3.0?

@cshannon

Copy link
Copy Markdown
Contributor

@cshannon wdyt about this one for 6.3.0?

I haven't looked at this at all and this definitely needs to wait. Did

@cshannon wdyt about this one for 6.3.0?

I think 6.4.0 makes more sense, I don't think anyone else has paid attention to this (I know I haven't) and adding a major new framework like this is a pretty big deal, even if it's off by default. I think it would be good to have some more time.

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.

Add OpenTelemetry plugin

3 participants