Skip to content

codeintel: Add language request telemetry

Administrator requested to merge ef/33795-telemetry into main

Created by: efritz

Closes #33795 (closed). This PR adds additional telemetry from #33869 and #34621. Blocked by https://github.com/sourcegraph/analytics/pull/412.

Sample payload from client -> Cloud:

"newCodeIntelUsage": {
  "StartOfWeek": "2022-04-24T00:00:00Z",
  "WAUs": 0,
  "PreciseWAUs": 0,
  "SearchBasedWAUs": 0,
  "CrossRepositoryWAUs": 0,
  "PreciseCrossRepositoryWAUs": 0,
  "SearchBasedCrossRepositoryWAUs": 0,
  "EventSummaries": null,
  "NumRepositories": 3664,
  "NumRepositoriesWithUploadRecords": 6,
  "NumRepositoriesWithoutUploadRecords": null,
  "NumRepositoriesWithFreshUploadRecords": 5,
  "NumRepositoriesWithIndexRecords": 1,
  "NumRepositoriesWithFreshIndexRecords": 1,
  "NumRepositoriesWithAutoIndexConfigurationRecords": 2,
  "CountsByLanguage": {
    "lsif-go": {
      "NumRepositoriesWithUploadRecords": 6,
      "NumRepositoriesWithFreshUploadRecords": 5,
      "NumRepositoriesWithIndexRecords": 1,
      "NumRepositoriesWithFreshIndexRecords": 1
    }
  },
  "SettingsPageViewCount": 0,
  "LanguageRequests": [
    {
      "LanguageID": "lua",
      "NumRequests": 1
    },
    {
      "LanguageID": "javascript",
      "NumRequests": 1
    }
  ],
  "InvestigationEvents": [
    {
      "Type": 3,
      "WAUs": 1,
      "Total": 1
    },
    {
      "Type": 1,
      "WAUs": 1,
      "Total": 2
    }
  ]
}

Sample payload from Cloud -> Google Pub/Sub:

"new_code_intel_usage": {
  "start_time": "2022-04-24T00:00:00Z",
  "waus": 0,
  "precise_waus": 0,
  "search_waus": 0,
  "xrepo_waus": 0,
  "precise_xrepo_waus": 0,
  "search_xrepo_waus": 0,
  "event_summaries": null,
  "num_repositories": 3664,
  "num_repositories_with_upload_records": 6,
  "num_repositories_without_upload_records": 3658,
  "num_repositories_with_fresh_upload_records": 5,
  "num_repositories_with_index_records": 1,
  "num_repositories_with_fresh_index_records": 1,
  "num_repositories_with_index_configuration_records": 2,
  "counts_by_language": [
    {
      "language_id": "lsif-go",
      "num_repositories_with_upload_records": 6,
      "num_repositories_with_fresh_upload_records": 5,
      "num_repositories_with_index_records": 1,
      "num_repositories_with_fresh_index_records": 1
    }
  ],
  "settings_page_view_count": 0,
  "language_requests": [
    {
      "language_id": "lua",
      "num_requests": 1
    },
    {
      "language_id": "javascript",
      "num_requests": 1
    }
  ],
  "investigation_events": [
    {
      "type": "CodeIntelligenceIndexErrorInvestigated",
      "waus": 1,
      "total": 1
    },
    {
      "type": "CodeIntelligenceIndexerSetupInvestigated",
      "waus": 1,
      "total": 2
    }
  ]
}

Note: The fields language_requests and investigation_events are new.

Test plan

Validated data out of updatecheck client and handler have the expected format (see above).

Merge request reports

Loading