Page MenuHomeWickedGov Phorge

StaticInjectionPropagator.php
No OneTemporary

Size
721 B
Referenced Files
None
Subscribers
None

StaticInjectionPropagator.php

<?php
namespace Wikimedia\Telemetry;
/**
* A {@link ContextPropagatorInterface} implementation that injects
* a fixed set of headers into outgoing requests. It does not perform extraction.
*
* @since 1.44
* @internal
*/
class StaticInjectionPropagator implements ContextPropagatorInterface {
private array $headers;
public function __construct( array $headers ) {
$this->headers = $headers;
}
/**
* @inheritDoc
*/
public function inject( ?SpanContext $spanContext, array $carrier ): array {
foreach ( $this->headers as $key => $value ) {
$carrier[$key] = $value;
}
return $carrier;
}
/**
* @inheritDoc
*/
public function extract( array $carrier ): ?SpanContext {
return null;
}
}

File Metadata

Mime Type
text/x-php
Expires
Wed, Aug 19, 15:03 (3 w, 5 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
5e/02/02de023d9a1bf65cbf159b5a9e63
Default Alt Text
StaticInjectionPropagator.php (721 B)

Event Timeline