From 7d1a02c754eb567fae10800b412a524da6f80867 Mon Sep 17 00:00:00 2001 From: Vardan Torosyan Date: Fri, 10 Sep 2021 14:05:29 +0200 Subject: [PATCH] Update EsVersion type to string from int for datasource client EsVersion used to be an integer prior to Grafana 8.x. This is considered legacy now and full semantic version as a string is used instead. --- datasource.go | 3 ++- datasource_test.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/datasource.go b/datasource.go index b8b98d8e..4fc91512 100644 --- a/datasource.go +++ b/datasource.go @@ -45,7 +45,8 @@ type JSONData struct { TimeInterval string `json:"timeInterval,omitempty"` // Used by Elasticsearch - EsVersion int64 `json:"esVersion,omitempty"` + // From Grafana 8.x esVersion is the semantic version of Elasticsearch. + EsVersion string `json:"esVersion,omitempty"` TimeField string `json:"timeField,omitempty"` Interval string `json:"interval,omitempty"` LogMessageField string `json:"logMessageField,omitempty"` diff --git a/datasource_test.go b/datasource_test.go index 53f8595e..4b0907a1 100644 --- a/datasource_test.go +++ b/datasource_test.go @@ -118,7 +118,7 @@ func TestNewElasticsearchDataSource(t *testing.T) { URL: "http://some-url.com", IsDefault: true, JSONData: JSONData{ - EsVersion: 70, + EsVersion: "7.0.0", TimeField: "time", Interval: "1m", LogMessageField: "message",