diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index c6ed1e581c..dc9b0d7c12 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -50,7 +50,7 @@ env: DDB_TABLE_NAME: BatchTestCache MAX_JOBS: 110 BATCH_INCLUDED_SERVICES: EKS,ECS,EC2,EKS_ARM64,EKS_FARGATE - GO_VERSION: ~1.22.2 + GO_VERSION: ~1.22.3 concurrency: diff --git a/.github/workflows/PR-build.yml b/.github/workflows/PR-build.yml index aff929696b..a45aee0289 100644 --- a/.github/workflows/PR-build.yml +++ b/.github/workflows/PR-build.yml @@ -25,7 +25,7 @@ env: IMAGE_NAME: aws-otel-collector PACKAGING_ROOT: build/packages TESTING_FRAMEWORK_REPO: aws-observability/aws-otel-test-framework - GO_VERSION: ~1.22.2 + GO_VERSION: ~1.22.3 concurrency: group: pr-build-${{ github.event.pull_request.number }} diff --git a/.github/workflows/aws-resources-clean.yml b/.github/workflows/aws-resources-clean.yml index d5650e0f9d..1e2548c955 100644 --- a/.github/workflows/aws-resources-clean.yml +++ b/.github/workflows/aws-resources-clean.yml @@ -24,7 +24,7 @@ on: default: "3" env: DAYS_TO_KEEP: 3 - GO_VERSION: ~1.22.2 + GO_VERSION: ~1.22.3 permissions: id-token: write diff --git a/.github/workflows/canary.yml b/.github/workflows/canary.yml index d75c05b3e5..5642777587 100644 --- a/.github/workflows/canary.yml +++ b/.github/workflows/canary.yml @@ -57,7 +57,7 @@ jobs: - name: Set up Go 1.x uses: actions/setup-go@v5 with: - go-version: '~1.22.2' + go-version: '~1.22.3' cache-dependency-path: testing-framework/cmd/aotutil/go.sum - name: Build aotutil run: cd testing-framework/cmd/aotutil && make build diff --git a/.github/workflows/perf.yml b/.github/workflows/perf.yml index 3aaa27c207..f83d97a64c 100644 --- a/.github/workflows/perf.yml +++ b/.github/workflows/perf.yml @@ -27,7 +27,7 @@ env: COMMIT_USER: Github Actions COMMIT_EMAIL: actions@github.com TESTING_FRAMEWORK_REPO: aws-observability/aws-otel-test-framework - GO_VERSION: ~1.22.2 + GO_VERSION: ~1.22.3 permissions: id-token: write diff --git a/.github/workflows/prod-image-mirror.yml b/.github/workflows/prod-image-mirror.yml index f21602973f..acc2a33d2c 100644 --- a/.github/workflows/prod-image-mirror.yml +++ b/.github/workflows/prod-image-mirror.yml @@ -29,7 +29,7 @@ jobs: - name: Set up Go 1.x uses: actions/setup-go@v5 with: - go-version: ~1.22.2 + go-version: ~1.22.3 - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v4 diff --git a/README.md b/README.md index e099469be7..9551bca382 100644 --- a/README.md +++ b/README.md @@ -18,14 +18,9 @@ Use the community resources below for getting help with the ADOT Collector. * If you think you may have found a bug, open a [bug report](https://github.com/aws-observability/aws-otel-collector/issues/new?template=bug_report.md). * For contributing guidelines, refer to [CONTRIBUTING.md](CONTRIBUTING.md). -### Notice: ADOT Collector v0.35.0 Breaking Change -Users of the `statsd` receiver, please refer to GitHub Issue - [Warning: StatsD Receiver → EMF Exporter Metric Pipeline Breaking Change](https://github.com/aws-observability/aws-otel-collector/issues/2249) -for information on a breaking change. - -### Notices: ADOT Collector v0.35.0 Breaking Changes -* Users of the 'awscontainerinsightreceiver', please refer to the GitHub Issue - [Warning: Container Image Default User Change → Important consideration for AWSContainerInsightReceiver](https://github.com/aws-observability/aws-otel-collector/issues/2317) for more information on an upcoming breaking change. -* Users of the `prometheus` or `prometheusremotewrite` exporters please refer to the GitHub Issue [Warning: ADOT Collector v0.35.0 breaking change](https://github.com/aws-observability/aws-otel-collector/issues/2367) -for information on an upcoming breaking change. +### Notice: ADOT Collector v0.41.0 Breaking Changes +* Users of the `datadog`, `logzio`, `sapm`, `signalfx` exporter components. please refer to [Attention: ADOT Collector v0.41.0 breaking changes - third party exporters deprecation](https://github.com/aws-observability/aws-otel-collector/issues/2734) + for more information on an upcoming breaking change . #### ADOT Collector Built-in Components diff --git a/cmd/awscollector/main.go b/cmd/awscollector/main.go index 1b8ad2e6e5..f75089b3ed 100644 --- a/cmd/awscollector/main.go +++ b/cmd/awscollector/main.go @@ -52,6 +52,11 @@ func main() { log.Printf("found no extra config, skip it, err: %v", err) } + // TODO : Remove after v0.41.0 release + log.Printf("attn: users of the `datadog`, `logzio`, `sapm`, `signalfx` exporter components. please refer to " + + "https://github.com/aws-observability/aws-otel-collector/issues/2734 in regards to an ADOT Collector v0.41.0 " + + "breaking change") + logger.SetupErrorLogger() // set the collector config from extracfg file @@ -71,10 +76,10 @@ func main() { } params := otelcol.CollectorSettings{ - Factories: defaultcomponents.Components, - BuildInfo: info, - LoggingOptions: []zap.Option{logger.WrapCoreOpt()}, - ConfigProvider: config.GetConfigProvider(flagSet), + Factories: defaultcomponents.Components, + BuildInfo: info, + LoggingOptions: []zap.Option{logger.WrapCoreOpt()}, + ConfigProviderSettings: config.GetConfigProviderSettings(flagSet), } if err = run(params, flagSet); err != nil { diff --git a/docs/releases/v0.39.0.md b/docs/releases/v0.39.0.md index 42d6d4135b..177e9fa997 100644 --- a/docs/releases/v0.39.0.md +++ b/docs/releases/v0.39.0.md @@ -7,6 +7,7 @@ **Merged pull requests:** - Bump OTel collector to `v0.98.0` [\#2724](https://github.com/aws-observability/aws-otel-collector/pull/2724) ([vasireddy99](https://github.com/vasireddy99)) - +- Revert Signalfx exporter commit for send_otlp_histograms [\#2729](https://github.com/aws-observability/aws-otel-collector/pull/2729) ([vasireddy99](https://github.com/vasireddy99)) +- Add third Party components behind featuregate [\#2735](https://github.com/aws-observability/aws-otel-collector/pull/2735) ([vasireddy99](https://github.com/vasireddy99)) \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)* diff --git a/pkg/config/config_factory.go b/pkg/config/config_factory.go index 1a0623a738..80a37403d3 100644 --- a/pkg/config/config_factory.go +++ b/pkg/config/config_factory.go @@ -17,7 +17,6 @@ package config import ( "flag" - "log" "os" "github.com/open-telemetry/opentelemetry-collector-contrib/confmap/provider/s3provider" @@ -35,7 +34,7 @@ const ( envKey = "AOT_CONFIG_CONTENT" ) -func GetConfigProvider(flags *flag.FlagSet) otelcol.ConfigProvider { +func GetConfigProviderSettings(flags *flag.FlagSet) otelcol.ConfigProviderSettings { // aws-otel-collector supports loading yaml config from Env Var // including SSM parameter store for ECS use case loc := getConfigFlag(flags) @@ -59,7 +58,7 @@ func GetConfigProvider(flags *flag.FlagSet) otelcol.ConfigProvider { } // create Config Provider Settings - settings := otelcol.ConfigProviderSettings{ + configProviderSettings := otelcol.ConfigProviderSettings{ ResolverSettings: confmap.ResolverSettings{ URIs: loc, Providers: mapProviders, @@ -67,12 +66,5 @@ func GetConfigProvider(flags *flag.FlagSet) otelcol.ConfigProvider { }, } - // get New config Provider - config_provider, err := otelcol.NewConfigProvider(settings) - - if err != nil { - log.Panicf("Err on creating Config Provider: %v\n", err) - } - - return config_provider + return configProviderSettings } diff --git a/pkg/config/config_factory_test.go b/pkg/config/config_factory_test.go index f755fb3a77..d47b12fb96 100644 --- a/pkg/config/config_factory_test.go +++ b/pkg/config/config_factory_test.go @@ -17,6 +17,7 @@ package config import ( "context" "fmt" + "log" "os" "path/filepath" "testing" @@ -55,7 +56,11 @@ func TestGetCfgFactoryConfig(t *testing.T) { "--config=invalid-path/otelcol-config.yaml", }) require.NoError(t, err) - provider := GetConfigProvider(flagSet) + + provider, err := otelcol.NewConfigProvider(GetConfigProviderSettings(flagSet)) + if err != nil { + log.Panicf("Err on creating Config Provider: %v\n", err) + } _, err = provider.Get(context.Background(), factories) require.Error(t, err) }) @@ -76,7 +81,10 @@ func TestGetCfgFactoryConfig(t *testing.T) { fmt.Sprintf("--config=%s", getValidTestConfigPath()), }) require.NoError(t, err) - provider := GetConfigProvider(flagSet) + provider, err := otelcol.NewConfigProvider(GetConfigProviderSettings(flagSet)) + if err != nil { + log.Panicf("Err on creating Config Provider: %v\n", err) + } cfg, err := provider.Get(context.Background(), factories) require.NoError(t, err) require.NotNil(t, cfg) @@ -97,7 +105,10 @@ func TestGetCfgFactoryConfig(t *testing.T) { fmt.Sprintf("--config=%s", getValidTestConfigPath()), }) require.NoError(t, err) - provider := GetConfigProvider(flagSet) + provider, err := otelcol.NewConfigProvider(GetConfigProviderSettings(flagSet)) + if err != nil { + log.Panicf("Err on creating Config Provider: %v\n", err) + } cfg, err := provider.Get(context.Background(), factories) require.NoError(t, err) require.NotNil(t, cfg) @@ -114,7 +125,10 @@ func TestGetMapProviderContainer(t *testing.T) { t.Setenv(envKey, "extensions:\n health_check:\n pprof:\n endpoint: '${PPROF_ENDPOINT}'\nreceivers:\n otlp:\n protocols:\n grpc:\n endpoint: 0.0.0.0:4317\nprocessors:\n batch:\nexporters:\n logging:\n loglevel: debug\n awsxray:\n local_mode: true\n region: 'us-west-2'\n awsemf:\n region: 'us-west-2'\nservice:\n pipelines:\n traces:\n receivers: [otlp]\n exporters: [logging,awsxray]\n metrics:\n receivers: [otlp]\n exporters: [awsemf]\n extensions: [pprof]") factories, _ := defaultcomponents.Components() - provider := GetConfigProvider(Flags(featuregate.NewRegistry())) + provider, err := otelcol.NewConfigProvider(GetConfigProviderSettings(Flags(featuregate.NewRegistry()))) + if err != nil { + log.Panicf("Err on creating Config Provider: %v\n", err) + } cfg, err := provider.Get(context.Background(), factories) require.NoError(t, err) require.NotNil(t, cfg) diff --git a/pkg/defaultcomponents/defaults.go b/pkg/defaultcomponents/defaults.go index cc625fb105..8146a1b794 100644 --- a/pkg/defaultcomponents/defaults.go +++ b/pkg/defaultcomponents/defaults.go @@ -63,6 +63,7 @@ import ( "go.opentelemetry.io/collector/extension" "go.opentelemetry.io/collector/extension/ballastextension" "go.opentelemetry.io/collector/extension/zpagesextension" + "go.opentelemetry.io/collector/featuregate" "go.opentelemetry.io/collector/otelcol" "go.opentelemetry.io/collector/processor" "go.opentelemetry.io/collector/processor/batchprocessor" @@ -72,6 +73,22 @@ import ( "go.uber.org/multierr" ) +var datadogExporterFeatureGateDeprecation = featuregate.GlobalRegistry().MustRegister("adot.exporter.datadogexporter.deprecation", + featuregate.StageAlpha, + featuregate.WithRegisterDescription("Removes the Datadog exporter from the set of configurable exporters ")) + +var logzioExporterFeatureGateDeprecation = featuregate.GlobalRegistry().MustRegister("adot.exporter.logzioexporter.deprecation", + featuregate.StageAlpha, + featuregate.WithRegisterDescription("Removes the Logzio Exporter from the set of configurable exporters ")) + +var sapmExporterFeatureGateDeprecation = featuregate.GlobalRegistry().MustRegister("adot.exporter.sapmexporter.deprecation", + featuregate.StageAlpha, + featuregate.WithRegisterDescription("Removes the SAPM Exporter from the set of configurable exporters")) + +var signalfxExporterFeatureGateDeprecation = featuregate.GlobalRegistry().MustRegister("adot.exporter.signalfxexporter.deprecation", + featuregate.StageAlpha, + featuregate.WithRegisterDescription("Removes the SignalFx Metrics Exporter from the set of configurable exporters")) + // Components register OTel components for ADOT-collector distribution func Components() (otelcol.Factories, error) { var errs error @@ -141,10 +158,6 @@ func Components() (otelcol.Factories, error) { prometheusexporter.NewFactory(), fileexporter.NewFactory(), kafkaexporter.NewFactory(), - sapmexporter.NewFactory(), - signalfxexporter.NewFactory(), - datadogexporter.NewFactory(), - logzioexporter.NewFactory(), loggingexporter.NewFactory(), otlpexporter.NewFactory(), otlphttpexporter.NewFactory(), @@ -152,6 +165,18 @@ func Components() (otelcol.Factories, error) { loadbalancingexporter.NewFactory(), awscloudwatchlogsexporter.NewFactory(), } + if !datadogExporterFeatureGateDeprecation.IsEnabled() { + exporterList = append(exporterList, datadogexporter.NewFactory()) + } + if !logzioExporterFeatureGateDeprecation.IsEnabled() { + exporterList = append(exporterList, logzioexporter.NewFactory()) + } + if !sapmExporterFeatureGateDeprecation.IsEnabled() { + exporterList = append(exporterList, sapmexporter.NewFactory()) + } + if !signalfxExporterFeatureGateDeprecation.IsEnabled() { + exporterList = append(exporterList, signalfxexporter.NewFactory()) + } exporters, err := exporter.MakeFactoryMap(exporterList...) diff --git a/pkg/defaultcomponents/defaults_test.go b/pkg/defaultcomponents/defaults_test.go index 052820d1b0..0504eecb27 100644 --- a/pkg/defaultcomponents/defaults_test.go +++ b/pkg/defaultcomponents/defaults_test.go @@ -17,6 +17,7 @@ package defaultcomponents import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/featuregate" "testing" "github.com/stretchr/testify/assert" @@ -44,11 +45,7 @@ func TestComponents(t *testing.T) { assert.NotNil(t, exporters[component.MustNewType("otlphttp")]) // other exporters assert.NotNil(t, exporters[component.MustNewType("file")]) - assert.NotNil(t, exporters[component.MustNewType("datadog")]) assert.NotNil(t, exporters[component.MustNewType("prometheus")]) - assert.NotNil(t, exporters[component.MustNewType("sapm")]) - assert.NotNil(t, exporters[component.MustNewType("signalfx")]) - assert.NotNil(t, exporters[component.MustNewType("logzio")]) assert.NotNil(t, exporters[component.MustNewType("prometheusremotewrite")]) assert.NotNil(t, exporters[component.MustNewType("kafka")]) assert.NotNil(t, exporters[component.MustNewType("loadbalancing")]) @@ -105,4 +102,56 @@ func TestComponents(t *testing.T) { assert.NotNil(t, processors[component.MustNewType("groupbytrace")]) assert.NotNil(t, processors[component.MustNewType("tail_sampling")]) assert.NotNil(t, processors[component.MustNewType("k8sattributes")]) + + // Ensure that the components behind feature gates are included + assert.NotNil(t, exporters[component.MustNewType("datadog")]) + assert.NotNil(t, exporters[component.MustNewType("sapm")]) + assert.NotNil(t, exporters[component.MustNewType("signalfx")]) + assert.NotNil(t, exporters[component.MustNewType("logzio")]) +} + +func TestEnableFeatureGate(t *testing.T) { + + testCases := []struct { + desc string + featureName string + component component.Type + }{ + { + desc: "disable datadog exporter", + featureName: "adot.exporter.datadogexporter.deprecation", + component: component.MustNewType("datadog"), + }, + { + desc: "disable logzio exporter", + featureName: "adot.exporter.logzioexporter.deprecation", + component: component.MustNewType("logzio"), + }, + { + desc: "disable sapm exporter", + featureName: "adot.exporter.sapmexporter.deprecation", + component: component.MustNewType("sapm"), + }, + { + desc: "disable signalfx exporter", + featureName: "adot.exporter.signalfxexporter.deprecation", + component: component.MustNewType("signalfx"), + }, + } + expectedLen := exportersCount + + for _, tc := range testCases { + expectedLen-- + t.Run(tc.desc, func(t *testing.T) { + err := featuregate.GlobalRegistry().Set(tc.featureName, true) + assert.NoError(t, err) + + factories, err := Components() + assert.NoError(t, err) + + exporters := factories.Exporters + assert.Len(t, exporters, expectedLen) + assert.Nil(t, exporters[tc.component]) + }) + } }