-
Notifications
You must be signed in to change notification settings - Fork 55
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
Support to add statically defined Prometheus labels to queries #14
Comments
Hi @yosefy Can you please give us a more complete example of what kind of feature you want to see in prometheus-sql. Cheers! |
say we have a query that will give us amount of cars of type ford and they all green labels: just another yaml part for adding more labels to result then columns it has thanks |
If I understood you correctly here then the end result in the metric endpoint would have to additional labels "type" and "color" which does not actually come from the SQL query itself, just added on afterwards. @yosefy: Is this correctly understood? |
yes exactly. |
FYI We do it like this: SELECT "ford" as type, "green" as color, foobar FROM foobar |
Depending on the DB you might need single quotes instead of double quotes |
Would be great to have this fixed because even when fetching would fail we would have labels (metric_name{type="ford"} -1) |
I am willing to work on this once #37 is merged. |
I've added documentation on how to do this in pull request #66 |
without injecting columns to query?
like
labels:
x: y
a: b
The text was updated successfully, but these errors were encountered: