Skip to content

Commit

Permalink
clean up feature gate references
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Boten <[email protected]>
  • Loading branch information
codeboten committed Jul 9, 2024
1 parent e4f7e8c commit 3d07cec
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
3 changes: 2 additions & 1 deletion internal/featuregates/featuregates.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ var StrictlyTypedInputGate = featuregate.GlobalRegistry().MustRegister(StrictlyT
)

var DisableOpenCensusBridge = featuregate.GlobalRegistry().MustRegister("service.disableOpenCensusBridge",
featuregate.StageBeta,
featuregate.StageStable,
featuregate.WithRegisterFromVersion("v0.105.0"),
featuregate.WithRegisterToVersion("v0.109.0"),
featuregate.WithRegisterDescription("`Disables the OpenCensus bridge meaning any component still using the OpenCensus SDK will no longer be able to produce telemetry."))
4 changes: 0 additions & 4 deletions service/internal/proctelemetry/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
sdkmetric "go.opentelemetry.io/otel/sdk/metric"
"go.opentelemetry.io/otel/sdk/resource"

"go.opentelemetry.io/collector/internal/featuregates"
"go.opentelemetry.io/collector/processor/processorhelper"
semconv "go.opentelemetry.io/collector/semconv/v1.18.0"
)
Expand Down Expand Up @@ -170,9 +169,6 @@ func initPrometheusExporter(prometheusConfig *config.Prometheus, asyncErrorChann
otelprom.WithNamespace("otelcol"),
otelprom.WithResourceAsConstantLabels(attribute.NewDenyKeysFilter()),
}
if !featuregates.DisableOpenCensusBridge.IsEnabled() {
opts = append(opts, otelprom.WithProducer(opencensus.NewMetricProducer()))
}
exporter, err := otelprom.New(opts...)
if err != nil {
return nil, nil, fmt.Errorf("error creating otel prometheus exporter: %w", err)
Expand Down
4 changes: 0 additions & 4 deletions service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"go.opentelemetry.io/collector/connector"
"go.opentelemetry.io/collector/exporter"
"go.opentelemetry.io/collector/extension"
"go.opentelemetry.io/collector/internal/featuregates"
"go.opentelemetry.io/collector/internal/localhostgate"
"go.opentelemetry.io/collector/internal/obsreportconfig"
"go.opentelemetry.io/collector/pdata/pcommon"
Expand Down Expand Up @@ -115,9 +114,6 @@ func New(ctx context.Context, set Settings, cfg Config) (*Service, error) {

logger.Info("Setting up own telemetry...")

if featuregates.DisableOpenCensusBridge.IsEnabled() {
logger.Info("OpenCensus bridge is disabled for Collector telemetry and will be removed in a future version, use --feature-gates=-service.disableOpenCensusBridge to re-enable")
}
mp, err := newMeterProvider(
meterProviderSettings{
res: res,
Expand Down

0 comments on commit 3d07cec

Please sign in to comment.