While Qovery will soon provide basic metrics on apps resources usage, you might need a more advanced view on what happens on your infrastructure. There are many solutions on the market, one of them being Datadog. Datadog is one of the leading platforms for monitoring and observability, and it's pretty easy to integrate it with Qovery.
Before you begin, this guide assumes the following:
- You have a Qovery cluster running
- You have access to your Kubernetes cluster through kubectl: see how here
- Helm v3 is installed on your machine: https://helm.sh/docs/intro/install/
Goal
In this tutorial, we will install the Datadog agent on a Qovery cluster to gather metrics about infrastructure and applications.
Create a Datadog Account
The first step is to create an account on Datadog: https://www.datadoghq.com.
You will be prompted to enter some information. An important decision you have to make is which site to use. It will determine where your data get stored.
Warning: You can't migrate your data between regions, so chose carefully. More information here: https://docs.datadoghq.com/fr/getting_started/site/
After signup, you will be redirected to a wizard. Fill-in the information until you get to step 3.
Prepare the agent Helm chart values
When you get to step 3,
Agent Setup
, selectKubernetes
in the list.This screen shows you all the information you need to install the agent.
Create a
datadog-values.yaml
file with the following content:datadog:clusterName: qovery-dx-cluster# datadog.site -- The site of the Datadog intake to send Agent data to## Set to 'datadoghq.eu' to send data to the EU site.site: datadoghq.eu# Export custom Kubernetes labels as tagspodLabelsAsTags:"qovery.com/*": "%%label%%"logs:enabled: truecontainerCollectAll: true# Set to false if you are not using APM.apm:enabled: truecontainerExcludeLogs: "kube_namespace:kube-system kube_namespace:qovery kube_namespace:cert-manager kube_namespace:nginx-ingress kube_namespace:logging kube_namespace:prometheus"# You can remove this part if you are not using APM.# Note that it it will be enabled for all your applications.clusterAgent:admissionController:enabled: truemutateUnlabelled: true- Replace
<CLUSTER NAME>
with a meaningful name to identify your cluster. - Set the
site
value corresponding to the one you selected upon account creation (you can find the information under1 > With Helm V3 > --set datadog.site=<YOUR SITE VALUE>
)
There are many other values you can set. For advanced usage, check: https://github.com/Datadog/helm-charts/blob/main/charts/datadog/values.yaml
- Replace
Install Datadog agent in your cluster
The Datadog agent is a program that will collect data from your cluster and forward it to Datadog. We'll install it uning
Helm
.First add the
datadog
Helm repository and update your local list:helm repo add datadog https://helm.datadoghq.comhelm repo updateThen we will install the agent in the
datadog
namespace:helm install datadog-agent \-n datadog --create-namespace \-f <PATH TO datadog-values.yaml> \--set datadog.apiKey='<API KEY>' \datadog/datadog- Edit the path to the
datadog-values.yaml
file you created - Replace
<API KEY>
with your actual API KEY. You can find it under1 > With Helm V3 > --set datadog.apiKey=<API KEY>
- Edit the path to the
Check the agent is running properly
Wait for a minute then run the following command:
kubectl get pods -n datadogIf the installation was successful, you should see an output similar to this one:
NAME READY STATUS RESTARTS AGEdatadog-agent-2xhsv 3/3 Running 0 1mdatadog-agent-cluster-agent-7f8bddd44-pwjnl 1/1 Running 0 1mdatadog-agent-kube-state-metrics-577fcf6778-kc2gk 1/1 Running 0 1mdatadog-agent-qfsl2 3/3 Running 0 1mdatadog-agent-s5r5r 3/3 Running 0 1mFinish Setup
Once Datadog receives your data, you should be able to click
Next
on the wizard. You might need to refresh the page in some cases. It can take a couple minutes before your data is ready.You will then arrive on
Step 4
You can skip this part if you're not interested in monitoring your cloud account.
Finally, restart your applications if you are using APM.
Conclusion
You now have Datadog agent running on your Qovery cluster. You can check their Getting Started
guide to familiarize yourself with the product: https://docs.datadoghq.com/fr/getting_started.