Metric Types
- COUNTOccurrences
- GAUGEPoint-in-time
- RATEPer-second
- HISTOGRAMDistribution
- DISTRIBUTIONGlobal stats
APM Concepts
- TraceFull request path
- SpanSingle operation
- ServiceApplication name
- ResourceEndpoint/query
- Error trackingException groups
Log Status
- emergencySystem unusable
- alertImmediate action
- criticalCritical conditions
- errorError conditions
- warnWarning
- infoInformational
Monitor Types
- MetricThreshold alerts
- AnomalyML detection
- OutlierGroup deviation
- ForecastPredict breach
- CompositeMulti-monitor
Agent Installation
# Linux installation
DD_API_KEY="your-api-key" \
DD_SITE="datadoghq.com" \
bash -c "$(curl -L https://s3.amazonaws.com/dd-agent/scripts/install_script.sh)"
# Docker container
docker run -d --name dd-agent \
-e DD_API_KEY="your-api-key" \
-e DD_SITE="datadoghq.com" \
-e DD_APM_ENABLED=true \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
-v /proc/:/host/proc/:ro \
gcr.io/datadoghq/agent:latest
DogStatsD Metrics (Python)
from datadog import initialize, statsd
initialize(statsd_host='localhost', statsd_port=8125)
# Increment counter
statsd.increment('page.views', tags=['env:prod'])
# Record gauge
statsd.gauge('queue.size', 42)
# Track histogram
statsd.histogram('request.duration', 0.5)
# Timing decorator
@statsd.timed('function.duration')
def my_function():
pass
Query Functions
- avg()Average value
- sum()Sum all values
- max()Maximum value
- min()Minimum value
- count()Data points
Trace Tags
- envEnvironment
- serviceService name
- versionApp version
- http.urlRequest URL
- http.status_codeStatus code
Log Pipeline Processing
# Grok parser example
rule %{date("yyyy-MM-dd HH:mm:ss"):timestamp} \
%{word:level} \
%{data:message}
# Attribute remapper
source: level
target: status
# Category processor
categories:
- "@http.status_code:[500 TO 599]": "Server Error"
- "@http.status_code:[400 TO 499]": "Client Error"
Alert Variables
- {{value}}Trigger value
- {{threshold}}Alert threshold
- {{host.name}}Host name
- {{last_triggered_at}}Trigger time
Agent Commands
- datadog-agent statusCheck status
- datadog-agent healthHealth check
- datadog-agent configShow config
- datadog-agent checkRun check