grafana-toolbox / grafana-client

Python client library for accessing the Grafana HTTP API.
MIT License
106 stars 30 forks source link

Upgrading grafana to 11.0.0 breaks `smartquery` subsystem #180

Open hbaghar opened 3 months ago

hbaghar commented 3 months ago

Describe the bug On upgrading my grafana instance to v11.0.0 I can no longer use some scripts I had created to create snapshots of my dashboards. Only thing I have noticed so far is that I can no longer able to make postgresql queries using smartquery

To Reproduce Steps to reproduce the behavior:

  1. Make postgresql query call using smartquery
  2. Observe error
    File "/Users/miniconda3/envs/my-env/lib/python3.9/site-packages/grafana_client/elements/datasource.py", line 349, in smartquery
    request = query_factory(datasource, model)
    File "/Users/miniconda3/envs/my-env/lib/python3.9/site-packages/grafana_client/knowledge.py", line 423, in query_factory
    raise NotImplementedError(f"Unknown data source type: {datasource_type}")
    NotImplementedError: Unknown data source type: grafana-postgresql-datasource

Expected behavior Function should return a response with data from my postgresql datasource

Versions

Additional context Unclear at this point if there are more breaking changes. I know that the latest release of this package supports only up to grafana 10.x. I wanted to know if we have any visibility on a newer release for this package that will resolve these issues.

amotl commented 1 month ago

Dear @hbaghar,

thanks a stack for your report. The "smartquery" subsystem is a bit secondary to grafana-client, nevertheless we sure enough would like to see this issue fixed. Have you been able to come up with a solution how to fix this in one way or another?

With kind regards, Andreas.

amotl commented 1 month ago

Unclear at this point if there are more breaking changes. I know that the latest release of this package supports only up to grafana 10.x. I wanted to know if we have any visibility on a newer release for this package that will resolve these issues.

As far as grafana-wtf covers the grafana-client API, the library should be well compatible with Grafana 11.