Hi, I’ve just managed to get Prometheus and Grafana set up with my cluster, each running in it’s own container. Basically seems to work in that I’ve configured up one node and it’s populating the Incus dashboard.
Problem: it only appears to be using the FIRST project listed in the config, i.e. it’s not iterating the project variable. This is my first time using Prometheus so I’ve no idea where to look, this is my config;
Dashboard looks good, but the drop-down for projects only show “management”. If I create another job “incus2” and make project: [‘mms’,‘management’,‘default’], then it too works, but the drop-down on the dashboard only lists ‘mms’.
I “could” just replicate the stanza for each project and have “one” project in the project list, then use the “job” drop-down to effectively switch between projects, but it would be great to see the project drop-down working.
Am I doing something wrong, or is this a bug on the Prometheus fetch code? (or the Grafana display code?)
When you do that, prometheus will make a single scrape to ..../1.0/metrics?project=management&project=default&project=mms
You can do the scrape yourself with curl and see what comes back. With incus 6.0.4, it seems to be looking at only the first value of the parameter provided:
# This shows only metrics from project "nsrc-builder"
curl -k 'https://localhost:8444/1.0/metrics?project=nsrc-builder&project=default' | perl -ne 'print "$1\n" if /project="(.*?)"/' | sort | uniq -c
I think it would be a feature request to honour multiple instances of the project parameter.
Erm, I want all projects … maybe I read the documentation wrong, I thought it said that if you didn’t specify “project” it would use “default” … is the default to pull “all” ? (I’m trying it now …)
Yep, cool, I just read the docs wrong … I’ve pulled the ‘param’ / project clause and now it’s filling all projects. Many thanks
I’m not sure how the templates work, but as a really minor tweak, it sounds like changing the type of “project” from list to string would stop anyone else having this problem, if that’s possible?