MediaWiki master
SpanInterface.php
Go to the documentation of this file.
1<?php
2namespace Wikimedia\Telemetry;
3
10interface SpanInterface {
15 public const SPAN_KIND_INTERNAL = 1;
16
20 public const SPAN_KIND_SERVER = 2;
21
25 public const SPAN_KIND_CLIENT = 3;
26
30 public const SPAN_KIND_PRODUCER = 4;
31
36 public const SPAN_KIND_CONSUMER = 5;
37
42 public function getContext(): SpanContext;
43
56 public function setAttributes( array $attributes ): SpanInterface;
57
66 public function setSpanKind( int $spanKind ): SpanInterface;
67
73 public function start( ?int $epochNanos = null ): SpanInterface;
74
80 public function end( ?int $epochNanos = null ): void;
81
90 public function activate(): void;
91
96 public function deactivate(): void;
97}
Data transfer object holding data associated with a given span.
Represents an OpenTelemetry span, i.e.
start(?int $epochNanos=null)
Start this span, optionally specifying an override for its start time.
setSpanKind(int $spanKind)
Set the kind of this span, which describes how it relates to its parent and children within the overa...
const SPAN_KIND_PRODUCER
Indicates that the span describes the initiators of an asynchronous request.
const SPAN_KIND_CLIENT
Indicates that the span describes a request to some remote service.
deactivate()
Deactivate this span.
getContext()
Get the context holding data for this span.
activate()
Make this span the active span.
const SPAN_KIND_INTERNAL
Default value.
const SPAN_KIND_CONSUMER
Indicates that the span describes a child of an asynchronous SpanInterface::SPAN_KIND_PRODUCER reques...
const SPAN_KIND_SERVER
Indicates that the span covers server-side handling of a synchronous RPC or other remote request.
setAttributes(array $attributes)
Set attributes (arbitrary metadata) for this span.
end(?int $epochNanos=null)
End this span, optionally specifying an override for its end time.