Include container names and versions with metrics #1631
Replies: 4 comments 3 replies
-
I am not sure how you want this to work, the prometheus metrics are all numeric: |
Beta Was this translation helpful? Give feedback.
-
Negative, Cadvisor export the list of containers, I write some specific data exportation from Postgresql using some text fields and this is not a GAUGE nor a COUNTER but a LABEL. I would like to use Watchtower to know the list of the NAMED containers I have to update, and with just this information, it shoulf by great. An example with custom request from postgres-exporter allowing to grab some text info from the database:pg_atlog_dichotomie_docs_mensuels:
query: |
SELECT
current_database() as datname,
al_registre(i_reg_doc_origine),
COUNT(CASE WHEN to_char(d_creation, 'YYYY-MM') = to_char(now() - interval '6 month', 'YYYY-MM') THEN 1 END) AS "mm6",
COUNT(CASE WHEN to_char(d_creation, 'YYYY-MM') = to_char(now() - interval '5 month', 'YYYY-MM') THEN 1 END) AS "mm5",
COUNT(CASE WHEN to_char(d_creation, 'YYYY-MM') = to_char(now() - interval '4 month', 'YYYY-MM') THEN 1 END) AS "mm4",
COUNT(CASE WHEN to_char(d_creation, 'YYYY-MM') = to_char(now() - interval '3 month', 'YYYY-MM') THEN 1 END) AS "mm3",
COUNT(CASE WHEN to_char(d_creation, 'YYYY-MM') = to_char(now() - interval '2 month', 'YYYY-MM') THEN 1 END) AS "mm2",
COUNT(CASE WHEN to_char(d_creation, 'YYYY-MM') = to_char(now() - interval '1 month', 'YYYY-MM') THEN 1 END) AS "mm1",
COUNT(CASE WHEN to_char(d_creation, 'YYYY-MM') = to_char(now(), 'YYYY-MM') THEN 1 END) AS "mec"
FROM document
WHERE d_creation >= date_trunc('month', now() - interval '6 month')
GROUP BY i_reg_doc_origine
ORDER BY COUNT(*) DESC;
metrics:
- mm6:
usage: "GAUGE"
description: "Nombre Mois M-6"
- mm5:
usage: "GAUGE"
description: "Nombre Mois M-5"
- mm4:
usage: "GAUGE"
description: "Nombre Mois M-4"
- mm3:
usage: "GAUGE"
description: "Nombre Mois M-3"
- mm2:
usage: "GAUGE"
description: "Nombre M-2"
- mm1:
usage: "GAUGE"
description: "Nombre M-1"
- mec:
usage: "GAUGE"
description: "Nombre Mois En_COURS"
- al_registre:
usage: "LABEL"
description: "Nom du registre"
- datname:
usage: "LABEL"
description: "Nom de la base de donnees" |
Beta Was this translation helpful? Give feedback.
-
Guys, thanks a lot for the job.
I have hundred of servers to manage and it would be miraculous if I was enable to build a grafana dashboard with some metrics grabbed by prometheus. Currently we have metrics but I would like to have the name of each container, the current version and the potential update version.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions