Usage data/metrics
Created by: coury-clark
Closes https://github.com/sourcegraph/sourcegraph/issues/39090 Adds some metrics that wrap behavior:
- event fetch
- event push
- queue size
Test plan
To test locally:
Set up gcp credentials
gcloud auth application-default login
Start sg
GOOGLE_APPLICATION_CREDENTIALS="$HOME/.config/gcloud/application_default_credentials.json" sg start ...
Add configuration to the site config
"exportUsageTelemetry": {
"enabled": true,
"topicProjectName": "sourcegraph-dogfood",
"topicName": "usage-data-testing"
},
Adding InsightHover
to the allowlist and resetting the scraper state:
[ worker] INFO worker.export-usage-telemetry telemetry/telemetry_job.go:127 fetching events from bookmark {"bookmark_id": 0}
[ worker] INFO worker.export-usage-telemetry telemetry/telemetry_job.go:138 telemetryHandler executed {"event count": 448, "maxId": 20578}