FriendlySpanConverterTest
extends TestCase
-
#[CoversClass]
-
\OpenTelemetry\SDK\Trace\SpanExporter\FriendlySpanConverter::class
Table of Contents
Constants
-
TEST_DATA
= ['name' => 'my.service', 'parent_span_id' => '1000000000000000', 'kind' => 'KIND_INTERNAL', 'start' => 1505855794194009601, 'end' => 1505855799465726528, 'context' => ['trace_id' => '00000000000000000000000000000000', 'span_id' => '0000000000000000', 'trace_state' => 'foz=baz,foo=bar', 'trace_flags' => 0], 'resource' => ['telemetry.sdk.name' => 'opentelemetry', 'telemetry.sdk.language' => 'php', 'telemetry.sdk.version' => 'dev'], 'attributes' => ['fruit' => 'apple'], 'status' => ['code' => 'Error', 'description' => 'status_description'], 'events' => [['name' => 'validators.list', 'timestamp' => 1505855799433901068, 'attributes' => ['job' => 'stage.updateTime']], ['name' => 'user.created', 'timestamp' => 1505855799433901555, 'attributes' => ['name' => 'John Doe']]], 'links' => [['context' => ['trace_id' => '20000000000000000000000000000000', 'span_id' => '2000000000000000', 'trace_state' => 'foo=baz,foz=bar', 'trace_flags' => 0], 'attributes' => ['foo' => 'bar']], ['context' => ['trace_id' => '20000000000000000000000000000000', 'span_id' => '3000000000000000', 'trace_state' => 'baz=foz,bar=foo', 'trace_flags' => 0], 'attributes' => ['foz' => 'baz']]], 'schema_url' => 'https://opentelemetry.io/schemas/1.25.0']
Methods
-
createEventInterfaceMock()
: EventInterface
-
createLinkInterfaceMock()
: LinkInterface
-
createSchemaUrlMock()
: string
-
test_convert()
: void
-
createAttributesInterfaceMock()
: AttributesInterface
-
createInstrumentationScopeMock()
: InstrumentationScopeInterface
-
createResourceInfoMock()
: ResourceInfo
-
createSpanContextMock()
: SpanContextInterface
-
createSpanDataInterfaceMock()
: SpanDataInterface
-
createStatusDataMock()
: StatusDataInterface
-
createTraceStateInterfaceMock()
: TraceStateInterface
TEST_DATA
private
mixed
TEST_DATA
= ['name' => 'my.service', 'parent_span_id' => '1000000000000000', 'kind' => 'KIND_INTERNAL', 'start' => 1505855794194009601, 'end' => 1505855799465726528, 'context' => ['trace_id' => '00000000000000000000000000000000', 'span_id' => '0000000000000000', 'trace_state' => 'foz=baz,foo=bar', 'trace_flags' => 0], 'resource' => ['telemetry.sdk.name' => 'opentelemetry', 'telemetry.sdk.language' => 'php', 'telemetry.sdk.version' => 'dev'], 'attributes' => ['fruit' => 'apple'], 'status' => ['code' => 'Error', 'description' => 'status_description'], 'events' => [['name' => 'validators.list', 'timestamp' => 1505855799433901068, 'attributes' => ['job' => 'stage.updateTime']], ['name' => 'user.created', 'timestamp' => 1505855799433901555, 'attributes' => ['name' => 'John Doe']]], 'links' => [['context' => ['trace_id' => '20000000000000000000000000000000', 'span_id' => '2000000000000000', 'trace_state' => 'foo=baz,foz=bar', 'trace_flags' => 0], 'attributes' => ['foo' => 'bar']], ['context' => ['trace_id' => '20000000000000000000000000000000', 'span_id' => '3000000000000000', 'trace_state' => 'baz=foz,bar=foo', 'trace_flags' => 0], 'attributes' => ['foz' => 'baz']]], 'schema_url' => 'https://opentelemetry.io/schemas/1.25.0']
createEventInterfaceMock()
public
createEventInterfaceMock(string $name, int $timestamp, AttributesInterface $attributes) : EventInterface
Parameters
-
$name
: string
-
-
$timestamp
: int
-
-
$attributes
: AttributesInterface
-
createLinkInterfaceMock()
public
createLinkInterfaceMock(SpanContextInterface $context, AttributesInterface $attributes) : LinkInterface
Parameters
-
$context
: SpanContextInterface
-
-
$attributes
: AttributesInterface
-
createSchemaUrlMock()
public
createSchemaUrlMock() : string
test_convert()
public
test_convert() : void
createAttributesInterfaceMock()
private
createAttributesInterfaceMock(array<string|int, mixed> $items) : AttributesInterface
Parameters
-
$items
: array<string|int, mixed>
-
createInstrumentationScopeMock()
private
createInstrumentationScopeMock() : InstrumentationScopeInterface
createResourceInfoMock()
private
createResourceInfoMock() : ResourceInfo
createSpanContextMock()
private
createSpanContextMock(string $spanId[, string $traceId = '0' ][, string|null $traceState = null ]) : SpanContextInterface
Parameters
-
$spanId
: string
-
-
$traceId
: string
= '0'
-
-
$traceState
: string|null
= null
-
createSpanDataInterfaceMock()
private
createSpanDataInterfaceMock() : SpanDataInterface
createStatusDataMock()
private
createStatusDataMock() : StatusDataInterface
createTraceStateInterfaceMock()
private
createTraceStateInterfaceMock(string $traceState) : TraceStateInterface
Parameters
-
$traceState
: string
-