Grafana provides 
<https://grafana.com/docs/grafana/latest/features/datasources/prometheus/#query-variable>
 this 
function:
*label*_*values(metric, label)*
to get the label values for a specific metric only, which sounds like what 
you need - just pick one metric which has the network devices, and one 
metric which has the filesystem devices.

Looking at the source code 
<https://github.com/grafana/grafana/blob/master/public/app/plugins/datasource/prometheus/metric_find_query.ts#L58>,
 
behind the scenes it calls
/api/v1/series?match[]=*<metricname>*
and then gets all the unique values of the label of interest.  It's not 
quite as convenient as /api1/v1/label/<label>/values but easy enough to 
code.

You *could* change the label names at ingestion time, by copying to a new 
label and dropping the old label, but I strongly recommend against this.  
It doesn't solve the problem in general - two different metrics may use the 
same label name for different purposes.  It will be confusing, since the 
metrics stored in the database are different to those exported.  
Furthermore, you'll find yourself incompatible with any dashboards written 
to use the "correct" original label names.

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/40d542c7-48c2-4bba-a514-0e559356ae53%40googlegroups.com.

Reply via email to