Skip to content

Usage data/metrics

Administrator requested to merge usage-data/metrics into main

Created by: coury-clark

Closes https://github.com/sourcegraph/sourcegraph/issues/39090 Adds some metrics that wrap behavior:

  1. event fetch
  2. event push
  3. 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}
CleanShot 2022-07-28 at 12 21 24@2x

Merge request reports

Loading