chore: instrument github oauth2 limits (#11532)

* chore: instrument github oauth2 limits

Rate limit information for github oauth2 providers instrumented in prometheus
This commit is contained in:
Steven Masley
2024-01-10 09:29:33 -06:00
committed by GitHub
parent 50b78e3325
commit 3f9da674c6
6 changed files with 421 additions and 10 deletions
+6 -1
View File
@@ -464,8 +464,13 @@ func ConvertConfig(instrument *promoauth.Factory, entries []codersdk.ExternalAut
oauthConfig = &exchangeWithClientSecret{oc}
}
instrumented := instrument.New(entry.ID, oauthConfig)
if strings.EqualFold(entry.Type, string(codersdk.EnhancedExternalAuthProviderGitHub)) {
instrumented = instrument.NewGithub(entry.ID, oauthConfig)
}
cfg := &Config{
InstrumentedOAuth2Config: instrument.New(entry.ID, oauthConfig),
InstrumentedOAuth2Config: instrumented,
ID: entry.ID,
Regex: regex,
Type: entry.Type,