|
| 1 | +# OpenTelemetry Collector PaaS Distro |
| 2 | + |
| 3 | +This distribution is made specifically to be used in a PaaS environment. It contains a subset of components from [OpenTelemetry Collector Core](https://github.com/open-telemetry/opentelemetry-collector) and [OpenTelemetry Collector Contrib](https://github.com/open-telemetry/opentelemetry-collector-contrib). |
| 4 | + |
| 5 | +## Components |
| 6 | + |
| 7 | +The full list of components is available in the [manifest](manifest.yaml). |
| 8 | + |
| 9 | +### Rules for Component Inclusion |
| 10 | + |
| 11 | + - Only includes components from Contrib and Core. |
| 12 | + - Only components that are Alpha or higher. |
| 13 | + - All receivers must facilitate the collection of data that is generated by the application running in the PaaS environment or enriching the data by introspecting the PaaS platform. |
| 14 | + - All components must be vendor-neutral. |
| 15 | + - Only exporters that use OTLP are allowed. |
| 16 | + - To facilitate troubleshooting, the nop and debug exporters are present as exceptions. |
| 17 | + |
| 18 | +## Heroku buildpack |
| 19 | + |
| 20 | +This distribution works as a Heroku buildpack. |
| 21 | + |
| 22 | +### Installation |
| 23 | + |
| 24 | +[Install the Heroku CLI, login, and create an |
| 25 | +app](https://devcenter.heroku.com/articles/heroku-cli). Add and configure the |
| 26 | +buildpack: |
| 27 | + |
| 28 | +``` |
| 29 | +# cd into the Heroku project directory |
| 30 | +# WARNING: running `heroku` command outside of project directories |
| 31 | +# will result in unexpected behavior |
| 32 | +cd <HEROKU_APP_DIRECTORY> |
| 33 | +
|
| 34 | +# Configure Heroku App to expose Dyno metadata |
| 35 | +# This metadata is required by the OpenTelemetry Collector to |
| 36 | +# set global dimensions such as `app_name`, `app_id` and `dyno_id`. |
| 37 | +# See [here](https://devcenter.heroku.com/articles/dyno-metadata) for more information. |
| 38 | +heroku labs:enable runtime-dyno-metadata |
| 39 | +
|
| 40 | +# Add buildpack for OpenTelemetry Collector |
| 41 | +# Note both lines are required together |
| 42 | +# TODO check URI works |
| 43 | +heroku buildpacks:add https://github.com/open-telemetry/opentelemetry-collector-releases.git/distributions/otelcol-paas#\ |
| 44 | +$(curl -s https://api.github.com/repos/open-telemetry/opentelemetry-collector-releases/releases | grep '"tag_name"' | head -n 1 | cut -d'"' -f4) |
| 45 | +# For production environment using an explict version number is advised |
| 46 | +#heroku buildpacks:add https://github.com/open-telemetry/opentelemetry-collector-releases.git#<TAG_NAME> |
| 47 | +
|
| 48 | +# Set required environment variables |
| 49 | +heroku config:set OTLP_ENDPOINT=<YOUR OTLP ENDPOINT> |
| 50 | +
|
| 51 | +# Optionally define custom configuration file in your Heroku project directory |
| 52 | +#heroku config:set CONFIG=/app/mydir/myconfig.yaml |
| 53 | +
|
| 54 | +# Create an emptycommit and deploy your app (assumes `main` branch exists) |
| 55 | +git commit --allow-empty -m "empty commit" |
| 56 | +git push heroku main |
| 57 | +
|
| 58 | +# Check logs |
| 59 | +#heroku logs -a <app-name> --tail |
| 60 | +``` |
| 61 | + |
| 62 | +## Advanced Configuration |
| 63 | + |
| 64 | +Use the following environment variables to configure this buildpack: |
| 65 | + |
| 66 | + |
| 67 | +| Environment Variable | Required | Default | Description | |
| 68 | +|----------------------|----------|------------------------------|---------------------------------------| |
| 69 | +| `OTLP_ENDPOINT` | Yes | | OTLP exporter endpoint | |
| 70 | +| `CONFIG` | No | $BUILD_DIR/.otel/config.yaml | Collector configuration file location | |
| 71 | +| `LOG_FILE` | No | `/dev/stdout` | Optional log file location | |
| 72 | +| `MEMORY_LIMIT_MIB` | No | `512` | Memory limit | |
| 73 | + |
0 commit comments