Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cedricziel/heroku-php-ext-opentelemetry
OpenTelemetry PHP Auto-Instrumentation for Heroku
https://github.com/cedricziel/heroku-php-ext-opentelemetry
dokku heroku opentelemetry opentelemetry-php
Last synced: about 1 month ago
JSON representation
OpenTelemetry PHP Auto-Instrumentation for Heroku
- Host: GitHub
- URL: https://github.com/cedricziel/heroku-php-ext-opentelemetry
- Owner: cedricziel
- Created: 2024-02-11T14:32:23.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-02-11T20:48:10.000Z (11 months ago)
- Last Synced: 2024-10-11T20:05:58.656Z (3 months ago)
- Topics: dokku, heroku, opentelemetry, opentelemetry-php
- Language: Shell
- Homepage:
- Size: 213 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# OpenTelemetry extensions for Heroku
This package provides PHP extensions for the OpenTelemetry SDK to enable collection
of compatible signals through auto-instrumentation.## Usage
Set the `HEROKU_PHP_PLATFORM_REPOSITORIES` environment variable pointing to this (or your) repository.
Once set, heroku will install the extensions on the next deploy.
On Heroku:
```shell
heroku config:set --app=APP_NAME HEROKU_PHP_PLATFORM_REPOSITORIES="https://cedricziel.github.io/heroku-php-ext-opentelemetry/"
```On dokku
```shell
dokku config:set --no-restart APP_NAME HEROKU_PHP_PLATFORM_REPOSITORIES="https://cedricziel.github.io/heroku-php-ext-opentelemetry/"
```## Next steps
After installing the extensions, you can enable and configure auto-instrumentation in your application.
Please check the PHP auto-instrumentation documentation of the OpenTelemetry SDK for PHP for more information.
https://opentelemetry.io/docs/languages/php/automatic/
### Enable and configure auto-instrumentation
Set the following environment variables to enable and configure auto-instrumentation:
* `OTEL_PHP_AUTOLOAD_ENABLED=true` to enable auto-instrumentation
* `OTEL_SERVICE_NAME=your-service-name` to set the service name
* `OTEL_TRACES_EXPORTER=otlp` to enable exporting traces to an OpenTelemetry Collector
* `OTEL_EXPORTER_OTLP_PROTOCOL=grpc` to use gRPC
* `OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:4318` to set the endpoint of the OpenTelemetry Collector
* `OTEL_PROPAGATORS=baggage,tracecontext` to enable baggage and trace context propagationOn Dokku:
```shell
dokku config:set --no-restart APP_NAME OTEL_PHP_AUTOLOAD_ENABLED=true \
OTEL_SERVICE_NAME=your-service-name \
OTEL_TRACES_EXPORTER=otlp \
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf \
OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:4318 \
OTEL_PROPAGATORS=baggage,tracecontext
```On Heroku:
```shell
dokku config:set --no-restart APP_NAME OTEL_PHP_AUTOLOAD_ENABLED=true \
OTEL_SERVICE_NAME=your-service-name \
OTEL_TRACES_EXPORTER=otlp \
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf \
OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:4318 \
OTEL_PROPAGATORS=baggage,tracecontext
```Learn more about the environment variables in the OpenTelemetry documentation: https://opentelemetry.io/docs/specs/otel/protocol/exporter/
### Install auto-instrumentation packages in your application
Find auto-instrumentation for PHP on Packagist: https://packagist.org/search/?query=open-telemetry&tags=instrumentation
## License
MIT