MediaWiki master
Wikimedia\Telemetry\NoopSpan Class Reference

An unsampled span that does nothing and persists no data. More...

Inherits Wikimedia\Telemetry\SpanInterface.

Collaboration diagram for Wikimedia\Telemetry\NoopSpan:

Public Member Functions

 __construct (SpanContext $context)
 
 activate ()
 Make this span the active span.This will cause any spans started without specifying an explicit parent to automatically become children of this span as long as it remains active.
Returns
void

 
 deactivate ()
 Deactivate this span.
Returns
void

 
 end (?int $epochNanos=null)
 End this span, optionally specifying an override for its end time.
Parameters
int | null$epochNanosThe end time to use, or null to use the current time.
Returns
void

 
 getContext ()
 Get the context holding data for this span.
Returns
SpanContext

 
 setAttributes (array $attributes)
 Set attributes (arbitrary metadata) for this span.Any existing attributes with the same keys will be overwritten. Attributes with a null value will be ignored during export.When deciding on the set of attributes to register as well as their naming, consider following Semantic Conventions where applicable.
Parameters
array$attributeskey-value mapping of attribute names to values
Returns
SpanInterface fluent interface

 
 setSpanKind (int $spanKind)
 Set the kind of this span, which describes how it relates to its parent and children within the overarching trace.
Parameters
int$spanKindOne of the SpanInterface::SPAN_KIND_** constants
See also
https://opentelemetry.io/docs/specs/otel/trace/api/#spankind
Returns
SpanInterface fluent interface

 
 start (?int $epochNanos=null)
 Start this span, optionally specifying an override for its start time.
Parameters
int | null$epochNanosThe start time to use, or null to use the current time.
Returns
SpanInterface

 

Additional Inherited Members

- Public Attributes inherited from Wikimedia\Telemetry\SpanInterface
const SPAN_KIND_CLIENT = 3
 Indicates that the span describes a request to some remote service.
 
const SPAN_KIND_CONSUMER = 5
 Indicates that the span describes a child of an asynchronous SpanInterface::SPAN_KIND_PRODUCER request.
 
const SPAN_KIND_INTERNAL = 1
 Default value.
 
const SPAN_KIND_PRODUCER = 4
 Indicates that the span describes the initiators of an asynchronous request.
 
const SPAN_KIND_SERVER = 2
 Indicates that the span covers server-side handling of a synchronous RPC or other remote request.
 

Detailed Description

An unsampled span that does nothing and persists no data.

Since
1.43
Access: internal

Definition at line 10 of file NoopSpan.php.

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\Telemetry\NoopSpan::__construct ( SpanContext $context)

Definition at line 13 of file NoopSpan.php.

Member Function Documentation

◆ activate()

Wikimedia\Telemetry\NoopSpan::activate ( )

Make this span the active span.This will cause any spans started without specifying an explicit parent to automatically become children of this span as long as it remains active.

Returns
void

Implements Wikimedia\Telemetry\SpanInterface.

Definition at line 43 of file NoopSpan.php.

◆ deactivate()

Wikimedia\Telemetry\NoopSpan::deactivate ( )

Deactivate this span.

Returns
void

Implements Wikimedia\Telemetry\SpanInterface.

Definition at line 48 of file NoopSpan.php.

◆ end()

Wikimedia\Telemetry\NoopSpan::end ( ?int $epochNanos = null)

End this span, optionally specifying an override for its end time.

Parameters
int | null$epochNanosThe end time to use, or null to use the current time.
Returns
void

Implements Wikimedia\Telemetry\SpanInterface.

Definition at line 38 of file NoopSpan.php.

◆ getContext()

Wikimedia\Telemetry\NoopSpan::getContext ( )

Get the context holding data for this span.

Returns
SpanContext

Implements Wikimedia\Telemetry\SpanInterface.

Definition at line 18 of file NoopSpan.php.

◆ setAttributes()

Wikimedia\Telemetry\NoopSpan::setAttributes ( array $attributes)

Set attributes (arbitrary metadata) for this span.Any existing attributes with the same keys will be overwritten. Attributes with a null value will be ignored during export.When deciding on the set of attributes to register as well as their naming, consider following Semantic Conventions where applicable.

Parameters
array$attributeskey-value mapping of attribute names to values
Returns
SpanInterface fluent interface

Implements Wikimedia\Telemetry\SpanInterface.

Definition at line 23 of file NoopSpan.php.

◆ setSpanKind()

Wikimedia\Telemetry\NoopSpan::setSpanKind ( int $spanKind)

Set the kind of this span, which describes how it relates to its parent and children within the overarching trace.

Parameters
int$spanKindOne of the SpanInterface::SPAN_KIND_** constants
See also
https://opentelemetry.io/docs/specs/otel/trace/api/#spankind
Returns
SpanInterface fluent interface

Implements Wikimedia\Telemetry\SpanInterface.

Definition at line 28 of file NoopSpan.php.

◆ start()

Wikimedia\Telemetry\NoopSpan::start ( ?int $epochNanos = null)

Start this span, optionally specifying an override for its start time.

Parameters
int | null$epochNanosThe start time to use, or null to use the current time.
Returns
SpanInterface

Implements Wikimedia\Telemetry\SpanInterface.

Definition at line 33 of file NoopSpan.php.


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