@Jorge Garcia Dominguez You will need to use Prometheus as there is no direct connection provided.
Step 1: Set Up Docker Monitoring with Prometheus
First, you need to set up Docker monitoring using Prometheus, which will collect the metrics from Docker containers.
- Install Prometheus: You can run Prometheus in a Docker container. Create a
prometheus.yml
configuration file:global: scrape_interval: 15s scrape_configs: - job_name: 'docker' static_configs: - targets: ['localhost:9323']
- Run Prometheus Container:
docker run -d --name=prometheus -p 9090:9090 -v $(pwd)/prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus
- Install cAdvisor: cAdvisor collects container metrics and exposes them to Prometheus.
docker run \ --volume=/:/rootfs:ro \ --volume=/var/run:/var/run:ro \ --volume=/sys:/sys:ro \ --volume=/var/lib/docker/:/var/lib/docker:ro \ --publish=9323:9323 \ --detach=true \ --name=cadvisor \ google/cadvisor:latest
Step 2: Configure Azure Managed Grafana to Use Prometheus
Now, you need to configure your Azure Managed Grafana to use Prometheus as a data source.
- Log in to Azure Managed Grafana: Open your Azure Managed Grafana instance.
- Add Prometheus Data Source:
- Navigate to Configuration > Data Sources.
- Click on Add data source.
- Select Prometheus from the list.
- Configure the Prometheus URL. If Prometheus is running locally, the URL will be
http://<your-prometheus-host>:9090
. - Click Save & Test to ensure the connection is working.
Step 3: Import Docker Monitoring Dashboard
Grafana provides pre-built dashboards for Docker monitoring.
- Import Dashboard:
- In your Azure Managed Grafana, go to Create > Import.
- You can find popular Docker monitoring dashboards on Grafana Dashboards. For example, dashboard ID
893
is a common Docker monitoring dashboard. - Enter the dashboard ID and click Load.
- Select the Prometheus data source you configured earlier.
- Click Import.
Step 4: Visualize Docker Metrics
Once the dashboard is imported, you should start seeing Docker metrics visualized in Grafana. The dashboard will display various metrics such as CPU usage, memory usage, network I/O, and more for your Docker containers.