Datasource/grafana-pyroscope: Do healthcheck on a window without data (#106312)

This will makes the healthcheck cheaper to anwser, as we would not expect data at this time window.

Fixes #106311
pull/106293/head
Christian Simon 1 month ago committed by GitHub
parent 98e4ec2e9e
commit 30dc3a3ce4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      pkg/tsdb/grafana-pyroscope-datasource/instance.go

@ -253,8 +253,8 @@ func (d *PyroscopeDatasource) CheckHealth(ctx context.Context, _ *backend.CheckH
// Since this is a health check mechanism and we only care about whether the
// request succeeded or failed, we set the window to be small.
start := time.Now().Add(-5 * time.Minute).UnixMilli()
end := time.Now().UnixMilli()
start := time.Unix(1, 0).UnixMilli()
end := time.Unix(4, 0).UnixMilli()
if _, err := d.client.ProfileTypes(ctx, start, end); err != nil {
status = backend.HealthStatusError
message = err.Error()

Loading…
Cancel
Save