stankiewicz opened a new issue, #40175:
URL: https://github.com/apache/beam/issues/40175
### What would you like to happen?
## Summary
Add distributed tracing support via OpenTelemetry to SolaceIO.java for
both read and write patterns using `.withEnableOpenTelemetryTracing()`. This
follows the pattern established in KafkaIO and PubsubIO, leveraging the user
properties mapping interface recently merged in PR #40108.
## Functional Requirements
### Read Pattern (Context Extraction)
• Opt-In Execution (otherwise don't add doFn): Enabled via
`.withEnableOpenTelemetryTracing()` defaults to false.
• Context Extraction DoFn:
• Reads incoming W3C trace context from
Solace.Record.getUserProperties() using W3CTraceContextPropagator.
• If valid trace headers exist, extracts the parent span context;
otherwise, defaults safely to current context.
• Span Management:
• Starts a new span named "SolaceIO.Read" using the runner's
OpenTelemetry tracer obtained from SdkHarnessOptions.
• Emits downstream records within the active span scope
(span.makeCurrent()), enabling runners (such as Google Cloud Dataflow with
element_metadata_supported) to propagate trace context across pipeline stages.
• Ensures the span is closed upon completion.
• Scope: Applies to the standard read pattern consuming Solace.Record.
### Write Pattern (Context Injection)
• Opt-In Execution: Enabled via .withEnableOpenTelemetryTracing();
defaults to false.
• Context Injection:
• Captures the active trace context from Context.current().
• Injects W3C trace headers into the record's userProperties map
before publication.
• Works uniformly across both streaming (WriterType.STREAMING) and
batched (WriterType.BATCHED) publishing modes.
• Serializes user properties to the Solace broker via the underlying
JCSMP message property map (SDTMap).
──────
## Protocol Changes (Solace Message Attributes)
Trace propagation relies on the W3C Trace Context specification
https://www.w3.org/TR/trace-context/ mapped to Solace message user properties
(SDTMap in JCSMP, exposed as Map<String, String> on Solace.Record via PR #40108
1. traceparent, (string, case-insesitive).
2. tracestate (string, optional, case-insesitive).
### Issue Priority
Priority: 2 (default / most feature requests should be filed as P2)
### Issue Components
- [ ] Component: Python SDK
- [x] Component: Java SDK
- [ ] Component: Go SDK
- [ ] Component: Typescript SDK
- [x] Component: IO connector
- [ ] Component: Beam YAML
- [ ] Component: Beam examples
- [ ] Component: Beam playground
- [ ] Component: Beam katas
- [ ] Component: Website
- [ ] Component: Infrastructure
- [ ] Component: Spark Runner
- [ ] Component: Flink Runner
- [ ] Component: Prism Runner
- [ ] Component: Twister2 Runner
- [ ] Component: Hazelcast Jet Runner
- [ ] Component: Google Cloud Dataflow Runner
--
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]