-
Notifications
You must be signed in to change notification settings - Fork 31
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
Review adjustments to smartquery
and query_factory
#38
Conversation
now returns dict containing all info to request Grafana API.
fix smart_query for check_health
This comment was marked as duplicate.
This comment was marked as duplicate.
Dear Jean-Francois, thanks a stack for your excellent contribution and for bringing up the corresponding discussion topics.
I will try to dedicate some time for a detailed review of your patch soon. I think your recent updates, especially removing With kind regards, |
elif datasource_type in ("prometheus", "loki") and LooseVersion(self.api.version) <= VERSION_7: | ||
if "queries" in request["data"] and len(request["data"]["queries"]) > 0 \ | ||
and "instant" in request["data"]["queries"][0] and request["data"]["queries"][0]["instant"]: | ||
return self.query( | ||
datasource.get("id"), | ||
request["expr"], | ||
request["data"]["to"], | ||
) | ||
else: | ||
return self.query_range( | ||
datasource.get("id"), | ||
request["expr"], | ||
request["data"]["from"], | ||
request["data"]["to"], | ||
request["data"]["step"], | ||
) |
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.
datasource accesses change with grafana version: Prometheus in v 7 use format specified in function query() and query_range(), but now use a standard format for the queries (type or range) and results.
Hi. It looks like @PankajKhanwani is looking for this improvement around properly supporting Prometheus at GH-85, right?
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.
Hi,
I think so.
even if PR was built for grafana 9.2 I think that the Prometheus datasource has not changed.
Do you believe you have time to review ?
JFPIK-
Dear Jean-Francois, having to apologize again for the long delay, I finally found some time to review your patch in detail. I really like it, and would like to wrap it up, to satisfy the linter and the software tests, and also squash the commits, in order to finally integrate it.
It is sad, right. I was well aware about those details when starting this experiment, that things will be in flux for times to come. Thank you for addressing any anomalies with your patch.
C'est la vie, I would say. Thank you so much for making the best out of it, by introducing corresponding version switching.
Thanks, I will look into it when starting to work on this.
I am absolutely not sure about it, but I definitively wanted to give it a try, because I thought it would make a nice feature. I know there will always be anomalies wrt. to a completely unified interface, that is natural. I am open to any discussions about this, and to hear back about what you think, how this topic could be approached better. Still, I think the outcome is quite nice: After learning a bit of query parameters, how to use With kind regards, Footnotes
|
smartquery
and query_factory
beyond data source health checks
smartquery
and query_factory
beyond data source health checkssmartquery
and query_factory
smartquery
and query_factory
smartquery
and query_factory
Closing this in favor of GH-112, where I added some adjustments to make the tests work again. Your improvements have been included into the 3.8.0 release, and I will be happy to receive corresponding feedback or bugfix patches, in case I made any mistakes. Thank you again, for both your patch and your patience. |
About
I've tried to use query methods from grafana-client info grafana-snapshot-tool. For that I need to perform some adjustement to api interface.
Discussion
it seems to me that :
I'm not sure that the grafana_client must implement a generic function smartquery() that permit to users to query and version to Grafana server and any data source in a unified way.
What is your opinion ?