worldia / instrumentation-bundle
1.1.3
2024-09-12 13:54 UTC
Requires
- monolog/monolog: ^3.0
- nyholm/dsn: ^2.0
- nyholm/psr7: ^1.5
- open-telemetry/api: >=1.0.2
- open-telemetry/sdk: ^1.0
- promphp/prometheus_client_php: ^2.4
- psr/http-client: ^1.0
- symfony/dependency-injection: *
Requires (Dev)
- doctrine/dbal: ^3.0
- friends-of-phpspec/phpspec-expect: ^4.0
- open-telemetry/gen-otlp-protobuf: ^1.0
- open-telemetry/transport-grpc: ^1.0
- php-http/httplug: ^2.3
- phpspec/phpspec: ^7.5
- phpstan/phpstan: ^1.4
- symfony/framework-bundle: *
- symfony/http-client: *
- symfony/messenger: *
- symfony/monolog-bundle: ^3.7
- symfony/security-core: *
- symfony/serializer: *
- symfony/twig-bundle: *
- worldia/coding-standards: ^1.0
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- dev-master / 1.0.x-dev
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- 1.0.0-beta7
- 1.0.0-beta6
- 1.0.0-beta5
- 1.0.0beta4
- 1.0.0beta3
- 1.0.0.beta2
- 1.0.0beta1
- 0.0.45
- 0.0.44
- 0.0.43
- 0.0.42
- 0.0.41
- 0.0.40
- 0.0.39
- 0.0.38
- 0.0.37
- 0.0.36
- 0.0.35
- 0.0.34
- 0.0.33
- 0.0.32
- 0.0.31
- 0.0.30
- 0.0.29
- 0.0.28
- 0.0.27
- 0.0.26
- 0.0.25
- 0.0.24
- 0.0.23
- 0.0.22
- 0.0.21
- 0.0.20
- 0.0.19
- 0.0.18
- 0.0.17
- 0.0.16
- 0.0.15
- 0.0.14
- 0.0.13
- 0.0.12
- 0.0.11
- 0.0.10
- 0.0.9
- 0.0.8
- 0.0.7
- 0.0.6
- 0.0.5
- 0.0.4
- 0.0.3
- 0.0.2
- 0.0.1
- dev-feat/use-noop-tracer-provider-if-disabled
- dev-cleanup
- dev-fix/trace-response-body
- dev-feat/filter-headers
- dev-fix/stream-tracing
- dev-chore/freeze-opentelemetry-version
- dev-feat/opentelemetry-meter-interface
- dev-fix/lint
- dev-add-operation-name-to-response-code-metric
- dev-only-set-generic-404-op-name-when-no-route-was-resolved
- dev-keep-http-response-content-even-when-throwing
- dev-null-op-tracer
- dev-fix-issue-25
This package is auto-updated.
Last update: 2024-09-12 14:05:17 UTC
README
特性
追踪
- 使用官方的 OpenTelemetry SDK
- 对请求、控制台命令、消费者和doctrine的最小自动追踪
- 从进入的请求到消费者、出站http调用和数据库(使用
sqlcommenter
)的追踪上下文传播 - 可以通过路径来配置黑名单请求以避免无用的追踪,例如
/metrics
或/_healthz
- 自动包含日志,可配置日志级别和通道
度量
- 使用 Prometheus 客户端
- 对常见请求、消费者和消息度量(请参阅提供的默认度量)的最小自动追踪
- 自动可配置的度量提供者,请见下文。
日志
- 将追踪上下文添加到日志中以便关联,可自定义键。
行李
- 使用官方的 OpenTelemetry SDK
- 从进入的请求到消费者和出站http调用的行李传播
健康
- 简单的端点以暴露应用程序健康(默认:
/_healthz
) - 自动可配置的健康检查接口,以添加对全局应用程序健康进行健康检查
安装和配置
composer require worldia/instrumentation-bundle <your-exporter>
您还需要安装一个 导出实现,并且Prometheus导出器需要APCu
。
Add to ```bundles.php```:
```php
return [
// Other bundles
Instrumentation\InstrumentationBundle::class => ['all' => true],
];
最小配置
请参阅完整的 配置参考,或者运行 bin/console config:dump-reference instrumentation
。
// docker-compose.yaml services: php: image: php:8.1 environment: - OTEL_PHP_TRACES_PROCESSOR=batch - OTEL_TRACES_SAMPLER=parentbased_always_on - OTEL_TRACES_EXPORTER=otlp - OTEL_EXPORTER_OTLP_PROTOCOL=grpc - OTEL_EXPORTER_OTLP_ENDPOINT=http://jaeger:4317 jaeger: image: jaegertracing/all-in-one:latest environment: COLLECTOR_OTLP_ENABLED: "true"
// instrumentation.yaml instrumentation: ~