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

Grafana Smart Query Prometheus missing key #85

Open
PankajKhanwani opened this issue May 3, 2023 · 6 comments
Open

Grafana Smart Query Prometheus missing key #85

PankajKhanwani opened this issue May 3, 2023 · 6 comments

Comments

@PankajKhanwani
Copy link

PankajKhanwani commented May 3, 2023

Describe the bug

result = grafana.datasource.smartquery(datasource=datasource, expression='openstack_nova_total_vms')

I have called smartquery for the type=prometheus.

This function doesn't take from and to keys which is required to call grafana for the prometheus query, otherwise it is giving 200 ok but the output doesn't contain any data. But if provided with timestamp in from and to it gives the data.

This is the result:

{'results': {'A': {'status': 200, 'frames': []}}}
@amotl
Copy link
Contributor

amotl commented May 3, 2023

Dear Pankaj,

thank you for writing in. Up until now, the smartquery subsystem has been primarily conceived to check datasources for health, see references below. That's probably the reason why many of the implementations are only stubs, and lack corresponding parameter propagations.

On the specific issue of improving the support for Prometheus on this matter, I think @peekjef72 already submitted corresponding improvements - at least this code fragment looks like that.

https://github.com/panodata/grafana-client/blob/b37a67b0fe5a0843cc4b1d256eff01176894e50c/grafana_client/elements/datasource.py#L315-L330

With kind regards,
Andreas.

References

@PankajKhanwani
Copy link
Author

Thanks @amotl, will be looking forward to use this library once this code gets merges. If any bugs found, will surely contribute to the repo

@amotl
Copy link
Contributor

amotl commented Oct 14, 2023

Dear Pankaj,

the improvements to the library by @peekjef72 have been merged. Maybe you are more successful now to run your query? We will be happy to hear back from you about it.

With kind regards,
Andreas.

@amotl amotl removed their assignment Oct 14, 2023
@amotl
Copy link
Contributor

amotl commented Jan 8, 2024

Dear @PankajKhanwani,

first of all, we would like to wish you a happy new year. Also, we want to take the chance to ask you whether you had the chance to check if querying Prometheus through grafana-client works well now, when using a recent release?

With kind regards,
Andreas.

@PankajKhanwani
Copy link
Author

Not yet. I will check it soon and will close this if everything works

@amotl
Copy link
Contributor

amotl commented Mar 29, 2024

Gentle ping ;]. We just released grafana-client 4.0.0 with a few more enhancements. Please let us know if the current version improves the situation for you. We would otherwise like to look into it, in order to improve functionality for you and others needing it.

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