Skip to content
This repository was archived by the owner on Jan 15, 2024. It is now read-only.

Commit c69abe9

Browse files
authored
Update EsVersion type to string from int for datasource client (#34)
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.
1 parent 3049c69 commit c69abe9

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

datasource.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ type JSONData struct {
4545
TimeInterval string `json:"timeInterval,omitempty"`
4646

4747
// Used by Elasticsearch
48-
EsVersion int64 `json:"esVersion,omitempty"`
48+
// From Grafana 8.x esVersion is the semantic version of Elasticsearch.
49+
EsVersion string `json:"esVersion,omitempty"`
4950
TimeField string `json:"timeField,omitempty"`
5051
Interval string `json:"interval,omitempty"`
5152
LogMessageField string `json:"logMessageField,omitempty"`

datasource_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ func TestNewElasticsearchDataSource(t *testing.T) {
118118
URL: "http://some-url.com",
119119
IsDefault: true,
120120
JSONData: JSONData{
121-
EsVersion: 70,
121+
EsVersion: "7.0.0",
122122
TimeField: "time",
123123
Interval: "1m",
124124
LogMessageField: "message",

0 commit comments

Comments
 (0)