hrzzzz opened a new pull request, #25749:
URL: https://github.com/apache/pulsar/pull/25749
### Motivation
The OpenTelemetry producer interceptor creates a send span but does not
inject the trace context into message properties. On the consumer side,
extractContext finds nothing in the properties and falls back to
Context.current(), so consumer spans always start a new trace instead of
being children of the producer span. Producer and consumer spans are impossible
to correlate.
### Modifications
- Added TracingContext.injectContext(Message, Context, TextMapPropagator)
overload that writes trace context directly to the message's underlying
MessageMetadata protobuf, handling both MessageImpl and TopicMessageImpl
wrappers.
- Called it from OpenTelemetryProducerInterceptor.beforeSend() after
creating the producer span.
### Verifying this change
- [x] Make sure that the change passes the CI checks.
Added test:
`org.apache.pulsar.broker.service.OpenTelemetryTracingIntegrationTest#testContextPropagationViaMessageProperties`
### Does this pull request potentially affect one of the following parts:
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
*If the box was checked, please highlight the changes*
- [ ] Dependencies (add or upgrade a dependency)
- [ ] The public API
- [ ] The schema
- [ ] The default values of configurations
- [ ] The threading model
- [ ] The binary protocol
- [ ] The REST endpoints
- [ ] The admin CLI options
- [ ] The metrics
- [ ] Anything that affects deployment
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]