Adds Support for Cross-Namespace Metrics

This commit is contained in:
AshMenhennett 2019-11-01 10:28:30 +11:00
parent 03bc47e9fb
commit 718cb2400e
4 changed files with 51 additions and 5 deletions

View file

@ -38,6 +38,9 @@ type DiscoveryRule struct {
// `.GroupBy` is the comma-separated expected group-by label names. The delimeters
// are `<<` and `>>`.
MetricsQuery string `yaml:"metricsQuery,omitempty"`
// Options specifies additional parameters that are taken into account
// when configuring a rule. These can be used to fine-tune the retrieval of metrics
Options Options `yaml:"options,omitempty"`
}
// RegexFilter is a filter that matches positively or negatively against a regex.
@ -80,6 +83,13 @@ type NameMapping struct {
As string `yaml:"as"`
}
// Option describes a set of customisations for retrieving metrics
type Options struct {
// option to allow cross-namespace metrics. Used to determine whether to
// append the namespace as a label selector when retrieving metrics
DetatchFromNamespace bool `yaml:"detachFromNamespace,omitempty"`
}
// ResourceRules describe the rules for querying resource metrics
// API results. It's assumed that the same metrics can be used
// to aggregate across different resources.