Datadog
You can integrate Ternary with Datadog to ingest metrics, powering such features as the Reporting Engine's Unit Economics.
Prerequisites
- Follow our API Authentication guide to get an Access Token or Ternary API Key.
Please provide the following for Ternary to begin interacting with Datadog's programmatic API:
- Datadog API Key - follow these instructions to create a Datadog API Key; the required key string for this onboarding should be a 32-character hex value (not to be confused with the key ID).
- Datadog Application Key - follow these instructions to create a Datadog Application Key;
- The required key string for this onboarding should be a 40-character hex string.
- Example Metric(s) - choose at least one metric from your Datadog account, along with Tag Keys for grouping, and any filters to be applied prior to ingestion.
Create a Datadog Integration
curl
-H "Authorization: Bearer ${TERNARY_ACCESS_TOKEN}"
-X POST
"<https://api.ternary.app/v1/tenants/${TENANT_ID}/integrations/datadog">
-d '
{
"name": "<MY-INTEGRATION-DISPLAY-NAME>",
"datadog": {
"apiKey": "<MY-API-KEY>",
"appKey": "<MY-APP-KEY>",
"metrics": {
"<MY-METRIC-1>": {
"displayName": "\<OPTIONAL:MY-METRIC-DISPLAY-NAME-1>",
"filter": "\<OPTIONAL:MY-GROUPING-TAG-KEY-1>",
"groupings": [
"<OPTIONAL:MY-GROUPING-TAG-KEY-1>"
]
},
"<MY-METRIC-2>": {
"displayName": "\<MY-METRIC-DISPLAY-NAME-2",
"filter": "\<OPTIONAL:MY-METRIC-FILTER-2>",
"groupings": [
"<OPTIONAL:MY-GROUPING-TAG-KEY-2>"
]
}
}
}
}
'
Update a Datadog Integration
To update a Datadog Integration, it is easiest to first fetch the integration by API, then make your changes, and submit the updated JSON document through an HTTP PUT request.
curl
-H "Authorization: Bearer ${TERNARY_ACCESS_TOKEN}"
-X PUT
"<https://api.ternary.app/v1/tenants/${TENANT_ID}/integrations/datadog/${DATADOG_INTEGRATION_ID}">
-d '<MY-UPDATED-JSON-DOCUMENT>'
FAQ
- What are metric groupings?
Metric groupings are Datadog Tag Keys which are used to disaggregate data into multiple time series. For example, for a metricunits.sold
that supports the tagsfruit
andmaterial
, if both tags are specified as groupings for the Ternary Datadog integration, then a separate time series will be ingested for each of the following tag combinations:- fruit:apple,material:nylon
- fruit:apple,material:steel
- fruit:mango,material:nylon
- fruit:mango,material:steel
- etc.
- What are metric filters?
Metric filters let you limit the time series which is ingested to Ternary. In the above example, adding a filterfruit:apple
would cause Ternary to only ingest data that has been taggedapple
for the keyfruit
. Learn more about Datadog's advanced filter syntax here.
Updated 4 months ago