open-telemetry / opentelemetry-config-http
OpenTelemetry HTTP configuration options
Installs: 2
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/open-telemetry/opentelemetry-config-http
Requires
- php: ^8.2
- open-telemetry/api: ^1.4
- psr/http-message: ^2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.7
- league/uri: ^7.5
- open-telemetry/sdk: ^1.6
- open-telemetry/sdk-configuration: ^0.5
- phan/phan: ^5.4
- phpstan/phpstan: ^2.1
- phpstan/phpstan-phpunit: ^2.0
- phpunit/phpunit: ^10.5
- psalm/plugin-phpunit: ^0.19.3
- symfony/polyfill-php83: ^1.32
- symfony/yaml: ^6.4
- vimeo/psalm: ^6.7
This package is auto-updated.
Last update: 2026-01-17 08:34:02 UTC
README
This is a read-only subtree split of https://github.com/open-telemetry/opentelemetry-php-contrib.
OpenTelemetry HTTP configuration
Provides configuration options for HTTP instrumentation packages.
Configuration
File-based configuration
instrumentation/development: php: http: client: capture_url_scheme: capture_url_template: capture_user_agent_original: capture_user_agent_synthetic_type: capture_network_transport: capture_request_body_size: capture_request_size: capture_response_body_size: capture_response_size: server: capture_client_port: capture_user_agent_synthetic_type: capture_network_transport: capture_network_local_address: capture_network_local_port: capture_request_body_size: capture_request_size: capture_response_body_size: capture_response_size: uri_sanitizers: - default: - redact_query_string_values: query_keys: [ passwd, secret ] known_http_methods: [ CONNECT, DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT, TRACE, CUSTOM ]
Env-based configuration
OTEL_PHP_INSTRUMENTATION_URL_SANITIZE_FIELD_NAMES="passwd,secret" OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS="CONNECT,DELETE,GET,HEAD,OPTIONS,PATCH,POST,PUT,TRACE,CUSTOM"
Usage
use OpenTelemetry\API\Configuration\ConfigProperties; use OpenTelemetry\API\Instrumentation\AutoInstrumentation\Context; use OpenTelemetry\API\Instrumentation\AutoInstrumentation\HookManagerInterface; use OpenTelemetry\API\Instrumentation\AutoInstrumentation\Instrumentation; use OpenTelemetry\Contrib\Instrumentation\HttpConfig\HttpConfig; final class CustomHttpInstrumentation implements Instrumentation { public function register(HookManagerInterface $hookManager, ConfigProperties $configuration, Context $context): void { $httpConfig = $configuration->get(HttpConfig::class) ?? new HttpConfig(); $httpConfig->... } }