From 6efda36cf89fd84c1dec9872fb2af259efd0706b Mon Sep 17 00:00:00 2001 From: Vasi Vasireddy Date: Thu, 25 Apr 2024 22:55:25 -0700 Subject: [PATCH] Remove deprecated setting in collector and add https provider --- collector/VERSION | 2 +- collector/go.mod | 2 +- collector/internal/collector/collector.go | 29 ++++++++++--------- .../disablequeuedretryconverter/converter.go | 4 +-- 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/collector/VERSION b/collector/VERSION index 9e6528fe3e..30c6952ca6 100644 --- a/collector/VERSION +++ b/collector/VERSION @@ -1 +1 @@ -v0.91.0 +v0.98.0 diff --git a/collector/go.mod b/collector/go.mod index 3752f1ff46..f58fa40143 100644 --- a/collector/go.mod +++ b/collector/go.mod @@ -31,6 +31,7 @@ require ( go.opentelemetry.io/collector/confmap/provider/envprovider v0.98.0 go.opentelemetry.io/collector/confmap/provider/fileprovider v0.98.0 go.opentelemetry.io/collector/confmap/provider/httpprovider v0.98.0 + go.opentelemetry.io/collector/confmap/provider/httpsprovider v0.98.0 go.opentelemetry.io/collector/confmap/provider/yamlprovider v0.98.0 go.opentelemetry.io/collector/otelcol v0.98.0 go.uber.org/multierr v1.11.0 @@ -138,7 +139,6 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.98.0 // indirect go.opentelemetry.io/collector/config/configtls v0.98.0 // indirect go.opentelemetry.io/collector/config/internal v0.98.0 // indirect - go.opentelemetry.io/collector/confmap/provider/httpsprovider v0.98.0 // indirect go.opentelemetry.io/collector/connector v0.98.0 // indirect go.opentelemetry.io/collector/consumer v0.98.0 // indirect go.opentelemetry.io/collector/exporter v0.98.0 // indirect diff --git a/collector/internal/collector/collector.go b/collector/internal/collector/collector.go index 35aaa180de..aa16983157 100644 --- a/collector/internal/collector/collector.go +++ b/collector/internal/collector/collector.go @@ -26,6 +26,7 @@ import ( "go.opentelemetry.io/collector/confmap/provider/envprovider" "go.opentelemetry.io/collector/confmap/provider/fileprovider" "go.opentelemetry.io/collector/confmap/provider/httpprovider" + "go.opentelemetry.io/collector/confmap/provider/httpsprovider" "go.opentelemetry.io/collector/confmap/provider/yamlprovider" "go.opentelemetry.io/collector/otelcol" "go.uber.org/zap" @@ -38,13 +39,14 @@ import ( // Collector runs a single otelcol as a go routine within the // same process as the executor. type Collector struct { - factories otelcol.Factories - configProvider otelcol.ConfigProvider - svc *otelcol.Collector - appDone chan struct{} - stopped bool - logger *zap.Logger - version string + factories otelcol.Factories + configProvider otelcol.ConfigProvider + configProviderSettings otelcol.ConfigProviderSettings + svc *otelcol.Collector + appDone chan struct{} + stopped bool + logger *zap.Logger + version string } func getConfig(logger *zap.Logger) string { @@ -59,7 +61,7 @@ func getConfig(logger *zap.Logger) string { func NewCollector(logger *zap.Logger, factories otelcol.Factories, version string) *Collector { l := logger.Named("NewCollector") providerSettings := confmap.ProviderSettings{Logger: l} - providers := []confmap.Provider{fileprovider.NewWithSettings(providerSettings), envprovider.NewWithSettings(providerSettings), yamlprovider.NewWithSettings(providerSettings), httpprovider.NewWithSettings(providerSettings), s3provider.New()} + providers := []confmap.Provider{fileprovider.NewWithSettings(providerSettings), envprovider.NewWithSettings(providerSettings), yamlprovider.NewWithSettings(providerSettings), httpprovider.NewWithSettings(providerSettings), s3provider.New(), httpsprovider.NewWithSettings(providerSettings)} mapProvider := make(map[string]confmap.Provider, len(providers)) for _, provider := range providers { @@ -82,10 +84,11 @@ func NewCollector(logger *zap.Logger, factories otelcol.Factories, version strin } col := &Collector{ - factories: factories, - configProvider: cfgProvider, - logger: logger, - version: version, + factories: factories, + configProvider: cfgProvider, + configProviderSettings: cfgSet, + logger: logger, + version: version, } return col } @@ -97,7 +100,7 @@ func (c *Collector) Start(ctx context.Context) error { Description: "Lambda Collector", Version: c.version, }, - ConfigProvider: c.configProvider, + ConfigProviderSettings: c.configProviderSettings, Factories: func() (otelcol.Factories, error) { return c.factories, nil }, diff --git a/collector/internal/confmap/converter/disablequeuedretryconverter/converter.go b/collector/internal/confmap/converter/disablequeuedretryconverter/converter.go index 981cb4ca38..dd2331c59b 100644 --- a/collector/internal/confmap/converter/disablequeuedretryconverter/converter.go +++ b/collector/internal/confmap/converter/disablequeuedretryconverter/converter.go @@ -4,7 +4,7 @@ // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, @@ -57,8 +57,6 @@ var exporters = map[string]struct{}{ type converter struct { } - - // New returns a confmap.Converter, that ensures queued retry is disabled for all configured exporters. func New() confmap.Converter { return &converter{}