MediaWiki master
Wikimedia\Telemetry\TracerInterface Interface Reference

Base interface for an OpenTelemetry tracer responsible for creating spans. More...

Inherited by Wikimedia\Telemetry\NoopTracer, and Wikimedia\Telemetry\Tracer.

Public Member Functions

 createRootSpan (string $spanName)
 Create a new root span, i.e.
 
 createSpan (string $spanName)
 Create a span with the given name and the currently active span as the implicit parent.
 
 createSpanWithParent (string $spanName, SpanContext $parentSpanContext)
 Create a span with the given name and parent.
 
 shutdown ()
 Shut down this tracer and export collected trace data.
 

Detailed Description

Base interface for an OpenTelemetry tracer responsible for creating spans.

Since
1.43

Definition at line 10 of file TracerInterface.php.

Member Function Documentation

◆ createRootSpan()

Wikimedia\Telemetry\TracerInterface::createRootSpan ( string $spanName)

Create a new root span, i.e.

a span with no parent that forms the basis for a new trace.

Parameters
string$spanNameThe descriptive name of this span. Refer to the OTEL Tracing API spec for recommended naming conventions.
Returns
SpanInterface

Implemented in Wikimedia\Telemetry\NoopTracer, and Wikimedia\Telemetry\Tracer.

◆ createSpan()

Wikimedia\Telemetry\TracerInterface::createSpan ( string $spanName)

Create a span with the given name and the currently active span as the implicit parent.

This requires a span to be already active and will throw an error otherwise.

Parameters
string$spanNameThe descriptive name of this span. Refer to the OTEL Tracing API spec for recommended naming conventions.
Returns
SpanInterface
Exceptions
PreconditionExceptionIf no span was active

Implemented in Wikimedia\Telemetry\Tracer.

◆ createSpanWithParent()

Wikimedia\Telemetry\TracerInterface::createSpanWithParent ( string $spanName,
SpanContext $parentSpanContext )

Create a span with the given name and parent.

Parameters
string$spanNameThe descriptive name of this span. Refer to the OTEL Tracing API spec for recommended naming conventions.
SpanContext$parentSpanContextContext of the parent span this span should be associated with.
Returns
SpanInterface

Implemented in Wikimedia\Telemetry\NoopTracer, and Wikimedia\Telemetry\Tracer.

◆ shutdown()

Wikimedia\Telemetry\TracerInterface::shutdown ( )

Shut down this tracer and export collected trace data.

Returns
void

Implemented in Wikimedia\Telemetry\NoopTracer, and Wikimedia\Telemetry\Tracer.


The documentation for this interface was generated from the following file: