Skip to content

Commit

Permalink
Remove WithOptions from WithOptions prefix from deprecated
Browse files Browse the repository at this point in the history
Signed-off-by: Bogdan Drutu <[email protected]>
  • Loading branch information
bogdandrutu committed Oct 4, 2024
1 parent ef1b0bd commit ef7be4a
Show file tree
Hide file tree
Showing 48 changed files with 79 additions and 79 deletions.
4 changes: 2 additions & 2 deletions exporter/coralogixexporter/logs_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ type logsExporter struct {
func (e *logsExporter) start(ctx context.Context, host component.Host) (err error) {
switch {
case !isEmpty(e.config.Logs.Endpoint):
if e.clientConn, err = e.config.Logs.ToClientConnWithOptions(ctx, host, e.settings, configgrpc.WithGrpcDialOption(grpc.WithUserAgent(e.userAgent))); err != nil {
if e.clientConn, err = e.config.Logs.ToClientConn(ctx, host, e.settings, configgrpc.WithGrpcDialOption(grpc.WithUserAgent(e.userAgent))); err != nil {
return err
}
case !isEmpty(e.config.Domain):

if e.clientConn, err = e.config.getDomainGrpcSettings().ToClientConnWithOptions(ctx, host, e.settings, configgrpc.WithGrpcDialOption(grpc.WithUserAgent(e.userAgent))); err != nil {
if e.clientConn, err = e.config.getDomainGrpcSettings().ToClientConn(ctx, host, e.settings, configgrpc.WithGrpcDialOption(grpc.WithUserAgent(e.userAgent))); err != nil {
return err
}
}
Expand Down
4 changes: 2 additions & 2 deletions exporter/coralogixexporter/metrics_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ func (e *metricsExporter) start(ctx context.Context, host component.Host) (err e

switch {
case !isEmpty(e.config.Metrics.Endpoint):
if e.clientConn, err = e.config.Metrics.ToClientConnWithOptions(ctx, host, e.settings, configgrpc.WithGrpcDialOption(grpc.WithUserAgent(e.userAgent))); err != nil {
if e.clientConn, err = e.config.Metrics.ToClientConn(ctx, host, e.settings, configgrpc.WithGrpcDialOption(grpc.WithUserAgent(e.userAgent))); err != nil {
return err
}
case !isEmpty(e.config.Domain):
if e.clientConn, err = e.config.getDomainGrpcSettings().ToClientConnWithOptions(ctx, host, e.settings, configgrpc.WithGrpcDialOption(grpc.WithUserAgent(e.userAgent))); err != nil {
if e.clientConn, err = e.config.getDomainGrpcSettings().ToClientConn(ctx, host, e.settings, configgrpc.WithGrpcDialOption(grpc.WithUserAgent(e.userAgent))); err != nil {
return err
}
}
Expand Down
4 changes: 2 additions & 2 deletions exporter/coralogixexporter/traces_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ func (e *tracesExporter) start(ctx context.Context, host component.Host) (err er

switch {
case !isEmpty(e.config.Traces.Endpoint):
if e.clientConn, err = e.config.Traces.ToClientConnWithOptions(ctx, host, e.settings, configgrpc.WithGrpcDialOption(grpc.WithUserAgent(e.userAgent))); err != nil {
if e.clientConn, err = e.config.Traces.ToClientConn(ctx, host, e.settings, configgrpc.WithGrpcDialOption(grpc.WithUserAgent(e.userAgent))); err != nil {
return err
}
case !isEmpty(e.config.Domain):
if e.clientConn, err = e.config.getDomainGrpcSettings().ToClientConnWithOptions(ctx, host, e.settings, configgrpc.WithGrpcDialOption(grpc.WithUserAgent(e.userAgent))); err != nil {
if e.clientConn, err = e.config.getDomainGrpcSettings().ToClientConn(ctx, host, e.settings, configgrpc.WithGrpcDialOption(grpc.WithUserAgent(e.userAgent))); err != nil {
return err
}
}
Expand Down
2 changes: 1 addition & 1 deletion exporter/opencensusexporter/opencensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func newOcExporter(_ context.Context, cfg *Config, settings component.TelemetryS

// start creates the gRPC client Connection
func (oce *ocExporter) start(ctx context.Context, host component.Host) error {
clientConn, err := oce.cfg.ClientConfig.ToClientConnWithOptions(ctx, host, oce.settings)
clientConn, err := oce.cfg.ClientConfig.ToClientConn(ctx, host, oce.settings)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion exporter/otelarrowexporter/otelarrow.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func (e *baseExporter) start(ctx context.Context, host component.Host) (err erro
dialOpts = append(dialOpts, configgrpc.WithGrpcDialOption(opt))
}

if e.clientConn, err = e.config.ClientConfig.ToClientConnWithOptions(ctx, host, e.settings.TelemetrySettings, dialOpts...); err != nil {
if e.clientConn, err = e.config.ClientConfig.ToClientConn(ctx, host, e.settings.TelemetrySettings, dialOpts...); err != nil {
return err
}
e.traceExporter = ptraceotlp.NewGRPCClient(e.clientConn)
Expand Down
2 changes: 1 addition & 1 deletion extension/healthcheckv2extension/internal/grpc/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func NewServer(
// Start implements the component.Component interface.
func (s *Server) Start(ctx context.Context, host component.Host) error {
var err error
s.grpcServer, err = s.config.ToServerWithOptions(ctx, host, s.telemetry)
s.grpcServer, err = s.config.ToServer(ctx, host, s.telemetry)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion extension/jaegerremotesampling/extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (jrse *jrsExtension) Start(ctx context.Context, host component.Host) error
}

if jrse.cfg.Source.Remote != nil {
conn, err := jrse.cfg.Source.Remote.ToClientConnWithOptions(ctx, host, jrse.telemetry)
conn, err := jrse.cfg.Source.Remote.ToClientConn(ctx, host, jrse.telemetry)
if err != nil {
return fmt.Errorf("failed to create the remote strategy store: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion extension/jaegerremotesampling/internal/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ type SamplingGRPCServer struct {
}

func (s *SamplingGRPCServer) Start(ctx context.Context, host component.Host) error {
server, err := s.settings.ToServerWithOptions(ctx, host, s.telemetry)
server, err := s.settings.ToServer(ctx, host, s.telemetry)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion extension/solarwindsapmsettingsextension/extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (extension *solarwindsapmSettingsExtension) Start(_ context.Context, host c
if err != nil {
return err
}
extension.conn, err = extension.config.ClientConfig.ToClientConnWithOptions(ctx, host, extension.telemetrySettings, configgrpc.WithGrpcDialOption(grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{RootCAs: systemCertPool}))))
extension.conn, err = extension.config.ClientConfig.ToClientConn(ctx, host, extension.telemetrySettings, configgrpc.WithGrpcDialOption(grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{RootCAs: systemCertPool}))))
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion internal/splunk/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ require (
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
go.opentelemetry.io/collector/component v0.110.1-0.20241004063257-d6cd5935eefc // indirect
go.opentelemetry.io/collector/component/componentprofiles v0.110.0 // indirect
go.opentelemetry.io/collector/component/componentprofiles v0.110.1-0.20241004063257-d6cd5935eefc // indirect
go.opentelemetry.io/collector/config/configretry v1.16.1-0.20241004063257-d6cd5935eefc // indirect
go.opentelemetry.io/collector/config/configtelemetry v0.110.1-0.20241004063257-d6cd5935eefc // indirect
go.opentelemetry.io/collector/consumer/consumerprofiles v0.110.1-0.20241004063257-d6cd5935eefc // indirect
Expand Down
4 changes: 2 additions & 2 deletions internal/splunk/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/datadog/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ require (
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rs/cors v1.11.1 // indirect
go.opentelemetry.io/collector/client v1.16.1-0.20241004063257-d6cd5935eefc // indirect
go.opentelemetry.io/collector/component/componentprofiles v0.110.0 // indirect
go.opentelemetry.io/collector/component/componentprofiles v0.110.1-0.20241004063257-d6cd5935eefc // indirect
go.opentelemetry.io/collector/config/configcompression v1.16.1-0.20241004063257-d6cd5935eefc // indirect
go.opentelemetry.io/collector/config/configtelemetry v0.110.1-0.20241004063257-d6cd5935eefc // indirect
go.opentelemetry.io/collector/config/internal v0.110.1-0.20241004063257-d6cd5935eefc // indirect
Expand Down
4 changes: 2 additions & 2 deletions pkg/datadog/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions processor/attributesprocessor/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func createTracesProcessor(
if err != nil {
return nil, err
}
return processorhelper.NewTracesProcessor(
return processorhelper.NewTraces(
ctx,
set,
cfg,
Expand All @@ -77,7 +77,7 @@ func createLogsProcessor(
return nil, err
}

return processorhelper.NewLogsProcessor(
return processorhelper.NewLogs(
ctx,
set,
cfg,
Expand Down Expand Up @@ -107,7 +107,7 @@ func createMetricsProcessor(
return nil, err
}

return processorhelper.NewMetricsProcessor(
return processorhelper.NewMetrics(
ctx,
set,
cfg,
Expand Down
2 changes: 1 addition & 1 deletion processor/coralogixprocessor/span.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func newCoralogixProcessor(ctx context.Context, set processor.Settings, cfg *Con
config: cfg,
}

return processorhelper.NewTracesProcessor(ctx,
return processorhelper.NewTraces(ctx,
set,
cfg,
nextConsumer,
Expand Down
2 changes: 1 addition & 1 deletion processor/cumulativetodeltaprocessor/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func createMetricsProcessor(

metricsProcessor := newCumulativeToDeltaProcessor(processorConfig, set.Logger)

return processorhelper.NewMetricsProcessor(
return processorhelper.NewMetrics(
ctx,
set,
cfg,
Expand Down
2 changes: 1 addition & 1 deletion processor/deltatorateprocessor/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func createMetricsProcessor(

metricsProcessor := newDeltaToRateProcessor(processorConfig, set.Logger)

return processorhelper.NewMetricsProcessor(
return processorhelper.NewMetrics(
ctx,
set,
cfg,
Expand Down
6 changes: 3 additions & 3 deletions processor/filterprocessor/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func createMetricsProcessor(
if err != nil {
return nil, err
}
return processorhelper.NewMetricsProcessor(
return processorhelper.NewMetrics(
ctx,
set,
cfg,
Expand All @@ -63,7 +63,7 @@ func createLogsProcessor(
if err != nil {
return nil, err
}
return processorhelper.NewLogsProcessor(
return processorhelper.NewLogs(
ctx,
set,
cfg,
Expand All @@ -82,7 +82,7 @@ func createTracesProcessor(
if err != nil {
return nil, err
}
return processorhelper.NewTracesProcessor(
return processorhelper.NewTraces(
ctx,
set,
cfg,
Expand Down
6 changes: 3 additions & 3 deletions processor/geoipprocessor/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func createMetricsProcessor(ctx context.Context, set processor.Settings, cfg com
if err != nil {
return nil, err
}
return processorhelper.NewMetricsProcessor(ctx, set, cfg, nextConsumer, newGeoIPProcessor(geoCfg, defaultResourceAttributes, providers, set).processMetrics, processorhelper.WithCapabilities(processorCapabilities))
return processorhelper.NewMetrics(ctx, set, cfg, nextConsumer, newGeoIPProcessor(geoCfg, defaultResourceAttributes, providers, set).processMetrics, processorhelper.WithCapabilities(processorCapabilities))
}

func createTracesProcessor(ctx context.Context, set processor.Settings, cfg component.Config, nextConsumer consumer.Traces) (processor.Traces, error) {
Expand All @@ -98,7 +98,7 @@ func createTracesProcessor(ctx context.Context, set processor.Settings, cfg comp
if err != nil {
return nil, err
}
return processorhelper.NewTracesProcessor(ctx, set, cfg, nextConsumer, newGeoIPProcessor(geoCfg, defaultResourceAttributes, providers, set).processTraces, processorhelper.WithCapabilities(processorCapabilities))
return processorhelper.NewTraces(ctx, set, cfg, nextConsumer, newGeoIPProcessor(geoCfg, defaultResourceAttributes, providers, set).processTraces, processorhelper.WithCapabilities(processorCapabilities))
}

func createLogsProcessor(ctx context.Context, set processor.Settings, cfg component.Config, nextConsumer consumer.Logs) (processor.Logs, error) {
Expand All @@ -107,5 +107,5 @@ func createLogsProcessor(ctx context.Context, set processor.Settings, cfg compon
if err != nil {
return nil, err
}
return processorhelper.NewLogsProcessor(ctx, set, cfg, nextConsumer, newGeoIPProcessor(geoCfg, defaultResourceAttributes, providers, set).processLogs, processorhelper.WithCapabilities(processorCapabilities))
return processorhelper.NewLogs(ctx, set, cfg, nextConsumer, newGeoIPProcessor(geoCfg, defaultResourceAttributes, providers, set).processLogs, processorhelper.WithCapabilities(processorCapabilities))
}
6 changes: 3 additions & 3 deletions processor/groupbyattrsprocessor/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func createTracesProcessor(
return nil, err
}

return processorhelper.NewTracesProcessor(
return processorhelper.NewTraces(
ctx,
set,
cfg,
Expand All @@ -94,7 +94,7 @@ func createLogsProcessor(
return nil, err
}

return processorhelper.NewLogsProcessor(
return processorhelper.NewLogs(
ctx,
set,
cfg,
Expand All @@ -116,7 +116,7 @@ func createMetricsProcessor(
return nil, err
}

return processorhelper.NewMetricsProcessor(
return processorhelper.NewMetrics(
ctx,
set,
cfg,
Expand Down
6 changes: 3 additions & 3 deletions processor/k8sattributesprocessor/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func createTracesProcessorWithOptions(
) (processor.Traces, error) {
kp := createKubernetesProcessor(set, cfg, options...)

return processorhelper.NewTracesProcessor(
return processorhelper.NewTraces(
ctx,
set,
cfg,
Expand All @@ -97,7 +97,7 @@ func createMetricsProcessorWithOptions(
) (processor.Metrics, error) {
kp := createKubernetesProcessor(set, cfg, options...)

return processorhelper.NewMetricsProcessor(
return processorhelper.NewMetrics(
ctx,
set,
cfg,
Expand All @@ -117,7 +117,7 @@ func createLogsProcessorWithOptions(
) (processor.Logs, error) {
kp := createKubernetesProcessor(set, cfg, options...)

return processorhelper.NewLogsProcessor(
return processorhelper.NewLogs(
ctx,
set,
cfg,
Expand Down
2 changes: 1 addition & 1 deletion processor/metricsgenerationprocessor/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func createMetricsProcessor(

metricsProcessor := newMetricsGenerationProcessor(buildInternalConfig(processorConfig), set.Logger)

return processorhelper.NewMetricsProcessor(
return processorhelper.NewMetrics(
ctx,
set,
cfg,
Expand Down
2 changes: 1 addition & 1 deletion processor/metricstransformprocessor/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func createMetricsProcessor(
}
metricsProcessor := newMetricsTransformProcessor(set.Logger, hCfg)

return processorhelper.NewMetricsProcessor(
return processorhelper.NewMetrics(
ctx,
set,
cfg,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func TestMetricsGrouping(t *testing.T) {
otlpDataModelGateEnabled: useOTLP,
}

mtp, err := processorhelper.NewMetricsProcessor(
mtp, err := processorhelper.NewMetrics(
context.Background(),
processortest.NewNopSettings(),
&Config{},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func TestMetricsTransformProcessor(t *testing.T) {
logger: zap.NewExample(),
}

mtp, err := processorhelper.NewMetricsProcessor(
mtp, err := processorhelper.NewMetrics(
context.Background(),
processortest.NewNopSettings(),
&Config{},
Expand Down
2 changes: 1 addition & 1 deletion processor/probabilisticsamplerprocessor/logsprocessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ func newLogsProcessor(ctx context.Context, set processor.Settings, nextConsumer
telemetryBuilder: telemetryBuilder,
}

return processorhelper.NewLogsProcessor(
return processorhelper.NewLogs(
ctx,
set,
cfg,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling"
)

func TestNewLogsProcessor(t *testing.T) {
func TestNewLogs(t *testing.T) {
tests := []struct {
name string
nextConsumer consumer.Logs
Expand Down
2 changes: 1 addition & 1 deletion processor/probabilisticsamplerprocessor/tracesprocessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func newTracesProcessor(ctx context.Context, set processor.Settings, cfg *Config
logger: set.Logger,
telemetryBuilder: telemetryBuilder,
}
return processorhelper.NewTracesProcessor(
return processorhelper.NewTraces(
ctx,
set,
cfg,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func TestEmptyHashFunction(t *testing.T) {
require.InDelta(t, 0.568, float64(hashed)/float64(numHashBuckets), 0.001)
}

func TestNewTracesProcessor(t *testing.T) {
func TestNewTraces(t *testing.T) {
tests := []struct {
name string
nextConsumer consumer.Traces
Expand Down
6 changes: 3 additions & 3 deletions processor/redactionprocessor/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func createTracesProcessor(
return nil, fmt.Errorf("error creating a redaction processor: %w", err)
}

return processorhelper.NewTracesProcessor(
return processorhelper.NewTraces(
ctx,
set,
cfg,
Expand All @@ -69,7 +69,7 @@ func createLogsProcessor(
return nil, fmt.Errorf("error creating a redaction processor: %w", err)
}

return processorhelper.NewLogsProcessor(
return processorhelper.NewLogs(
ctx,
set,
cfg,
Expand All @@ -91,7 +91,7 @@ func createMetricsProcessor(
return nil, fmt.Errorf("error creating a redaction processor: %w", err)
}

return processorhelper.NewMetricsProcessor(
return processorhelper.NewMetrics(
ctx,
set,
cfg,
Expand Down
Loading

0 comments on commit ef7be4a

Please sign in to comment.