cdd7ad020e | ||
---|---|---|
.. | ||
AttributesConverter.php | ||
ContentTypes.php | ||
HttpEndpointResolver.php | ||
HttpEndpointResolverInterface.php | ||
LogsConverter.php | ||
LogsExporter.php | ||
LogsExporterFactory.php | ||
MetricConverter.php | ||
MetricExporter.php | ||
MetricExporterFactory.php | ||
OtlpHttpTransportFactory.php | ||
OtlpUtil.php | ||
ProtobufSerializer.php | ||
Protocols.php | ||
README.md | ||
SpanConverter.php | ||
SpanExporter.php | ||
SpanExporterFactory.php | ||
_register.php | ||
composer.json |
README.md
OpenTelemetry OTLP exporter
Documentation
https://opentelemetry.io/docs/instrumentation/php/exporters/#otlp
Usage
Http transport
$transport = (new \OpenTelemetry\Contrib\Otlp\OtlpHttpTransportFactory())->create('http://collector:4318');
$exporter = new \OpenTelemetry\Contrib\Otlp\SpanExporter($transport);
gRPC transport
To export over gRPC, you will need to additionally install the open-telemetry/transport-grpc
package.
Protobuf Runtime library
OTLP exporting requires a protobuf implementation.
The open-telemetry/gen-otlp-protobuf
requires the google/protobuf
native implementation. It's fine for development, but
not recommended for production usage.
The recommended option for production is to install the Protobuf C extension for PHP. The extension makes exporting significantly more performant. This can be easily installed with the following command:
pecl install protobuf
Contributing
This repository is a read-only git subtree split. To contribute, please see the main OpenTelemetry PHP monorepo.