Home

Awesome


<p align="center"> <strong> <a href="#getting-started">Getting Started</a> &nbsp;&nbsp;&bull;&nbsp;&nbsp; <a href="CONTRIBUTING.md">Getting Involved</a> </strong> </p> <p align="center"> <a href="https://github.com/signalfx/splunk-otel-collector-heroku/releases"> <img alt="GitHub release (latest by date including pre-releases)" src="https://img.shields.io/github/v/release/signalfx/splunk-otel-collector-heroku?include_prereleases&style=for-the-badge"> </a> <img alt="Beta" src="https://img.shields.io/badge/status-beta-informational?style=for-the-badge"> </p> <p align="center"> <strong> <a href="#example">Example</a> &nbsp;&nbsp;&bull;&nbsp;&nbsp; <a href="TROUBLESHOOTING.md">Troubleshooting</a> </strong> </p>

Splunk OpenTelemetry Collector for Heroku

The Splunk OpenTelemetry Collector for Heroku is a buildpack for the Splunk OpenTelemetry Collector. The buildpack to installs and runs the Splunk OpenTelemetry Collector on a Dyno to receive, process and export metric and trace data for Splunk Observability Cloud:

:construction: This project is currently in BETA

Getting Started

Install the Heroku CLI, login, and create an app. Add and configure the buildpack:

# cd into the Heroku project directory
# WARNING: running `heroku` command outside of project directories
#          will result in unexpected behavior
cd <HEROKU_APP_DIRECTORY>

# Configure Heroku App to expose Dyno metadata
# This metadata is required by the Splunk OpenTelemetry Collector to
# set global dimensions such as `app_name`, `app_id` and `dyno_id`.
# See [here](https://devcenter.heroku.com/articles/dyno-metadata) for more information.
heroku labs:enable runtime-dyno-metadata

# Add buildpack for Splunk OpenTelemetry Collector
# Note both lines are required together
heroku buildpacks:add https://github.com/signalfx/splunk-otel-collector-heroku.git#\
$(curl -s https://api.github.com/repos/signalfx/splunk-otel-collector-heroku/releases | grep '"tag_name"' | head -n 1 | cut -d'"' -f4)
# For production environment using an explict version number is advised
#heroku buildpacks:add https://github.com/signalfx/splunk-otel-collector-heroku.git#<TAG_NAME>

# Set required environment variables
heroku config:set SPLUNK_ACCESS_TOKEN=<YOUR_ACCESS_TOKEN>
heroku config:set SPLUNK_REALM=<YOUR_REALM>

# Optionally define custom configuration file in your Heroku project directory
#heroku config:set SPLUNK_CONFIG=/app/mydir/myconfig.yaml

# Create an emptycommit and deploy your app (assumes `main` branch exists)
git commit --allow-empty -m "empty commit"
git push heroku main

# Check logs
#heroku logs -a <app-name> --tail

Advanced Configuration

Use the following environment variables to configure this buildpack

Environment VariableRequiredDefaultDescription
SFX_AGENT_DISABLEDNofalseWhether to disable installing the smart agent as part of the buildpack.
SPLUNK_ACCESS_TOKENYesSplunk access token.
SPLUNK_REALMYesSplunk realm.
SPLUNK_API_URLNohttps://api.SPLUNK_REALM.signalfx.comThe Splunk API base URL.
SPLUNK_CONFIGNo/app/config.yamlThe configuration to use. /app/.splunk/config.yaml used if default not found.
SPLUNK_INGEST_URLNohttps://ingest.SPLUNK_REALM.signalfx.comThe Splunk Infrastructure Monitoring base URL.
SPLUNK_LOG_FILENo/dev/stdoutSpecify location of agent logs. If not specified, logs will go to stdout.
SPLUNK_MEMORY_TOTAL_MIBNo512Total available memory to agent.
SPLUNK_OTEL_VERSIONNolatestVersion of Splunk OTel Collector to use. Defaults to latest.
SPLUNK_TRACE_URLNohttps://ingest.SPLUNK_REALM.signalfx.com/v2/traceThe Splunk APM base URL.

Example

To try the buildpack with the included demo application:

# cd into the Heroku project directory
# WARNING: running `heroku` command outside of project directories
#          will result in unexpected behavior
cd test
git init
heroku apps:create ${USER}-test

# Configure Heroku App to expose Dyno metadata; required to set global dimensions.
# See https://devcenter.heroku.com/articles/dyno-metadata for more information.
heroku labs:enable runtime-dyno-metadata

# Add buildpack for Splunk OpenTelemetry Collector
# Note both lines are required together
heroku buildpacks:add https://github.com/signalfx/splunk-otel-collector-heroku.git#\
$(curl -s https://api.github.com/repos/signalfx/splunk-otel-collector-heroku/releases | grep '"tag_name"' | head -n 1 | cut -d'"' -f4)

# Required for test application
heroku buildpacks:add heroku/nodejs

# Set required environment variables
heroku config:set SPLUNK_ACCESS_TOKEN=<YOUR_ACCESS_TOKEN>
heroku config:set SPLUNK_REALM=<YOUR_REALM>

# Add, commit and deploy your app (assumes `main` branch exists)
git add -A && git commit -av -m "add test application"
git push heroku main

# Check logs
heroku logs -a ${USER}-test --tail

License

Apache Software License version 2.0.