Skip to content

Commit

Permalink
Remove deprecated setting in collector and add https provider
Browse files Browse the repository at this point in the history
  • Loading branch information
vasireddy99 committed Apr 26, 2024
1 parent 441d0a5 commit 6efda36
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 18 deletions.
2 changes: 1 addition & 1 deletion collector/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.91.0
v0.98.0
2 changes: 1 addition & 1 deletion collector/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
29 changes: 16 additions & 13 deletions collector/internal/collector/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 {
Expand All @@ -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 {
Expand All @@ -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
}
Expand All @@ -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
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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{}
Expand Down

0 comments on commit 6efda36

Please sign in to comment.