OpenTelemetry PHP

Application

Table of Contents

Interfaces

BaggageBuilderInterface
BaggageInterface
Represents a value that can be stored within {@see ContextInterface}.
MetadataInterface
LogWriterInterface
ClockInterface
ComponentPlugin
A component plugin that can be used to create a component.
ComponentProvider
A component provider is responsible for interpreting configuration and returning an implementation of a particular type.
ComponentProviderRegistry
A registry of component providers.
EnvComponentLoader
EnvComponentLoaderRegistry
EnvResolver
Helper class to access environment-based configuration.
ConfigProperties
ConfigProviderInterface
GeneralInstrumentationConfiguration
HookManagerInterface
Instrumentation
InstrumentationConfiguration
ConfigurationResolverInterface
InstrumentationInterface
EventLoggerInterface
EventLoggerProviderInterface
LoggerInterface
Implementations MUST be safe for concurrent use, for example from multiple fibers.
LoggerProviderInterface
Implementations MUST be safe for concurrent use, for example from multiple fibers.
LogRecordBuilderInterface
AsynchronousInstrument
Marker interface for asynchronous instruments.
CounterInterface
Marker interface for synchronous instruments.
GaugeInterface
A synchronous instrument which can be used to record non-additive values.
HistogramInterface
Marker interface for synchronous instruments.
Instrument
Implementations MUST be safe for concurrent use, for example from multiple fibers.
MeterInterface
Implementations MUST be safe for concurrent use, for example from multiple fibers.
MeterProviderInterface
Implementations MUST be safe for concurrent use, for example from multiple fibers.
ObservableCallbackInterface
An observed callback.
ObservableCounterInterface
Marker interface for asynchronous instruments.
ObservableGaugeInterface
Marker interface for asynchronous instruments.
ObservableUpDownCounterInterface
Marker interface for asynchronous instruments.
ObserverInterface
SynchronousInstrument
Marker interface for synchronous instruments.
UpDownCounterInterface
Marker interface for synchronous instruments.
Signals
SpanBuilderInterface
Obtained from a {@see TracerInterface} and used to construct a {@see SpanInterface}.
SpanContextInterface
SpanInterface
Implementations MUST be safe for concurrent use, for example from multiple fibers.
SpanKind
SemanticConventionResolver
StatusCode
TraceFlags
TracerInterface
Implementations MUST be safe for concurrent use, for example from multiple fibers.
TracerProviderInterface
Implementations MUST be safe for concurrent use, for example from multiple fibers.
TraceStateInterface
TraceState parses and stores the tracestate header as an immutable list of string key/value pairs. It provides the following operations following the rules described in the W3C Trace Context specification: - Get value for a given key - Add a new key/value pair - Update an existing value for a given key - Delete a key/value pair
EnvReader
EnvSource
EnvSourceProvider
IgnoresUnknownProviders
Drops a component-map key with no registered provider, instead of failing the parse. Opt in with `componentMap(...)->attribute(IgnoresUnknownProviders::ATTRIBUTE, true)`.
ResourceCollection
ContextInterface
Immutable execution scoped propagation mechanism.
ContextKeyInterface
ContextStorageInterface
ContextStorageScopeInterface
ExecutionContextAwareInterface
ImplicitContextKeyedInterface
Represents a value that can be stored within {@see ContextInterface}.
ExtendedPropagationGetterInterface
Interface for getting values from a carrier.
PropagationGetterInterface
PropagationSetterInterface
ResponsePropagatorInterface
TextMapPropagatorInterface
ScopeInterface
ContentTypes
HttpEndpointResolverInterface
AttributesBuilderInterface
AttributesFactoryInterface
AttributesInterface
AttributeValidatorInterface
Defaults
Default values for environment variables defined by the OpenTelemetry specification and language specific variables for the PHP SDK.
KnownValues
"Known values" for OpenTelemetry configurataion variables.
ResolverInterface
ValueTypes
Environment variables defined by the OpenTelemetry specification and language specific variables for the PHP SDK.
Variables
Environment variables defined by the OpenTelemetry specification and language specific variables for the PHP SDK.
VariableTypes
DistributionConfiguration
DistributionProperties
TransportFactoryInterface
TransportInterface
CancellationInterface
FutureInterface
DependencyResolverInterface
ResolverInterface
DiscoveryInterface
ResolverInterface
FactoryResolverInterface
MessageFactoryInterface
InstrumentationScopeFactoryInterface
InstrumentationScopeInterface
Configurable
ClockInterface
EventLoggerProviderInterface
LoggerProviderInterface
Implementations MUST be safe for concurrent use, for example from multiple fibers.
LogRecordExporterFactoryInterface
LogRecordExporterInterface
LogRecordProcessorInterface
PsrSeverityMapperInterface
AggregationInterface
AggregationTemporalitySelectorInterface
DataInterface
DefaultAggregationProviderInterface
ExemplarFilterInterface
The exemplar spec is not yet stable, and can change at any time.
ExemplarReservoirInterface
MeterProviderInterface
Implementations MUST be safe for concurrent use, for example from multiple fibers.
MetricExporterFactoryInterface
MetricExporterInterface
MetricMetadataInterface
MetricReaderInterface
MetricSourceInterface
MetricSourceProviderInterface
MetricSourceRegistryInterface
PushMetricExporterInterface
StalenessHandlerFactoryInterface
StalenessHandlerInterface
SelectionCriteriaInterface
ViewRegistryInterface
RegistrarInterface
Service provider interface (SPI) through which a package contributes components to the {@see Registry}, for example exporter factories, transport factories and propagators.
ResourceDetectorInterface
EventInterface
ExtendedSpanProcessorInterface
IdGeneratorInterface
LinkInterface
RandomTraceIdGeneratorInterface
Marks an ID generator whose trace IDs meet the W3C Trace Context Level 2 randomness requirements, so that root spans get the `Random` trace flag.
ReadableSpanInterface
ReadWriteSpanInterface
Implementations MUST be safe for concurrent use, for example from multiple fibers.
ComposableSamplerInterface
A sampler that returns its sampling preference (a {@see SamplingIntentInterface}) instead of a decision.
PredicateInterface
A condition of a {@see ComposableRuleBased} rule.
SamplingIntentInterface
The sampling preference returned by a {@see ComposableSamplerInterface}.
SamplerInterface
This interface is used to organize sampling logic.
SpanConverterInterface
SpanDataInterface
Represents an immutable snapshot of a {@see API\SpanInterface}.
SpanExporterFactoryInterface
SpanExporterInterface
SpanProcessorInterface
SpanSuppression
SpanSuppressionStrategy
SpanSuppressor
StatusDataInterface
TracerProviderInterface
Implementations MUST be safe for concurrent use, for example from multiple fibers.
ClientAttributes
Semantic attributes and corresponding values for client.
CodeAttributes
Semantic attributes and corresponding values for code.
ContainerAttributes
Semantic attributes and corresponding values for container.
DbAttributes
Semantic attributes and corresponding values for db.
DeploymentAttributes
Semantic attributes and corresponding values for deployment.
ErrorAttributes
Semantic attributes and corresponding values for error.
ExceptionAttributes
Semantic attributes and corresponding values for exception.
HttpAttributes
Semantic attributes and corresponding values for http.
NetworkAttributes
Semantic attributes and corresponding values for network.
OtelAttributes
Semantic attributes and corresponding values for otel.
RpcAttributes
Semantic attributes and corresponding values for rpc.
ServerAttributes
Semantic attributes and corresponding values for server.
ServiceAttributes
Semantic attributes and corresponding values for service.
TelemetryAttributes
Semantic attributes and corresponding values for telemetry.
UrlAttributes
Semantic attributes and corresponding values for url.
UserAgentAttributes
Semantic attributes and corresponding values for user_agent.
ClientIncubatingAttributes
Semantic attributes and corresponding values for client.
CodeIncubatingAttributes
Semantic attributes and corresponding values for code.
ContainerIncubatingAttributes
Semantic attributes and corresponding values for container.
DbIncubatingAttributes
Semantic attributes and corresponding values for db.
DeploymentIncubatingAttributes
Semantic attributes and corresponding values for deployment.
DnsIncubatingAttributes
Semantic attributes and corresponding values for dns.
ErrorIncubatingAttributes
Semantic attributes and corresponding values for error.
ExceptionIncubatingAttributes
Semantic attributes and corresponding values for exception.
FeatureFlagIncubatingAttributes
Semantic attributes and corresponding values for feature_flag.
HostIncubatingAttributes
Semantic attributes and corresponding values for host.
HttpIncubatingAttributes
Semantic attributes and corresponding values for http.
JsonrpcIncubatingAttributes
Semantic attributes and corresponding values for jsonrpc.
KafkaIncubatingAttributes
Semantic attributes and corresponding values for kafka.
LogIncubatingAttributes
Semantic attributes and corresponding values for log.
MessagingIncubatingAttributes
Semantic attributes and corresponding values for messaging.
NetIncubatingAttributes
Semantic attributes and corresponding values for net.
NetworkIncubatingAttributes
Semantic attributes and corresponding values for network.
OracleCloudIncubatingAttributes
Semantic attributes and corresponding values for oracle_cloud.
OracleIncubatingAttributes
Semantic attributes and corresponding values for oracle.
OsIncubatingAttributes
Semantic attributes and corresponding values for os.
OtelIncubatingAttributes
Semantic attributes and corresponding values for otel.
PeerIncubatingAttributes
Semantic attributes and corresponding values for peer.
ProcessIncubatingAttributes
Semantic attributes and corresponding values for process.
RabbitmqIncubatingAttributes
Semantic attributes and corresponding values for rabbitmq.
RocketmqIncubatingAttributes
Semantic attributes and corresponding values for rocketmq.
RpcIncubatingAttributes
Semantic attributes and corresponding values for rpc.
ServerIncubatingAttributes
Semantic attributes and corresponding values for server.
ServiceIncubatingAttributes
Semantic attributes and corresponding values for service.
TelemetryIncubatingAttributes
Semantic attributes and corresponding values for telemetry.
TlsIncubatingAttributes
Semantic attributes and corresponding values for tls.
UrlIncubatingAttributes
Semantic attributes and corresponding values for url.
UserAgentIncubatingAttributes
Semantic attributes and corresponding values for user_agent.
UserIncubatingAttributes
Semantic attributes and corresponding values for user.
DbIncubatingMetrics
Metrics for db.
DnsIncubatingMetrics
Metrics for dns.
HttpIncubatingMetrics
Metrics for http.
McpIncubatingMetrics
Metrics for mcp.
NfsIncubatingMetrics
Metrics for nfs.
OpenshiftIncubatingMetrics
Metrics for openshift.
OtelIncubatingMetrics
Metrics for otel.
DbMetrics
Metrics for db.
HttpMetrics
Metrics for http.
ResourceAttributes
ResourceAttributeValues
TraceAttributes
TraceAttributeValues

