Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

httpcli: add prometheus metric for monitoring the rate that Sourcegraph issues requests to external services#61348

Merged
ggilmore merged 1 commit into
mainfrom
spr/main/0f3120ed
Apr 2, 2024
Merged

httpcli: add prometheus metric for monitoring the rate that Sourcegraph issues requests to external services#61348
ggilmore merged 1 commit into
mainfrom
spr/main/0f3120ed

Conversation

@ggilmore

@ggilmore ggilmore commented Mar 22, 2024

Copy link
Copy Markdown
Contributor

This PR adds a Prometheus metric that tracks the rate that Sourcegraph issues HTTP request that target external hosts (e.g. github.com, gitlab.com, etc.)

For every HTTP request, the metric tracks the hostname, HTTP method, and response code.

I have also added a new "External HTTP Request Rate" section the frontend Grafana dasboard that plots this metric. See the example screenshot below.

screencapture-sourcegraph-test-3443-debug-grafana-d-frontend-frontend-2024-03-22-13_18_13

Test Plan

  • Some rote unit tests
  • Generated the above screenshot on my local sourcegraph instance with sg start monitoring

@cla-bot cla-bot Bot added the cla-signed label Mar 22, 2024
@github-actions github-actions Bot added team/product-platform team/source Tickets under the purview of Source - the one Source to graph it all labels Mar 22, 2024
@ggilmore ggilmore force-pushed the spr/main/0f3120ed branch from 52d9f1f to c4d109d Compare March 22, 2024 20:22
@ggilmore ggilmore requested a review from a team March 22, 2024 20:22
Comment thread monitoring/definitions/frontend.go Outdated
},
Multi: true,
},
{

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this lives on frontend, but it's not specific to frontend, right? I.e., we show all requests from all services here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. The frontend dashboard includes a few different metrics like this (that are not specific to any particular microservice), so I thought this new one was similar.

@ggilmore ggilmore force-pushed the spr/main/0f3120ed branch 2 times, most recently from 8a74e74 to dc0aa2b Compare April 2, 2024 20:28
…ph issues requests to external services

commit-id:0f3120ed
@ggilmore ggilmore force-pushed the spr/main/0f3120ed branch from dc0aa2b to 7683b71 Compare April 2, 2024 20:31
@ggilmore ggilmore merged commit d3786cb into main Apr 2, 2024
@ggilmore ggilmore deleted the spr/main/0f3120ed branch April 2, 2024 20:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla-signed team/product-platform team/source Tickets under the purview of Source - the one Source to graph it all

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants