diff --git a/.chloggen/depcollector.yaml b/.chloggen/depcollector.yaml new file mode 100755 index 00000000000..d5b78ae3759 --- /dev/null +++ b/.chloggen/depcollector.yaml @@ -0,0 +1,11 @@ +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: deprecation + +# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) +component: service + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Deprecate service.[Collector|NewSvcHandler|CollectorSettings|State|NewCommand] in favor of collector package" + +# One or more tracking issues or pull requests related to the change +issues: [6608] diff --git a/.chloggen/obsreport-processor.yaml b/.chloggen/obsreport-processor.yaml new file mode 100644 index 00000000000..e234f3d5ee6 --- /dev/null +++ b/.chloggen/obsreport-processor.yaml @@ -0,0 +1,11 @@ +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: enhancement + +# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) +component: obsreport + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: "Instrument `obsreport.Processor` metrics with otel-go" + +# One or more tracking issues or pull requests related to the change +issues: [6607] \ No newline at end of file diff --git a/service/collector_windows_test.go b/collector/collector_windows_test.go similarity index 93% rename from service/collector_windows_test.go rename to collector/collector_windows_test.go index 4929a04add5..0c95bdb3ec4 100644 --- a/service/collector_windows_test.go +++ b/collector/collector_windows_test.go @@ -15,7 +15,7 @@ //go:build windows // +build windows -package service +package collector import ( "os" @@ -38,7 +38,7 @@ func TestNewSvcHandler(t *testing.T) { factories, err := componenttest.NopFactories() require.NoError(t, err) - s := NewSvcHandler(CollectorSettings{BuildInfo: component.NewDefaultBuildInfo(), Factories: factories}) + s := NewSvcHandler(Settings{BuildInfo: component.NewDefaultBuildInfo(), Factories: factories}) colDone := make(chan struct{}) requests := make(chan svc.ChangeRequest) diff --git a/service/command_test.go b/collector/command_test.go similarity index 62% rename from service/command_test.go rename to collector/command_test.go index df5b45ae914..7732cd05d54 100644 --- a/service/command_test.go +++ b/collector/command_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package service +package collector import ( "path/filepath" @@ -23,10 +23,13 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/confmap" + "go.opentelemetry.io/collector/confmap/converter/expandconverter" + "go.opentelemetry.io/collector/confmap/provider/fileprovider" ) func TestNewCommandVersion(t *testing.T) { - cmd := NewCommand(CollectorSettings{BuildInfo: component.BuildInfo{Version: "test_version"}}) + cmd := NewCommand(Settings{BuildInfo: component.BuildInfo{Version: "test_version"}}) assert.Equal(t, "test_version", cmd.Version) } @@ -34,7 +37,7 @@ func TestNewCommandNoConfigURI(t *testing.T) { factories, err := componenttest.NopFactories() require.NoError(t, err) - cmd := NewCommand(CollectorSettings{Factories: factories}) + cmd := NewCommand(Settings{Factories: factories}) require.Error(t, cmd.Execute()) } @@ -42,9 +45,16 @@ func TestNewCommandInvalidComponent(t *testing.T) { factories, err := componenttest.NopFactories() require.NoError(t, err) - cfgProvider, err := NewConfigProvider(newDefaultConfigProviderSettings([]string{filepath.Join("testdata", "otelcol-invalid.yaml")})) + cfgProvider, err := NewConfigProvider( + ConfigProviderSettings{ + ResolverSettings: confmap.ResolverSettings{ + URIs: []string{filepath.Join("testdata", "otelcol-invalid.yaml")}, + Providers: map[string]confmap.Provider{"file": fileprovider.New()}, + Converters: []confmap.Converter{expandconverter.New()}, + }, + }) require.NoError(t, err) - cmd := NewCommand(CollectorSettings{Factories: factories, ConfigProvider: cfgProvider}) + cmd := NewCommand(Settings{Factories: factories, ConfigProvider: cfgProvider}) require.Error(t, cmd.Execute()) } diff --git a/service/config_provider_test.go b/collector/config_provider_test.go similarity index 95% rename from service/config_provider_test.go rename to collector/config_provider_test.go index 70a021cf6a0..35ce80d22a8 100644 --- a/service/config_provider_test.go +++ b/collector/config_provider_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package service +package collector import ( "context" @@ -30,17 +30,18 @@ import ( "go.opentelemetry.io/collector/confmap" "go.opentelemetry.io/collector/confmap/provider/fileprovider" "go.opentelemetry.io/collector/confmap/provider/yamlprovider" + "go.opentelemetry.io/collector/service" "go.opentelemetry.io/collector/service/telemetry" ) -var configNop = &Config{ +var configNop = &service.Config{ Receivers: map[component.ID]component.Config{component.NewID("nop"): componenttest.NewNopReceiverFactory().CreateDefaultConfig()}, Processors: map[component.ID]component.Config{component.NewID("nop"): componenttest.NewNopProcessorFactory().CreateDefaultConfig()}, Exporters: map[component.ID]component.Config{component.NewID("nop"): componenttest.NewNopExporterFactory().CreateDefaultConfig()}, Extensions: map[component.ID]component.Config{component.NewID("nop"): componenttest.NewNopExtensionFactory().CreateDefaultConfig()}, - Service: ConfigService{ + Service: service.ConfigService{ Extensions: []component.ID{component.NewID("nop")}, - Pipelines: map[component.ID]*ConfigServicePipeline{ + Pipelines: map[component.ID]*service.ConfigServicePipeline{ component.NewID("traces"): { Receivers: []component.ID{component.NewID("nop")}, Processors: []component.ID{component.NewID("nop")}, diff --git a/collector/moved.go b/collector/moved.go new file mode 100644 index 00000000000..9ae355c4571 --- /dev/null +++ b/collector/moved.go @@ -0,0 +1,66 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// 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 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package collector handles the command-line, configuration, and runs the +// OpenTelemetry Collector. +package collector // import "go.opentelemetry.io/collector/collector" + +import ( + "go.opentelemetry.io/collector/service" +) + +// State defines Collector's state. +type State = service.State //nolint:staticcheck + +const ( + StateStarting = service.StateStarting //nolint:staticcheck + StateRunning = service.StateRunning //nolint:staticcheck + StateClosing = service.StateClosing //nolint:staticcheck + StateClosed = service.StateClosed //nolint:staticcheck +) + +// Collector represents a server providing the OpenTelemetry Collector service. +type Collector = service.Collector //nolint:staticcheck + +// New creates and returns a new instance of Collector. +var New = service.New //nolint:staticcheck + +// Settings holds configuration for creating a new Collector. +type Settings = service.CollectorSettings //nolint:staticcheck + +// ConfigProvider provides the service configuration. +// +// The typical usage is the following: +// +// cfgProvider.Get(...) +// cfgProvider.Watch() // wait for an event. +// cfgProvider.Get(...) +// cfgProvider.Watch() // wait for an event. +// // repeat Get/Watch cycle until it is time to shut down the Collector process. +// cfgProvider.Shutdown() +type ConfigProvider = service.ConfigProvider //nolint:staticcheck + +// ConfigProviderSettings are the settings to configure the behavior of the ConfigProvider. +type ConfigProviderSettings = service.ConfigProviderSettings //nolint:staticcheck + +// NewConfigProvider returns a new ConfigProvider that provides the service configuration: +// * Initially it resolves the "configuration map": +// - Retrieve the confmap.Conf by merging all retrieved maps from the given `locations` in order. +// - Then applies all the confmap.Converter in the given order. +// +// * Then unmarshalls the confmap.Conf into the service Config. +var NewConfigProvider = service.NewConfigProvider //nolint:staticcheck + +// NewCommand constructs a new cobra.Command using the given CollectorSettings. +var NewCommand = service.NewCommand //nolint:staticcheck diff --git a/collector/moved_windows.go b/collector/moved_windows.go new file mode 100644 index 00000000000..85c654088a2 --- /dev/null +++ b/collector/moved_windows.go @@ -0,0 +1,25 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// 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 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build windows +// +build windows + +package collector // import "go.opentelemetry.io/collector/collector" + +import ( + "go.opentelemetry.io/collector/service" +) + +// NewSvcHandler constructs a new svc.Handler using the given CollectorSettings. +var NewSvcHandler = service.NewSvcHandler //nolint:staticcheck diff --git a/collector/testdata/otelcol-invalid.yaml b/collector/testdata/otelcol-invalid.yaml new file mode 100644 index 00000000000..133ce74d85b --- /dev/null +++ b/collector/testdata/otelcol-invalid.yaml @@ -0,0 +1,18 @@ +receivers: + nop: + +processors: + nop: + +exporters: + nop: + +service: + telemetry: + metrics: + address: localhost:8888 + pipelines: + traces: + receivers: [nop] + processors: [invalid] + exporters: [nop] diff --git a/collector/testdata/otelcol-nop.yaml b/collector/testdata/otelcol-nop.yaml new file mode 100644 index 00000000000..6780b937e13 --- /dev/null +++ b/collector/testdata/otelcol-nop.yaml @@ -0,0 +1,30 @@ +receivers: + nop: + +processors: + nop: + +exporters: + nop: + +extensions: + nop: + +service: + telemetry: + metrics: + address: localhost:8888 + extensions: [nop] + pipelines: + traces: + receivers: [nop] + processors: [nop] + exporters: [nop] + metrics: + receivers: [nop] + processors: [nop] + exporters: [nop] + logs: + receivers: [nop] + processors: [nop] + exporters: [nop] diff --git a/obsreport/obsreport_processor.go b/obsreport/obsreport_processor.go index 1dd06228efb..56fd8cb2890 100644 --- a/obsreport/obsreport_processor.go +++ b/obsreport/obsreport_processor.go @@ -20,12 +20,25 @@ import ( "go.opencensus.io/stats" "go.opencensus.io/tag" + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/metric/instrument" + "go.opentelemetry.io/otel/metric/instrument/syncint64" + "go.opentelemetry.io/otel/metric/unit" + "go.uber.org/multierr" + "go.uber.org/zap" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config/configtelemetry" + "go.opentelemetry.io/collector/featuregate" + "go.opentelemetry.io/collector/internal/obsreportconfig" "go.opentelemetry.io/collector/internal/obsreportconfig/obsmetrics" ) +var ( + processorName = "processor" + processorScope = scopeName + nameSep + processorName +) + // BuildProcessorCustomMetricName is used to be build a metric name following // the standards used in the Collector. The configType should be the same // value used to identify the type on the config. @@ -44,6 +57,21 @@ func BuildProcessorCustomMetricName(configType, metric string) string { type Processor struct { level configtelemetry.Level mutators []tag.Mutator + + logger *zap.Logger + + useOtelForMetrics bool + otelAttrs []attribute.KeyValue + + acceptedSpansCounter syncint64.Counter + refusedSpansCounter syncint64.Counter + droppedSpansCounter syncint64.Counter + acceptedMetricPointsCounter syncint64.Counter + refusedMetricPointsCounter syncint64.Counter + droppedMetricPointsCounter syncint64.Counter + acceptedLogRecordsCounter syncint64.Counter + refusedLogRecordsCounter syncint64.Counter + droppedLogRecordsCounter syncint64.Counter } // ProcessorSettings are settings for creating a Processor. @@ -54,134 +82,217 @@ type ProcessorSettings struct { // NewProcessor creates a new Processor. func NewProcessor(cfg ProcessorSettings) (*Processor, error) { - return &Processor{ - level: cfg.ProcessorCreateSettings.MetricsLevel, - mutators: []tag.Mutator{tag.Upsert(obsmetrics.TagKeyProcessor, cfg.ProcessorID.String(), tag.WithTTL(tag.TTLNoPropagation))}, - }, nil + return newProcessor(cfg, featuregate.GetRegistry()) +} + +func newProcessor(cfg ProcessorSettings, registry *featuregate.Registry) (*Processor, error) { + proc := &Processor{ + level: cfg.ProcessorCreateSettings.MetricsLevel, + mutators: []tag.Mutator{tag.Upsert(obsmetrics.TagKeyProcessor, cfg.ProcessorID.String(), tag.WithTTL(tag.TTLNoPropagation))}, + logger: cfg.ProcessorCreateSettings.Logger, + useOtelForMetrics: registry.IsEnabled(obsreportconfig.UseOtelForInternalMetricsfeatureGateID), + otelAttrs: []attribute.KeyValue{ + attribute.String(obsmetrics.ProcessorKey, cfg.ProcessorID.String()), + }, + } + + if err := proc.createOtelMetrics(cfg); err != nil { + return nil, err + } + + return proc, nil +} + +func (por *Processor) createOtelMetrics(cfg ProcessorSettings) error { + if !por.useOtelForMetrics { + return nil + } + meter := cfg.ProcessorCreateSettings.MeterProvider.Meter(processorScope) + var errors, err error + + por.acceptedSpansCounter, err = meter.SyncInt64().Counter( + obsmetrics.ProcessorPrefix+obsmetrics.AcceptedSpansKey, + instrument.WithDescription("Number of spans successfully pushed into the next component in the pipeline."), + instrument.WithUnit(unit.Dimensionless), + ) + errors = multierr.Append(errors, err) + + por.refusedSpansCounter, err = meter.SyncInt64().Counter( + obsmetrics.ProcessorPrefix+obsmetrics.RefusedSpansKey, + instrument.WithDescription("Number of spans that were rejected by the next component in the pipeline."), + instrument.WithUnit(unit.Dimensionless), + ) + errors = multierr.Append(errors, err) + + por.droppedSpansCounter, err = meter.SyncInt64().Counter( + obsmetrics.ProcessorPrefix+obsmetrics.DroppedSpansKey, + instrument.WithDescription("Number of spans that were dropped."), + instrument.WithUnit(unit.Dimensionless), + ) + errors = multierr.Append(errors, err) + + por.acceptedMetricPointsCounter, err = meter.SyncInt64().Counter( + obsmetrics.ProcessorPrefix+obsmetrics.AcceptedMetricPointsKey, + instrument.WithDescription("Number of metric points successfully pushed into the next component in the pipeline."), + instrument.WithUnit(unit.Dimensionless), + ) + errors = multierr.Append(errors, err) + + por.refusedMetricPointsCounter, err = meter.SyncInt64().Counter( + obsmetrics.ProcessorPrefix+obsmetrics.RefusedMetricPointsKey, + instrument.WithDescription("Number of metric points that were rejected by the next component in the pipeline."), + instrument.WithUnit(unit.Dimensionless), + ) + errors = multierr.Append(errors, err) + + por.droppedMetricPointsCounter, err = meter.SyncInt64().Counter( + obsmetrics.ProcessorPrefix+obsmetrics.DroppedMetricPointsKey, + instrument.WithDescription("Number of metric points that were dropped."), + instrument.WithUnit(unit.Dimensionless), + ) + errors = multierr.Append(errors, err) + + por.acceptedLogRecordsCounter, err = meter.SyncInt64().Counter( + obsmetrics.ProcessorPrefix+obsmetrics.AcceptedLogRecordsKey, + instrument.WithDescription("Number of log records successfully pushed into the next component in the pipeline."), + instrument.WithUnit(unit.Dimensionless), + ) + errors = multierr.Append(errors, err) + + por.refusedLogRecordsCounter, err = meter.SyncInt64().Counter( + obsmetrics.ProcessorPrefix+obsmetrics.RefusedLogRecordsKey, + instrument.WithDescription("Number of log records that were rejected by the next component in the pipeline."), + instrument.WithUnit(unit.Dimensionless), + ) + errors = multierr.Append(errors, err) + + por.droppedLogRecordsCounter, err = meter.SyncInt64().Counter( + obsmetrics.ProcessorPrefix+obsmetrics.DroppedLogRecordsKey, + instrument.WithDescription("Number of log records that were dropped."), + instrument.WithUnit(unit.Dimensionless), + ) + errors = multierr.Append(errors, err) + + return errors +} + +func (por *Processor) recordWithOtel(ctx context.Context, dataType component.DataType, accepted, refused, dropped int64) { + var acceptedCount, refusedCount, droppedCount syncint64.Counter + switch dataType { + case component.DataTypeTraces: + acceptedCount = por.acceptedSpansCounter + refusedCount = por.refusedSpansCounter + droppedCount = por.droppedSpansCounter + case component.DataTypeMetrics: + acceptedCount = por.acceptedMetricPointsCounter + refusedCount = por.refusedMetricPointsCounter + droppedCount = por.droppedMetricPointsCounter + case component.DataTypeLogs: + acceptedCount = por.acceptedLogRecordsCounter + refusedCount = por.refusedLogRecordsCounter + droppedCount = por.droppedLogRecordsCounter + } + + acceptedCount.Add(ctx, accepted, por.otelAttrs...) + refusedCount.Add(ctx, refused, por.otelAttrs...) + droppedCount.Add(ctx, dropped, por.otelAttrs...) +} + +func (por *Processor) recordWithOC(ctx context.Context, dataType component.DataType, accepted, refused, dropped int64) { + var acceptedMeasure, refusedMeasure, droppedMeasure *stats.Int64Measure + + switch dataType { + case component.DataTypeTraces: + acceptedMeasure = obsmetrics.ProcessorAcceptedSpans + refusedMeasure = obsmetrics.ProcessorRefusedSpans + droppedMeasure = obsmetrics.ProcessorDroppedSpans + case component.DataTypeMetrics: + acceptedMeasure = obsmetrics.ProcessorAcceptedMetricPoints + refusedMeasure = obsmetrics.ProcessorRefusedMetricPoints + droppedMeasure = obsmetrics.ProcessorDroppedMetricPoints + case component.DataTypeLogs: + acceptedMeasure = obsmetrics.ProcessorAcceptedLogRecords + refusedMeasure = obsmetrics.ProcessorRefusedLogRecords + droppedMeasure = obsmetrics.ProcessorDroppedLogRecords + } + + // ignore the error for now; should not happen + _ = stats.RecordWithTags( + ctx, + por.mutators, + acceptedMeasure.M(accepted), + refusedMeasure.M(refused), + droppedMeasure.M(dropped), + ) +} + +func (por *Processor) recordData(ctx context.Context, dataType component.DataType, accepted, refused, dropped int64) { + if por.useOtelForMetrics { + por.recordWithOtel(ctx, dataType, accepted, refused, dropped) + } else { + por.recordWithOC(ctx, dataType, accepted, refused, dropped) + } } // TracesAccepted reports that the trace data was accepted. func (por *Processor) TracesAccepted(ctx context.Context, numSpans int) { if por.level != configtelemetry.LevelNone { - // ignore the error for now; should not happen - _ = stats.RecordWithTags( - ctx, - por.mutators, - obsmetrics.ProcessorAcceptedSpans.M(int64(numSpans)), - obsmetrics.ProcessorRefusedSpans.M(0), - obsmetrics.ProcessorDroppedSpans.M(0), - ) + por.recordData(ctx, component.DataTypeTraces, int64(numSpans), int64(0), int64(0)) } } // TracesRefused reports that the trace data was refused. func (por *Processor) TracesRefused(ctx context.Context, numSpans int) { if por.level != configtelemetry.LevelNone { - // ignore the error for now; should not happen - _ = stats.RecordWithTags( - ctx, - por.mutators, - obsmetrics.ProcessorAcceptedSpans.M(0), - obsmetrics.ProcessorRefusedSpans.M(int64(numSpans)), - obsmetrics.ProcessorDroppedSpans.M(0), - ) + por.recordData(ctx, component.DataTypeTraces, int64(0), int64(numSpans), int64(0)) } } // TracesDropped reports that the trace data was dropped. func (por *Processor) TracesDropped(ctx context.Context, numSpans int) { if por.level != configtelemetry.LevelNone { - // ignore the error for now; should not happen - _ = stats.RecordWithTags( - ctx, - por.mutators, - obsmetrics.ProcessorAcceptedSpans.M(0), - obsmetrics.ProcessorRefusedSpans.M(0), - obsmetrics.ProcessorDroppedSpans.M(int64(numSpans)), - ) + por.recordData(ctx, component.DataTypeTraces, int64(0), int64(0), int64(numSpans)) } } // MetricsAccepted reports that the metrics were accepted. func (por *Processor) MetricsAccepted(ctx context.Context, numPoints int) { if por.level != configtelemetry.LevelNone { - // ignore the error for now; should not happen - _ = stats.RecordWithTags( - ctx, - por.mutators, - obsmetrics.ProcessorAcceptedMetricPoints.M(int64(numPoints)), - obsmetrics.ProcessorRefusedMetricPoints.M(0), - obsmetrics.ProcessorDroppedMetricPoints.M(0), - ) + por.recordData(ctx, component.DataTypeMetrics, int64(numPoints), int64(0), int64(0)) } } // MetricsRefused reports that the metrics were refused. func (por *Processor) MetricsRefused(ctx context.Context, numPoints int) { if por.level != configtelemetry.LevelNone { - // ignore the error for now; should not happen - _ = stats.RecordWithTags( - ctx, - por.mutators, - obsmetrics.ProcessorAcceptedMetricPoints.M(0), - obsmetrics.ProcessorRefusedMetricPoints.M(int64(numPoints)), - obsmetrics.ProcessorDroppedMetricPoints.M(0), - ) + por.recordData(ctx, component.DataTypeMetrics, int64(0), int64(numPoints), int64(0)) } } // MetricsDropped reports that the metrics were dropped. func (por *Processor) MetricsDropped(ctx context.Context, numPoints int) { if por.level != configtelemetry.LevelNone { - // ignore the error for now; should not happen - _ = stats.RecordWithTags( - ctx, - por.mutators, - obsmetrics.ProcessorAcceptedMetricPoints.M(0), - obsmetrics.ProcessorRefusedMetricPoints.M(0), - obsmetrics.ProcessorDroppedMetricPoints.M(int64(numPoints)), - ) + por.recordData(ctx, component.DataTypeMetrics, int64(0), int64(0), int64(numPoints)) } } // LogsAccepted reports that the logs were accepted. func (por *Processor) LogsAccepted(ctx context.Context, numRecords int) { if por.level != configtelemetry.LevelNone { - // ignore the error for now; should not happen - _ = stats.RecordWithTags( - ctx, - por.mutators, - obsmetrics.ProcessorAcceptedLogRecords.M(int64(numRecords)), - obsmetrics.ProcessorRefusedLogRecords.M(0), - obsmetrics.ProcessorDroppedLogRecords.M(0), - ) + por.recordData(ctx, component.DataTypeLogs, int64(numRecords), int64(0), int64(0)) } } // LogsRefused reports that the logs were refused. func (por *Processor) LogsRefused(ctx context.Context, numRecords int) { if por.level != configtelemetry.LevelNone { - // ignore the error for now; should not happen - _ = stats.RecordWithTags( - ctx, - por.mutators, - obsmetrics.ProcessorAcceptedLogRecords.M(0), - obsmetrics.ProcessorRefusedLogRecords.M(int64(numRecords)), - obsmetrics.ProcessorDroppedMetricPoints.M(0), - ) + por.recordData(ctx, component.DataTypeLogs, int64(0), int64(numRecords), int64(0)) } } // LogsDropped reports that the logs were dropped. func (por *Processor) LogsDropped(ctx context.Context, numRecords int) { if por.level != configtelemetry.LevelNone { - // ignore the error for now; should not happen - _ = stats.RecordWithTags( - ctx, - por.mutators, - obsmetrics.ProcessorAcceptedLogRecords.M(0), - obsmetrics.ProcessorRefusedLogRecords.M(0), - obsmetrics.ProcessorDroppedLogRecords.M(int64(numRecords)), - ) + por.recordData(ctx, component.DataTypeLogs, int64(0), int64(0), int64(numRecords)) } } diff --git a/obsreport/obsreport_test.go b/obsreport/obsreport_test.go index 219e3502c5d..f9f39b99b5e 100644 --- a/obsreport/obsreport_test.go +++ b/obsreport/obsreport_test.go @@ -479,18 +479,17 @@ func TestReceiveWithLongLivedCtx(t *testing.T) { } func TestProcessorTraceData(t *testing.T) { - tt, err := obsreporttest.SetupTelemetry() - require.NoError(t, err) - t.Cleanup(func() { require.NoError(t, tt.Shutdown(context.Background())) }) + testTelemetry(t, testProcessorTraceData) +} +func testProcessorTraceData(t *testing.T, tt obsreporttest.TestTelemetry, registry *featuregate.Registry) { const acceptedSpans = 27 const refusedSpans = 19 const droppedSpans = 13 - - obsrep, err := NewProcessor(ProcessorSettings{ + obsrep, err := newProcessor(ProcessorSettings{ ProcessorID: processor, ProcessorCreateSettings: tt.ToProcessorCreateSettings(), - }) + }, registry) require.NoError(t, err) obsrep.TracesAccepted(context.Background(), acceptedSpans) obsrep.TracesRefused(context.Background(), refusedSpans) @@ -500,18 +499,18 @@ func TestProcessorTraceData(t *testing.T) { } func TestProcessorMetricsData(t *testing.T) { - tt, err := obsreporttest.SetupTelemetry() - require.NoError(t, err) - t.Cleanup(func() { require.NoError(t, tt.Shutdown(context.Background())) }) + testTelemetry(t, testProcessorMetricsData) +} +func testProcessorMetricsData(t *testing.T, tt obsreporttest.TestTelemetry, registry *featuregate.Registry) { const acceptedPoints = 29 const refusedPoints = 11 const droppedPoints = 17 - obsrep, err := NewProcessor(ProcessorSettings{ + obsrep, err := newProcessor(ProcessorSettings{ ProcessorID: processor, ProcessorCreateSettings: tt.ToProcessorCreateSettings(), - }) + }, registry) require.NoError(t, err) obsrep.MetricsAccepted(context.Background(), acceptedPoints) obsrep.MetricsRefused(context.Background(), refusedPoints) @@ -543,18 +542,18 @@ func TestBuildProcessorCustomMetricName(t *testing.T) { } func TestProcessorLogRecords(t *testing.T) { - tt, err := obsreporttest.SetupTelemetry() - require.NoError(t, err) - t.Cleanup(func() { require.NoError(t, tt.Shutdown(context.Background())) }) + testTelemetry(t, testProcessorLogRecords) +} +func testProcessorLogRecords(t *testing.T, tt obsreporttest.TestTelemetry, registry *featuregate.Registry) { const acceptedRecords = 29 const refusedRecords = 11 const droppedRecords = 17 - obsrep, err := NewProcessor(ProcessorSettings{ + obsrep, err := newProcessor(ProcessorSettings{ ProcessorID: processor, ProcessorCreateSettings: tt.ToProcessorCreateSettings(), - }) + }, registry) require.NoError(t, err) obsrep.LogsAccepted(context.Background(), acceptedRecords) obsrep.LogsRefused(context.Background(), refusedRecords) diff --git a/obsreport/obsreporttest/obsreporttest.go b/obsreport/obsreporttest/obsreporttest.go index f9ed4634cfd..da20d9fbaa9 100644 --- a/obsreport/obsreporttest/obsreporttest.go +++ b/obsreport/obsreporttest/obsreporttest.go @@ -16,9 +16,6 @@ package obsreporttest // import "go.opentelemetry.io/collector/obsreport/obsrepo import ( "context" - "fmt" - "reflect" - "sort" ocprom "contrib.go.opencensus.io/exporter/prometheus" "github.com/prometheus/client_golang/prometheus" @@ -157,32 +154,20 @@ func CheckExporterLogs(tts TestTelemetry, exporter component.ID, sentLogRecords, // CheckProcessorTraces checks that for the current exported values for trace exporter metrics match given values. // When this function is called it is required to also call SetupTelemetry as first thing. -func CheckProcessorTraces(_ TestTelemetry, processor component.ID, acceptedSpans, refusedSpans, droppedSpans int64) error { - processorTags := tagsForProcessorView(processor) - return multierr.Combine( - checkValueForView(processorTags, acceptedSpans, "processor/accepted_spans"), - checkValueForView(processorTags, refusedSpans, "processor/refused_spans"), - checkValueForView(processorTags, droppedSpans, "processor/dropped_spans")) +func CheckProcessorTraces(tts TestTelemetry, processor component.ID, acceptedSpans, refusedSpans, droppedSpans int64) error { + return tts.otelPrometheusChecker.checkProcessorTraces(processor, acceptedSpans, refusedSpans, droppedSpans) } // CheckProcessorMetrics checks that for the current exported values for metrics exporter metrics match given values. // When this function is called it is required to also call SetupTelemetry as first thing. -func CheckProcessorMetrics(_ TestTelemetry, processor component.ID, acceptedMetricPoints, refusedMetricPoints, droppedMetricPoints int64) error { - processorTags := tagsForProcessorView(processor) - return multierr.Combine( - checkValueForView(processorTags, acceptedMetricPoints, "processor/accepted_metric_points"), - checkValueForView(processorTags, refusedMetricPoints, "processor/refused_metric_points"), - checkValueForView(processorTags, droppedMetricPoints, "processor/dropped_metric_points")) +func CheckProcessorMetrics(tts TestTelemetry, processor component.ID, acceptedMetricPoints, refusedMetricPoints, droppedMetricPoints int64) error { + return tts.otelPrometheusChecker.checkProcessorMetrics(processor, acceptedMetricPoints, refusedMetricPoints, droppedMetricPoints) } // CheckProcessorLogs checks that for the current exported values for logs exporter metrics match given values. // When this function is called it is required to also call SetupTelemetry as first thing. -func CheckProcessorLogs(_ TestTelemetry, processor component.ID, acceptedLogRecords, refusedLogRecords, droppedLogRecords int64) error { - processorTags := tagsForProcessorView(processor) - return multierr.Combine( - checkValueForView(processorTags, acceptedLogRecords, "processor/accepted_log_records"), - checkValueForView(processorTags, refusedLogRecords, "processor/refused_log_records"), - checkValueForView(processorTags, droppedLogRecords, "processor/dropped_log_records")) +func CheckProcessorLogs(tts TestTelemetry, processor component.ID, acceptedLogRecords, refusedLogRecords, droppedLogRecords int64) error { + return tts.otelPrometheusChecker.checkProcessorLogs(processor, acceptedLogRecords, refusedLogRecords, droppedLogRecords) } // CheckReceiverTraces checks that for the current exported values for trace receiver metrics match given values. @@ -208,41 +193,3 @@ func CheckReceiverMetrics(tts TestTelemetry, receiver component.ID, protocol str func CheckScraperMetrics(tts TestTelemetry, receiver component.ID, scraper component.ID, scrapedMetricPoints, erroredMetricPoints int64) error { return tts.otelPrometheusChecker.checkScraperMetrics(receiver, scraper, scrapedMetricPoints, erroredMetricPoints) } - -// checkValueForView checks that for the current exported value in the view with the given name -// for {LegacyTagKeyReceiver: receiverName} is equal to "value". -func checkValueForView(wantTags []tag.Tag, value int64, vName string) error { - // Make sure the tags slice is sorted by tag keys. - sortTags(wantTags) - - rows, err := view.RetrieveData(vName) - if err != nil { - return err - } - - for _, row := range rows { - // Make sure the tags slice is sorted by tag keys. - sortTags(row.Tags) - if reflect.DeepEqual(wantTags, row.Tags) { - sum := row.Data.(*view.SumData) - if float64(value) != sum.Value { - return fmt.Errorf("[%s]: values did no match, wanted %f got %f", vName, float64(value), sum.Value) - } - return nil - } - } - return fmt.Errorf("[%s]: could not find tags, wantTags: %s in rows %v", vName, wantTags, rows) -} - -// tagsForProcessorView returns the tags that are needed for the processor views. -func tagsForProcessorView(processor component.ID) []tag.Tag { - return []tag.Tag{ - {Key: processorTag, Value: processor.String()}, - } -} - -func sortTags(tags []tag.Tag) { - sort.SliceStable(tags, func(i, j int) bool { - return tags[i].Key.Name() < tags[j].Key.Name() - }) -} diff --git a/obsreport/obsreporttest/obsreporttest_test.go b/obsreport/obsreporttest/obsreporttest_test.go index 75367e45f60..a343cca4e65 100644 --- a/obsreport/obsreporttest/obsreporttest_test.go +++ b/obsreport/obsreporttest/obsreporttest_test.go @@ -32,9 +32,10 @@ const ( ) var ( - scraper = component.NewID("fakeScraper") - receiver = component.NewID("fakeReicever") - exporter = component.NewID("fakeExporter") + scraper = component.NewID("fakeScraper") + receiver = component.NewID("fakeReicever") + processor = component.NewID("fakeProcessor") + exporter = component.NewID("fakeExporter") ) func TestCheckScraperMetricsViews(t *testing.T) { @@ -121,6 +122,81 @@ func TestCheckReceiverLogsViews(t *testing.T) { assert.Error(t, obsreporttest.CheckReceiverLogs(tt, receiver, transport, 0, 7)) } +func TestCheckProcessorTracesViews(t *testing.T) { + tt, err := obsreporttest.SetupTelemetry() + require.NoError(t, err) + t.Cleanup(func() { require.NoError(t, tt.Shutdown(context.Background())) }) + + por, err := obsreport.NewProcessor(obsreport.ProcessorSettings{ + ProcessorID: processor, + ProcessorCreateSettings: tt.ToProcessorCreateSettings(), + }) + assert.NoError(t, err) + + por.TracesAccepted(context.Background(), 7) + por.TracesRefused(context.Background(), 8) + por.TracesDropped(context.Background(), 9) + + assert.NoError(t, obsreporttest.CheckProcessorTraces(tt, processor, 7, 8, 9)) + assert.Error(t, obsreporttest.CheckProcessorTraces(tt, processor, 0, 0, 0)) + assert.Error(t, obsreporttest.CheckProcessorTraces(tt, processor, 7, 0, 0)) + assert.Error(t, obsreporttest.CheckProcessorTraces(tt, processor, 7, 8, 0)) + assert.Error(t, obsreporttest.CheckProcessorTraces(tt, processor, 7, 0, 9)) + assert.Error(t, obsreporttest.CheckProcessorTraces(tt, processor, 0, 8, 0)) + assert.Error(t, obsreporttest.CheckProcessorTraces(tt, processor, 0, 8, 9)) + assert.Error(t, obsreporttest.CheckProcessorTraces(tt, processor, 0, 0, 9)) +} + +func TestCheckProcessorMetricsViews(t *testing.T) { + tt, err := obsreporttest.SetupTelemetry() + require.NoError(t, err) + t.Cleanup(func() { require.NoError(t, tt.Shutdown(context.Background())) }) + + por, err := obsreport.NewProcessor(obsreport.ProcessorSettings{ + ProcessorID: processor, + ProcessorCreateSettings: tt.ToProcessorCreateSettings(), + }) + assert.NoError(t, err) + + por.MetricsAccepted(context.Background(), 7) + por.MetricsRefused(context.Background(), 8) + por.MetricsDropped(context.Background(), 9) + + assert.NoError(t, obsreporttest.CheckProcessorMetrics(tt, processor, 7, 8, 9)) + assert.Error(t, obsreporttest.CheckProcessorMetrics(tt, processor, 0, 0, 0)) + assert.Error(t, obsreporttest.CheckProcessorMetrics(tt, processor, 7, 0, 0)) + assert.Error(t, obsreporttest.CheckProcessorMetrics(tt, processor, 7, 8, 0)) + assert.Error(t, obsreporttest.CheckProcessorMetrics(tt, processor, 7, 0, 9)) + assert.Error(t, obsreporttest.CheckProcessorMetrics(tt, processor, 0, 8, 0)) + assert.Error(t, obsreporttest.CheckProcessorMetrics(tt, processor, 0, 8, 9)) + assert.Error(t, obsreporttest.CheckProcessorMetrics(tt, processor, 0, 0, 9)) +} + +func TestCheckProcessorLogViews(t *testing.T) { + tt, err := obsreporttest.SetupTelemetry() + require.NoError(t, err) + t.Cleanup(func() { require.NoError(t, tt.Shutdown(context.Background())) }) + + por, err := obsreport.NewProcessor(obsreport.ProcessorSettings{ + ProcessorID: processor, + ProcessorCreateSettings: tt.ToProcessorCreateSettings(), + }) + assert.NoError(t, err) + + por.LogsAccepted(context.Background(), 7) + por.LogsRefused(context.Background(), 8) + por.LogsDropped(context.Background(), 9) + + assert.NoError(t, obsreporttest.CheckProcessorLogs(tt, processor, 7, 8, 9)) + assert.Error(t, obsreporttest.CheckProcessorLogs(tt, processor, 0, 0, 0)) + assert.Error(t, obsreporttest.CheckProcessorLogs(tt, processor, 7, 0, 0)) + assert.Error(t, obsreporttest.CheckProcessorLogs(tt, processor, 7, 8, 0)) + assert.Error(t, obsreporttest.CheckProcessorLogs(tt, processor, 7, 0, 9)) + assert.Error(t, obsreporttest.CheckProcessorLogs(tt, processor, 0, 8, 0)) + assert.Error(t, obsreporttest.CheckProcessorLogs(tt, processor, 0, 8, 9)) + assert.Error(t, obsreporttest.CheckProcessorLogs(tt, processor, 0, 0, 9)) +} + func TestCheckExporterTracesViews(t *testing.T) { tt, err := obsreporttest.SetupTelemetry() require.NoError(t, err) diff --git a/obsreport/obsreporttest/otelprometheuschecker.go b/obsreport/obsreporttest/otelprometheuschecker.go index b50225eb031..b9b8cb55cd2 100644 --- a/obsreport/obsreporttest/otelprometheuschecker.go +++ b/obsreport/obsreporttest/otelprometheuschecker.go @@ -62,6 +62,30 @@ func (pc *prometheusChecker) checkReceiverMetrics(receiver component.ID, protoco pc.checkCounter("receiver_refused_metric_points", droppedMetricPoints, receiverAttrs)) } +func (pc *prometheusChecker) checkProcessorTraces(processor component.ID, acceptedSpans, refusedSpans, droppedSpans int64) error { + processorAttrs := attributesForProcessorMetrics(processor) + return multierr.Combine( + pc.checkCounter("processor_accepted_spans", acceptedSpans, processorAttrs), + pc.checkCounter("processor_refused_spans", refusedSpans, processorAttrs), + pc.checkCounter("processor_dropped_spans", droppedSpans, processorAttrs)) +} + +func (pc *prometheusChecker) checkProcessorMetrics(processor component.ID, acceptedMetricPoints, refusedMetricPoints, droppedMetricPoints int64) error { + processorAttrs := attributesForProcessorMetrics(processor) + return multierr.Combine( + pc.checkCounter("processor_accepted_metric_points", acceptedMetricPoints, processorAttrs), + pc.checkCounter("processor_refused_metric_points", refusedMetricPoints, processorAttrs), + pc.checkCounter("processor_dropped_metric_points", droppedMetricPoints, processorAttrs)) +} + +func (pc *prometheusChecker) checkProcessorLogs(processor component.ID, acceptedLogRecords, refusedLogRecords, droppedLogRecords int64) error { + processorAttrs := attributesForProcessorMetrics(processor) + return multierr.Combine( + pc.checkCounter("processor_accepted_log_records", acceptedLogRecords, processorAttrs), + pc.checkCounter("processor_refused_log_records", refusedLogRecords, processorAttrs), + pc.checkCounter("processor_dropped_log_records", droppedLogRecords, processorAttrs)) +} + func (pc *prometheusChecker) checkExporterTraces(exporter component.ID, sentSpans, sendFailedSpans int64) error { exporterAttrs := attributesForExporterMetrics(exporter) return multierr.Combine( @@ -167,6 +191,12 @@ func attributesForReceiverMetrics(receiver component.ID, transport string) []att } } +func attributesForProcessorMetrics(processor component.ID) []attribute.KeyValue { + return []attribute.KeyValue{ + attribute.String(processorTag.Name(), processor.String()), + } +} + // attributesForReceiverMetrics returns the attributes that are needed for the receiver metrics. func attributesForExporterMetrics(exporter component.ID) []attribute.KeyValue { return []attribute.KeyValue{ diff --git a/obsreport/obsreporttest/otelprometheuschecker_test.go b/obsreport/obsreporttest/otelprometheuschecker_test.go index bde065ce0c0..0787621994d 100644 --- a/obsreport/obsreporttest/otelprometheuschecker_test.go +++ b/obsreport/obsreporttest/otelprometheuschecker_test.go @@ -49,6 +49,7 @@ func TestPromChecker(t *testing.T) { scraper := component.NewID("fakeScraper") receiver := component.NewID("fakeReceiver") + processor := component.NewID("fakeProcessor") exporter := component.NewID("fakeExporter") transport := "fakeTransport" @@ -97,6 +98,21 @@ func TestPromChecker(t *testing.T) { "metrics from Receiver Logs should be valid", ) + assert.NoError(t, + pc.checkProcessorTraces(processor, 42, 13, 7), + "metrics from Receiver Traces should be valid", + ) + + assert.NoError(t, + pc.checkProcessorMetrics(processor, 7, 41, 13), + "metrics from Receiver Metrics should be valid", + ) + + assert.NoError(t, + pc.checkProcessorLogs(processor, 102, 35, 14), + "metrics from Receiver Logs should be valid", + ) + assert.NoError(t, pc.checkExporterTraces(exporter, 43, 14), "metrics from Exporter Traces should be valid", diff --git a/obsreport/obsreporttest/testdata/prometheus_response b/obsreport/obsreporttest/testdata/prometheus_response index 60680c8fb48..fb954905988 100644 --- a/obsreport/obsreporttest/testdata/prometheus_response +++ b/obsreport/obsreporttest/testdata/prometheus_response @@ -16,6 +16,33 @@ exporter_send_failed_log_records{exporter="fakeExporter"} 36 # HELP exporter_sent_log_records Number of logs successfully sent to destination. # TYPE exporter_sent_log_records counter exporter_sent_log_records{exporter="fakeExporter"} 103 +# HELP processor_accepted_spans Number of spans successfully pushed into the next component in the pipeline. +# TYPE processor_accepted_spans counter +processor_accepted_spans{processor="fakeProcessor"} 42 +# HELP processor_refused_spans Number of spans that were rejected by the next component in the pipeline. +# TYPE processor_refused_spans counter +processor_refused_spans{processor="fakeProcessor"} 13 +# HELP processor_dropped_spans Number of spans that were dropped. +# TYPE processor_dropped_spans counter +processor_dropped_spans{processor="fakeProcessor"} 7 +# HELP processor_accepted_metric_points Number of metric points successfully pushed into the next component in the pipeline. +# TYPE processor_accepted_metric_points counter +processor_accepted_metric_points{processor="fakeProcessor"} 7 +# HELP processor_refused_metric_points Number of metric points that were rejected by the next component in the pipeline. +# TYPE processor_refused_metric_points counter +processor_refused_metric_points{processor="fakeProcessor"} 41 +# HELP processor_dropped_metric_points Number of metric points that were dropped. +# TYPE processor_dropped_metric_points counter +processor_dropped_metric_points{processor="fakeProcessor"} 13 +# HELP processor_accepted_log_records Number of log records successfully pushed into the next component in the pipeline. +# TYPE processor_accepted_log_records counter +processor_accepted_log_records{processor="fakeProcessor"} 102 +# HELP processor_refused_log_records Number of log records that were rejected by the next component in the pipeline. +# TYPE processor_refused_log_records counter +processor_refused_log_records{processor="fakeProcessor"} 35 +# HELP processor_dropped_log_records Number of log records that were dropped. +# TYPE processor_dropped_log_records counter +processor_dropped_log_records{processor="fakeProcessor"} 14 # HELP receiver_accepted_log_records Number of log records successfully pushed into the pipeline. # TYPE receiver_accepted_log_records counter receiver_accepted_log_records{receiver="fakeReceiver",transport="fakeTransport"} 102 diff --git a/service/collector.go b/service/collector.go index acd10cb0613..38c7f00068e 100644 --- a/service/collector.go +++ b/service/collector.go @@ -34,12 +34,17 @@ import ( ) // State defines Collector's state. +// Deprecated: [v0.67.0] use collector.State type State int const ( + // Deprecated: [v0.67.0] use collector.StateStarting StateStarting State = iota + // Deprecated: [v0.67.0] use collector.StateRunning StateRunning + // Deprecated: [v0.67.0] use collector.StateClosing StateClosing + // Deprecated: [v0.67.0] use collector.StateClosed StateClosed ) @@ -69,6 +74,7 @@ func (s State) String() string { // - Users can call (*Collector).Shutdown anytime to shut down the collector. // Collector represents a server providing the OpenTelemetry Collector service. +// Deprecated: [v0.67.0] use collector.Collector type Collector struct { set CollectorSettings @@ -86,6 +92,7 @@ type Collector struct { } // New creates and returns a new instance of Collector. +// Deprecated: [v0.67.0] use collector.New func New(set CollectorSettings) (*Collector, error) { if set.ConfigProvider == nil { return nil, errors.New("invalid nil config provider") diff --git a/service/collector_windows.go b/service/collector_windows.go index f429b6c29c0..f41a7f1b3bc 100644 --- a/service/collector_windows.go +++ b/service/collector_windows.go @@ -40,6 +40,7 @@ type windowsService struct { } // NewSvcHandler constructs a new svc.Handler using the given CollectorSettings. +// Deprecated: [v0.67.0] use collector.NewSvcHandler func NewSvcHandler(set CollectorSettings) svc.Handler { return &windowsService{settings: set, flags: flags()} } diff --git a/service/config_provider.go b/service/config_provider.go index 3feba9741fe..f8afbf8f1c7 100644 --- a/service/config_provider.go +++ b/service/config_provider.go @@ -37,6 +37,8 @@ import ( // cfgProvider.Watch() // wait for an event. // // repeat Get/Watch cycle until it is time to shut down the Collector process. // cfgProvider.Shutdown() +// +// Deprecated: [v0.67.0] use collector.ConfigProvider type ConfigProvider interface { // Get returns the service configuration, or error otherwise. // @@ -66,6 +68,7 @@ type configProvider struct { } // ConfigProviderSettings are the settings to configure the behavior of the ConfigProvider. +// Deprecated: [v0.67.0] use collector.ConfigProviderSettings type ConfigProviderSettings struct { // ResolverSettings are the settings to configure the behavior of the confmap.Resolver. ResolverSettings confmap.ResolverSettings @@ -87,6 +90,7 @@ func newDefaultConfigProviderSettings(uris []string) ConfigProviderSettings { // - Then applies all the confmap.Converter in the given order. // // * Then unmarshalls the confmap.Conf into the service Config. +// Deprecated: [v0.67.0] use collector.NewConfigProvider func NewConfigProvider(set ConfigProviderSettings) (ConfigProvider, error) { mr, err := confmap.NewResolver(set.ResolverSettings) if err != nil { diff --git a/service/servicetest/configprovider.go b/service/servicetest/configprovider.go index 227458ea93b..d88775c26c5 100644 --- a/service/servicetest/configprovider.go +++ b/service/servicetest/configprovider.go @@ -17,6 +17,7 @@ package servicetest // import "go.opentelemetry.io/collector/service/servicetest import ( "context" + "go.opentelemetry.io/collector/collector" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/confmap" "go.opentelemetry.io/collector/confmap/converter/expandconverter" @@ -30,7 +31,7 @@ import ( // LoadConfig loads a config.Config from file, and does NOT validate the configuration. func LoadConfig(fileName string, factories component.Factories) (*service.Config, error) { // Read yaml config from file - provider, err := service.NewConfigProvider(service.ConfigProviderSettings{ + provider, err := collector.NewConfigProvider(collector.ConfigProviderSettings{ ResolverSettings: confmap.ResolverSettings{ URIs: []string{fileName}, Providers: makeMapProvidersMap(fileprovider.New(), envprovider.New(), yamlprovider.New(), httpprovider.New()), diff --git a/service/settings.go b/service/settings.go index 070d6911b0c..527880a1383 100644 --- a/service/settings.go +++ b/service/settings.go @@ -42,6 +42,7 @@ type settings struct { } // CollectorSettings holds configuration for creating a new Collector. +// Deprecated: [v0.66.0] use collector.Settings type CollectorSettings struct { // Factories component factories. Factories component.Factories