-
Notifications
You must be signed in to change notification settings - Fork 191
/
TextMapPropagatorB3.php
34 lines (28 loc) · 1.08 KB
/
TextMapPropagatorB3.php
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
29
30
31
32
33
34
<?php
declare(strict_types=1);
namespace OpenTelemetry\Config\SDK\ComponentProvider\Propagator;
use Nevay\SPI\ServiceProviderDependency\PackageDependency;
use OpenTelemetry\Config\SDK\Configuration\ComponentProvider;
use OpenTelemetry\Config\SDK\Configuration\ComponentProviderRegistry;
use OpenTelemetry\Config\SDK\Configuration\Context;
use OpenTelemetry\Context\Propagation\TextMapPropagatorInterface;
use OpenTelemetry\Extension\Propagator\B3\B3Propagator;
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
/**
* @implements ComponentProvider<TextMapPropagatorInterface>
*/
#[PackageDependency('open-telemetry/extension-propagator-b3', '^1.0.1')]
final class TextMapPropagatorB3 implements ComponentProvider
{
/**
* @param array{} $properties
*/
public function createPlugin(array $properties, Context $context): TextMapPropagatorInterface
{
return B3Propagator::getB3SingleHeaderInstance();
}
public function getConfig(ComponentProviderRegistry $registry): ArrayNodeDefinition
{
return new ArrayNodeDefinition('b3');
}
}