Aptible PaaS logoDocs

How to set up Datadog APM

Guide for setting up Datadog Application Performance Monitoring (APM) on your Aptible apps

Overview

Datadog APM (Application Performance Monitoring) can be configured with Aptible to monitor and analyze the performance of Aptible apps and services in real-time.

Set up

⚠️ Prerequisites: An Aptible account, the Aptible CLI, Git, and a Datadog account

Step 1: Enable tracing in your application code

Follow Datadog’s instructions for running enabling tracing, and preparing the Datadog agent in containers:

Step 2: Deploy the Datadog Agent as an Aptible app

Create an Aptible app to run your Datadog agent in a container, add the necessary configurations, deploy your app, and expose it with an app endpoint.

Notes:

  • You’ll need to update DD_API_KEY=foo in the commands below to reference your actual Datadog API Key.
  • These commands reference v7 of the Datadog Agent, the latest version tested on Aptible.
aptible apps:create datadog-agent
aptible config:set --app datadog-agent DD_TRACE_ANALYTICS_ENABLED=true DD_API_KEY=foo
aptible deploy --app datadog-agent --docker-image=datadog/agent:7
aptible endpoints:https:create --app datadog-agent --default-domain

Step 3: Update ENV Variables

Update the ENV for each of your apps for which you enabled tracing in Step 1, so these apps report their instrumentation data to the Datadog Agent app deployed in Step 2.

Notes:

  • You’ll need to update DD_TRACE_AGENT_URL=https://app-42.on-aptible.com to the actual address of the Datadog Agent app endpoint created in Step 2.
  • You’ll need to update --app yourapp to your actual app’s handle.
  • Note that we’re configuring the agent to connect over port 443 instead of 8126. This is because in Step 2, we created an HTTPS endpoint for the Datadog Agent app. Aptible manages the TLS certificate and encryption for that endpoint, ensuring encrypted communication between each of your apps and the Datadog Agent.
  • The DD_TRACE_AGENT_URL ENV variable works automatically for the Java, Python, Ruby, Node.js, PHP, C++ and .Net tracing libraries, but for other libraries, you may need to update the library’s configuration code to explicitly reference this ENV variable. Follow the instructions for your language/framework’s specific tracing library.
aptible config:set DD_TRACE_AGENT_URL=https://app-42.on-aptible.com --app yourapp
How to set up Datadog APM