Skip to content

Commit

Permalink
Use the new usage-stats endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
joanlopez committed Sep 12, 2024
1 parent 4a3d600 commit b9f0fec
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit b9f0fec

Please # to comment.