Grafana for a variable, get values from multiple labels for one metric

Viewed 550

I hope you're having a nice day.

To create a variable in Grafana for a dashboard I need to get values from multiple labels from a metric :

dbinstance_identifier & dbcluster_identifier

To get the values in my variable i use the function "label_values()", but i can only put 1 label in that function :

label_values(XXXXXXXX, dbinstance_identifier)

I would want something like :

label_values(XXXXXXXX, dbinstance_identifier | dbcluster_identifier) but it returns a parse error...

What is the best solution ?

Yours sincerely,

Arthur

1 Answers

I was able to solve this problem using query_result and regex:

query_result(XXXXXXXX{})

/.*_identifier="([^"]*).*/
Related