Classes

Baggage
BaggageBuilder
Entry
Metadata
BaggagePropagator
Parser
ConfiguredLogger
Writes internal log messages through {@see Logging::logWriter()}, filtered by a level held on the instance rather than by the global minimum. This lets a configured `log_level` apply to messages emitted while the SDK is being created, before {@see Logging::setLogLevel()} has been called.
Logging
Logging utility functions for internal logging (of OpenTelemetry errors/warnings etc).
ErrorLogWriter
Formatter
NoopLogWriter
Psr3LogWriter
StreamLogWriter
TriggerErrorLogWriter
LogWriterFactory
Clock
Context
NoopConfigProperties
NoopConfigProvider
Globals
Provides access to the globally configured instrumentation instances.
ConfigurationRegistry
Context
Context used for component creation.
ExtensionHookManager
HookManager
NoopHookManager
CachedInstrumentation
Provides access to cached {@link TracerInterface} and {@link MeterInterface} instances.
EnvComponentLoaderHttpConfig
EnvComponentLoaderPeerConfig
HttpConfig
PeerConfig
ConfigurationResolver
Configurator
Configures the global (context scoped) instrumentation instances.
SpanAttribute
For function and methods that have the {@link WithSpan} attribute, adding this attribute to an argument will add the argument as a span attribute.
WithSpan
Functions and methods with this attribute will be auto-instrumented by the OpenTelemetry extension.
WithSpanHandler
Generic pre-hook and post-hook handlers for attribute-based auto instrumentation
LoggerHolder
LateBindingLogger
LateBindingLoggerProvider
LogRecord
Deprecated, use {@link LoggerInterface::logRecordBuilder()} instead.
Psr3
NoopEventLogger
NoopEventLoggerProvider
NoopLogger
NoopLoggerProvider
NoopLogRecordBuilder
LateBindingMeter
LateBindingMeterProvider
NoopMeter
NoopMeterProvider
LateBindingTracer
LateBindingTracerProvider
Late binding providers are designed to be used by Instrumentation, while we do not have control over when all components (propagators, etc) which are registered through composer.autoload.files are actually loaded. It means that tracers etc are not fetched from Globals until the last possible instant (ie, when they try to create a span, get an instrument, etc).
LocalRootSpan
NonRecordingSpan
NoopSpanBuilder
NoopTracer
NoopTracerProvider
TraceContextPropagator
TraceContext is a propagator that supports the W3C Trace Context format (https://www.w3.org/TR/trace-context/)
TraceContextValidator
Span
SpanContext
SpanContextValidator
SemanticConvention
TraceState
ConfigProvider
Reads file-based instrumentation configuration from `OTEL_CONFIG_FILE`, registered under {@see ConfigProviderInterface} via SPI.
ConfigurationFactory
SymfonyDotenvProvider
VlucasPhpdotenvProvider
ArrayEnvSource
EnvSourceReader
GetenvEnvSource
LazyEnvSource
PhpIniEnvSource
ServerEnvSource
Validation
Provides validation closures for {@see NodeDefinition}s.
Configuration
Instrumentation
Context
ContextKeys
ArrayAccessGetterSetter
EnvironmentGetterSetter
MultiResponsePropagator
MultiTextMapPropagator
NoopResponsePropagator
NoopTextMapPropagator
SanitizeCombinedHeadersPropagationGetter
Some servers concatenate multiple headers with ';' -- we need to replace these with ',' This is still a workaround and doesn't get around the problem fully, specifically it doesn't handle edge cases where the header has a trailing ';' or an empty trace state.
GrpcTransportFactory
AttributesConverter
HttpEndpointResolver
Resolves non-signal-specific OTLP HTTP endpoints to signal-specific ones according to the specification.
LogsConverter
LogsExporter
LogsExporterFactory
MetricConverter
MetricExporter
MetricExporterFactory
OtlpHttpTransportFactory
OtlpUtil
Protocols
SpanConverter
SpanExporter
SpanExporterFactory
StdoutLogsExporterFactory
StdoutMetricExporterFactory
StdoutSpanExporterFactory
Exporter
SpanConverter
SpanExporterFactory
SpanKind
B3DebugFlagContextKey
B3MultiPropagator
B3Multi is a propagator that supports the specification for multiple "b3" http headers used for trace context propagation across service boundaries.
B3Propagator
B3 is a propagator that supports the specification for the header "b3" used for trace context propagation across service boundaries.
B3SinglePropagator
B3 is a propagator that supports the specification for the B3 single header "b3" used for trace context propagation across service boundaries.
DependencyResolver
HttpPlugClientResolver
MessageFactoryResolver
PsrClientResolver
Attributes
AttributeValidator
LogRecordAttributeValidator
Configuration
Configuration can come from one or more of the following sources (from highest to lowest priority): - values defined in php.ini - environment variable ($_SERVER) - configuration file (todo)
BooleanParser
ListParser
MapParser
RatioParser
PhpIniAccessor
Util
StackTraceFormatter
PsrTransport
PsrTransportFactory
InMemoryStorageManager
StreamTransportFactory
CompletedFuture
ErrorFuture
NullCancellation
Buzz
CurlClient
Guzzle
Symfony
Discovery
MessageFactory
InstrumentationScope
Represents the instrumentation scope information associated with the Tracer or Meter
InstrumentationScopeFactory
Configurator
ClockFactory
ClassConstantAccessor
ComposerHandler
ShutdownHandler
DistributionConfigurationSdk
SpanSuppressionStrategySemConv
SpanSuppressionStrategySpanKind
EventLogger
EventLoggerProvider
EventLoggerProviderFactory
ConsoleExporter
Writes log records as human-readable JSON.
ConsoleExporterFactory
InMemoryExporter
InMemoryExporterFactory
NoopExporter
ExporterFactory
Logger
LoggerConfig
LoggerProvider
LoggerProviderBuilder
LoggerProviderFactory
LoggerSharedState
LogRecordLimits
LogRecordLimitsBuilder
LogRecordProcessorFactory
NoopEventLoggerProvider
NoopLoggerProvider
BatchLogRecordProcessor
MultiLogRecordProcessor
NoopLogRecordProcessor
SimpleLogRecordProcessor
ReadableLogRecord
Deprecated, use {@link LoggerInterface::logRecordBuilder()} instead.
ReadWriteLogRecord
Deprecated, use {@link LoggerInterface::logRecordBuilder()} instead.
SimplePsrFileLogger
DropAggregation
Drops all measurements. A view with this aggregation registers no stream, so an instrument with no other view is disabled.
ExplicitBucketHistogramAggregation
ExplicitBucketHistogramSummary
LastValueAggregation
LastValueSummary
SumAggregation
SumSummary
Exemplar
Gauge
Histogram
HistogramDataPoint
Metric
NumberDataPoint
Sum
Temporality
Metric aggregation temporality.
AllExemplarFilter
The exemplar spec is not yet stable, and can change at any time.
NoneExemplarFilter
The exemplar spec is not yet stable, and can change at any time.
WithSampledTraceExemplarFilter
The exemplar spec is not yet stable, and can change at any time.
FilteredReservoir
The exemplar spec is not yet stable, and can change at any time.
FixedSizeReservoir
HistogramBucketReservoir
NoopReservoir
Instrument
InstrumentType
Instrument type.
MeterConfig
MeterProvider
MeterProviderBuilder
MeterProviderFactory
ConsoleMetricExporter
Writes metrics as human-readable JSON.
ConsoleMetricExporterFactory
InMemoryExporter
InMemoryExporterFactory
NoopMetricExporter
NoopMetricExporterFactory
ExportingReader
NoopMeterProvider
DelayedStalenessHandlerFactory
ImmediateStalenessHandlerFactory
NoopStalenessHandlerFactory
TemporalityPreference
Chooses aggregation temporality by instrument kind, as for `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE`.
CriteriaViewRegistry
AllCriteria
InstrumentationScopeNameCriteria
InstrumentationScopeSchemaUrlCriteria
InstrumentationScopeVersionCriteria
InstrumentNameCriteria
InstrumentTypeCriteria
InstrumentUnitCriteria
ViewTemplate
ViewProjection
PropagatorFactory
ResponsePropagatorFactory
Registry
A registry to enable central registration of components that the SDK requires but which may be provided by non-SDK modules, such as contrib and extension.
Composer
Detect service name and version of root package. Not included in `all` detectors.
Composite
Constant
Environment
A malformed value is discarded in full, not pair by pair.
Host
OperatingSystem
Process
ProcessRuntime
Sdk
The SDK MUST provide access to a Resource with at least the attributes listed at {@see https://github.com/open-telemetry/semantic-conventions/blob/v1.32.0/docs/resource/README.md#semantic-attributes-with-sdk-provided-default-value}
SdkProvided
Service
ServiceInstance
ResourceInfo
A Resource is an immutable representation of the entity producing telemetry. For example, a process producing telemetry that is running in a container on Kubernetes has a Pod name, it is in a namespace and possibly is part of a Deployment which also has a name. All three of these attributes can be included in the Resource.
ResourceInfoFactory
Sdk
SdkAutoloader
SdkBuilder
AutoRootSpan
Event
ExporterFactory
ImmutableSpan
Link
NoopTracerProvider
RandomIdGenerator
AlwaysOffSampler
This implementation of the SamplerInterface always skips record.
AlwaysOnSampler
This implementation of the SamplerInterface always records.
AlwaysRecordSampler
This implementation of the SamplerInterface converts {@link \OpenTelemetry\SDK\Trace\SamplingResult::DROP} decisions from the root sampler into {@link \OpenTelemetry\SDK\Trace\SamplingResult::RECORD_ONLY} decisions, allowing processors to see all spans without sending them to exporters.
ComposableAlwaysOff
Drops every span (no threshold, adjusted count not reliable).
ComposableAlwaysOn
Samples every span (threshold 0).
ComposableAnnotating
Delegates the decision to another composable sampler and adds attributes to sampled spans.
ComposableParentThreshold
Propagates the sampling decision of the parent and delegates root spans to the root sampler.
ComposableProbability
Samples spans with a fixed probability.
ComposableRuleBased
Evaluates (predicate, sampler) rules in order and returns the intent of the first matching rule.
CompositeSampler
Makes the final sampling decision for a {@see ComposableSamplerInterface} and maintains the `ot` entry of the TraceState.
Predicate
Closure based {@see PredicateInterface} with named constructors for the common conditions.
PredicatedSampler
A rule of {@see ComposableRuleBased}: the sampler is used for spans that match the predicate.
SamplingIntent
Immutable {@see SamplingIntentInterface}.
ParentBased
This implementation of the SamplerInterface that respects parent context's sampling decision and delegates for the root span.
TraceIdRatioBasedSampler
This implementation of the SamplerInterface records with given probability.
SamplerFactory
SamplingResult
Span
SpanBuilder
AbstractDecorator
ConsoleSpanExporter
Writes spans as human-readable JSON.
ConsoleSpanExporterFactory
FriendlySpanConverter
InMemoryExporter
InMemorySpanExporterFactory
LoggerDecorator
LoggerExporter
NullSpanConverter
SpanLimits
SpanLimitsBuilder
BatchSpanProcessor
BatchSpanProcessorBuilder
MultiSpanProcessor
Class SpanMultiProcessor is a SpanProcessor that forwards all events to an array of SpanProcessors.
NoopSpanProcessor
SimpleSpanProcessor
SpanProcessorFactory
NoopSuppressionStrategy
SemanticConventionSuppressionStrategy
SpanKindSuppressionStrategy
StatusData
Tracer
TracerConfig
TracerProvider
TracerProviderBuilder
TracerProviderFactory
TracerSharedState
Stores shared state/config between all {@see API\TracerInterface} created via the same {@see API\TracerProviderInterface}.

Traits

LogsMessagesTrait
InstrumentationTrait
This trait in conjunction with the InstrumentationInterface is meant as a base for instrumentations for the OpenTelemetry API.
ConfigTrait
DefaultAggregationProviderTrait
LoggerAwareTrait
SpanExporterDecoratorTrait
SpanExporterTrait
UsesSpanConverterTrait

Enums

Severity
Version

Functions

trace()  : R
Executes the given closure within the provided span.

Functions

trace()

Executes the given closure within the provided span.

trace(SpanInterface $span, Closure $closure[, iterable<int|string, mixed> $args = [] ]) : R

The span will be ended.

Parameters
$span : SpanInterface

span to enclose the closure with

$closure : Closure
$args : iterable<int|string, mixed> = []

arguments to provide to the closure

Tags
template
phpstan-ignore-next-line
Return values
R —

result of the closure invocation

On this page

Search results