Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions pkg/beholder/meter_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package beholder

import (
sdkmetric "go.opentelemetry.io/otel/sdk/metric"
"go.opentelemetry.io/otel/sdk/metric/exemplar"

"github.com/smartcontractkit/chainlink-common/pkg/beholder/metricviews"
)
Expand All @@ -24,9 +25,9 @@ func (cfg Config) metricViews() []sdkmetric.View {
return append(cfg.MetricViews, metricviews.Default(cfg.MetricViewsDenyAttributes)...)
}

// metricOptions returns cfg-derived sdkmetric.Option values (metric views and the
// SDK per-instrument cardinality limit). Callers append reader/resource options
// at the call site.
// metricOptions returns the sdkmetric.Option values every Beholder meter
// provider gets: metric views, the per-instrument cardinality limit, and the
// exemplar filter. Callers append reader/resource options at the call site.
func (cfg Config) metricOptions() []sdkmetric.Option {
views := cfg.metricViews()
var opts []sdkmetric.Option
Expand All @@ -36,5 +37,8 @@ func (cfg Config) metricOptions() []sdkmetric.Option {
if cfg.MetricCardinalityLimit > 0 {
opts = append(opts, sdkmetric.WithCardinalityLimit(cfg.MetricCardinalityLimit))
}
// Exemplars are dropped at VictoriaMetrics ingestion (wontfix upstream);
// generating them only inflates every export.
opts = append(opts, sdkmetric.WithExemplarFilter(exemplar.AlwaysOffFilter))
return opts
}
Loading