Monitor docker application

Hello,
I have a nginx application which runs on a docker. I need to monitor its ulimit usage and nginx metrics. But I am not so sure, how am i going to monitor inside docker with pmm-agent. Do you have any guidance for that? Do i need to use docker-compose and add both images to make them run? If yes, will pmm-agent monitor ulimits and nginx process as well?

Any help will be appreciated

Hello @Cihan_Tunali!

It’s best not to install anything inside a docker container. Fortunately, there’s a solution that won’t require touching the Nginx docker.
If you’re interested in Nginx-specific metrics, you can start GitHub - nginxinc/nginx-prometheus-exporter: NGINX Prometheus Exporter for NGINX and NGINX Plus to expose the metrics (optional).

You can expose docker metrics and limits by downloading and starting GitHub - google/cadvisor: Analyzes resource usage and performance characteristics of running containers., or you can add it to your docker-compose.

Afterward, you’ll have one or two ports (if you started nginx-exporter too) that expose Prometheus metrics, which you’ll need to add to PMM as External Services. For more information, please refer to our documentation at External Services - Percona Monitoring and Management.

Once you’ve completed these steps, you’ll have metrics from cadvisor and nginx (if added) in your PMM. You can create your own dashboard or upload a community one, such as Cadvisor exporter | Grafana Labs.

I hope this helps! Let us know how it goes.