-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add threshold validation to cmd/config
This commit adds a `validateThresholdConfig` function to `cmd/config`, and integrates it as part of the `validateConfig` operations. From now on, `validateConfig` takes a `metrics.Registry` as input, and validates that thresholds defined in the config apply to existing metrics, and use methods that are valid for the metric they apply to. As a side effect, this commit adds a `Get` method to `metrics.Registry` in order to be able to query registered metrics, regardless of whether they are custom or builtin metrics. As another side effect, this commit introduces a `lib.Contains` helper function allowing to check if a slice of strings contains a given string. This is used to simplify the matching of supported aggregation methods on metrics in the `validateThresholdConfig` function. ref #2330
- Loading branch information
Showing
5 changed files
with
546 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.