diff --git a/pkg/otlp/model/translator/metrics_translator.go b/pkg/otlp/model/translator/metrics_translator.go index 2e35c20f08fc..ac9318842643 100644 --- a/pkg/otlp/model/translator/metrics_translator.go +++ b/pkg/otlp/model/translator/metrics_translator.go @@ -39,8 +39,8 @@ type Translator struct { // New creates a new translator with given options. func New(logger *zap.Logger, options ...Option) (*Translator, error) { cfg := translatorConfig{ - HistMode: HistogramModeNoBuckets, - SendCountSum: true, + HistMode: HistogramModeDistributions, + SendCountSum: false, Quantiles: false, SendMonotonic: true, ResourceAttributesAsTags: false, @@ -56,6 +56,10 @@ func New(logger *zap.Logger, options ...Option) (*Translator, error) { } } + if cfg.HistMode == HistogramModeNoBuckets && !cfg.SendCountSum { + return nil, fmt.Errorf("no buckets mode and no send count sum are incompatible") + } + cache := newTTLCache(cfg.sweepInterval, cfg.deltaTTL) return &Translator{cache, logger, cfg}, nil }