Skip to main content
The Datadog provider allows you to query metrics from Datadog’s Metrics API for verification checks. It uses the Datadog v2 Scalar Query API to fetch aggregated metric values.

Configuration

Properties

provider.type
string
required
Must be "datadog".
provider.apiKey
string
required
Datadog API key. Supports Go templates (e.g., {{.variables.dd_api_key}}).
provider.appKey
string
required
Datadog Application key. Supports Go templates. Use the actual key value, NOT the Key ID.
provider.queries
map[string]string
required
Named queries map. Keys become accessible as result.queries.<name> in success conditions. Values support Go templates for dynamic filtering.
provider.formula
string
Formula to combine query results. Reference queries by their key names (e.g., "a / b * 100").
provider.aggregator
string
default:"last"
Aggregation method. Options: last, avg, min, max, sum, mean, percentile, l2norm, area.
provider.intervalSeconds
integer
default:"300"
Time window in seconds for the query. Determines how far back to look for metric data.
provider.site
string
default:"datadoghq.com"
Datadog site URL. Options: datadoghq.com, datadoghq.eu, us3.datadoghq.com, us5.datadoghq.com, ap1.datadoghq.com.

Aggregator Options

The aggregator property specifies how to aggregate metric values:
  • last (default) - Most recent value
  • avg - Average value
  • min - Minimum value
  • max - Maximum value
  • sum - Sum of values
  • mean - Mean value
  • percentile - Percentile value
  • l2norm - L2 norm
  • area - Area under the curve

Supported Sites

  • datadoghq.com (US1 - default)
  • datadoghq.eu (EU)
  • us3.datadoghq.com (US3)
  • us5.datadoghq.com (US5)
  • ap1.datadoghq.com (AP1)

Response Data Available in CEL

The Datadog provider makes the following data available in your CEL success conditions:

Accessing Query Values

Since queries are named, you access them by name in your success condition:

Example Configurations

Single Query

Multiple Queries with Formula

Use multiple queries with a formula to calculate ratios or complex metrics:

With Environment and Resource Tags

Latency Percentile

Example Success Conditions

Template Variables

The Datadog provider supports Go templates in the apiKey, appKey, site, formula, and queries fields:

Storing Secrets in Variables

For sensitive values like API keys, use deployment variables:
  1. Create deployment variables for your Datadog credentials
  2. Reference them in the provider configuration using template syntax

Finding Your Datadog Keys

API Key

  1. Go to Datadog console → Organization SettingsAPI Keys
  2. Create or copy an existing API key (40-character hex string)

Application Key

  1. Go to Datadog console → Organization SettingsApplication Keys
  2. Create or copy an existing Application key
  3. Important: Use the actual key value, NOT the “Key ID” (which is a UUID)

Best Practices

  • Use deployment variables for API keys and application keys - never hardcode credentials
  • Name queries descriptively to make success conditions readable
  • Use appropriate intervals - shorter intervals provide faster feedback but may have less data
  • Tag your metrics with service, environment, and version information for better filtering
  • Test queries manually in Datadog before using them in verification
  • Handle missing data by checking result.ok and result.queries.<name> != null
  • Use formulas for calculated metrics like error rates or ratios