diff --git a/CHANGELOG.md b/CHANGELOG.md index 6132478..98739b5 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## tip +* BUGFIX: fixed healthcheck + ## [v0.10.0](https://github.com/VictoriaMetrics/victoriametrics-datasource/releases/tag/v0.10.0) * FEATURE: set the default query type to `instant` when creating alerting rules. See [this issue](https://github.com/VictoriaMetrics/victoriametrics-datasource/issues/205). diff --git a/pkg/plugin/datasource.go b/pkg/plugin/datasource.go index 834749e..59dea5e 100644 --- a/pkg/plugin/datasource.go +++ b/pkg/plugin/datasource.go @@ -7,7 +7,6 @@ import ( "fmt" "io" "net/http" - "path" "strings" "sync" "time" @@ -171,9 +170,9 @@ func (d *Datasource) CheckHealth(ctx context.Context, _ *backend.CheckHealthRequ endpoint := d.settings.URL idx := strings.Index(endpoint, "/select/") if idx > 0 { - endpoint = path.Join(endpoint[:idx], health) + endpoint = fmt.Sprintf("%s%s", endpoint[:idx], health) } else { - endpoint = path.Join(endpoint, health) + endpoint = fmt.Sprintf("%s%s", strings.TrimRight(endpoint, "/"), health) } r, err := http.NewRequestWithContext(ctx, http.MethodGet, endpoint, nil) if err != nil {