From c696fec155e71f224122970b6e35fc830194a39b Mon Sep 17 00:00:00 2001 From: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com> Date: Wed, 5 Apr 2023 16:49:39 -0600 Subject: [PATCH] [processor/cumulativetodelta] Remove stable gate (#20717) * Remove stable gate * changelog * Go mod tidy --- .chloggen/ctd-remove-gate.yaml | 16 ++++++++++ processor/cumulativetodeltaprocessor/go.mod | 2 +- .../cumulativetodeltaprocessor/processor.go | 31 +++++-------------- 3 files changed, 25 insertions(+), 24 deletions(-) create mode 100755 .chloggen/ctd-remove-gate.yaml diff --git a/.chloggen/ctd-remove-gate.yaml b/.chloggen/ctd-remove-gate.yaml new file mode 100755 index 000000000000..d2e34f822d39 --- /dev/null +++ b/.chloggen/ctd-remove-gate.yaml @@ -0,0 +1,16 @@ +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: breaking + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: cumulativetodeltaprocessor + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Removes stable `processor.cumulativetodeltaprocessor.EnableHistogramSupport` feature gate. Setting this gate will cause an error. + +# One or more tracking issues related to the change +issues: [20717] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: diff --git a/processor/cumulativetodeltaprocessor/go.mod b/processor/cumulativetodeltaprocessor/go.mod index 0d9e67f34af8..f629a0df42d2 100644 --- a/processor/cumulativetodeltaprocessor/go.mod +++ b/processor/cumulativetodeltaprocessor/go.mod @@ -10,7 +10,6 @@ require ( go.opentelemetry.io/collector/component v0.75.0 go.opentelemetry.io/collector/confmap v0.75.0 go.opentelemetry.io/collector/consumer v0.75.0 - go.opentelemetry.io/collector/featuregate v0.75.0 go.opentelemetry.io/collector/pdata v1.0.0-rc9 go.uber.org/zap v1.24.0 ) @@ -31,6 +30,7 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect go.opencensus.io v0.24.0 // indirect + go.opentelemetry.io/collector/featuregate v0.75.0 // indirect go.opentelemetry.io/otel v1.14.0 // indirect go.opentelemetry.io/otel/metric v0.37.0 // indirect go.opentelemetry.io/otel/trace v1.14.0 // indirect diff --git a/processor/cumulativetodeltaprocessor/processor.go b/processor/cumulativetodeltaprocessor/processor.go index fab00b77d6b7..f0e2e6b4f787 100644 --- a/processor/cumulativetodeltaprocessor/processor.go +++ b/processor/cumulativetodeltaprocessor/processor.go @@ -18,7 +18,6 @@ import ( "context" "math" - "go.opentelemetry.io/collector/featuregate" "go.opentelemetry.io/collector/pdata/pmetric" "go.uber.org/zap" @@ -26,30 +25,20 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/processor/cumulativetodeltaprocessor/internal/tracking" ) -var enableHistogramSupportGate = featuregate.GlobalRegistry().MustRegister( - "processor.cumulativetodeltaprocessor.EnableHistogramSupport", - featuregate.StageStable, - featuregate.WithRegisterDescription("Enables histogram conversion support"), - featuregate.WithRegisterReferenceURL("https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/15658"), - featuregate.WithRegisterRemovalVersion("v0.68.0"), -) - type cumulativeToDeltaProcessor struct { - includeFS filterset.FilterSet - excludeFS filterset.FilterSet - logger *zap.Logger - deltaCalculator *tracking.MetricTracker - cancelFunc context.CancelFunc - histogramSupportEnabled bool + includeFS filterset.FilterSet + excludeFS filterset.FilterSet + logger *zap.Logger + deltaCalculator *tracking.MetricTracker + cancelFunc context.CancelFunc } func newCumulativeToDeltaProcessor(config *Config, logger *zap.Logger) *cumulativeToDeltaProcessor { ctx, cancel := context.WithCancel(context.Background()) p := &cumulativeToDeltaProcessor{ - logger: logger, - deltaCalculator: tracking.NewMetricTracker(ctx, logger, config.MaxStaleness), - cancelFunc: cancel, - histogramSupportEnabled: enableHistogramSupportGate.IsEnabled(), + logger: logger, + deltaCalculator: tracking.NewMetricTracker(ctx, logger, config.MaxStaleness), + cancelFunc: cancel, } if len(config.Include.Metrics) > 0 { p.includeFS, _ = filterset.CreateFilterSet(config.Include.Metrics, &config.Include.Config) @@ -92,10 +81,6 @@ func (ctdp *cumulativeToDeltaProcessor) processMetrics(_ context.Context, md pme ms.SetAggregationTemporality(pmetric.AggregationTemporalityDelta) return ms.DataPoints().Len() == 0 case pmetric.MetricTypeHistogram: - if !ctdp.histogramSupportEnabled { - return false - } - ms := m.Histogram() if ms.AggregationTemporality() != pmetric.AggregationTemporalityCumulative { return false