Skip to content
Snippets Groups Projects

usage-data: restrict scraped events to an allowlist

Created by: coury-clark

Closes https://github.com/sourcegraph/sourcegraph/issues/39094

Implements an allowlist for events that are keyed by name. Currently this is stored in a database table. See linked issue for some thoughts on how this could be improved.

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}
select count(*) from event_logs where name = 'InsightHover';
count
448

Merge request reports

Approval is optional

Merged by avatar (Sep 22, 2025 8:40pm UTC)

Merge details

  • Changes merged into main with 6cf8dd46.
  • Deleted the source branch.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading