Overview

Datadog APM (Application Performance Monitoring) can be configured with Aptible to monitor and analyze the performance of Aptible apps and databases in real-time.
To use the Datadog APM on Aptible, you’ll need to deploy the Datadog Agent as an App on Aptible, set a few configuration variables, and expose it through a HTTPS endpoint.
aptible apps:create datadog-agent
aptible config:set --app datadog-agent DD_API_KEY=foo DD_HOSTNAME=aptible
aptible deploy --app datadog-agent --docker-image=datadog/agent:7
aptible endpoints:https:create --app datadog-agent --default-domain cmd
The example above deploys the Datadog Agent v7 from Dockerhub, an endpoint with a default domain, and also sets two required configuration variables.
  • DD_API_KEY should be set to an API Key associated with your Datadog Organization.
  • DD_HOSTNAME is a hostname identifier. Because Aptible does not grant containers permission to runtime information, you’ll need explicitly set a hostname. While this can be anything, we recommend using this variable to help identify what the agent is monitoring.
If you intend to use the Datadog APM for Database Monitoring, you’ll need to make some adjustments to point the Datadog Agent at the database(s) you want to monitor. We go over these changes in the Setting Up Database Monitoring section below.
To deliver data to Datadog, you’ll need to instrument your application for tracing, as well as connect it to the Datadog Agent.Datadog provides a number of guides on how to set up your application for tracing. Follow the guide most relevant for your application to set up tracing.To connect to the Datadog Agent, set the DD_TRACE_AGENT_URL configuration variable for each App.
aptible config:set --app yourapp DD_TRACE_AGENT_URL=https://app-42.on-aptible.com:443
You’ll want DD_TRACE_AGENT_URL to be set to the hostname of the endpoint you created, with :443 appended to the end to specify the listening port 443.
Datadog offers integrations for various databases, including integrations for Redis, PostgreSQL, and MySQL through the Datadog Agent. For each database you want to integrate with, you’ll need to follow Datadog’s specific integration guide to prepare the database.In addition, you’ll also need to adjust the Datadog Agent application deployed on Aptible to point at your databases. This involves creating a Dockerfile for the Datadog Agent and Deploying with Git. How your Dockerfile looks will differ slightly depending on the database(s) you want to monitor but involves replacing the generic $DATABASE_TYPE.d/conf.yaml with one pointing at your database.For example, a Dockerfile pointing to a PostgreSQL database could look like this:
FROM datadog/datadog-agent:7
COPY postgres.yaml /conf.d/postgres.d/conf.yaml
Where postgres.yaml is a file in your repository with information that points at the PostgreSQL database.You can find specifics on how to configure each database type in Datadog’s integration documentation under the Host tab.
If you followed the instructions earlier and deployed with a Docker Image, you’ll need to complete a few extra steps to swap back to git-based deployments. You can find those instructions here
Depending on the type of Database you want to monitor, you may need to set additional configuration variables. Please refer to Datadog’s documentation for specific instructions.