MediaWiki master
|
Holds shared telemetry state, such as finished span data buffered for export. More...
Public Member Functions | |
activateSpan (SpanContext $spanContext) | |
Make the given span the active span. | |
addSpanContext (SpanContext $context) | |
Add the given span to the list of finished spans. | |
clearSpanContexts () | |
Clear the list of finished spans. | |
deactivateSpan (SpanContext $spanContext) | |
Deactivate the given span, if it was the active span. | |
endRootSpan () | |
End the root span associated with the current request or process. | |
getActiveSpanContext () | |
Get the context of the currently active span, or null if no span is active. | |
getSpanContexts () | |
Get the list of finished spans. | |
setRootSpan (SpanInterface $rootSpan) | |
Set the root span associated with the current request or process. | |
Static Public Member Functions | |
static | destroyInstance () |
Reset shared tracer state. | |
static | getInstance () |
Get or initialize the shared tracer state for the current process or web request. | |
Holds shared telemetry state, such as finished span data buffered for export.
Since this data is tied to the lifetime of a given web request or process, this class is a singleton to avoid discarding data in the case of MediaWiki service container resets.
Definition at line 16 of file TracerState.php.
Wikimedia\Telemetry\TracerState::activateSpan | ( | SpanContext | $spanContext | ) |
Make the given span the active span.
SpanContext | $spanContext | Context of the span to activate |
Definition at line 92 of file TracerState.php.
Wikimedia\Telemetry\TracerState::addSpanContext | ( | SpanContext | $context | ) |
Add the given span to the list of finished spans.
SpanContext | $context |
Definition at line 68 of file TracerState.php.
Wikimedia\Telemetry\TracerState::clearSpanContexts | ( | ) |
Clear the list of finished spans.
Definition at line 83 of file TracerState.php.
Wikimedia\Telemetry\TracerState::deactivateSpan | ( | SpanContext | $spanContext | ) |
Deactivate the given span, if it was the active span.
SpanContext | $spanContext | Context of the span to deactivate |
Definition at line 101 of file TracerState.php.
|
static |
Reset shared tracer state.
Useful for testing.
Definition at line 54 of file TracerState.php.
Wikimedia\Telemetry\TracerState::endRootSpan | ( | ) |
End the root span associated with the current request or process.
Definition at line 139 of file TracerState.php.
Wikimedia\Telemetry\TracerState::getActiveSpanContext | ( | ) |
Get the context of the currently active span, or null
if no span is active.
Definition at line 116 of file TracerState.php.
|
static |
Get or initialize the shared tracer state for the current process or web request.
Definition at line 45 of file TracerState.php.
Wikimedia\Telemetry\TracerState::getSpanContexts | ( | ) |
Wikimedia\Telemetry\TracerState::setRootSpan | ( | SpanInterface | $rootSpan | ) |
Set the root span associated with the current request or process.
SpanInterface | $rootSpan | The root span to set. |
PreconditionException | If a root span was already initialized for this request or process. |
Definition at line 127 of file TracerState.php.