Skip to content

Commit

Permalink
clean readme
Browse files Browse the repository at this point in the history
  • Loading branch information
cdaguerre committed Jan 12, 2025
1 parent e03e263 commit 27be902
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 57 deletions.
37 changes: 6 additions & 31 deletions example/.env
Original file line number Diff line number Diff line change
@@ -1,36 +1,11 @@
# In all environments, the following files are loaded if they exist,
# the latter taking precedence over the former:
#
# * .env contains default values for the environment variables needed by the app
# * .env.local uncommitted file with local overrides
# * .env.$APP_ENV committed environment-specific defaults
# * .env.$APP_ENV.local uncommitted environment-specific overrides
#
# Real environment variables win over .env files.
#
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
# https://symfony.com/doc/current/configuration/secrets.html
#
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration

###> symfony/framework-bundle ###
APP_ENV=dev
APP_SECRET=
###< symfony/framework-bundle ###

###> symfony/messenger ###
# Choose one of the transports below
MESSENGER_TRANSPORT_DSN=amqp://guest:guest@rabbitmq:5672/%2f/messages
# MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0
###< symfony/messenger ###

###> doctrine/doctrine-bundle ###
# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
#
# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db"
# DATABASE_URL="mysql://app:[email protected]:3306/app?serverVersion=8.0.32&charset=utf8mb4"
# DATABASE_URL="mysql://app:[email protected]:3306/app?serverVersion=10.11.2-MariaDB&charset=utf8mb4"
DATABASE_URL="postgresql://app:!ChangeMe!@postgresql:5432/app?serverVersion=16&charset=utf8"
###< doctrine/doctrine-bundle ###

OTEL_SERVICE_NAME=test-app
OTEL_PHP_DETECTORS=none
OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=Delta
OTEL_EXPORTER_OTLP_PROTOCOL=http/json
OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4318
8 changes: 1 addition & 7 deletions example/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
build:
context: docker/caddy
environment:
- OTEL_SERVICE_NAME=test-app
- OTEL_SERVICE_NAME
- OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317
ports:
- "80:80"
Expand All @@ -17,12 +17,6 @@ services:
php:
build:
context: docker/php
environment:
- OTEL_SERVICE_NAME=test-app
- OTEL_PHP_DETECTORS=none
- OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=Delta
- OTEL_EXPORTER_OTLP_PROTOCOL=http/json
- OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4318
volumes:
- ..:/app

Expand Down
28 changes: 9 additions & 19 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,37 +18,27 @@ For a fully working example including Jaeger, Grafana, Tempo, Loki and Prometheu
Install along your [exporter implementation](https://packagist.org/packages/open-telemetry/exporter-otlp?query=open-telemetry%2Fexporter-), eg. `open-telemetry/exporter-otlp`.

```sh
$ composer require worldia/instrumentation-bundle open-telemetry/exporter-otlp
composer require worldia/instrumentation-bundle open-telemetry/exporter-otlp
```

Add to `bundles.php`.
```php
// bundles.php

return [
// Other bundles
Instrumentation\InstrumentationBundle::class => ['all' => true],
];
```
Configure OTEL env vars. Replace `<your-telemetry-collector>` by yours, eg. `jaeger`, `tempo`, `otel-collector`, ...
```yaml
// docker-compose.yaml

services:
php:
image: php:8.4-fpm-alpine
environment:
- OTEL_SERVICE_NAME=test-app
- OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=Delta
- OTEL_EXPORTER_OTLP_PROTOCOL=http/json
- OTEL_EXPORTER_OTLP_ENDPOINT=http://jaeger:4318
jaeger:
image: jaegertracing/jaeger
OTEL_SERVICE_NAME=test-app
OTEL_PHP_DETECTORS=none
OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=Delta
OTEL_EXPORTER_OTLP_PROTOCOL=http/json
OTEL_EXPORTER_OTLP_ENDPOINT=http://<your-telemetry-collector>:4318
```
Enable the extension. See the complete [configuration reference here](./docs/config-reference.md) or run ```bin/console config:dump-reference instrumentation```.
```yaml
// instrumentation.yaml

instrumentation: ~
```
See the complete [configuration reference here](./docs/config-reference.md) or run ```bin/console config:dump-reference instrumentation```.
### Usage
Expand Down

0 comments on commit 27be902

Please sign in to comment.