From 30dc3a3ce4fb9c21f5b2115bf5a9a818a567a610 Mon Sep 17 00:00:00 2001 From: Christian Simon Date: Fri, 6 Jun 2025 08:29:31 +0100 Subject: [PATCH] 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 --- pkg/tsdb/grafana-pyroscope-datasource/instance.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/tsdb/grafana-pyroscope-datasource/instance.go b/pkg/tsdb/grafana-pyroscope-datasource/instance.go index c69ec2ceabb..66de2eb3302 100644 --- a/pkg/tsdb/grafana-pyroscope-datasource/instance.go +++ b/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()