Skip to content
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

Add Options for MetricValidator #87

Closed
kristinapathak opened this issue Apr 26, 2021 · 1 comment · Fixed by #99
Closed

Add Options for MetricValidator #87

kristinapathak opened this issue Apr 26, 2021 · 1 comment · Fixed by #99
Assignees
Labels
enhancement New feature or request validator
Milestone

Comments

@kristinapathak
Copy link
Contributor

}, ServerLabel, OutcomeLabel, ReasonLabel, ClientIDLabel, PartnerIDLabel, EndpointLabel),

Some Option ideas:

  • WithEndpoints([]*regexp.Regexp) - if not provided, an empty string (would cause CapabilitiesMap to error out every time; not ideal) or n/a could be used instead of not_recognized. Then someone testing would be able to determine if the label value is a configuration/setup issue. This could also be providing a function that determines the endpoint label to use given the url in the request.
  • MonitorOnly() - errorOut should be true by default. If this option is provided, it will be false.

An added benefit of having a NewMetricValidator function is it allows us to nil check the measures and CapabilitiesChecker.

@kristinapathak kristinapathak added enhancement New feature or request validator labels Apr 26, 2021
@kristinapathak kristinapathak self-assigned this Apr 26, 2021
@joe94
Copy link
Member

joe94 commented Apr 26, 2021

Sounds good to me 👍
The part about a default label value for endpoints reminded me that we could improve readability in this function by having it return a struct with the different label values as fields.

func (m MetricValidator) prepMetrics(auth bascule.Authentication) (string, string, string, string, error) {

This could be part of this issue or be on its own.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request validator
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants