Context
provide.foundation.tracer.context
¶
TODO: Add module docstring.
Classes¶
SpanContext
¶
Context manager for managing span lifecycle.
Automatically sets and clears the current span.
Source code in provide/foundation/tracer/context.py
Functions¶
create_child_span
¶
Create a child span.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of the span |
required |
parent
|
Span | None
|
Parent span, defaults to current span |
None
|
Returns:
| Type | Description |
|---|---|
Span
|
New child span |
Source code in provide/foundation/tracer/context.py
get_current_span
¶
get_current_trace_id
¶
get_trace_context
¶
Get the current trace context information.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Dictionary with trace context information |
Source code in provide/foundation/tracer/context.py
set_current_span
¶
with_span
¶
Create a new span context.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of the span |
required |
Returns:
| Type | Description |
|---|---|
SpanContext
|
SpanContext that can be used as a context manager |