From 4a2d29d7c6e7b11a526ec524199f15a002b06039 Mon Sep 17 00:00:00 2001 From: Anton Kolesnikov Date: Wed, 19 Feb 2025 15:20:07 +0800 Subject: [PATCH] fix: add service_name label to the canary exporter --- cmd/profilecli/canary_exporter.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/profilecli/canary_exporter.go b/cmd/profilecli/canary_exporter.go index b3e6a0a1f1..99776ba98c 100644 --- a/cmd/profilecli/canary_exporter.go +++ b/cmd/profilecli/canary_exporter.go @@ -297,6 +297,7 @@ func (ce *canaryExporter) testPyroscopeCell(ctx context.Context) error { p.Labels = p.Labels[:0] p.CustomProfile("deadmans_switch", "made_up", "profilos", "made_up", "profilos") p.WithLabels( + "service_name", "pyroscope-canary-exporter", "job", "canary-exporter", "instance", ce.hostname, ) @@ -351,7 +352,7 @@ func (ce *canaryExporter) testPyroscopeCell(ctx context.Context) error { respQueryInstant, err := ce.params.queryClient().SelectMergeProfile(rCtx, connect.NewRequest(&querierv1.SelectMergeProfileRequest{ Start: now.UnixMilli(), End: now.Add(5 * time.Second).UnixMilli(), - LabelSelector: fmt.Sprintf(`{job="canary-exporter", instance="%s"}`, ce.hostname), + LabelSelector: fmt.Sprintf(`{service_name="pyroscope-canary-exporter", job="canary-exporter", instance="%s"}`, ce.hostname), ProfileTypeID: "deadmans_switch:made_up:profilos:made_up:profilos", })) if err != nil {