https://github.com/djiit/heroku-buildpack-otelcol
Heroku Buildpack that bootstraps a otel-collector in your dyno
https://github.com/djiit/heroku-buildpack-otelcol
heroku-buildpack otel-collector
Last synced: 15 days ago
JSON representation
Heroku Buildpack that bootstraps a otel-collector in your dyno
- Host: GitHub
- URL: https://github.com/djiit/heroku-buildpack-otelcol
- Owner: Djiit
- License: mit
- Created: 2021-11-21T15:36:00.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-18T23:50:16.000Z (about 2 years ago)
- Last Synced: 2025-03-27T06:22:41.665Z (about 1 month ago)
- Topics: heroku-buildpack, otel-collector
- Language: Shell
- Homepage:
- Size: 8.79 KB
- Stars: 7
- Watchers: 2
- Forks: 20
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# OpenTelemetry Collector Heroku Buildpack
This [Heroku buildpack][1] installs OpenTelemetry Collector in your Heroku dyno to collect app metrics and traces.
## Configuration
This buildpack assumes that otel collector config file is located at `/otelcol/config.yml` in your application.
By default, this buildpack installs [OpenTelemetry Collector Core][2], to install [OpenTelemetry Collector Contrib][3], set `OTELCOL_CONTRIB` to `true` in your enviroment variables.
In addition, you can include a prerun script, `/otelcol/prerun.sh`, in your application.
The prerun script runs after all of the standard configuration actions and immediately before starting OpenTelemetry Collector.
This allows you to modify the environment variables (for example: $DISABLE_OTELCOL), perform additional configurations, etc.```shell
#!/usr/bin/env bash# Disable based on dyno type
if [ "$DYNOTYPE" == "run" ]; then
DISABLE_OTELCOL="true"
fi# Update configuration placeholder using the Heroku application environment variable
if [ -n "$RUNTIME_URL" ]; then
sed -i "s//$RUNTIME_URL/" "$APP_OTELCOL/config.yml"
fi
```## Credits
Most of the code and inspiration comes from the excellent [sendsonar's Prometheus Heroku Buildpack][4]
[1]: https://devcenter.heroku.com/articles/buildpacks
[2]: https://github.com/open-telemetry/opentelemetry-collector
[3]: https://github.com/open-telemetry/opentelemetry-collector-contrib
[4]: https://github.com/sendsonar/heroku-buildpack-prometheus