Hi,
I have the following metric:
kube_system_upstream_public_cra7ccfa2b62624_alb1_responseMsec
The substring “public_cra7ccfa…_alb1” is an ID for an Application Load Balancer (ALB). I don’t want to create variables or queries using the given metric name as it is, because if I want to export my dashboard and use it in another environment where the ALB ID is different, then I would have to change that part of the metric name everywhere where its used. So I managed to isolate the ALB ID with a regex expression and assign it to a variable called “alb”. I’ m trying to use that variable as part as the metric name in a query as follows:
kube_system_upstream_$alb_responseMsec
But that gives me the following error:
Template variables could not be initialized: parse error at char 22: could not parse remaining input “$alb_responseMs”…
I also tried:
kube_system_upstream_"$alb"_responseMsec
Which gives me the following error:
Template variables could not be initialized: parse error at char 22: could not parse remaining input "“public_cra7ccf”…
Is it possible to do what I’m trying? If so, what would be the correct syntax in order for the query to be successful?
Thanks in advance!
Regards