Skip to content

Add OpenTelemetry support to PubSub configuration#2946

Open
raphasil wants to merge 6 commits intosmallrye:mainfrom
raphasil:issues/2941
Open

Add OpenTelemetry support to PubSub configuration#2946
raphasil wants to merge 6 commits intosmallrye:mainfrom
raphasil:issues/2941

Conversation

@raphasil
Copy link

closes #2941

@ozangunalp
Copy link
Collaborator

ozangunalp commented Feb 3, 2026

@raphasil I pushed a rebase, a small fix and a test for enabling OTel on the pubsub client. However, this does not enable tracing propagation for messaging, like in Quarkus.

We can do that in a future PR.

@ozangunalp ozangunalp added this to the 4.33.0 milestone Feb 3, 2026
private final List<ManagedChannel> channels = new CopyOnWriteArrayList<>();

@Inject
private Instance<OpenTelemetry> openTelemetryInstance;
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't this require OpenTelemetry to be on the classpath?

Copy link
Collaborator

Choose a reason for hiding this comment

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

opentelemetry-api yes. We do have the smallrye-reactive-messaging-otel module to pull those dependencies. But gcp pubsub depends on the OTel API too.

Copy link
Author

Choose a reason for hiding this comment

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

@cescoffier The OpenTelemetry library is already included in the classpath through both the google-cloud-pubsub library, which relies on OpenTelemetry for gRPC instrumentation, and the smallrye-reactive-messaging-otel library. The tracing functionality is only activated when the configuration otel-enabled=true is set and when the OpenTelemetry instance is accessible via CDI. Please let me know if I misunderstood anything.

@ozangunalp ozangunalp modified the milestones: 4.33.0, 4.34.0 Feb 9, 2026
@raphasil
Copy link
Author

raphasil commented Feb 10, 2026

@ozangunalp I implemented tracing propagation at the messaging level to link producer and consumer spans across the messaging system. I used the Kafka and AMQP modules as references. I also fixed the tests

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add OpenTelemetry Support for smallrye-reactive-messaging-gcp-pubsub

3 participants