agent: suppose filter_default telemetry option
This commit is contained in:
parent
85b221a1d6
commit
b81e4e18f0
|
@ -888,6 +888,10 @@ func (c *Command) setupTelemetry(config *Config) (*metrics.InmemSink, error) {
|
|||
metricsConf.AllowedPrefixes = allowedPrefixes
|
||||
metricsConf.BlockedPrefixes = blockedPrefixes
|
||||
|
||||
if telConfig.FilterDefault != nil {
|
||||
metricsConf.FilterDefault = *telConfig.FilterDefault
|
||||
}
|
||||
|
||||
// Configure the statsite sink
|
||||
var fanout metrics.FanoutSink
|
||||
if telConfig.StatsiteAddr != "" {
|
||||
|
|
|
@ -444,6 +444,10 @@ type Telemetry struct {
|
|||
// PrefixFilter allows for filtering out metrics from being collected
|
||||
PrefixFilter []string `mapstructure:"prefix_filter"`
|
||||
|
||||
// FilterDefault controls whether to allow metrics that have not been specified
|
||||
// by the filter
|
||||
FilterDefault *bool `mapstructure:"filter_default"`
|
||||
|
||||
// DisableDispatchedJobSummaryMetrics allows for ignore dispatched jobs when
|
||||
// publishing Job summary metrics. This is useful in environment that produce
|
||||
// high numbers of single count dispatch jobs as the metrics for each take up
|
||||
|
@ -1320,6 +1324,10 @@ func (a *Telemetry) Merge(b *Telemetry) *Telemetry {
|
|||
result.PrefixFilter = b.PrefixFilter
|
||||
}
|
||||
|
||||
if b.FilterDefault != nil {
|
||||
result.FilterDefault = b.FilterDefault
|
||||
}
|
||||
|
||||
if b.DisableDispatchedJobSummaryMetrics {
|
||||
result.DisableDispatchedJobSummaryMetrics = b.DisableDispatchedJobSummaryMetrics
|
||||
}
|
||||
|
|
|
@ -735,6 +735,7 @@ func parseTelemetry(result **Telemetry, list *ast.ObjectList) error {
|
|||
"disable_tagged_metrics",
|
||||
"backwards_compatible_metrics",
|
||||
"prefix_filter",
|
||||
"filter_default",
|
||||
"disable_dispatched_job_summary_metrics",
|
||||
}
|
||||
if err := helper.CheckHCLKeys(listVal, valid); err != nil {
|
||||
|
|
|
@ -64,12 +64,16 @@ The following options are available on all telemetry configurations.
|
|||
only be added to tagged metrics. Note that this option is used to transition
|
||||
monitoring to tagged metrics and will eventually be deprecated.
|
||||
|
||||
|
||||
- `disable_tagged_metrics` `(bool: false)` - Specifies if Nomad should not emit
|
||||
tagged metrics and only emit metrics compatible with versions below Nomad
|
||||
0.7. Note that this option is used to transition monitoring to tagged
|
||||
metrics and will eventually be deprecated.
|
||||
|
||||
- `filter_default` `(bool: true)` - This controls whether to allow metrics that
|
||||
have not been specified by the filter. Defaults to true, which will allow all
|
||||
metrics when no filters are provided. When set to false with no filters, no
|
||||
metrics will be sent.
|
||||
|
||||
- `prefix_filter` `(list: [])` - This is a list of filter rules to apply for
|
||||
allowing/blocking metrics by prefix. A leading "<b>+</b>" will enable any
|
||||
metrics with the given prefix, and a leading "<b>-</b>" will block them. If
|
||||
|
|
Loading…
Reference in New Issue