New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enforce metric cardinality check to Gauge, Histogram and Summary metric #99738
Conversation
/assign @logicalhan PHAL:) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
@@ -156,6 +166,9 @@ func (v *HistogramVec) With(labels map[string]string) ObserverMetric { | |||
if !v.IsCreated() { | |||
return noop | |||
} | |||
if v.LabelValueAllowLists != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: it might be cleaner to set this to an no-opt struct and always just call v.LabelValueAllowLists.ConstrainLabelMap(labels)
@@ -99,12 +99,19 @@ type SummaryVec struct { | |||
func NewSummaryVec(opts *SummaryOpts, labels []string) *SummaryVec { | |||
opts.StabilityLevel.setDefaults() | |||
|
|||
fqName := BuildFQName(opts.Namespace, opts.Subsystem, opts.Name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we should have a method on opts which is opts.FQName()? (not in this PR though).
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: logicalhan, YoyinZyc The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/triage accepted |
/triage accepted |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Following up #99385, this PR enforce metric cardinality check to other types(Gauge, Histogram, Summary) metric.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: