Skip to main content

Datadog P99 Latency Check

Last updated on

Datadog APM P99 latency check validates the 99th percentile latency of a service using Datadog APM metrics. The target service and environment are supplied at runtime via probe variables, allowing this probe to be reused across services.

Infrastructure type

  • Kubernetes

Use cases

Datadog P99 Latency Check probe helps you:

  • Verify worst-case latency during high-percentile SLO checks
  • Monitor p99 latency after infrastructure faults
  • Validate tail latency recovery after chaos injection
  • Detect outlier latency spikes during experiments

Overview

This probe queries Datadog APM for the latency_p99 stat of the target service, converts seconds to milliseconds using the formula p99*1000, and compares the mean aggregated value against your threshold.

Probe type

APM Probe (Datadog)

Prerequisites

  • Kubernetes chaos infrastructure with Harness Delegate
  • A configured Datadog connector
  • Datadog APM instrumented on the target service
  • Probe variable SERVICE_NAME set at experiment runtime

Probe properties

Comparator

TypeCriteriaDefault value
float<=800

The probe passes when the mean p99 latency (in milliseconds) is less than or equal to the comparator value.

Datadog APM probe inputs

FieldDescriptionDefault
connectorIDIdentifier of the Datadog connectorRequired at runtime
durationInMinLook-back window in minutes10
queryTypeDatadog query API versionv2
queries[0].nameQuery alias used in the formulap99
queries[0].dataSourceMetric source typeapm_metrics
queries[0].params.envDatadog APM environment<+probe.variables.ENV>
queries[0].params.serviceDatadog APM service name<+probe.variables.SERVICE_NAME>
queries[0].params.statAPM latency statlatency_p99
formulaConverts seconds to millisecondsp99*1000
aggregationAggregation over the time windowmean

Probe variables

VariableDescriptionRequired
SERVICE_NAMEDatadog APM service nameYes
ENVDatadog APM environment tagNo

Configurable inputs

InputDescriptionRequiredDefault
CONNECTOR_IDDatadog connector identifierYes-
DURATION_IN_MINLook-back window in minutesNo10
COMPARATOR_VALUEp99 latency threshold in millisecondsYes800

Run properties

PropertyDescriptionTypeDefault
timeoutMaximum time to wait for the probe to completeString30s
intervalTime between probe executionsString5s
attemptNumber of retry attempts before marking as failedInteger1
pollingIntervalTime between retry attemptsString30s
initialDelayInitial delay before starting the probeString1s
stopOnFailureStop the experiment if the probe failsBooleanfalse
verbosityLog verbosity levelStringdebug

Probe definition

You can define this probe in your chaos experiment as follows:

probe:
- name: datadog-p99-latency-check
type: apmProbe
mode: Continuous
apmProbe/inputs:
type: Datadog
comparator:
type: float
value: "800"
criteria: <=
datadogApmProbeInputs:
connectorID: <+connector.identifier>
durationInMin: 10
queryType: v2
queries:
- name: p99
dataSource: apm_metrics
params:
env: <+probe.variables.ENV>
service: <+probe.variables.SERVICE_NAME>
stat: latency_p99
formula: p99*1000
aggregation: mean
runProperties:
timeout: 30s
interval: 5s
attempt: 1
pollingInterval: 30s
initialDelay: 1s
stopOnFailure: false
verbosity: debug

Next steps