Returns
Returns a context token that must be passed toclear_context() for cleanup.
Example
Parameters
string
required
The trace ID to associate spans with. All subsequent spans will be linked to this ID.
How It Works
When you callset_context(), it attaches the provided ID to the current OpenTelemetry context. Any spans created by @traced decorated functions or start_span() will automatically include this ID as an attribute, enabling:
- Span Correlation - All spans are linked to the same trace
- Automatic Export - Spans are batched and exported to Galtea API