This article is available in French.
1. Installer l'agent #
Linux, Docker, Kubernetes.
Linux #
DD_API_KEY=<cle_api> DD_SITE="datadoghq.eu" \
bash -c "$(curl -L https://install.datadoghq.com/scripts/install_script_agent7.sh)"
sudo datadog-agent status | head -40Docker #
docker run -d --name dd-agent \
-e DD_API_KEY=<cle_api> -e DD_SITE=datadoghq.eu \
-e DD_LOGS_ENABLED=true -e DD_LOGS_CONFIG_CONTAINER_COLLECT_ALL=true \
-e DD_APM_ENABLED=true -e DD_APM_NON_LOCAL_TRAFFIC=true -e DD_DOGSTATSD_NON_LOCAL_TRAFFIC=true \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
-v /proc/:/host/proc/:ro -v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro \
-p 8126:8126 -p 8125:8125/udp \
gcr.io/datadoghq/agent:7Kubernetes avec l'opérateur #
helm repo add datadog https://helm.datadoghq.com && helm repo update
helm install datadog-operator datadog/datadog-operator -n datadog --create-namespace
kubectl -n datadog create secret generic datadog-secret --from-literal api-key=<cle_api>apiVersion: datadoghq.com/v2alpha1
kind: DatadogAgent
metadata: { name: datadog, namespace: datadog }
spec:
global:
site: datadoghq.eu
clusterName: prod-eu
credentials:
apiSecret: { secretName: datadog-secret, keyName: api-key }
features:
logCollection: { enabled: true, containerCollectAll: true }
apm: { instrumentation: { enabled: true } }
liveProcessCollection: { enabled: true }2. Les intégrations #
Activer un check.
Fichier de configuration #
# /etc/datadog-agent/conf.d/nginx.d/conf.yaml
init_config:
instances:
- nginx_status_url: http://localhost:81/nginx_status
tags: [service:front, env:prod]sudo datadog-agent check nginx # exécuter le check une fois
sudo systemctl restart datadog-agentAutodiscovery des conteneurs #
Pour les conteneurs, la configuration se met dans des annotations (Kubernetes) ou des labels (Docker) : l'agent applique le check à chaque conteneur correspondant, où qu'il tourne.
metadata:
annotations:
ad.datadoghq.com/nginx.checks: |
{"nginx": {"instances": [{"nginx_status_url": "http://%%host%%:81/nginx_status"}]}}
ad.datadoghq.com/nginx.logs: '[{"source": "nginx", "service": "front"}]'Bonne Pratique : La variable %%host%% est remplacée par l'adresse du conteneur : la même annotation fonctionne pour tous les pods.3. Diagnostiquer l'agent #
Les commandes utiles.
Commandes #
sudo datadog-agent status # état des checks, logs, APM, erreurs
sudo datadog-agent configcheck # configurations chargées (dont autodiscovery)
sudo datadog-agent flare <ticket> # paquet de diagnostic pour le support
kubectl -n datadog exec ds/datadog-agent -- agent statusMy progress
Sign in to track your progress and take notes. Sign in
Recommended Articles
Understanding the concept of score
The concept of score allows Elasticsearch to rank your documents by relevance during a search.
Understanding the Elastic Common Schema (ECS)
As always in our consulting engagements, we recommend that companies harmonise and standardise: k...
License consumption types
Understand the evolution of billing in Dynatrace: the difference between the old licensing model ...
Grafana Alloy: The importance of Self-Monitoring
Discover why and how to configure Grafana Alloy so that it monitors itself, collecting its own lo...
Grafana Alloy: Understanding and exploiting the User Interface (UI)
Discover how to enable, secure, and use Grafana Alloy's built-in web interface to visualize your ...
Grafana Alloy: Introduction and Architecture
Discover the fundamental concepts of Grafana Alloy, the transition from the static Agent to Alloy...
Grafana Alloy: Syntax and Configuration (Alloy Language: River)
As part of a Grafana training or observability training, master the declarative syntax of Grafana...
Grafana Alloy: Metrics Collection (Prometheus & Ecosystem)
Learn how to configure Grafana Alloy to collect, transform, and forward metrics using the Prometh...
Grafana Alloy: Log Management with Loki
Discover how to configure Grafana Alloy to read log files, journald, or network streams, process ...