Skip to content

signalfx/splunk-otel-collector-heroku

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Getting Started   •   Getting Involved

GitHub release (latest by date including pre-releases) Beta

Example   •   Troubleshooting


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:

🚧 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 Variable Required Default Description
SFX_AGENT_DISABLED No false Whether to disable installing the smart agent as part of the buildpack.
SPLUNK_ACCESS_TOKEN Yes Splunk access token.
SPLUNK_REALM Yes Splunk realm.
SPLUNK_API_URL No https://api.SPLUNK_REALM.signalfx.com The Splunk API base URL.
SPLUNK_CONFIG No /app/config.yaml The configuration to use. /app/.splunk/config.yaml used if default not found.
SPLUNK_INGEST_URL No https://ingest.SPLUNK_REALM.signalfx.com The Splunk Infrastructure Monitoring base URL.
SPLUNK_LOG_FILE No /dev/stdout Specify location of agent logs. If not specified, logs will go to stdout.
SPLUNK_MEMORY_TOTAL_MIB No 512 Total available memory to agent.
SPLUNK_OTEL_VERSION No latest Version of Splunk OTel Collector to use. Defaults to latest.
SPLUNK_TRACE_URL No https://ingest.SPLUNK_REALM.signalfx.com/v2/trace The 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.