Skip to content

Commit

Permalink
RA: Fix legacy override utilization metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
beautifulentropy committed Oct 30, 2023
1 parent 50ec478 commit 64dad81
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions ra/ra.go
Original file line number Diff line number Diff line change
Expand Up @@ -1428,12 +1428,12 @@ func (ra *RegistrationAuthorityImpl) enforceNameCounts(ctx context.Context, name
// return the badNames in the same order they were input.
for _, name := range names {
threshold, overrideKey := limit.GetThreshold(name, regID)
if overrideKey != "" {
utilization := float64(response.Counts[name]) / float64(threshold)
ra.rlOverrideUsageGauge.WithLabelValues(ratelimit.CertificatesPerName, overrideKey).Set(utilization)
}
if response.Counts[name] >= threshold {
badNames = append(badNames, name)
} else if overrideKey != "" {
// Name is under threshold due to an override.
utilization := float64(response.Counts[name]) / float64(threshold)
ra.rlOverrideUsageGauge.WithLabelValues(ratelimit.CertificatesPerName, overrideKey).Set(utilization)
}
}
return badNames, response.Earliest.AsTime(), nil
Expand Down
6 changes: 3 additions & 3 deletions ratelimit/rate-limits.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
const (
// CertificatesPerName is the name of the CertificatesPerName rate limit
// when referenced in metric labels.
CertificatesPerName = "certificates_per_domain_per_account"
CertificatesPerName = "certificates_per_domain"

// RegistrationsPerIP is the name of the RegistrationsPerIP rate limit when
// referenced in metric labels.
Expand All @@ -33,11 +33,11 @@ const (

// CertificatesPerFQDNSet is the name of the CertificatesPerFQDNSet rate
// limit when referenced in metric labels.
CertificatesPerFQDNSet = "certificates_per_fqdn_set_per_account"
CertificatesPerFQDNSet = "certificates_per_fqdn_set"

// CertificatesPerFQDNSetFast is the name of the CertificatesPerFQDNSetFast
// rate limit when referenced in metric labels.
CertificatesPerFQDNSetFast = "certificates_per_fqdn_set_per_account_fast"
CertificatesPerFQDNSetFast = "certificates_per_fqdn_set_fast"

// NewOrdersPerAccount is the name of the NewOrdersPerAccount rate limit
// when referenced in metric labels.
Expand Down

0 comments on commit 64dad81

Please sign in to comment.