-
Notifications
You must be signed in to change notification settings - Fork 223
Expand file tree
/
Copy pathWithSpan.php
More file actions
28 lines (24 loc) · 862 Bytes
/
WithSpan.php
File metadata and controls
28 lines (24 loc) · 862 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
declare(strict_types=1);
namespace OpenTelemetry\API\Instrumentation;
use Attribute;
use OpenTelemetry\API\Trace\SpanKind; //@phan-suppress-current-line PhanUnreferencedUseNormal
/**
* Functions and methods with this attribute will be auto-instrumented
* by the OpenTelemetry extension.
*/
#[Attribute(Attribute::TARGET_FUNCTION|Attribute::TARGET_METHOD)]
final readonly class WithSpan
{
/**
* @param string|null $span_name Optional span name. Default: function name or class::method
* @param int|null $span_kind Optional {@link SpanKind}. Default: {@link SpanKind::KIND_INTERNAL}
* @param array $attributes Optional attributes to be added to the span.
*/
public function __construct(
public ?string $span_name = null,
public ?int $span_kind = null,
public array $attributes = [],
) {
}
}