From b9f0fec033555cdaaf1d3a77cb68429c1a44d7a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joan=20L=C3=B3pez=20de=20la=20Franca=20Beltran?= Date: Thu, 12 Sep 2024 08:31:01 +0200 Subject: [PATCH] Use the new usage-stats endpoint --- cmd/report.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/report.go b/cmd/report.go index 8f8e3a45429..0003706b2ef 100644 --- a/cmd/report.go +++ b/cmd/report.go @@ -37,14 +37,18 @@ func reportUsage(ctx context.Context, execScheduler *execution.Scheduler, test * if err != nil { return err } - req, err := http.NewRequestWithContext(ctx, http.MethodPost, "https://reports.k6.io", bytes.NewBuffer(body)) + + const usageStatsURL = "https://stats.grafana.org/k6-usage-report" + req, err := http.NewRequestWithContext(ctx, http.MethodPost, usageStatsURL, bytes.NewBuffer(body)) if err != nil { return err } + req.Header.Set("Content-Type", "application/json") res, err := http.DefaultClient.Do(req) if err == nil { _ = res.Body.Close() } + return err }