Skip to content

Commit

Permalink
[chore] Remove use of deprecated ConfigProvider (#33323)
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerHelmuth authored May 31, 2024
1 parent f1a07c9 commit 6005ae8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 27 deletions.
12 changes: 4 additions & 8 deletions exporter/datadogexporter/integrationtest/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,18 +271,14 @@ func getIntegrationTestCollector(t *testing.T, cfgStr string, url string, factor
_, err = otelcoltest.LoadConfigAndValidate(confFile.Name(), factories)
require.NoError(t, err, "All yaml config must be valid.")

configProvider, err := otelcol.NewConfigProvider(
otelcol.ConfigProviderSettings{
appSettings := otelcol.CollectorSettings{
Factories: func() (otelcol.Factories, error) { return factories, nil },
ConfigProviderSettings: otelcol.ConfigProviderSettings{
ResolverSettings: confmap.ResolverSettings{
URIs: []string{confFile.Name()},
ProviderFactories: []confmap.ProviderFactory{fileprovider.NewFactory()},
},
})
require.NoError(t, err)

appSettings := otelcol.CollectorSettings{
Factories: func() (otelcol.Factories, error) { return factories, nil },
ConfigProvider: configProvider,
},
BuildInfo: component.BuildInfo{
Command: "otelcol",
Description: "OpenTelemetry Collector",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,18 +146,14 @@ service:
Processors: processors,
}

configProvider, err := otelcol.NewConfigProvider(
otelcol.ConfigProviderSettings{
appSettings := otelcol.CollectorSettings{
Factories: func() (otelcol.Factories, error) { return factories, nil },
ConfigProviderSettings: otelcol.ConfigProviderSettings{
ResolverSettings: confmap.ResolverSettings{
URIs: []string{confFile.Name()},
ProviderFactories: []confmap.ProviderFactory{fileprovider.NewFactory()},
},
})
require.NoError(t, err)

appSettings := otelcol.CollectorSettings{
Factories: func() (otelcol.Factories, error) { return factories, nil },
ConfigProvider: configProvider,
},
BuildInfo: component.BuildInfo{
Command: "otelcol",
Description: "OpenTelemetry Collector",
Expand Down
16 changes: 5 additions & 11 deletions testbed/testbed/in_process_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,15 @@ func (ipp *inProcessCollector) Start(_ StartParams) error {
}
ipp.configFile = confFile.Name()

configProvider, err := otelcol.NewConfigProvider(
otelcol.ConfigProviderSettings{
settings := otelcol.CollectorSettings{
BuildInfo: component.NewDefaultBuildInfo(),
Factories: func() (otelcol.Factories, error) { return ipp.factories, nil },
ConfigProviderSettings: otelcol.ConfigProviderSettings{
ResolverSettings: confmap.ResolverSettings{
URIs: []string{ipp.configFile},
ProviderFactories: []confmap.ProviderFactory{fileprovider.NewFactory()},
},
})
if err != nil {
return err
}

settings := otelcol.CollectorSettings{
BuildInfo: component.NewDefaultBuildInfo(),
Factories: func() (otelcol.Factories, error) { return ipp.factories, nil },
ConfigProvider: configProvider,
},
SkipSettingGRPCLogger: true,
}

Expand Down

0 comments on commit 6005ae8

Please sign in to comment.