Is your feature request related to a problem?
IDs are currently not being completely set within the OTel C++ repository, which creates issues with exporting and rendering spans. For example, linked spans don't show up in GCP when exported to the OTel Collector after being exported using OTLP exporter. Furthermore, zPages doesn't show trace, parent, and span IDs for sampled spans. This also creates problems with testing, since checking for correctness of rendering is often tested without unit tests (i.e. in the case of zPages).
Describe the solution you'd like
There needs to be ID generation and association.
Trace IDs should be generated earlier than span ones, sometimes propagated from upstream service. Span IDs for a given span should be set to a random value during span creation within the SDK. PR #290 deals with this issue
Trace, span, and parent IDs also should be associated to the correct spans accordingly. This can be done by (per @nadiaciobanu):
- In Tracer::StartSpan(), extract the current span context from the runtime context and pass it into the Span constructor (this represents the new span's parent context). If there is no current span, pass an invalid span context to the Span constructor.
- Add a SpanContext instance to the Span class. In the Span constructor, create a new SpanContext for the current span and set the ids using the parent span context.
Describe alternatives you've considered
N/A
Additional context
OTel C++ Gitter Chat
Is your feature request related to a problem?
IDs are currently not being completely set within the OTel C++ repository, which creates issues with exporting and rendering spans. For example, linked spans don't show up in GCP when exported to the OTel Collector after being exported using OTLP exporter. Furthermore, zPages doesn't show trace, parent, and span IDs for sampled spans. This also creates problems with testing, since checking for correctness of rendering is often tested without unit tests (i.e. in the case of zPages).
Describe the solution you'd like
There needs to be ID generation and association.
Trace IDs should be generated earlier than span ones, sometimes propagated from upstream service. Span IDs for a given span should be set to a random value during span creation within the SDK. PR #290 deals with this issue
Trace, span, and parent IDs also should be associated to the correct spans accordingly. This can be done by (per @nadiaciobanu):
Describe alternatives you've considered
N/A
Additional context
OTel C++ Gitter Chat