Skip to content

Commit

Permalink
fixed healthcheck (#211)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewChubatiuk authored Oct 17, 2024
1 parent 19c85d4 commit 946b54c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
5 changes: 2 additions & 3 deletions pkg/plugin/datasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"fmt"
"io"
"net/http"
"path"
"strings"
"sync"
"time"
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 946b54c

Please sign in to comment.