community.grafana icon indicating copy to clipboard operation
community.grafana copied to clipboard

Support for ES < 9.10 is dropped from Grafana 9.0.2

Open markri opened this issue 3 years ago • 5 comments

In Grafana 9.0.3, the support for Elasticsearch < 9.10 is dropped. Meaning that we can't create an ES datasource anymore as the dictionary prohibits the use of anything like that (on module 1.5.0)

es_version=dict(type='int', default=710, choices=[2, 5, 56, 60, 70]),

In Grafana 9.0.3 you have now 2 options, 7.10+ and 8.0+. Via API provisioning (I know because of exporting the datasource from grafana) you need to enter "7.10.0" to get it to 7.10+, but this is not an integer. So some typecasting needs to be done until a string "7.10.0" is put into esVersion on the actual call.

markri avatar Jul 20 '22 20:07 markri

I just noticed that only 9.0.2 is supported for now. So I'll downgrade it to that version.

  • update * This issue also occurs on 9.0.2, which would make this somewhat more relevant I suppose as it should be supported ATM

markri avatar Jul 20 '22 20:07 markri

@markri I have a hotfix in review, I added an integration test that attempts to create a datasource with "7.10+" elastic version. The API and the WUI looks to reflect something that worked, but I would be happy if you could test with your real use case.

The Grafana Api has the tendancy to accepts things that are not really working and I don't have a real elastic instance running in my integration tests :/

Edit: You should be able to test the patch by referencing the collection by a Git Url and the hotfix-263 branch as version.

rrey avatar Aug 22 '22 13:08 rrey

Hi @rrey I just confirmed that everything is working now. Thanks!

I tested following contexts:

  • es_version: "7.10+"
  • Setting existing ES to 8.0 and have Ansible set it to 7.10+
  • Creating a new ES datasource with 7.10+
  • Tested for idem potency

So ready to merge I guess?

markri avatar Aug 31 '22 09:08 markri

Thanks for testing this @markri ! The datasource is working properly after creation ? You can properly get data from it through explorer/panel/Dashboard ?

rrey avatar Sep 01 '22 09:09 rrey

Yup, save & test button yields green message, and dashboard stats are working fine

markri avatar Sep 01 '22 10:09 markri