Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameterization the name of metric in the Datadog query #6684

Open
jrybak23 opened this issue Nov 3, 2020 · 1 comment
Open

Parameterization the name of metric in the Datadog query #6684

jrybak23 opened this issue Nov 3, 2020 · 1 comment

Comments

@jrybak23
Copy link

jrybak23 commented Nov 3, 2020

There are a bunch of custom metrics that looks like:

metric.name.key1
metric.name.key2
...

There is a template variables dropdown (https://docs.datadoghq.com/dashboards/template_variables/) on the dashboard that contains all keys. (Name of the variable is $key and values key1, key2..)

The metrics query like this works fine:

avg:metric.name.key1{*}.as_count()

But is it possible to parametrize the query with the $key variable by concatenation with the part of the name of metric? So it would look like this:

avg:metric.name.$key{*}.as_count()

As I know, it is possible to something like that by using tags but unfortunately, there are no any metrics with the tag "key".

Not sure that the issue was created in the appropriate repo so move it to the correct one if needed.
Also, here is the same StackOverflow question:
https://stackoverflow.com/questions/64661079/string-interpolation-with-the-name-of-metric-in-the-datadog-query

@23ewrdtf
Copy link

I have a similar problem:

The original query is: "query": "sum:ray.cluster.active_nodes{$service,$host}" and it works fine.

When I do "query": "sum:bigraycluster.ray.cluster.active_nodes{$service,$host}" it works but when I add a variable "query": "sum:$raycluster.ray.cluster.active_nodes{$service,$host}" it gives me a query error.

Are variables not allowed in metrics? I did try {$raycluster}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants