From 7d276862d29419af3d441230aa3e097cd038a573 Mon Sep 17 00:00:00 2001 From: GCalmels Date: Tue, 11 Jun 2024 12:17:42 +0200 Subject: [PATCH] chore: update readme and freeze phpstan version < 1.11 --- composer.json | 2 +- readme.md | 40 ++++++++++++++++++++++++---------------- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/composer.json b/composer.json index b92b07b..298ddee 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,7 @@ "open-telemetry/gen-otlp-protobuf": "^1.0", "php-http/httplug": "^2.3", "phpspec/phpspec": "^7.5", - "phpstan/phpstan": "^1.4", + "phpstan/phpstan": "<1.11", "symfony/framework-bundle": "*", "symfony/http-client": "*", "symfony/messenger": "*", diff --git a/readme.md b/readme.md index 90f3e23..a7235ba 100644 --- a/readme.md +++ b/readme.md @@ -3,25 +3,31 @@ ### Features #### Tracing + - Using the official [OpenTelemetry SDK](https://github.com/open-telemetry/opentelemetry-php) - Minimal auto-instrumentation for **requests**, console **commands**, **consumers** and **doctrine** - Trace context propagation from incoming **requests** to **consumers**, **outgoing http calls** and **databases** (using [`sqlcommenter`](https://google.github.io/sqlcommenter/)) - Configurable blacklisting of requests by path to avoid useless traces, eg. `/metrics` or `/_healthz` - Automatic log inclusion with configurable log level and channels +- Disabling tracing with the `NoopTracerProvider` thanks to OTEL_SDK_DISABLED=true #### Metrics + - Using the [Prometheus Client](https://github.com/PromPHP/prometheus_client_php) - Minimal auto-instrumentation for common **request**, **consumer** and **message** metrics (see list of provided [default metrics](./docs/metrics/default-metrics.md)). - Autoconfigurable metric providers, see below. #### Logging + - Adds trace context to logs for correlation, with customizable keys. #### Baggage + - Using the official [OpenTelemetry SDK](https://github.com/open-telemetry/opentelemetry-php) - Baggage propagation from incoming **requests** to **consumers** and **outgoing http calls** #### Health + - A simple endpoint to expose application health (default: `/_healthz`) - Autoconfigurable healthcheck interface to add healthchecks to be made for global application health @@ -30,8 +36,10 @@ ```sh composer require worldia/instrumentation-bundle ``` + You will aso need to install an [exporter implementation](https://packagist.org/packages/open-telemetry/exporter-otlp?query=open-telemetry%2Fexporter-) and `APCu` is required by the prometheus exporter. -``` + +```` Add to ```bundles.php```: ```php @@ -39,10 +47,10 @@ return [ // Other bundles Instrumentation\InstrumentationBundle::class => ['all' => true], ]; -``` +```` -**Minimal configuration** -See the complete [configuration reference here](./docs/config-reference.md) or run ```bin/console config:dump-reference instrumentation```. +**Minimal configuration** +See the complete [configuration reference here](./docs/config-reference.md) or run `bin/console config:dump-reference instrumentation`. ```yaml // docker-compose.yaml @@ -71,18 +79,18 @@ instrumentation: ~ ### Usage - **Tracing** - - [Simple tracing example](./docs/tracing/simple-trace.md) - - [Simple tracing example using the static API](./docs/tracing/static-usage.md) - - [Add Urls to your traces in error messages](./docs/tracing/add-urls-to-your-traces.md) - - [Use upstream request id as trace id](./docs/tracing/upstream-request-id.md) - - [Customize operation (span) name for a message](./docs/tracing/custom-operation-name-for-message.md) - - [Link strategy for a message](./docs/tracing/link-strategy-for-message.md) - - [Propagating trace/baggage context in HTTP requests](./docs/tracing/propagating-context.md) - - [Add request / response bodies as span attributes for HTTP requests](./docs/tracing/message-bodies.md) + - [Simple tracing example](./docs/tracing/simple-trace.md) + - [Simple tracing example using the static API](./docs/tracing/static-usage.md) + - [Add Urls to your traces in error messages](./docs/tracing/add-urls-to-your-traces.md) + - [Use upstream request id as trace id](./docs/tracing/upstream-request-id.md) + - [Customize operation (span) name for a message](./docs/tracing/custom-operation-name-for-message.md) + - [Link strategy for a message](./docs/tracing/link-strategy-for-message.md) + - [Propagating trace/baggage context in HTTP requests](./docs/tracing/propagating-context.md) + - [Add request / response bodies as span attributes for HTTP requests](./docs/tracing/message-bodies.md) - **Metrics** - - [Adding a metric](./docs/metrics/adding-a-metric.md) - - [Using Redis as storage adapter](./docs/metrics/using-redis-as-storage.md) (Recommended) + - [Adding a metric](./docs/metrics/adding-a-metric.md) + - [Using Redis as storage adapter](./docs/metrics/using-redis-as-storage.md) (Recommended) - **Logging** - - [Customizing trace context log keys](./docs/logging/custom-keys.md) + - [Customizing trace context log keys](./docs/logging/custom-keys.md) - **Health** - - [Adding a healthcheck](./docs/health/adding-a-healthcheck.md) + - [Adding a healthcheck](./docs/health/adding-a-healthcheck.md)