Monitor Heroku application-level telemetry for comprehensive visibility and troubleshooting.
Heroku's Cedar platform is a long-standing runtime for deploying applications. Unlike the modern Fir runtime, Cedar does not have native OpenTelemetry integration. Observability on Cedar requires a manual, application-centric approach.
This integration guide focuses on instrumenting your application with an OpenTelemetry agent or SDK, packaging it within a container, and deploying it to Cedar. This method allows you to generate and export rich telemetry directly from your application to Dash0.
Observability on Heroku's Cedar platform requires a manual, application-centric approach where you package an OpenTelemetry agent with your application in a container. This guide walks through the required steps to instrument, contextualize, and export telemetry from a Cedar application to Dash0.
The core tasks are:
1. Enable Dyno Metadata A critical first step is to expose Heroku's runtime information to your dyno. This metadata is essential for correlating telemetry with your application's environment.
Execute the following Heroku CLI commands for your application. This is a one-time setup.
HEROKU_*
environment variables after your next deployment.2. Create the OTel SDK Configuration File
The OTel SDK configuration file format is an experimental feature and may not be supported by all language-specific
SDKs. It is well-supported by the OpenTelemetry Java agent. Before implementing, check the official OpenTelemetry
Configuration project for the latest compatibility
information. If your SDK does not support this file, you will need to configure the resource attributes manually in
your application's code, reading the HEROKU_*
environment variables directly.
Next, create a configuration file that maps the Heroku environment variables to standard OpenTelemetry resource attributes. This ensures your telemetry is correctly tagged with its source.
If you want to continue to use the OTEL_*
environment variables alongside this configuration file, make sure to base
your file on
https://github.com/open-telemetry/opentelemetry-configuration/blob/v0.4.0/examples/sdk-migration-config.yaml
3. Package the Application and Agent
How you configure and build your container image will depend on your chosen technology stack. The key is to ensure your Dockerfile
or build process includes the OpenTelemetry auto-instrumentation agent for your language and also copies the sdk-config.yaml
file created in the previous step into the image.
Please refer to the detailed, language-specific guides in the Dash0 Integration Hub for guidance regarding the auto-instrumentation configuration:
For inspiration, see our guide on Monitoring Heroku Applications with OpenTelemetry. It provides a detailed walkthrough of how to use buildpacks to bundle the Java auto-instrumentation agent into your application image.
4. Configure the Exporter
Now, configure Heroku with your Dash0 endpoint and API token. The OTel agent (if enabled) will automatically use these standard environment variables. You also need to tell the agent where to find the SDK configuration file.
Replace the placeholder values <YOUR_APP_NAME>
, <YOUR_PATH_TO_FILE>
with your specific application name and configuration file path.
5. Build and Deploy the Container
Finally, build the Docker image and deploy it using Heroku's container registry.
After a few moments, your application will be running on Cedar, and the OTel agent will begin sending telemetry to your Dash0 account.