Skip to content

insights: add metrics around the commit indexer

Administrator requested to merge insights/commit-indexer-metrics into main

Created by: CristinaBirkel

Closes #22037

Description

This PR exposes a few new metrics to prometheus:

  • insights_commit_indexer : wraps the commit indexer worker in basic metrics.
  • insights_commit_indexer_fetch : wraps getCommits in basic metrics.
  • insights_commit_indexer_commits_added : a counter for how many commits are appended to the index.

Note: For the counter, I added a label for the repo name. This will be really high cardinality in some cases, but I figured it might be useful for drilling down if need be and can probably be ignored when creating an overall graph. But let me know if it would be better to leave it off.

Testing Steps

I tested this locally by running Sourcegraph with monitoring and verifying in Grafana that the metrics were showing up.

Specifically for the counter, I wiped my commit index table and modified the metadata so that it would actually have some new commits to add, and verified that those were counted as expected.

Let me know if you see any issues!

Merge request reports

Loading