-
Notifications
You must be signed in to change notification settings - Fork 630
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
feat(datasource-plugin): add support for label queries #1877
Conversation
size-limit report 📦
|
Flamegraph.com reportCreated by Flamegraph.com Github Action |
Flamegraph.com reportCreated by Flamegraph.com Github Action |
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## main #1877 +/- ##
=======================================
Coverage 63.28% 63.28%
=======================================
Files 175 175
Lines 5912 5912
Branches 1587 1587
=======================================
Hits 3741 3741
Misses 2162 2162
Partials 9 9 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
5e2445a
to
85bdb39
Compare
85bdb39
to
3b5c43e
Compare
@eh-am if you have a chance, please give the PR a look – after our discussion, I made an attempt to implement label queries, and I wonder if it is sufficient for our needs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is pretty sweet!
Kapture.2023-02-24.at.20.18.53.mp4
One thing I find necessary though is to be able to choose no tag. In the example above I may want to look at simple.app.cpu{}
, it would be nice to have some kind of catch all using .*
, but that would require updating the endpoints etc I assume.
One last thing is that we can't forget about updating the README with this new functionality.
One idea is to in the datasource, if both sides of the |
Yeah, also was thinking about this. But honestly I doubt variable substitution mechanism in Grafana is good/designed for this – I can picture one may want to use multiple labels, use different operators, have a sophisticated logic of label dependencies, etc. In general, I can't even find a good example when to use I was playing with various scenarios and discovered that repeating panel or row does not seem to work as expected (both for apps and label values) – when I specify multiple values, our datasource gets an array of values: What do you think? Is it what we should handle in our panel plugin / query editor or I did miss something? |
Ok, I figured out how to make it work with multi-variable choice: |
4abbb6c
to
c9f95f0
Compare
41bc990
to
9aa53f4
Compare
The implementation and query syntax is similar to the Prometheus datasource for convenience: https://grafana.com/docs/grafana/latest/datasources/prometheus/template-variables/#use-query-variables