'process-exporter and docker container processus

I would like to mine the thread count of each processes of my docker containers for my prometheus.
I tried Cadvisor but it seems they don't have this feature..

That's why I am trying to work with process-exporter.
The problem is that if I am using docker-compose and entrypoint files, the name that I have to put in the config.yml of process-exporter is the name of the file of the entrypoint..

Example: If I start a container where an entrypoint (named entrypoint.sh) is setup:

cat /proc/$pid/stat

1590825 (entrypoint.sh) S 000 000 000 00 .... 

We can see that even in the /proc/$pid/stat the name of process is entrypoint.sh.

Then my config.yml for process-exporter should be:

process_names:
  - comm:
    - "entrypoint.sh"

And there is another problem, even if a set "entrypoint.sh" in the config file I don't know why but it will show me the metrics of the "sh" process..



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source