From e6cd56dce176d8adecdd567c634d1e69a5616c2e Mon Sep 17 00:00:00 2001 From: mrasu Date: Fri, 13 Sep 2024 00:38:24 +0900 Subject: [PATCH 01/17] Make the first argument of NewScraper `component.Type` (#11159) #### Description As a step of https://github.com/open-telemetry/opentelemetry-collector/issues/9473, make the first argument of `scraperhelper.NewScraper` to take `component.Type`. This PR deprecates `NewScraperWithComponentType` as the method is temporary and was created to change an argument of `NewScraper` --- .chloggen/replace-new-scraper.yaml | 25 +++++++++++++++++++ receiver/scraperhelper/scraper.go | 18 ++++++------- .../scraperhelper/scrapercontroller_test.go | 8 +++--- 3 files changed, 38 insertions(+), 13 deletions(-) create mode 100644 .chloggen/replace-new-scraper.yaml diff --git a/.chloggen/replace-new-scraper.yaml b/.chloggen/replace-new-scraper.yaml new file mode 100644 index 00000000000..676d41a9b20 --- /dev/null +++ b/.chloggen/replace-new-scraper.yaml @@ -0,0 +1,25 @@ +# Use this changelog template to create an entry for release notes. + +# 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: scraperhelper + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Deprecate NewScraperWithComponentType, should use NewScraper + +# One or more tracking issues or pull requests related to the change +issues: [11159] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: + +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Include 'api' if there is a change to a library API. +# Default: '[user]' +change_logs: [api] diff --git a/receiver/scraperhelper/scraper.go b/receiver/scraperhelper/scraper.go index 143be6b06c9..b222f0bc339 100644 --- a/receiver/scraperhelper/scraper.go +++ b/receiver/scraperhelper/scraper.go @@ -61,15 +61,7 @@ func (b *baseScraper) ID() component.ID { // NewScraper creates a Scraper that calls Scrape at the specified collection interval, // reports observability information, and passes the scraped metrics to the next consumer. -// -// Deprecated: [v0.109.0] use NewScraperWithComponentType instead. -func NewScraper(name string, scrape ScrapeFunc, options ...ScraperOption) (Scraper, error) { - return NewScraperWithComponentType(component.MustNewType(name), scrape, options...) -} - -// NewScraperWithComponentType creates a Scraper that calls Scrape at the specified collection interval, -// reports observability information, and passes the scraped metrics to the next consumer. -func NewScraperWithComponentType(t component.Type, scrape ScrapeFunc, options ...ScraperOption) (Scraper, error) { +func NewScraper(t component.Type, scrape ScrapeFunc, options ...ScraperOption) (Scraper, error) { if scrape == nil { return nil, errNilFunc } @@ -83,3 +75,11 @@ func NewScraperWithComponentType(t component.Type, scrape ScrapeFunc, options .. return bs, nil } + +// NewScraperWithComponentType creates a Scraper that calls Scrape at the specified collection interval, +// reports observability information, and passes the scraped metrics to the next consumer. +// +// Deprecated: [v0.110.0] use NewScraper instead. +func NewScraperWithComponentType(t component.Type, scrape ScrapeFunc, options ...ScraperOption) (Scraper, error) { + return NewScraper(t, scrape, options...) +} diff --git a/receiver/scraperhelper/scrapercontroller_test.go b/receiver/scraperhelper/scrapercontroller_test.go index 5a459b7e514..eb8c37bb16c 100644 --- a/receiver/scraperhelper/scrapercontroller_test.go +++ b/receiver/scraperhelper/scrapercontroller_test.go @@ -223,7 +223,7 @@ func configureMetricOptions(t *testing.T, test metricsTestCase, initializeChs [] scrapeMetricsChs[i] = make(chan int) tsm := &testScrapeMetrics{ch: scrapeMetricsChs[i], err: test.scrapeErr} - scp, err := NewScraperWithComponentType(component.MustNewType("scraper"), tsm.scrape, scraperOptions...) + scp, err := NewScraper(component.MustNewType("scraper"), tsm.scrape, scraperOptions...) assert.NoError(t, err) metricOptions = append(metricOptions, AddScraper(scp)) @@ -325,7 +325,7 @@ func TestSingleScrapePerInterval(t *testing.T) { tickerCh := make(chan time.Time) - scp, err := NewScraperWithComponentType(component.MustNewType("scaper"), tsm.scrape) + scp, err := NewScraper(component.MustNewType("scaper"), tsm.scrape) assert.NoError(t, err) receiver, err := NewScraperControllerReceiver( @@ -367,7 +367,7 @@ func TestScrapeControllerStartsOnInit(t *testing.T) { ch: make(chan int, 1), } - scp, err := NewScraperWithComponentType(component.MustNewType("scraper"), tsm.scrape) + scp, err := NewScraper(component.MustNewType("scraper"), tsm.scrape) require.NoError(t, err, "Must not error when creating scraper") r, err := NewScraperControllerReceiver( @@ -403,7 +403,7 @@ func TestScrapeControllerInitialDelay(t *testing.T) { } ) - scp, err := NewScraperWithComponentType(component.MustNewType("timed"), func(context.Context) (pmetric.Metrics, error) { + scp, err := NewScraper(component.MustNewType("timed"), func(context.Context) (pmetric.Metrics, error) { elapsed <- time.Now() return pmetric.NewMetrics(), nil }) From e17f72833572c19430624fabe986a9ac4651d944 Mon Sep 17 00:00:00 2001 From: Pablo Baeyens Date: Thu, 12 Sep 2024 18:09:48 +0200 Subject: [PATCH 02/17] [confmap] Do not leak expanded values on Sub (#11157) #### Description Fixes `Sub` method to drop string representation if the requested sub-conf has it. #### Link to tracking issue Fixes #11154 #### Testing Added unit tests. --- .chloggen/mx-psi_fix-sub-config.yaml | 26 ++++++++++++++++++++++++++ confmap/confmap.go | 7 ++++++- confmap/confmap_test.go | 22 ++++++++++++++++++++++ 3 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 .chloggen/mx-psi_fix-sub-config.yaml diff --git a/.chloggen/mx-psi_fix-sub-config.yaml b/.chloggen/mx-psi_fix-sub-config.yaml new file mode 100644 index 00000000000..af4c99bca09 --- /dev/null +++ b/.chloggen/mx-psi_fix-sub-config.yaml @@ -0,0 +1,26 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: bug_fix + +# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) +component: confmap + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Fix loading config of a component from a different source. + +# One or more tracking issues or pull requests related to the change +issues: [11154] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: | + This issue only affected loading the whole component config, loading parts of a component config from a different source was working correctly. + +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Include 'api' if there is a change to a library API. +# Default: '[user]' +change_logs: [] diff --git a/confmap/confmap.go b/confmap/confmap.go index a340dabbd1c..fce5d0267d0 100644 --- a/confmap/confmap.go +++ b/confmap/confmap.go @@ -172,8 +172,13 @@ func (l *Conf) Sub(key string) (*Conf, error) { return New(), nil } - if v, ok := data.(map[string]any); ok { + switch v := data.(type) { + case map[string]any: return NewFromStringMap(v), nil + case expandedValue: + if m, ok := v.Value.(map[string]any); ok { + return NewFromStringMap(m), nil + } } return nil, fmt.Errorf("unexpected sub-config value kind for key:%s value:%v kind:%v", key, data, reflect.TypeOf(data).Kind()) diff --git a/confmap/confmap_test.go b/confmap/confmap_test.go index 3c5a118836c..24682c20347 100644 --- a/confmap/confmap_test.go +++ b/confmap/confmap_test.go @@ -876,6 +876,28 @@ func TestExpandedValue(t *testing.T) { assert.Error(t, cm.Unmarshal(&cfgBool)) } +func TestSubExpandedValue(t *testing.T) { + cm := NewFromStringMap(map[string]any{ + "key": map[string]any{ + "subkey": expandedValue{ + Value: map[string]any{"subsubkey": "value"}, + Original: "subsubkey: value", + }, + }, + }) + + assert.Equal(t, map[string]any{"subkey": map[string]any{"subsubkey": "value"}}, cm.Get("key")) + assert.Equal(t, map[string]any{"key": map[string]any{"subkey": map[string]any{"subsubkey": "value"}}}, cm.ToStringMap()) + assert.Equal(t, map[string]any{"subsubkey": "value"}, cm.Get("key::subkey")) + + sub, err := cm.Sub("key::subkey") + assert.NoError(t, err) + assert.Equal(t, map[string]any{"subsubkey": "value"}, sub.ToStringMap()) + + // This should return value, but currently `Get` does not support keys within expanded values. + assert.Nil(t, cm.Get("key::subkey::subsubkey")) +} + func TestStringyTypes(t *testing.T) { tests := []struct { valueOfType any From 3bcb341c7d242d7160e5e94cb8bd3f602d11e218 Mon Sep 17 00:00:00 2001 From: Alex Boten <223565+codeboten@users.noreply.github.com> Date: Thu, 12 Sep 2024 11:34:42 -0700 Subject: [PATCH 03/17] [processorhelper] remove deprecated funcs (#11151) Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com> --- .chloggen/main.yaml | 25 ++++ component/componenttest/obsreporttest.go | 12 +- .../componenttest/otelprometheuschecker.go | 15 ++- .../otelprometheuschecker_test.go | 6 +- processor/processorhelper/documentation.md | 24 ---- .../internal/metadata/generated_telemetry.go | 21 ---- processor/processorhelper/metadata.yaml | 24 ---- processor/processorhelper/obsreport.go | 47 ++----- processor/processorhelper/obsreport_test.go | 117 +++++++----------- 9 files changed, 97 insertions(+), 194 deletions(-) create mode 100644 .chloggen/main.yaml diff --git a/.chloggen/main.yaml b/.chloggen/main.yaml new file mode 100644 index 00000000000..506af46bb8c --- /dev/null +++ b/.chloggen/main.yaml @@ -0,0 +1,25 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: breaking + +# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) +component: processorhelper + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: "Remove deprecated `[Traces|Metrics|Logs]`Inserted funcs" + +# One or more tracking issues or pull requests related to the change +issues: [11151] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: + +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Include 'api' if there is a change to a library API. +# Default: '[user]' +change_logs: [] diff --git a/component/componenttest/obsreporttest.go b/component/componenttest/obsreporttest.go index 9e780315017..3662c640671 100644 --- a/component/componenttest/obsreporttest.go +++ b/component/componenttest/obsreporttest.go @@ -82,20 +82,20 @@ func (tts *TestTelemetry) CheckExporterMetricGauge(metric string, val int64, ext // CheckProcessorTraces checks that for the current exported values for trace exporter metrics match given values. // Note: SetupTelemetry must be called before this function. -func (tts *TestTelemetry) CheckProcessorTraces(acceptedSpans, refusedSpans, droppedSpans, insertedSpans int64) error { - return tts.prometheusChecker.checkProcessorTraces(tts.id, acceptedSpans, refusedSpans, droppedSpans, insertedSpans) +func (tts *TestTelemetry) CheckProcessorTraces(acceptedSpans, refusedSpans, droppedSpans int64) error { + return tts.prometheusChecker.checkProcessorTraces(tts.id, acceptedSpans, refusedSpans, droppedSpans) } // CheckProcessorMetrics checks that for the current exported values for metrics exporter metrics match given values. // Note: SetupTelemetry must be called before this function. -func (tts *TestTelemetry) CheckProcessorMetrics(acceptedMetricPoints, refusedMetricPoints, droppedMetricPoints, insertedMetricPoints int64) error { - return tts.prometheusChecker.checkProcessorMetrics(tts.id, acceptedMetricPoints, refusedMetricPoints, droppedMetricPoints, insertedMetricPoints) +func (tts *TestTelemetry) CheckProcessorMetrics(acceptedMetricPoints, refusedMetricPoints, droppedMetricPoints int64) error { + return tts.prometheusChecker.checkProcessorMetrics(tts.id, acceptedMetricPoints, refusedMetricPoints, droppedMetricPoints) } // CheckProcessorLogs checks that for the current exported values for logs exporter metrics match given values. // Note: SetupTelemetry must be called before this function. -func (tts *TestTelemetry) CheckProcessorLogs(acceptedLogRecords, refusedLogRecords, droppedLogRecords, insertedLogRecords int64) error { - return tts.prometheusChecker.checkProcessorLogs(tts.id, acceptedLogRecords, refusedLogRecords, droppedLogRecords, insertedLogRecords) +func (tts *TestTelemetry) CheckProcessorLogs(acceptedLogRecords, refusedLogRecords, droppedLogRecords int64) error { + return tts.prometheusChecker.checkProcessorLogs(tts.id, acceptedLogRecords, refusedLogRecords, droppedLogRecords) } // CheckReceiverTraces checks that for the current exported values for trace receiver metrics match given values. diff --git a/component/componenttest/otelprometheuschecker.go b/component/componenttest/otelprometheuschecker.go index 6a63617c206..14b357b9704 100644 --- a/component/componenttest/otelprometheuschecker.go +++ b/component/componenttest/otelprometheuschecker.go @@ -48,25 +48,24 @@ func (pc *prometheusChecker) checkReceiver(receiver component.ID, datatype, prot pc.checkCounter(fmt.Sprintf("receiver_refused_%s", datatype), droppedMetricPoints, receiverAttrs)) } -func (pc *prometheusChecker) checkProcessorTraces(processor component.ID, accepted, refused, dropped, inserted int64) error { - return pc.checkProcessor(processor, "spans", accepted, refused, dropped, inserted) +func (pc *prometheusChecker) checkProcessorTraces(processor component.ID, accepted, refused, dropped int64) error { + return pc.checkProcessor(processor, "spans", accepted, refused, dropped) } -func (pc *prometheusChecker) checkProcessorMetrics(processor component.ID, accepted, refused, dropped, inserted int64) error { - return pc.checkProcessor(processor, "metric_points", accepted, refused, dropped, inserted) +func (pc *prometheusChecker) checkProcessorMetrics(processor component.ID, accepted, refused, dropped int64) error { + return pc.checkProcessor(processor, "metric_points", accepted, refused, dropped) } -func (pc *prometheusChecker) checkProcessorLogs(processor component.ID, accepted, refused, dropped, inserted int64) error { - return pc.checkProcessor(processor, "log_records", accepted, refused, dropped, inserted) +func (pc *prometheusChecker) checkProcessorLogs(processor component.ID, accepted, refused, dropped int64) error { + return pc.checkProcessor(processor, "log_records", accepted, refused, dropped) } -func (pc *prometheusChecker) checkProcessor(processor component.ID, datatype string, accepted, refused, dropped, inserted int64) error { +func (pc *prometheusChecker) checkProcessor(processor component.ID, datatype string, accepted, refused, dropped int64) error { processorAttrs := attributesForProcessorMetrics(processor) return multierr.Combine( pc.checkCounter(fmt.Sprintf("processor_accepted_%s", datatype), accepted, processorAttrs), pc.checkCounter(fmt.Sprintf("processor_refused_%s", datatype), refused, processorAttrs), pc.checkCounter(fmt.Sprintf("processor_dropped_%s", datatype), dropped, processorAttrs), - pc.checkCounter(fmt.Sprintf("processor_inserted_%s", datatype), inserted, processorAttrs), ) } diff --git a/component/componenttest/otelprometheuschecker_test.go b/component/componenttest/otelprometheuschecker_test.go index a2efb109355..d7176134f54 100644 --- a/component/componenttest/otelprometheuschecker_test.go +++ b/component/componenttest/otelprometheuschecker_test.go @@ -88,17 +88,17 @@ func TestPromChecker(t *testing.T) { ) assert.NoError(t, - pc.checkProcessorTraces(processor, 42, 13, 7, 5), + pc.checkProcessorTraces(processor, 42, 13, 7), "metrics from Receiver Traces should be valid", ) assert.NoError(t, - pc.checkProcessorMetrics(processor, 7, 41, 13, 4), + pc.checkProcessorMetrics(processor, 7, 41, 13), "metrics from Receiver Metrics should be valid", ) assert.NoError(t, - pc.checkProcessorLogs(processor, 102, 35, 14, 3), + pc.checkProcessorLogs(processor, 102, 35, 14), "metrics from Receiver Logs should be valid", ) diff --git a/processor/processorhelper/documentation.md b/processor/processorhelper/documentation.md index e14bbbd779c..0b82255410f 100644 --- a/processor/processorhelper/documentation.md +++ b/processor/processorhelper/documentation.md @@ -78,30 +78,6 @@ Number of spans passed to the processor. | ---- | ----------- | ---------- | --------- | | {spans} | Sum | Int | true | -### otelcol_processor_inserted_log_records - -Number of log records that were inserted. - -| Unit | Metric Type | Value Type | Monotonic | -| ---- | ----------- | ---------- | --------- | -| {records} | Sum | Int | true | - -### otelcol_processor_inserted_metric_points - -Number of metric points that were inserted. - -| Unit | Metric Type | Value Type | Monotonic | -| ---- | ----------- | ---------- | --------- | -| {datapoints} | Sum | Int | true | - -### otelcol_processor_inserted_spans - -Number of spans that were inserted. - -| Unit | Metric Type | Value Type | Monotonic | -| ---- | ----------- | ---------- | --------- | -| {spans} | Sum | Int | true | - ### otelcol_processor_outgoing_log_records Number of log records emitted from the processor. diff --git a/processor/processorhelper/internal/metadata/generated_telemetry.go b/processor/processorhelper/internal/metadata/generated_telemetry.go index 31b15261a2f..11a7a86ee4b 100644 --- a/processor/processorhelper/internal/metadata/generated_telemetry.go +++ b/processor/processorhelper/internal/metadata/generated_telemetry.go @@ -38,9 +38,6 @@ type TelemetryBuilder struct { ProcessorIncomingLogRecords metric.Int64Counter ProcessorIncomingMetricPoints metric.Int64Counter ProcessorIncomingSpans metric.Int64Counter - ProcessorInsertedLogRecords metric.Int64Counter - ProcessorInsertedMetricPoints metric.Int64Counter - ProcessorInsertedSpans metric.Int64Counter ProcessorOutgoingLogRecords metric.Int64Counter ProcessorOutgoingMetricPoints metric.Int64Counter ProcessorOutgoingSpans metric.Int64Counter @@ -116,24 +113,6 @@ func NewTelemetryBuilder(settings component.TelemetrySettings, options ...teleme metric.WithUnit("{spans}"), ) errs = errors.Join(errs, err) - builder.ProcessorInsertedLogRecords, err = builder.meters[configtelemetry.LevelBasic].Int64Counter( - "otelcol_processor_inserted_log_records", - metric.WithDescription("Number of log records that were inserted."), - metric.WithUnit("{records}"), - ) - errs = errors.Join(errs, err) - builder.ProcessorInsertedMetricPoints, err = builder.meters[configtelemetry.LevelBasic].Int64Counter( - "otelcol_processor_inserted_metric_points", - metric.WithDescription("Number of metric points that were inserted."), - metric.WithUnit("{datapoints}"), - ) - errs = errors.Join(errs, err) - builder.ProcessorInsertedSpans, err = builder.meters[configtelemetry.LevelBasic].Int64Counter( - "otelcol_processor_inserted_spans", - metric.WithDescription("Number of spans that were inserted."), - metric.WithUnit("{spans}"), - ) - errs = errors.Join(errs, err) builder.ProcessorOutgoingLogRecords, err = builder.meters[configtelemetry.LevelBasic].Int64Counter( "otelcol_processor_outgoing_log_records", metric.WithDescription("Number of log records emitted from the processor."), diff --git a/processor/processorhelper/metadata.yaml b/processor/processorhelper/metadata.yaml index 9f6d1731f85..b9ead8f95f4 100644 --- a/processor/processorhelper/metadata.yaml +++ b/processor/processorhelper/metadata.yaml @@ -82,14 +82,6 @@ telemetry: value_type: int monotonic: true - processor_inserted_spans: - enabled: true - description: Number of spans that were inserted. - unit: "{spans}" - sum: - value_type: int - monotonic: true - processor_accepted_metric_points: enabled: true description: Number of metric points successfully pushed into the next component in the pipeline. @@ -114,14 +106,6 @@ telemetry: value_type: int monotonic: true - processor_inserted_metric_points: - enabled: true - description: Number of metric points that were inserted. - unit: "{datapoints}" - sum: - value_type: int - monotonic: true - processor_accepted_log_records: enabled: true description: Number of log records successfully pushed into the next component in the pipeline. @@ -145,11 +129,3 @@ telemetry: sum: value_type: int monotonic: true - - processor_inserted_log_records: - enabled: true - description: Number of log records that were inserted. - unit: "{records}" - sum: - value_type: int - monotonic: true diff --git a/processor/processorhelper/obsreport.go b/processor/processorhelper/obsreport.go index 158b590cfc4..d8fffafaf94 100644 --- a/processor/processorhelper/obsreport.go +++ b/processor/processorhelper/obsreport.go @@ -78,94 +78,69 @@ func (or *ObsReport) recordInOut(ctx context.Context, dataType component.DataTyp outgoingCount.Add(ctx, int64(outgoing), metric.WithAttributes(or.otelAttrs...)) } -func (or *ObsReport) recordData(ctx context.Context, dataType component.DataType, accepted, refused, dropped, inserted int64) { - var acceptedCount, refusedCount, droppedCount, insertedCount metric.Int64Counter +func (or *ObsReport) recordData(ctx context.Context, dataType component.DataType, accepted, refused, dropped int64) { + var acceptedCount, refusedCount, droppedCount metric.Int64Counter switch dataType { case component.DataTypeTraces: acceptedCount = or.telemetryBuilder.ProcessorAcceptedSpans refusedCount = or.telemetryBuilder.ProcessorRefusedSpans droppedCount = or.telemetryBuilder.ProcessorDroppedSpans - insertedCount = or.telemetryBuilder.ProcessorInsertedSpans case component.DataTypeMetrics: acceptedCount = or.telemetryBuilder.ProcessorAcceptedMetricPoints refusedCount = or.telemetryBuilder.ProcessorRefusedMetricPoints droppedCount = or.telemetryBuilder.ProcessorDroppedMetricPoints - insertedCount = or.telemetryBuilder.ProcessorInsertedMetricPoints case component.DataTypeLogs: acceptedCount = or.telemetryBuilder.ProcessorAcceptedLogRecords refusedCount = or.telemetryBuilder.ProcessorRefusedLogRecords droppedCount = or.telemetryBuilder.ProcessorDroppedLogRecords - insertedCount = or.telemetryBuilder.ProcessorInsertedLogRecords } acceptedCount.Add(ctx, accepted, metric.WithAttributes(or.otelAttrs...)) refusedCount.Add(ctx, refused, metric.WithAttributes(or.otelAttrs...)) droppedCount.Add(ctx, dropped, metric.WithAttributes(or.otelAttrs...)) - insertedCount.Add(ctx, inserted, metric.WithAttributes(or.otelAttrs...)) } // TracesAccepted reports that the trace data was accepted. func (or *ObsReport) TracesAccepted(ctx context.Context, numSpans int) { - or.recordData(ctx, component.DataTypeTraces, int64(numSpans), int64(0), int64(0), int64(0)) + or.recordData(ctx, component.DataTypeTraces, int64(numSpans), int64(0), int64(0)) } // TracesRefused reports that the trace data was refused. func (or *ObsReport) TracesRefused(ctx context.Context, numSpans int) { - or.recordData(ctx, component.DataTypeTraces, int64(0), int64(numSpans), int64(0), int64(0)) + or.recordData(ctx, component.DataTypeTraces, int64(0), int64(numSpans), int64(0)) } // TracesDropped reports that the trace data was dropped. func (or *ObsReport) TracesDropped(ctx context.Context, numSpans int) { - or.recordData(ctx, component.DataTypeTraces, int64(0), int64(0), int64(numSpans), int64(0)) -} - -// TracesInserted reports that the trace data was inserted. -// -// Deprecated: [v0.109.0] This method was not used in core/contrib and it's unclear when it should have been used. -func (or *ObsReport) TracesInserted(ctx context.Context, numSpans int) { - or.recordData(ctx, component.DataTypeTraces, int64(0), int64(0), int64(0), int64(numSpans)) + or.recordData(ctx, component.DataTypeTraces, int64(0), int64(0), int64(numSpans)) } // MetricsAccepted reports that the metrics were accepted. func (or *ObsReport) MetricsAccepted(ctx context.Context, numPoints int) { - or.recordData(ctx, component.DataTypeMetrics, int64(numPoints), int64(0), int64(0), int64(0)) + or.recordData(ctx, component.DataTypeMetrics, int64(numPoints), int64(0), int64(0)) } // MetricsRefused reports that the metrics were refused. func (or *ObsReport) MetricsRefused(ctx context.Context, numPoints int) { - or.recordData(ctx, component.DataTypeMetrics, int64(0), int64(numPoints), int64(0), int64(0)) + or.recordData(ctx, component.DataTypeMetrics, int64(0), int64(numPoints), int64(0)) } // MetricsDropped reports that the metrics were dropped. func (or *ObsReport) MetricsDropped(ctx context.Context, numPoints int) { - or.recordData(ctx, component.DataTypeMetrics, int64(0), int64(0), int64(numPoints), int64(0)) -} - -// MetricsInserted reports that the metrics were inserted. -// -// Deprecated: [v0.109.0] This method was not used in core/contrib and it's unclear when it should have been used. -func (or *ObsReport) MetricsInserted(ctx context.Context, numPoints int) { - or.recordData(ctx, component.DataTypeMetrics, int64(0), int64(0), int64(0), int64(numPoints)) + or.recordData(ctx, component.DataTypeMetrics, int64(0), int64(0), int64(numPoints)) } // LogsAccepted reports that the logs were accepted. func (or *ObsReport) LogsAccepted(ctx context.Context, numRecords int) { - or.recordData(ctx, component.DataTypeLogs, int64(numRecords), int64(0), int64(0), int64(0)) + or.recordData(ctx, component.DataTypeLogs, int64(numRecords), int64(0), int64(0)) } // LogsRefused reports that the logs were refused. func (or *ObsReport) LogsRefused(ctx context.Context, numRecords int) { - or.recordData(ctx, component.DataTypeLogs, int64(0), int64(numRecords), int64(0), int64(0)) + or.recordData(ctx, component.DataTypeLogs, int64(0), int64(numRecords), int64(0)) } // LogsDropped reports that the logs were dropped. func (or *ObsReport) LogsDropped(ctx context.Context, numRecords int) { - or.recordData(ctx, component.DataTypeLogs, int64(0), int64(0), int64(numRecords), int64(0)) -} - -// LogsInserted reports that the logs were inserted. -// -// Deprecated: [v0.109.0] This method was not used in core/contrib and it's unclear when it should have been used. -func (or *ObsReport) LogsInserted(ctx context.Context, numRecords int) { - or.recordData(ctx, component.DataTypeLogs, int64(0), int64(0), int64(0), int64(numRecords)) + or.recordData(ctx, component.DataTypeLogs, int64(0), int64(0), int64(numRecords)) } diff --git a/processor/processorhelper/obsreport_test.go b/processor/processorhelper/obsreport_test.go index f48b6739ef0..6b8aa846e8c 100644 --- a/processor/processorhelper/obsreport_test.go +++ b/processor/processorhelper/obsreport_test.go @@ -27,7 +27,6 @@ func TestProcessorTraceData(t *testing.T) { const acceptedSpans = 27 const refusedSpans = 19 const droppedSpans = 13 - const insertedSpans = 5 obsrep, err := newObsReport(ObsReportSettings{ ProcessorID: processorID, @@ -37,9 +36,8 @@ func TestProcessorTraceData(t *testing.T) { obsrep.TracesAccepted(context.Background(), acceptedSpans) obsrep.TracesRefused(context.Background(), refusedSpans) obsrep.TracesDropped(context.Background(), droppedSpans) - obsrep.TracesInserted(context.Background(), insertedSpans) - require.NoError(t, tt.CheckProcessorTraces(acceptedSpans, refusedSpans, droppedSpans, insertedSpans)) + require.NoError(t, tt.CheckProcessorTraces(acceptedSpans, refusedSpans, droppedSpans)) }) } @@ -48,7 +46,6 @@ func TestProcessorMetricsData(t *testing.T) { const acceptedPoints = 29 const refusedPoints = 11 const droppedPoints = 17 - const insertedPoints = 4 obsrep, err := newObsReport(ObsReportSettings{ ProcessorID: processorID, @@ -58,9 +55,8 @@ func TestProcessorMetricsData(t *testing.T) { obsrep.MetricsAccepted(context.Background(), acceptedPoints) obsrep.MetricsRefused(context.Background(), refusedPoints) obsrep.MetricsDropped(context.Background(), droppedPoints) - obsrep.MetricsInserted(context.Background(), insertedPoints) - require.NoError(t, tt.CheckProcessorMetrics(acceptedPoints, refusedPoints, droppedPoints, insertedPoints)) + require.NoError(t, tt.CheckProcessorMetrics(acceptedPoints, refusedPoints, droppedPoints)) }) } @@ -91,7 +87,6 @@ func TestProcessorLogRecords(t *testing.T) { const acceptedRecords = 29 const refusedRecords = 11 const droppedRecords = 17 - const insertedRecords = 3 obsrep, err := newObsReport(ObsReportSettings{ ProcessorID: processorID, @@ -101,9 +96,8 @@ func TestProcessorLogRecords(t *testing.T) { obsrep.LogsAccepted(context.Background(), acceptedRecords) obsrep.LogsRefused(context.Background(), refusedRecords) obsrep.LogsDropped(context.Background(), droppedRecords) - obsrep.LogsInserted(context.Background(), insertedRecords) - require.NoError(t, tt.CheckProcessorLogs(acceptedRecords, refusedRecords, droppedRecords, insertedRecords)) + require.NoError(t, tt.CheckProcessorLogs(acceptedRecords, refusedRecords, droppedRecords)) }) } @@ -121,24 +115,19 @@ func TestCheckProcessorTracesViews(t *testing.T) { por.TracesAccepted(context.Background(), 7) por.TracesRefused(context.Background(), 8) por.TracesDropped(context.Background(), 9) - por.TracesInserted(context.Background(), 10) - - assert.NoError(t, tt.CheckProcessorTraces(7, 8, 9, 10)) - assert.Error(t, tt.CheckProcessorTraces(0, 0, 0, 0)) - assert.Error(t, tt.CheckProcessorTraces(7, 0, 0, 0)) - assert.Error(t, tt.CheckProcessorTraces(0, 8, 0, 0)) - assert.Error(t, tt.CheckProcessorTraces(0, 0, 9, 0)) - assert.Error(t, tt.CheckProcessorTraces(0, 0, 0, 10)) - assert.Error(t, tt.CheckProcessorTraces(7, 8, 0, 0)) - assert.Error(t, tt.CheckProcessorTraces(7, 0, 9, 0)) - assert.Error(t, tt.CheckProcessorTraces(7, 0, 0, 10)) - assert.Error(t, tt.CheckProcessorTraces(0, 8, 9, 0)) - assert.Error(t, tt.CheckProcessorTraces(0, 8, 0, 10)) - assert.Error(t, tt.CheckProcessorTraces(0, 0, 9, 10)) - assert.Error(t, tt.CheckProcessorTraces(7, 8, 9, 0)) - assert.Error(t, tt.CheckProcessorTraces(7, 8, 0, 10)) - assert.Error(t, tt.CheckProcessorTraces(7, 0, 9, 10)) - assert.Error(t, tt.CheckProcessorTraces(0, 8, 9, 10)) + + assert.NoError(t, tt.CheckProcessorTraces(7, 8, 9)) + assert.Error(t, tt.CheckProcessorTraces(0, 0, 0)) + assert.Error(t, tt.CheckProcessorTraces(7, 0, 0)) + assert.Error(t, tt.CheckProcessorTraces(0, 8, 0)) + assert.Error(t, tt.CheckProcessorTraces(0, 0, 9)) + assert.Error(t, tt.CheckProcessorTraces(0, 0, 0)) + assert.Error(t, tt.CheckProcessorTraces(7, 8, 0)) + assert.Error(t, tt.CheckProcessorTraces(7, 0, 9)) + assert.Error(t, tt.CheckProcessorTraces(7, 0, 0)) + assert.Error(t, tt.CheckProcessorTraces(0, 8, 9)) + assert.Error(t, tt.CheckProcessorTraces(0, 8, 0)) + assert.Error(t, tt.CheckProcessorTraces(0, 0, 9)) } func TestCheckProcessorMetricsViews(t *testing.T) { @@ -155,24 +144,19 @@ func TestCheckProcessorMetricsViews(t *testing.T) { por.MetricsAccepted(context.Background(), 7) por.MetricsRefused(context.Background(), 8) por.MetricsDropped(context.Background(), 9) - por.MetricsInserted(context.Background(), 10) - - assert.NoError(t, tt.CheckProcessorMetrics(7, 8, 9, 10)) - assert.Error(t, tt.CheckProcessorMetrics(0, 0, 0, 0)) - assert.Error(t, tt.CheckProcessorMetrics(7, 0, 0, 0)) - assert.Error(t, tt.CheckProcessorMetrics(0, 8, 0, 0)) - assert.Error(t, tt.CheckProcessorMetrics(0, 0, 9, 0)) - assert.Error(t, tt.CheckProcessorMetrics(0, 0, 0, 10)) - assert.Error(t, tt.CheckProcessorMetrics(7, 8, 0, 0)) - assert.Error(t, tt.CheckProcessorMetrics(7, 0, 9, 0)) - assert.Error(t, tt.CheckProcessorMetrics(7, 0, 0, 10)) - assert.Error(t, tt.CheckProcessorMetrics(0, 8, 9, 0)) - assert.Error(t, tt.CheckProcessorMetrics(0, 8, 0, 10)) - assert.Error(t, tt.CheckProcessorMetrics(0, 0, 9, 10)) - assert.Error(t, tt.CheckProcessorMetrics(7, 8, 9, 0)) - assert.Error(t, tt.CheckProcessorMetrics(7, 8, 0, 10)) - assert.Error(t, tt.CheckProcessorMetrics(7, 0, 9, 10)) - assert.Error(t, tt.CheckProcessorMetrics(0, 8, 9, 10)) + + assert.NoError(t, tt.CheckProcessorMetrics(7, 8, 9)) + assert.Error(t, tt.CheckProcessorMetrics(0, 0, 0)) + assert.Error(t, tt.CheckProcessorMetrics(7, 0, 0)) + assert.Error(t, tt.CheckProcessorMetrics(0, 8, 0)) + assert.Error(t, tt.CheckProcessorMetrics(0, 0, 9)) + assert.Error(t, tt.CheckProcessorMetrics(0, 0, 0)) + assert.Error(t, tt.CheckProcessorMetrics(7, 8, 0)) + assert.Error(t, tt.CheckProcessorMetrics(7, 0, 9)) + assert.Error(t, tt.CheckProcessorMetrics(7, 0, 0)) + assert.Error(t, tt.CheckProcessorMetrics(0, 8, 9)) + assert.Error(t, tt.CheckProcessorMetrics(0, 8, 0)) + assert.Error(t, tt.CheckProcessorMetrics(0, 0, 9)) } func TestCheckProcessorLogViews(t *testing.T) { @@ -189,24 +173,19 @@ func TestCheckProcessorLogViews(t *testing.T) { por.LogsAccepted(context.Background(), 7) por.LogsRefused(context.Background(), 8) por.LogsDropped(context.Background(), 9) - por.LogsInserted(context.Background(), 10) - - assert.NoError(t, tt.CheckProcessorLogs(7, 8, 9, 10)) - assert.Error(t, tt.CheckProcessorLogs(0, 0, 0, 0)) - assert.Error(t, tt.CheckProcessorLogs(7, 0, 0, 0)) - assert.Error(t, tt.CheckProcessorLogs(0, 8, 0, 0)) - assert.Error(t, tt.CheckProcessorLogs(0, 0, 9, 0)) - assert.Error(t, tt.CheckProcessorLogs(0, 0, 0, 10)) - assert.Error(t, tt.CheckProcessorLogs(7, 8, 0, 0)) - assert.Error(t, tt.CheckProcessorLogs(7, 0, 9, 0)) - assert.Error(t, tt.CheckProcessorLogs(7, 0, 0, 10)) - assert.Error(t, tt.CheckProcessorLogs(0, 8, 9, 0)) - assert.Error(t, tt.CheckProcessorLogs(0, 8, 0, 10)) - assert.Error(t, tt.CheckProcessorLogs(0, 0, 9, 10)) - assert.Error(t, tt.CheckProcessorLogs(7, 8, 9, 0)) - assert.Error(t, tt.CheckProcessorLogs(7, 8, 0, 10)) - assert.Error(t, tt.CheckProcessorLogs(7, 0, 9, 10)) - assert.Error(t, tt.CheckProcessorLogs(0, 8, 9, 10)) + + assert.NoError(t, tt.CheckProcessorLogs(7, 8, 9)) + assert.Error(t, tt.CheckProcessorLogs(0, 0, 0)) + assert.Error(t, tt.CheckProcessorLogs(7, 0, 0)) + assert.Error(t, tt.CheckProcessorLogs(0, 8, 0)) + assert.Error(t, tt.CheckProcessorLogs(0, 0, 9)) + assert.Error(t, tt.CheckProcessorLogs(0, 0, 0)) + assert.Error(t, tt.CheckProcessorLogs(7, 8, 0)) + assert.Error(t, tt.CheckProcessorLogs(7, 0, 9)) + assert.Error(t, tt.CheckProcessorLogs(7, 0, 0)) + assert.Error(t, tt.CheckProcessorLogs(0, 8, 9)) + assert.Error(t, tt.CheckProcessorLogs(0, 8, 0)) + assert.Error(t, tt.CheckProcessorLogs(0, 0, 9)) } func TestNoMetrics(t *testing.T) { @@ -215,7 +194,6 @@ func TestNoMetrics(t *testing.T) { const accepted = 29 const refused = 11 const dropped = 17 - const inserted = 5 set := tt.TelemetrySettings() set.LeveledMeterProvider = func(_ configtelemetry.Level) metric.MeterProvider { @@ -231,15 +209,13 @@ func TestNoMetrics(t *testing.T) { por.TracesAccepted(context.Background(), accepted) por.TracesRefused(context.Background(), refused) por.TracesDropped(context.Background(), dropped) - por.TracesInserted(context.Background(), inserted) - require.Error(t, tt.CheckProcessorTraces(accepted, refused, dropped, inserted)) + require.Error(t, tt.CheckProcessorTraces(accepted, refused, dropped)) }) testTelemetry(t, processorID, func(t *testing.T, tt componenttest.TestTelemetry) { const accepted = 29 const refused = 11 const dropped = 17 - const inserted = 4 set := tt.TelemetrySettings() set.LeveledMeterProvider = func(_ configtelemetry.Level) metric.MeterProvider { @@ -255,15 +231,13 @@ func TestNoMetrics(t *testing.T) { por.MetricsAccepted(context.Background(), accepted) por.MetricsRefused(context.Background(), refused) por.MetricsDropped(context.Background(), dropped) - por.MetricsInserted(context.Background(), inserted) - require.Error(t, tt.CheckProcessorMetrics(accepted, refused, dropped, inserted)) + require.Error(t, tt.CheckProcessorMetrics(accepted, refused, dropped)) }) testTelemetry(t, processorID, func(t *testing.T, tt componenttest.TestTelemetry) { const accepted = 29 const refused = 11 const dropped = 17 - const inserted = 3 set := tt.TelemetrySettings() set.LeveledMeterProvider = func(_ configtelemetry.Level) metric.MeterProvider { @@ -279,9 +253,8 @@ func TestNoMetrics(t *testing.T) { por.LogsAccepted(context.Background(), accepted) por.LogsRefused(context.Background(), refused) por.LogsDropped(context.Background(), dropped) - por.LogsInserted(context.Background(), inserted) - require.Error(t, tt.CheckProcessorLogs(accepted, refused, dropped, inserted)) + require.Error(t, tt.CheckProcessorLogs(accepted, refused, dropped)) }) } From 5fc39ba6334f396c3b5497bf6d29db12823cb50c Mon Sep 17 00:00:00 2001 From: Murphy Chen Date: Fri, 13 Sep 2024 05:03:25 +0800 Subject: [PATCH 04/17] [mdatagen] mdatagen support validate metrics in in telemetry section (#10942) #### Description I have a use case, I define an attribute and try to use it in `telemetry.metric` however I encounter an error: `unused attributes: [xxx]` So, I push this PR to enhance the `validateMetrics()` func to support validate metrics in `telemetry.metric` #### Link to tracking issue fix Fixes https://github.com/open-telemetry/opentelemetry-collector/issues/10925 --------- Co-authored-by: Alex Boten <223565+codeboten@users.noreply.github.com> --- .chloggen/fix-metadatagen-validate.yaml | 25 ++++++++ cmd/mdatagen/testdata/unused_attribute.yaml | 17 +++++- cmd/mdatagen/validate.go | 63 ++++++++++++--------- cmd/mdatagen/validate_test.go | 4 +- 4 files changed, 77 insertions(+), 32 deletions(-) create mode 100644 .chloggen/fix-metadatagen-validate.yaml diff --git a/.chloggen/fix-metadatagen-validate.yaml b/.chloggen/fix-metadatagen-validate.yaml new file mode 100644 index 00000000000..37d5122793f --- /dev/null +++ b/.chloggen/fix-metadatagen-validate.yaml @@ -0,0 +1,25 @@ +# Use this changelog template to create an entry for release notes. + +# 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: mdatagen + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: mdatagen `validateMetrics()` support validate metrics in `telemetry.metric` + +# One or more tracking issues or pull requests related to the change +issues: [10925] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: + +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Include 'api' if there is a change to a library API. +# Default: '[user]' +change_logs: [] diff --git a/cmd/mdatagen/testdata/unused_attribute.yaml b/cmd/mdatagen/testdata/unused_attribute.yaml index d71586a7714..a3348712f8b 100644 --- a/cmd/mdatagen/testdata/unused_attribute.yaml +++ b/cmd/mdatagen/testdata/unused_attribute.yaml @@ -10,7 +10,10 @@ status: stable: [metrics] attributes: - used_attr: + used_attr_in_metrics_section: + description: Used attribute. + type: string + used_attr_in_telemetry_section: description: Used attribute. type: string @@ -26,4 +29,14 @@ metrics: unit: "1" gauge: value_type: double - attributes: [used_attr] + attributes: [used_attr_in_metrics_section] + +telemetry: + metrics: + metric: + enabled: true + description: Metric. + unit: "1" + gauge: + value_type: double + attributes: [used_attr_in_telemetry_section] \ No newline at end of file diff --git a/cmd/mdatagen/validate.go b/cmd/mdatagen/validate.go index 63108f29470..4685b1e2b1c 100644 --- a/cmd/mdatagen/validate.go +++ b/cmd/mdatagen/validate.go @@ -129,34 +129,9 @@ func (md *metadata) validateResourceAttributes() error { func (md *metadata) validateMetrics() error { var errs error usedAttrs := map[attributeName]bool{} - for mn, m := range md.Metrics { - if m.Sum == nil && m.Gauge == nil { - errs = errors.Join(errs, fmt.Errorf("metric %v doesn't have a metric type key, "+ - "one of the following has to be specified: sum, gauge", mn)) - continue - } - if m.Sum != nil && m.Gauge != nil { - errs = errors.Join(errs, fmt.Errorf("metric %v has more than one metric type keys, "+ - "only one of the following has to be specified: sum, gauge", mn)) - continue - } - if err := m.validate(); err != nil { - errs = errors.Join(errs, fmt.Errorf(`metric "%v": %w`, mn, err)) - continue - } - unknownAttrs := make([]attributeName, 0, len(m.Attributes)) - for _, attr := range m.Attributes { - if _, ok := md.Attributes[attr]; ok { - usedAttrs[attr] = true - } else { - unknownAttrs = append(unknownAttrs, attr) - } - } - if len(unknownAttrs) > 0 { - errs = errors.Join(errs, fmt.Errorf(`metric "%v" refers to undefined attributes: %v`, mn, unknownAttrs)) - } - } - errs = errors.Join(errs, md.validateAttributes(usedAttrs)) + errs = errors.Join(errs, validateMetrics(md.Metrics, md.Attributes, usedAttrs), + validateMetrics(md.Telemetry.Metrics, md.Attributes, usedAttrs), + md.validateAttributes(usedAttrs)) return errs } @@ -204,3 +179,35 @@ func (md *metadata) validateAttributes(usedAttrs map[attributeName]bool) error { } return errs } + +func validateMetrics(metrics map[metricName]metric, attributes map[attributeName]attribute, usedAttrs map[attributeName]bool) error { + var errs error + for mn, m := range metrics { + if m.Sum == nil && m.Gauge == nil && m.Histogram == nil { + errs = errors.Join(errs, fmt.Errorf("metric %v doesn't have a metric type key, "+ + "one of the following has to be specified: sum, gauge, histogram", mn)) + continue + } + if (m.Sum != nil && m.Gauge != nil) || (m.Sum != nil && m.Histogram != nil) || (m.Gauge != nil && m.Histogram != nil) { + errs = errors.Join(errs, fmt.Errorf("metric %v has more than one metric type keys, "+ + "only one of the following has to be specified: sum, gauge, histogram", mn)) + continue + } + if err := m.validate(); err != nil { + errs = errors.Join(errs, fmt.Errorf(`metric "%v": %w`, mn, err)) + continue + } + unknownAttrs := make([]attributeName, 0, len(m.Attributes)) + for _, attr := range m.Attributes { + if _, ok := attributes[attr]; ok { + usedAttrs[attr] = true + } else { + unknownAttrs = append(unknownAttrs, attr) + } + } + if len(unknownAttrs) > 0 { + errs = errors.Join(errs, fmt.Errorf(`metric "%v" refers to undefined attributes: %v`, mn, unknownAttrs)) + } + } + return errs +} diff --git a/cmd/mdatagen/validate_test.go b/cmd/mdatagen/validate_test.go index 497b726bca8..fcc62428648 100644 --- a/cmd/mdatagen/validate_test.go +++ b/cmd/mdatagen/validate_test.go @@ -69,12 +69,12 @@ func TestValidate(t *testing.T) { { name: "testdata/no_metric_type.yaml", wantErr: "metric system.cpu.time doesn't have a metric type key, " + - "one of the following has to be specified: sum, gauge", + "one of the following has to be specified: sum, gauge, histogram", }, { name: "testdata/two_metric_types.yaml", wantErr: "metric system.cpu.time has more than one metric type keys, " + - "only one of the following has to be specified: sum, gauge", + "only one of the following has to be specified: sum, gauge, histogram", }, { name: "testdata/invalid_input_type.yaml", From 5141578509428f867cbc730bd7c25a96357e5284 Mon Sep 17 00:00:00 2001 From: Zhengke Zhou Date: Fri, 13 Sep 2024 22:43:14 +0800 Subject: [PATCH 05/17] [Chore] assert.Positive comply with testifylint (#11165) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### Description testifylint wants to change the assertion and make sure it compiles。 #### Link to tracking issue Fixes #11164 --- internal/iruntime/total_memory_other_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/iruntime/total_memory_other_test.go b/internal/iruntime/total_memory_other_test.go index 5b1d9115827..195dc1f196a 100644 --- a/internal/iruntime/total_memory_other_test.go +++ b/internal/iruntime/total_memory_other_test.go @@ -14,5 +14,5 @@ import ( func TestTotalMemory(t *testing.T) { totalMemory, err := TotalMemory() assert.NoError(t, err) - assert.True(t, totalMemory > 0) + assert.Positive(t, totalMemory) } From 5102a1ec658ecb42e4e08c29014f2e2ce9f80e5e Mon Sep 17 00:00:00 2001 From: Pablo Baeyens Date: Fri, 13 Sep 2024 17:29:43 +0200 Subject: [PATCH 06/17] [cmd/builder] Disable strict version check (#11168) #### Description Disable strict version check. The `--skip-strict-version-check` is kept but is now a no-op. This fixes #11152. #### Link to tracking issue Fixes #11152 --- .../mx-psi_disable-strict-versioning.yaml | 26 +++++++++++++++++++ cmd/builder/internal/command.go | 2 +- cmd/builder/internal/command_test.go | 2 +- 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 .chloggen/mx-psi_disable-strict-versioning.yaml diff --git a/.chloggen/mx-psi_disable-strict-versioning.yaml b/.chloggen/mx-psi_disable-strict-versioning.yaml new file mode 100644 index 00000000000..677225ad0dc --- /dev/null +++ b/.chloggen/mx-psi_disable-strict-versioning.yaml @@ -0,0 +1,26 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: bug_fix + +# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) +component: cmd/builder + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Temporarily disable strict versioning checks + +# One or more tracking issues or pull requests related to the change +issues: [11129, 11152] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: | + The strict versioning check may be enabled by default in a future version once all configuration providers are stabilized. + +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Include 'api' if there is a change to a library API. +# Default: '[user]' +change_logs: [] diff --git a/cmd/builder/internal/command.go b/cmd/builder/internal/command.go index a738fb1c1f1..3af77178727 100644 --- a/cmd/builder/internal/command.go +++ b/cmd/builder/internal/command.go @@ -84,7 +84,7 @@ configuration is provided, ocb will generate a default Collector. cmd.Flags().BoolVar(&cfg.SkipGenerate, skipGenerateFlag, false, "Whether builder should skip generating go code (default false)") cmd.Flags().BoolVar(&cfg.SkipCompilation, skipCompilationFlag, false, "Whether builder should only generate go code with no compile of the collector (default false)") cmd.Flags().BoolVar(&cfg.SkipGetModules, skipGetModulesFlag, false, "Whether builder should skip updating go.mod and retrieve Go module list (default false)") - cmd.Flags().BoolVar(&cfg.SkipStrictVersioning, skipStrictVersioningFlag, false, "Whether builder should skip strictly checking the calculated versions following dependency resolution") + cmd.Flags().BoolVar(&cfg.SkipStrictVersioning, skipStrictVersioningFlag, true, "Whether builder should skip strictly checking the calculated versions following dependency resolution") cmd.Flags().BoolVar(&cfg.Verbose, verboseFlag, false, "Whether builder should print verbose output (default false)") cmd.Flags().StringVar(&cfg.LDFlags, ldflagsFlag, "", `ldflags to include in the "go build" command`) cmd.Flags().StringVar(&cfg.Distribution.Name, distributionNameFlag, "otelcol-custom", "The executable name for the OpenTelemetry Collector distribution") diff --git a/cmd/builder/internal/command_test.go b/cmd/builder/internal/command_test.go index d071efb312d..2f2a68f69ef 100644 --- a/cmd/builder/internal/command_test.go +++ b/cmd/builder/internal/command_test.go @@ -257,7 +257,7 @@ func Test_applyCfgFromFile(t *testing.T) { assert.Equal(t, tt.want.SkipGenerate, cfg.SkipGenerate) assert.Equal(t, tt.want.SkipCompilation, cfg.SkipCompilation) assert.Equal(t, tt.want.SkipGetModules, cfg.SkipGetModules) - assert.Equal(t, tt.want.SkipStrictVersioning, cfg.SkipStrictVersioning) + assert.True(t, cfg.SkipStrictVersioning) assert.Equal(t, tt.want.Excludes, cfg.Excludes) assert.Equal(t, tt.want.Exporters, cfg.Exporters) assert.Equal(t, tt.want.Receivers, cfg.Receivers) From 8a070097ec6d45d581f63d5c9ed18f2b5933255e Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Fri, 13 Sep 2024 09:37:43 -0700 Subject: [PATCH 07/17] [mdatagen] Avoid public APIs with internal params (#11040) Signed-off-by: Bogdan Drutu --- .chloggen/avoid-internal.yaml | 20 +++++++ .../internal/metadata/generated_metrics.go | 54 ++++++++++++------- .../internal/metadata/generated_telemetry.go | 22 +++++--- .../metadata/generated_telemetry_test.go | 4 +- cmd/mdatagen/templates/metrics.go.tmpl | 54 ++++++++++++------- cmd/mdatagen/templates/telemetry.go.tmpl | 23 +++++--- cmd/mdatagen/templates/telemetry_test.go.tmpl | 4 +- .../internal/metadata/generated_telemetry.go | 16 ++++-- .../metadata/generated_telemetry_test.go | 4 +- .../internal/metadata/generated_telemetry.go | 22 +++++--- .../metadata/generated_telemetry_test.go | 4 +- .../internal/metadata/generated_telemetry.go | 16 ++++-- .../metadata/generated_telemetry_test.go | 4 +- .../internal/metadata/generated_telemetry.go | 16 ++++-- .../metadata/generated_telemetry_test.go | 4 +- .../internal/metadata/generated_telemetry.go | 16 ++++-- .../metadata/generated_telemetry_test.go | 4 +- .../internal/metadata/generated_telemetry.go | 52 ++++++++++-------- .../metadata/generated_telemetry_test.go | 4 +- 19 files changed, 230 insertions(+), 113 deletions(-) create mode 100644 .chloggen/avoid-internal.yaml diff --git a/.chloggen/avoid-internal.yaml b/.chloggen/avoid-internal.yaml new file mode 100644 index 00000000000..70bd015768b --- /dev/null +++ b/.chloggen/avoid-internal.yaml @@ -0,0 +1,20 @@ +# Use this changelog template to create an entry for release notes. + +# 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: mdatagen + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Avoid using private types in public APIs and also protect options to be implemented outside this module. + +# One or more tracking issues or pull requests related to the change +issues: [11040] + +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Include 'api' if there is a change to a library API. +# Default: '[user]' +change_logs: [api] diff --git a/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_metrics.go b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_metrics.go index b05bf39206d..1e345a799b7 100644 --- a/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_metrics.go +++ b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_metrics.go @@ -331,17 +331,25 @@ type MetricsBuilder struct { metricOptionalMetricEmptyUnit metricOptionalMetricEmptyUnit } -// metricBuilderOption applies changes to default metrics builder. -type metricBuilderOption func(*MetricsBuilder) +// MetricBuilderOption applies changes to default metrics builder. +type MetricBuilderOption interface { + apply(*MetricsBuilder) +} + +type metricBuilderOptionFunc func(mb *MetricsBuilder) + +func (mbof metricBuilderOptionFunc) apply(mb *MetricsBuilder) { + mbof(mb) +} // WithStartTime sets startTime on the metrics builder. -func WithStartTime(startTime pcommon.Timestamp) metricBuilderOption { - return func(mb *MetricsBuilder) { +func WithStartTime(startTime pcommon.Timestamp) MetricBuilderOption { + return metricBuilderOptionFunc(func(mb *MetricsBuilder) { mb.startTime = startTime - } + }) } -func NewMetricsBuilder(mbc MetricsBuilderConfig, settings receiver.Settings, options ...metricBuilderOption) *MetricsBuilder { +func NewMetricsBuilder(mbc MetricsBuilderConfig, settings receiver.Settings, options ...MetricBuilderOption) *MetricsBuilder { if !mbc.Metrics.DefaultMetric.enabledSetByUser { settings.Logger.Warn("[WARNING] Please set `enabled` field explicitly for `default.metric`: This metric will be disabled by default soon.") } @@ -426,7 +434,7 @@ func NewMetricsBuilder(mbc MetricsBuilderConfig, settings receiver.Settings, opt } for _, op := range options { - op(mb) + op.apply(mb) } return mb } @@ -444,20 +452,28 @@ func (mb *MetricsBuilder) updateCapacity(rm pmetric.ResourceMetrics) { } // ResourceMetricsOption applies changes to provided resource metrics. -type ResourceMetricsOption func(pmetric.ResourceMetrics) +type ResourceMetricsOption interface { + apply(pmetric.ResourceMetrics) +} + +type resourceMetricsOptionFunc func(pmetric.ResourceMetrics) + +func (rmof resourceMetricsOptionFunc) apply(rm pmetric.ResourceMetrics) { + rmof(rm) +} // WithResource sets the provided resource on the emitted ResourceMetrics. // It's recommended to use ResourceBuilder to create the resource. func WithResource(res pcommon.Resource) ResourceMetricsOption { - return func(rm pmetric.ResourceMetrics) { + return resourceMetricsOptionFunc(func(rm pmetric.ResourceMetrics) { res.CopyTo(rm.Resource()) - } + }) } // WithStartTimeOverride overrides start time for all the resource metrics data points. // This option should be only used if different start time has to be set on metrics coming from different resources. func WithStartTimeOverride(start pcommon.Timestamp) ResourceMetricsOption { - return func(rm pmetric.ResourceMetrics) { + return resourceMetricsOptionFunc(func(rm pmetric.ResourceMetrics) { var dps pmetric.NumberDataPointSlice metrics := rm.ScopeMetrics().At(0).Metrics() for i := 0; i < metrics.Len(); i++ { @@ -471,7 +487,7 @@ func WithStartTimeOverride(start pcommon.Timestamp) ResourceMetricsOption { dps.At(j).SetStartTimestamp(start) } } - } + }) } // EmitForResource saves all the generated metrics under a new resource and updates the internal state to be ready for @@ -479,7 +495,7 @@ func WithStartTimeOverride(start pcommon.Timestamp) ResourceMetricsOption { // needs to emit metrics from several resources. Otherwise calling this function is not required, // just `Emit` function can be called instead. // Resource attributes should be provided as ResourceMetricsOption arguments. -func (mb *MetricsBuilder) EmitForResource(rmo ...ResourceMetricsOption) { +func (mb *MetricsBuilder) EmitForResource(options ...ResourceMetricsOption) { rm := pmetric.NewResourceMetrics() rm.SetSchemaUrl(conventions.SchemaURL) ils := rm.ScopeMetrics().AppendEmpty() @@ -492,8 +508,8 @@ func (mb *MetricsBuilder) EmitForResource(rmo ...ResourceMetricsOption) { mb.metricOptionalMetric.emit(ils.Metrics()) mb.metricOptionalMetricEmptyUnit.emit(ils.Metrics()) - for _, op := range rmo { - op(rm) + for _, op := range options { + op.apply(rm) } for attr, filter := range mb.resourceAttributeIncludeFilter { if val, ok := rm.Resource().Attributes().Get(attr); ok && !filter.Matches(val.AsString()) { @@ -515,8 +531,8 @@ func (mb *MetricsBuilder) EmitForResource(rmo ...ResourceMetricsOption) { // Emit returns all the metrics accumulated by the metrics builder and updates the internal state to be ready for // recording another set of metrics. This function will be responsible for applying all the transformations required to // produce metric representation defined in metadata and user config, e.g. delta or cumulative. -func (mb *MetricsBuilder) Emit(rmo ...ResourceMetricsOption) pmetric.Metrics { - mb.EmitForResource(rmo...) +func (mb *MetricsBuilder) Emit(options ...ResourceMetricsOption) pmetric.Metrics { + mb.EmitForResource(options...) metrics := mb.metricsBuffer mb.metricsBuffer = pmetric.NewMetrics() return metrics @@ -554,9 +570,9 @@ func (mb *MetricsBuilder) RecordOptionalMetricEmptyUnitDataPoint(ts pcommon.Time // Reset resets metrics builder to its initial state. It should be used when external metrics source is restarted, // and metrics builder should update its startTime and reset it's internal state accordingly. -func (mb *MetricsBuilder) Reset(options ...metricBuilderOption) { +func (mb *MetricsBuilder) Reset(options ...MetricBuilderOption) { mb.startTime = pcommon.NewTimestampFromTime(time.Now()) for _, op := range options { - op(mb) + op.apply(mb) } } diff --git a/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_telemetry.go b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_telemetry.go index 43104bedead..17685ad210d 100644 --- a/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_telemetry.go +++ b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_telemetry.go @@ -38,17 +38,25 @@ type TelemetryBuilder struct { meters map[configtelemetry.Level]metric.Meter } -// telemetryBuilderOption applies changes to default builder. -type telemetryBuilderOption func(*TelemetryBuilder) +// TelemetryBuilderOption applies changes to default builder. +type TelemetryBuilderOption interface { + apply(*TelemetryBuilder) +} + +type telemetryBuilderOptionFunc func(mb *TelemetryBuilder) + +func (tbof telemetryBuilderOptionFunc) apply(mb *TelemetryBuilder) { + tbof(mb) +} // WithProcessRuntimeTotalAllocBytesCallback sets callback for observable ProcessRuntimeTotalAllocBytes metric. -func WithProcessRuntimeTotalAllocBytesCallback(cb func() int64, opts ...metric.ObserveOption) telemetryBuilderOption { - return func(builder *TelemetryBuilder) { +func WithProcessRuntimeTotalAllocBytesCallback(cb func() int64, opts ...metric.ObserveOption) TelemetryBuilderOption { + return telemetryBuilderOptionFunc(func(builder *TelemetryBuilder) { builder.observeProcessRuntimeTotalAllocBytes = func(_ context.Context, o metric.Observer) error { o.ObserveInt64(builder.ProcessRuntimeTotalAllocBytes, cb(), opts...) return nil } - } + }) } // InitQueueLength configures the QueueLength metric. @@ -71,10 +79,10 @@ func (builder *TelemetryBuilder) InitQueueLength(cb func() int64, opts ...metric // NewTelemetryBuilder provides a struct with methods to update all internal telemetry // for a component -func NewTelemetryBuilder(settings component.TelemetrySettings, options ...telemetryBuilderOption) (*TelemetryBuilder, error) { +func NewTelemetryBuilder(settings component.TelemetrySettings, options ...TelemetryBuilderOption) (*TelemetryBuilder, error) { builder := TelemetryBuilder{meters: map[configtelemetry.Level]metric.Meter{}} for _, op := range options { - op(&builder) + op.apply(&builder) } builder.meters[configtelemetry.LevelBasic] = LeveledMeter(settings, configtelemetry.LevelBasic) var err, errs error diff --git a/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_telemetry_test.go b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_telemetry_test.go index 2d6767665ff..d34a3f5f639 100644 --- a/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_telemetry_test.go +++ b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_telemetry_test.go @@ -75,9 +75,9 @@ func TestNewTelemetryBuilder(t *testing.T) { TracerProvider: mockTracerProvider{}, } applied := false - _, err := NewTelemetryBuilder(set, func(b *TelemetryBuilder) { + _, err := NewTelemetryBuilder(set, telemetryBuilderOptionFunc(func(b *TelemetryBuilder) { applied = true - }) + })) require.NoError(t, err) require.True(t, applied) } diff --git a/cmd/mdatagen/templates/metrics.go.tmpl b/cmd/mdatagen/templates/metrics.go.tmpl index a084d847ee8..1a7075d3de4 100644 --- a/cmd/mdatagen/templates/metrics.go.tmpl +++ b/cmd/mdatagen/templates/metrics.go.tmpl @@ -144,17 +144,25 @@ type MetricsBuilder struct { {{- end }} } -// metricBuilderOption applies changes to default metrics builder. -type metricBuilderOption func(*MetricsBuilder) +// MetricBuilderOption applies changes to default metrics builder. +type MetricBuilderOption interface { + apply(*MetricsBuilder) +} + +type metricBuilderOptionFunc func(mb *MetricsBuilder) + +func (mbof metricBuilderOptionFunc) apply(mb *MetricsBuilder) { + mbof(mb) +} // WithStartTime sets startTime on the metrics builder. -func WithStartTime(startTime pcommon.Timestamp) metricBuilderOption { - return func(mb *MetricsBuilder) { +func WithStartTime(startTime pcommon.Timestamp) MetricBuilderOption { + return metricBuilderOptionFunc(func(mb *MetricsBuilder) { mb.startTime = startTime - } + }) } -func NewMetricsBuilder(mbc MetricsBuilderConfig, settings receiver.Settings, options ...metricBuilderOption) *MetricsBuilder { +func NewMetricsBuilder(mbc MetricsBuilderConfig, settings receiver.Settings, options ...MetricBuilderOption) *MetricsBuilder { {{- range $name, $metric := .Metrics }} {{- if $metric.Warnings.IfEnabled }} if mbc.Metrics.{{ $name.Render }}.Enabled { @@ -212,7 +220,7 @@ func NewMetricsBuilder(mbc MetricsBuilderConfig, settings receiver.Settings, opt {{- end }} for _, op := range options { - op(mb) + op.apply(mb) } return mb } @@ -232,20 +240,28 @@ func (mb *MetricsBuilder) updateCapacity(rm pmetric.ResourceMetrics) { } // ResourceMetricsOption applies changes to provided resource metrics. -type ResourceMetricsOption func(pmetric.ResourceMetrics) +type ResourceMetricsOption interface { + apply(pmetric.ResourceMetrics) +} + +type resourceMetricsOptionFunc func(pmetric.ResourceMetrics) + +func (rmof resourceMetricsOptionFunc) apply(rm pmetric.ResourceMetrics) { + rmof(rm) +} // WithResource sets the provided resource on the emitted ResourceMetrics. // It's recommended to use ResourceBuilder to create the resource. func WithResource(res pcommon.Resource) ResourceMetricsOption { - return func(rm pmetric.ResourceMetrics) { + return resourceMetricsOptionFunc(func(rm pmetric.ResourceMetrics) { res.CopyTo(rm.Resource()) - } + }) } // WithStartTimeOverride overrides start time for all the resource metrics data points. // This option should be only used if different start time has to be set on metrics coming from different resources. func WithStartTimeOverride(start pcommon.Timestamp) ResourceMetricsOption { - return func(rm pmetric.ResourceMetrics) { + return resourceMetricsOptionFunc(func(rm pmetric.ResourceMetrics) { var dps pmetric.NumberDataPointSlice metrics := rm.ScopeMetrics().At(0).Metrics() for i := 0; i < metrics.Len(); i++ { @@ -259,7 +275,7 @@ func WithStartTimeOverride(start pcommon.Timestamp) ResourceMetricsOption { dps.At(j).SetStartTimestamp(start) } } - } + }) } // EmitForResource saves all the generated metrics under a new resource and updates the internal state to be ready for @@ -267,7 +283,7 @@ func WithStartTimeOverride(start pcommon.Timestamp) ResourceMetricsOption { // needs to emit metrics from several resources. Otherwise calling this function is not required, // just `Emit` function can be called instead. // Resource attributes should be provided as ResourceMetricsOption arguments. -func (mb *MetricsBuilder) EmitForResource(rmo ...ResourceMetricsOption) { +func (mb *MetricsBuilder) EmitForResource(options ...ResourceMetricsOption) { rm := pmetric.NewResourceMetrics() {{- if .SemConvVersion }} rm.SetSchemaUrl(conventions.SchemaURL) @@ -280,8 +296,8 @@ func (mb *MetricsBuilder) EmitForResource(rmo ...ResourceMetricsOption) { mb.metric{{- $name.Render }}.emit(ils.Metrics()) {{- end }} - for _, op := range rmo { - op(rm) + for _, op := range options { + op.apply(rm) } {{ if .ResourceAttributes -}} for attr, filter := range mb.resourceAttributeIncludeFilter { @@ -305,8 +321,8 @@ func (mb *MetricsBuilder) EmitForResource(rmo ...ResourceMetricsOption) { // Emit returns all the metrics accumulated by the metrics builder and updates the internal state to be ready for // recording another set of metrics. This function will be responsible for applying all the transformations required to // produce metric representation defined in metadata and user config, e.g. delta or cumulative. -func (mb *MetricsBuilder) Emit(rmo ...ResourceMetricsOption) pmetric.Metrics { - mb.EmitForResource(rmo...) +func (mb *MetricsBuilder) Emit(options ...ResourceMetricsOption) pmetric.Metrics { + mb.EmitForResource(options...) metrics := mb.metricsBuffer mb.metricsBuffer = pmetric.NewMetrics() return metrics @@ -344,9 +360,9 @@ func (mb *MetricsBuilder) Record{{ $name.Render }}DataPoint(ts pcommon.Timestamp // Reset resets metrics builder to its initial state. It should be used when external metrics source is restarted, // and metrics builder should update its startTime and reset it's internal state accordingly. -func (mb *MetricsBuilder) Reset(options ...metricBuilderOption) { +func (mb *MetricsBuilder) Reset(options ...MetricBuilderOption) { mb.startTime = pcommon.NewTimestampFromTime(time.Now()) for _, op := range options { - op(mb) + op.apply(mb) } } diff --git a/cmd/mdatagen/templates/telemetry.go.tmpl b/cmd/mdatagen/templates/telemetry.go.tmpl index a4b98c3359b..7460f5958c1 100644 --- a/cmd/mdatagen/templates/telemetry.go.tmpl +++ b/cmd/mdatagen/templates/telemetry.go.tmpl @@ -48,8 +48,17 @@ type TelemetryBuilder struct { meters map[configtelemetry.Level]metric.Meter } -// telemetryBuilderOption applies changes to default builder. -type telemetryBuilderOption func(*TelemetryBuilder) +// TelemetryBuilderOption applies changes to default builder. +type TelemetryBuilderOption interface { + apply(*TelemetryBuilder) +} + +type telemetryBuilderOptionFunc func(mb *TelemetryBuilder) + +func (tbof telemetryBuilderOptionFunc) apply(mb *TelemetryBuilder) { + tbof(mb) +} + {{- range $name, $metric := .Telemetry.Metrics }} {{- if $metric.Optional }} @@ -79,13 +88,13 @@ func (builder *TelemetryBuilder) Init{{ $name.Render }}({{ if $metric.Data.Async {{- else }} {{ if $metric.Data.Async -}} // With{{ $name.Render }}Callback sets callback for observable {{ $name.Render }} metric. -func With{{ $name.Render }}Callback(cb func() {{ $metric.Data.BasicType }}, opts ...metric.ObserveOption) telemetryBuilderOption { - return func(builder *TelemetryBuilder) { +func With{{ $name.Render }}Callback(cb func() {{ $metric.Data.BasicType }}, opts ...metric.ObserveOption) TelemetryBuilderOption { + return telemetryBuilderOptionFunc(func(builder *TelemetryBuilder) { builder.observe{{ $name.Render }} = func(_ context.Context, o metric.Observer) error { o.Observe{{ casesTitle $metric.Data.BasicType }}(builder.{{ $name.Render }}, cb(), opts...) return nil } - } + }) } {{- end }} {{- end }} @@ -94,10 +103,10 @@ func With{{ $name.Render }}Callback(cb func() {{ $metric.Data.BasicType }}, opts // NewTelemetryBuilder provides a struct with methods to update all internal telemetry // for a component -func NewTelemetryBuilder(settings component.TelemetrySettings, options ...telemetryBuilderOption) (*TelemetryBuilder, error) { +func NewTelemetryBuilder(settings component.TelemetrySettings, options ...TelemetryBuilderOption) (*TelemetryBuilder, error) { builder := TelemetryBuilder{meters: map[configtelemetry.Level]metric.Meter{}} for _, op := range options { - op(&builder) + op.apply(&builder) } {{- range $level, $val := .Telemetry.Levels }} builder.meters[configtelemetry.Level{{ casesTitle $level }}] = LeveledMeter(settings, configtelemetry.Level{{ casesTitle $level }}) diff --git a/cmd/mdatagen/templates/telemetry_test.go.tmpl b/cmd/mdatagen/templates/telemetry_test.go.tmpl index 600fe5d42d8..87cd7c2688a 100644 --- a/cmd/mdatagen/templates/telemetry_test.go.tmpl +++ b/cmd/mdatagen/templates/telemetry_test.go.tmpl @@ -76,9 +76,9 @@ func TestNewTelemetryBuilder(t *testing.T) { TracerProvider: mockTracerProvider{}, } applied := false - _, err := NewTelemetryBuilder(set, func(b *TelemetryBuilder) { + _, err := NewTelemetryBuilder(set, telemetryBuilderOptionFunc(func(b *TelemetryBuilder) { applied = true - }) + })) require.NoError(t, err) require.True(t, applied) } diff --git a/exporter/exporterhelper/internal/metadata/generated_telemetry.go b/exporter/exporterhelper/internal/metadata/generated_telemetry.go index a35625ac0a5..b61d6cda6f2 100644 --- a/exporter/exporterhelper/internal/metadata/generated_telemetry.go +++ b/exporter/exporterhelper/internal/metadata/generated_telemetry.go @@ -44,8 +44,16 @@ type TelemetryBuilder struct { meters map[configtelemetry.Level]metric.Meter } -// telemetryBuilderOption applies changes to default builder. -type telemetryBuilderOption func(*TelemetryBuilder) +// TelemetryBuilderOption applies changes to default builder. +type TelemetryBuilderOption interface { + apply(*TelemetryBuilder) +} + +type telemetryBuilderOptionFunc func(mb *TelemetryBuilder) + +func (tbof telemetryBuilderOptionFunc) apply(mb *TelemetryBuilder) { + tbof(mb) +} // InitExporterQueueCapacity configures the ExporterQueueCapacity metric. func (builder *TelemetryBuilder) InitExporterQueueCapacity(cb func() int64, opts ...metric.ObserveOption) error { @@ -85,10 +93,10 @@ func (builder *TelemetryBuilder) InitExporterQueueSize(cb func() int64, opts ... // NewTelemetryBuilder provides a struct with methods to update all internal telemetry // for a component -func NewTelemetryBuilder(settings component.TelemetrySettings, options ...telemetryBuilderOption) (*TelemetryBuilder, error) { +func NewTelemetryBuilder(settings component.TelemetrySettings, options ...TelemetryBuilderOption) (*TelemetryBuilder, error) { builder := TelemetryBuilder{meters: map[configtelemetry.Level]metric.Meter{}} for _, op := range options { - op(&builder) + op.apply(&builder) } builder.meters[configtelemetry.LevelBasic] = LeveledMeter(settings, configtelemetry.LevelBasic) var err, errs error diff --git a/exporter/exporterhelper/internal/metadata/generated_telemetry_test.go b/exporter/exporterhelper/internal/metadata/generated_telemetry_test.go index ad1906945a4..20372daee92 100644 --- a/exporter/exporterhelper/internal/metadata/generated_telemetry_test.go +++ b/exporter/exporterhelper/internal/metadata/generated_telemetry_test.go @@ -75,9 +75,9 @@ func TestNewTelemetryBuilder(t *testing.T) { TracerProvider: mockTracerProvider{}, } applied := false - _, err := NewTelemetryBuilder(set, func(b *TelemetryBuilder) { + _, err := NewTelemetryBuilder(set, telemetryBuilderOptionFunc(func(b *TelemetryBuilder) { applied = true - }) + })) require.NoError(t, err) require.True(t, applied) } diff --git a/processor/batchprocessor/internal/metadata/generated_telemetry.go b/processor/batchprocessor/internal/metadata/generated_telemetry.go index 38a97468402..f4079ad8f0e 100644 --- a/processor/batchprocessor/internal/metadata/generated_telemetry.go +++ b/processor/batchprocessor/internal/metadata/generated_telemetry.go @@ -39,25 +39,33 @@ type TelemetryBuilder struct { meters map[configtelemetry.Level]metric.Meter } -// telemetryBuilderOption applies changes to default builder. -type telemetryBuilderOption func(*TelemetryBuilder) +// TelemetryBuilderOption applies changes to default builder. +type TelemetryBuilderOption interface { + apply(*TelemetryBuilder) +} + +type telemetryBuilderOptionFunc func(mb *TelemetryBuilder) + +func (tbof telemetryBuilderOptionFunc) apply(mb *TelemetryBuilder) { + tbof(mb) +} // WithProcessorBatchMetadataCardinalityCallback sets callback for observable ProcessorBatchMetadataCardinality metric. -func WithProcessorBatchMetadataCardinalityCallback(cb func() int64, opts ...metric.ObserveOption) telemetryBuilderOption { - return func(builder *TelemetryBuilder) { +func WithProcessorBatchMetadataCardinalityCallback(cb func() int64, opts ...metric.ObserveOption) TelemetryBuilderOption { + return telemetryBuilderOptionFunc(func(builder *TelemetryBuilder) { builder.observeProcessorBatchMetadataCardinality = func(_ context.Context, o metric.Observer) error { o.ObserveInt64(builder.ProcessorBatchMetadataCardinality, cb(), opts...) return nil } - } + }) } // NewTelemetryBuilder provides a struct with methods to update all internal telemetry // for a component -func NewTelemetryBuilder(settings component.TelemetrySettings, options ...telemetryBuilderOption) (*TelemetryBuilder, error) { +func NewTelemetryBuilder(settings component.TelemetrySettings, options ...TelemetryBuilderOption) (*TelemetryBuilder, error) { builder := TelemetryBuilder{meters: map[configtelemetry.Level]metric.Meter{}} for _, op := range options { - op(&builder) + op.apply(&builder) } builder.meters[configtelemetry.LevelBasic] = LeveledMeter(settings, configtelemetry.LevelBasic) builder.meters[configtelemetry.LevelDetailed] = LeveledMeter(settings, configtelemetry.LevelDetailed) diff --git a/processor/batchprocessor/internal/metadata/generated_telemetry_test.go b/processor/batchprocessor/internal/metadata/generated_telemetry_test.go index f05add260c3..1591d07b7fb 100644 --- a/processor/batchprocessor/internal/metadata/generated_telemetry_test.go +++ b/processor/batchprocessor/internal/metadata/generated_telemetry_test.go @@ -75,9 +75,9 @@ func TestNewTelemetryBuilder(t *testing.T) { TracerProvider: mockTracerProvider{}, } applied := false - _, err := NewTelemetryBuilder(set, func(b *TelemetryBuilder) { + _, err := NewTelemetryBuilder(set, telemetryBuilderOptionFunc(func(b *TelemetryBuilder) { applied = true - }) + })) require.NoError(t, err) require.True(t, applied) } diff --git a/processor/processorhelper/internal/metadata/generated_telemetry.go b/processor/processorhelper/internal/metadata/generated_telemetry.go index 11a7a86ee4b..ff2ede1496a 100644 --- a/processor/processorhelper/internal/metadata/generated_telemetry.go +++ b/processor/processorhelper/internal/metadata/generated_telemetry.go @@ -47,15 +47,23 @@ type TelemetryBuilder struct { meters map[configtelemetry.Level]metric.Meter } -// telemetryBuilderOption applies changes to default builder. -type telemetryBuilderOption func(*TelemetryBuilder) +// TelemetryBuilderOption applies changes to default builder. +type TelemetryBuilderOption interface { + apply(*TelemetryBuilder) +} + +type telemetryBuilderOptionFunc func(mb *TelemetryBuilder) + +func (tbof telemetryBuilderOptionFunc) apply(mb *TelemetryBuilder) { + tbof(mb) +} // NewTelemetryBuilder provides a struct with methods to update all internal telemetry // for a component -func NewTelemetryBuilder(settings component.TelemetrySettings, options ...telemetryBuilderOption) (*TelemetryBuilder, error) { +func NewTelemetryBuilder(settings component.TelemetrySettings, options ...TelemetryBuilderOption) (*TelemetryBuilder, error) { builder := TelemetryBuilder{meters: map[configtelemetry.Level]metric.Meter{}} for _, op := range options { - op(&builder) + op.apply(&builder) } builder.meters[configtelemetry.LevelBasic] = LeveledMeter(settings, configtelemetry.LevelBasic) var err, errs error diff --git a/processor/processorhelper/internal/metadata/generated_telemetry_test.go b/processor/processorhelper/internal/metadata/generated_telemetry_test.go index dc6fbeca903..21457f0a3fd 100644 --- a/processor/processorhelper/internal/metadata/generated_telemetry_test.go +++ b/processor/processorhelper/internal/metadata/generated_telemetry_test.go @@ -75,9 +75,9 @@ func TestNewTelemetryBuilder(t *testing.T) { TracerProvider: mockTracerProvider{}, } applied := false - _, err := NewTelemetryBuilder(set, func(b *TelemetryBuilder) { + _, err := NewTelemetryBuilder(set, telemetryBuilderOptionFunc(func(b *TelemetryBuilder) { applied = true - }) + })) require.NoError(t, err) require.True(t, applied) } diff --git a/receiver/receiverhelper/internal/metadata/generated_telemetry.go b/receiver/receiverhelper/internal/metadata/generated_telemetry.go index 766735f943c..86c263792cb 100644 --- a/receiver/receiverhelper/internal/metadata/generated_telemetry.go +++ b/receiver/receiverhelper/internal/metadata/generated_telemetry.go @@ -38,15 +38,23 @@ type TelemetryBuilder struct { meters map[configtelemetry.Level]metric.Meter } -// telemetryBuilderOption applies changes to default builder. -type telemetryBuilderOption func(*TelemetryBuilder) +// TelemetryBuilderOption applies changes to default builder. +type TelemetryBuilderOption interface { + apply(*TelemetryBuilder) +} + +type telemetryBuilderOptionFunc func(mb *TelemetryBuilder) + +func (tbof telemetryBuilderOptionFunc) apply(mb *TelemetryBuilder) { + tbof(mb) +} // NewTelemetryBuilder provides a struct with methods to update all internal telemetry // for a component -func NewTelemetryBuilder(settings component.TelemetrySettings, options ...telemetryBuilderOption) (*TelemetryBuilder, error) { +func NewTelemetryBuilder(settings component.TelemetrySettings, options ...TelemetryBuilderOption) (*TelemetryBuilder, error) { builder := TelemetryBuilder{meters: map[configtelemetry.Level]metric.Meter{}} for _, op := range options { - op(&builder) + op.apply(&builder) } builder.meters[configtelemetry.LevelBasic] = LeveledMeter(settings, configtelemetry.LevelBasic) var err, errs error diff --git a/receiver/receiverhelper/internal/metadata/generated_telemetry_test.go b/receiver/receiverhelper/internal/metadata/generated_telemetry_test.go index c96d8509125..b8162a38f07 100644 --- a/receiver/receiverhelper/internal/metadata/generated_telemetry_test.go +++ b/receiver/receiverhelper/internal/metadata/generated_telemetry_test.go @@ -75,9 +75,9 @@ func TestNewTelemetryBuilder(t *testing.T) { TracerProvider: mockTracerProvider{}, } applied := false - _, err := NewTelemetryBuilder(set, func(b *TelemetryBuilder) { + _, err := NewTelemetryBuilder(set, telemetryBuilderOptionFunc(func(b *TelemetryBuilder) { applied = true - }) + })) require.NoError(t, err) require.True(t, applied) } diff --git a/receiver/scraperhelper/internal/metadata/generated_telemetry.go b/receiver/scraperhelper/internal/metadata/generated_telemetry.go index 498746b0e87..5bcbf186364 100644 --- a/receiver/scraperhelper/internal/metadata/generated_telemetry.go +++ b/receiver/scraperhelper/internal/metadata/generated_telemetry.go @@ -34,15 +34,23 @@ type TelemetryBuilder struct { meters map[configtelemetry.Level]metric.Meter } -// telemetryBuilderOption applies changes to default builder. -type telemetryBuilderOption func(*TelemetryBuilder) +// TelemetryBuilderOption applies changes to default builder. +type TelemetryBuilderOption interface { + apply(*TelemetryBuilder) +} + +type telemetryBuilderOptionFunc func(mb *TelemetryBuilder) + +func (tbof telemetryBuilderOptionFunc) apply(mb *TelemetryBuilder) { + tbof(mb) +} // NewTelemetryBuilder provides a struct with methods to update all internal telemetry // for a component -func NewTelemetryBuilder(settings component.TelemetrySettings, options ...telemetryBuilderOption) (*TelemetryBuilder, error) { +func NewTelemetryBuilder(settings component.TelemetrySettings, options ...TelemetryBuilderOption) (*TelemetryBuilder, error) { builder := TelemetryBuilder{meters: map[configtelemetry.Level]metric.Meter{}} for _, op := range options { - op(&builder) + op.apply(&builder) } builder.meters[configtelemetry.LevelBasic] = LeveledMeter(settings, configtelemetry.LevelBasic) var err, errs error diff --git a/receiver/scraperhelper/internal/metadata/generated_telemetry_test.go b/receiver/scraperhelper/internal/metadata/generated_telemetry_test.go index d2d189e7643..ad6bc072985 100644 --- a/receiver/scraperhelper/internal/metadata/generated_telemetry_test.go +++ b/receiver/scraperhelper/internal/metadata/generated_telemetry_test.go @@ -75,9 +75,9 @@ func TestNewTelemetryBuilder(t *testing.T) { TracerProvider: mockTracerProvider{}, } applied := false - _, err := NewTelemetryBuilder(set, func(b *TelemetryBuilder) { + _, err := NewTelemetryBuilder(set, telemetryBuilderOptionFunc(func(b *TelemetryBuilder) { applied = true - }) + })) require.NoError(t, err) require.True(t, applied) } diff --git a/service/internal/metadata/generated_telemetry.go b/service/internal/metadata/generated_telemetry.go index c08e6cd7cd3..5c60998cb83 100644 --- a/service/internal/metadata/generated_telemetry.go +++ b/service/internal/metadata/generated_telemetry.go @@ -45,75 +45,83 @@ type TelemetryBuilder struct { meters map[configtelemetry.Level]metric.Meter } -// telemetryBuilderOption applies changes to default builder. -type telemetryBuilderOption func(*TelemetryBuilder) +// TelemetryBuilderOption applies changes to default builder. +type TelemetryBuilderOption interface { + apply(*TelemetryBuilder) +} + +type telemetryBuilderOptionFunc func(mb *TelemetryBuilder) + +func (tbof telemetryBuilderOptionFunc) apply(mb *TelemetryBuilder) { + tbof(mb) +} // WithProcessCPUSecondsCallback sets callback for observable ProcessCPUSeconds metric. -func WithProcessCPUSecondsCallback(cb func() float64, opts ...metric.ObserveOption) telemetryBuilderOption { - return func(builder *TelemetryBuilder) { +func WithProcessCPUSecondsCallback(cb func() float64, opts ...metric.ObserveOption) TelemetryBuilderOption { + return telemetryBuilderOptionFunc(func(builder *TelemetryBuilder) { builder.observeProcessCPUSeconds = func(_ context.Context, o metric.Observer) error { o.ObserveFloat64(builder.ProcessCPUSeconds, cb(), opts...) return nil } - } + }) } // WithProcessMemoryRssCallback sets callback for observable ProcessMemoryRss metric. -func WithProcessMemoryRssCallback(cb func() int64, opts ...metric.ObserveOption) telemetryBuilderOption { - return func(builder *TelemetryBuilder) { +func WithProcessMemoryRssCallback(cb func() int64, opts ...metric.ObserveOption) TelemetryBuilderOption { + return telemetryBuilderOptionFunc(func(builder *TelemetryBuilder) { builder.observeProcessMemoryRss = func(_ context.Context, o metric.Observer) error { o.ObserveInt64(builder.ProcessMemoryRss, cb(), opts...) return nil } - } + }) } // WithProcessRuntimeHeapAllocBytesCallback sets callback for observable ProcessRuntimeHeapAllocBytes metric. -func WithProcessRuntimeHeapAllocBytesCallback(cb func() int64, opts ...metric.ObserveOption) telemetryBuilderOption { - return func(builder *TelemetryBuilder) { +func WithProcessRuntimeHeapAllocBytesCallback(cb func() int64, opts ...metric.ObserveOption) TelemetryBuilderOption { + return telemetryBuilderOptionFunc(func(builder *TelemetryBuilder) { builder.observeProcessRuntimeHeapAllocBytes = func(_ context.Context, o metric.Observer) error { o.ObserveInt64(builder.ProcessRuntimeHeapAllocBytes, cb(), opts...) return nil } - } + }) } // WithProcessRuntimeTotalAllocBytesCallback sets callback for observable ProcessRuntimeTotalAllocBytes metric. -func WithProcessRuntimeTotalAllocBytesCallback(cb func() int64, opts ...metric.ObserveOption) telemetryBuilderOption { - return func(builder *TelemetryBuilder) { +func WithProcessRuntimeTotalAllocBytesCallback(cb func() int64, opts ...metric.ObserveOption) TelemetryBuilderOption { + return telemetryBuilderOptionFunc(func(builder *TelemetryBuilder) { builder.observeProcessRuntimeTotalAllocBytes = func(_ context.Context, o metric.Observer) error { o.ObserveInt64(builder.ProcessRuntimeTotalAllocBytes, cb(), opts...) return nil } - } + }) } // WithProcessRuntimeTotalSysMemoryBytesCallback sets callback for observable ProcessRuntimeTotalSysMemoryBytes metric. -func WithProcessRuntimeTotalSysMemoryBytesCallback(cb func() int64, opts ...metric.ObserveOption) telemetryBuilderOption { - return func(builder *TelemetryBuilder) { +func WithProcessRuntimeTotalSysMemoryBytesCallback(cb func() int64, opts ...metric.ObserveOption) TelemetryBuilderOption { + return telemetryBuilderOptionFunc(func(builder *TelemetryBuilder) { builder.observeProcessRuntimeTotalSysMemoryBytes = func(_ context.Context, o metric.Observer) error { o.ObserveInt64(builder.ProcessRuntimeTotalSysMemoryBytes, cb(), opts...) return nil } - } + }) } // WithProcessUptimeCallback sets callback for observable ProcessUptime metric. -func WithProcessUptimeCallback(cb func() float64, opts ...metric.ObserveOption) telemetryBuilderOption { - return func(builder *TelemetryBuilder) { +func WithProcessUptimeCallback(cb func() float64, opts ...metric.ObserveOption) TelemetryBuilderOption { + return telemetryBuilderOptionFunc(func(builder *TelemetryBuilder) { builder.observeProcessUptime = func(_ context.Context, o metric.Observer) error { o.ObserveFloat64(builder.ProcessUptime, cb(), opts...) return nil } - } + }) } // NewTelemetryBuilder provides a struct with methods to update all internal telemetry // for a component -func NewTelemetryBuilder(settings component.TelemetrySettings, options ...telemetryBuilderOption) (*TelemetryBuilder, error) { +func NewTelemetryBuilder(settings component.TelemetrySettings, options ...TelemetryBuilderOption) (*TelemetryBuilder, error) { builder := TelemetryBuilder{meters: map[configtelemetry.Level]metric.Meter{}} for _, op := range options { - op(&builder) + op.apply(&builder) } builder.meters[configtelemetry.LevelBasic] = LeveledMeter(settings, configtelemetry.LevelBasic) var err, errs error diff --git a/service/internal/metadata/generated_telemetry_test.go b/service/internal/metadata/generated_telemetry_test.go index c8f5f6fb6e7..6e64350d4c5 100644 --- a/service/internal/metadata/generated_telemetry_test.go +++ b/service/internal/metadata/generated_telemetry_test.go @@ -75,9 +75,9 @@ func TestNewTelemetryBuilder(t *testing.T) { TracerProvider: mockTracerProvider{}, } applied := false - _, err := NewTelemetryBuilder(set, func(b *TelemetryBuilder) { + _, err := NewTelemetryBuilder(set, telemetryBuilderOptionFunc(func(b *TelemetryBuilder) { applied = true - }) + })) require.NoError(t, err) require.True(t, applied) } From 3b50b38d396e9275bc94dba0e8b8ea83e7948961 Mon Sep 17 00:00:00 2001 From: Alex Boten <223565+codeboten@users.noreply.github.com> Date: Fri, 13 Sep 2024 13:07:15 -0700 Subject: [PATCH 08/17] [processorhelper] report signal as attribute on incoming/outgoing items (#11144) This updating the existing metric points that were recently added to use signal as an attribute instead of separating the metric name. It follows the suggestions in [otep 259](https://github.com/open-telemetry/oteps/pull/259) for the metric and attribute names. Putting this in draft to get some feedback from @djaglowski before moving forward with this change --------- Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com> --- .../codeboten_consolidate-inout-items.yaml | 36 ++++++++++++++ processor/processorhelper/documentation.md | 44 +++-------------- .../internal/metadata/generated_telemetry.go | 48 ++++--------------- processor/processorhelper/logs.go | 4 +- processor/processorhelper/logs_test.go | 16 +++---- processor/processorhelper/metadata.yaml | 44 +++-------------- processor/processorhelper/metrics.go | 4 +- processor/processorhelper/metrics_test.go | 16 +++---- processor/processorhelper/obsreport.go | 19 ++------ processor/processorhelper/traces.go | 4 +- processor/processorhelper/traces_test.go | 16 +++---- 11 files changed, 94 insertions(+), 157 deletions(-) create mode 100644 .chloggen/codeboten_consolidate-inout-items.yaml diff --git a/.chloggen/codeboten_consolidate-inout-items.yaml b/.chloggen/codeboten_consolidate-inout-items.yaml new file mode 100644 index 00000000000..067327f9e79 --- /dev/null +++ b/.chloggen/codeboten_consolidate-inout-items.yaml @@ -0,0 +1,36 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: breaking + +# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) +component: processorhelper + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: "Update incoming/outgoing metrics to a single metric with a `otel.signal` attributes." + +# One or more tracking issues or pull requests related to the change +issues: [11144] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: | + The following metrics were added in the previous version + - otelcol_processor_incoming_spans + - otelcol_processor_outgoing_spans + - otelcol_processor_incoming_metric_points + - otelcol_processor_outgoing_metric_points + - otelcol_processor_incoming_log_records + - otelcol_processor_outgoing_log_records + + They are being replaced with the following to more closely align with OTEP 259: + - otelcol_processor_incoming_items + - otelcol_processor_outgoing_items + +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Include 'api' if there is a change to a library API. +# Default: '[user]' +change_logs: [] diff --git a/processor/processorhelper/documentation.md b/processor/processorhelper/documentation.md index 0b82255410f..4f57c096a8a 100644 --- a/processor/processorhelper/documentation.md +++ b/processor/processorhelper/documentation.md @@ -54,53 +54,21 @@ Number of spans that were dropped. | ---- | ----------- | ---------- | --------- | | {spans} | Sum | Int | true | -### otelcol_processor_incoming_log_records +### otelcol_processor_incoming_items -Number of log records passed to the processor. +Number of items passed to the processor. | Unit | Metric Type | Value Type | Monotonic | | ---- | ----------- | ---------- | --------- | -| {records} | Sum | Int | true | - -### otelcol_processor_incoming_metric_points - -Number of metric points passed to the processor. - -| Unit | Metric Type | Value Type | Monotonic | -| ---- | ----------- | ---------- | --------- | -| {datapoints} | Sum | Int | true | - -### otelcol_processor_incoming_spans - -Number of spans passed to the processor. - -| Unit | Metric Type | Value Type | Monotonic | -| ---- | ----------- | ---------- | --------- | -| {spans} | Sum | Int | true | +| {items} | Sum | Int | true | -### otelcol_processor_outgoing_log_records +### otelcol_processor_outgoing_items -Number of log records emitted from the processor. +Number of items emitted from the processor. | Unit | Metric Type | Value Type | Monotonic | | ---- | ----------- | ---------- | --------- | -| {records} | Sum | Int | true | - -### otelcol_processor_outgoing_metric_points - -Number of metric points emitted from the processor. - -| Unit | Metric Type | Value Type | Monotonic | -| ---- | ----------- | ---------- | --------- | -| {datapoints} | Sum | Int | true | - -### otelcol_processor_outgoing_spans - -Number of spans emitted from the processor. - -| Unit | Metric Type | Value Type | Monotonic | -| ---- | ----------- | ---------- | --------- | -| {spans} | Sum | Int | true | +| {items} | Sum | Int | true | ### otelcol_processor_refused_log_records diff --git a/processor/processorhelper/internal/metadata/generated_telemetry.go b/processor/processorhelper/internal/metadata/generated_telemetry.go index ff2ede1496a..83053bdee91 100644 --- a/processor/processorhelper/internal/metadata/generated_telemetry.go +++ b/processor/processorhelper/internal/metadata/generated_telemetry.go @@ -35,12 +35,8 @@ type TelemetryBuilder struct { ProcessorDroppedLogRecords metric.Int64Counter ProcessorDroppedMetricPoints metric.Int64Counter ProcessorDroppedSpans metric.Int64Counter - ProcessorIncomingLogRecords metric.Int64Counter - ProcessorIncomingMetricPoints metric.Int64Counter - ProcessorIncomingSpans metric.Int64Counter - ProcessorOutgoingLogRecords metric.Int64Counter - ProcessorOutgoingMetricPoints metric.Int64Counter - ProcessorOutgoingSpans metric.Int64Counter + ProcessorIncomingItems metric.Int64Counter + ProcessorOutgoingItems metric.Int64Counter ProcessorRefusedLogRecords metric.Int64Counter ProcessorRefusedMetricPoints metric.Int64Counter ProcessorRefusedSpans metric.Int64Counter @@ -103,40 +99,16 @@ func NewTelemetryBuilder(settings component.TelemetrySettings, options ...Teleme metric.WithUnit("{spans}"), ) errs = errors.Join(errs, err) - builder.ProcessorIncomingLogRecords, err = builder.meters[configtelemetry.LevelBasic].Int64Counter( - "otelcol_processor_incoming_log_records", - metric.WithDescription("Number of log records passed to the processor."), - metric.WithUnit("{records}"), - ) - errs = errors.Join(errs, err) - builder.ProcessorIncomingMetricPoints, err = builder.meters[configtelemetry.LevelBasic].Int64Counter( - "otelcol_processor_incoming_metric_points", - metric.WithDescription("Number of metric points passed to the processor."), - metric.WithUnit("{datapoints}"), - ) - errs = errors.Join(errs, err) - builder.ProcessorIncomingSpans, err = builder.meters[configtelemetry.LevelBasic].Int64Counter( - "otelcol_processor_incoming_spans", - metric.WithDescription("Number of spans passed to the processor."), - metric.WithUnit("{spans}"), + builder.ProcessorIncomingItems, err = builder.meters[configtelemetry.LevelBasic].Int64Counter( + "otelcol_processor_incoming_items", + metric.WithDescription("Number of items passed to the processor."), + metric.WithUnit("{items}"), ) errs = errors.Join(errs, err) - builder.ProcessorOutgoingLogRecords, err = builder.meters[configtelemetry.LevelBasic].Int64Counter( - "otelcol_processor_outgoing_log_records", - metric.WithDescription("Number of log records emitted from the processor."), - metric.WithUnit("{records}"), - ) - errs = errors.Join(errs, err) - builder.ProcessorOutgoingMetricPoints, err = builder.meters[configtelemetry.LevelBasic].Int64Counter( - "otelcol_processor_outgoing_metric_points", - metric.WithDescription("Number of metric points emitted from the processor."), - metric.WithUnit("{datapoints}"), - ) - errs = errors.Join(errs, err) - builder.ProcessorOutgoingSpans, err = builder.meters[configtelemetry.LevelBasic].Int64Counter( - "otelcol_processor_outgoing_spans", - metric.WithDescription("Number of spans emitted from the processor."), - metric.WithUnit("{spans}"), + builder.ProcessorOutgoingItems, err = builder.meters[configtelemetry.LevelBasic].Int64Counter( + "otelcol_processor_outgoing_items", + metric.WithDescription("Number of items emitted from the processor."), + metric.WithUnit("{items}"), ) errs = errors.Join(errs, err) builder.ProcessorRefusedLogRecords, err = builder.meters[configtelemetry.LevelBasic].Int64Counter( diff --git a/processor/processorhelper/logs.go b/processor/processorhelper/logs.go index 1f3c7ccde09..f8b76b512a3 100644 --- a/processor/processorhelper/logs.go +++ b/processor/processorhelper/logs.go @@ -7,6 +7,7 @@ import ( "context" "errors" + "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/trace" "go.opentelemetry.io/collector/component" @@ -46,6 +47,7 @@ func NewLogsProcessor( if err != nil { return nil, err } + obs.otelAttrs = append(obs.otelAttrs, attribute.String("otel.signal", "logs")) eventOptions := spanAttributes(set.ID) bs := fromOptions(options) @@ -63,7 +65,7 @@ func NewLogsProcessor( return err } recordsOut := ld.LogRecordCount() - obs.recordInOut(ctx, component.DataTypeLogs, recordsIn, recordsOut) + obs.recordInOut(ctx, recordsIn, recordsOut) return nextConsumer.ConsumeLogs(ctx, ld) }, bs.consumerOptions...) if err != nil { diff --git a/processor/processorhelper/logs_test.go b/processor/processorhelper/logs_test.go index b3a220bfb3f..676155595e5 100644 --- a/processor/processorhelper/logs_test.go +++ b/processor/processorhelper/logs_test.go @@ -96,31 +96,31 @@ func TestLogsProcessor_RecordInOut(t *testing.T) { testTelemetry.assertMetrics(t, []metricdata.Metrics{ { - Name: "otelcol_processor_incoming_log_records", - Description: "Number of log records passed to the processor.", - Unit: "{records}", + Name: "otelcol_processor_incoming_items", + Description: "Number of items passed to the processor.", + Unit: "{items}", Data: metricdata.Sum[int64]{ Temporality: metricdata.CumulativeTemporality, IsMonotonic: true, DataPoints: []metricdata.DataPoint[int64]{ { Value: 3, - Attributes: attribute.NewSet(attribute.String("processor", "processorhelper")), + Attributes: attribute.NewSet(attribute.String("processor", "processorhelper"), attribute.String("otel.signal", "logs")), }, }, }, }, { - Name: "otelcol_processor_outgoing_log_records", - Description: "Number of log records emitted from the processor.", - Unit: "{records}", + Name: "otelcol_processor_outgoing_items", + Description: "Number of items emitted from the processor.", + Unit: "{items}", Data: metricdata.Sum[int64]{ Temporality: metricdata.CumulativeTemporality, IsMonotonic: true, DataPoints: []metricdata.DataPoint[int64]{ { Value: 1, - Attributes: attribute.NewSet(attribute.String("processor", "processorhelper")), + Attributes: attribute.NewSet(attribute.String("processor", "processorhelper"), attribute.String("otel.signal", "logs")), }, }, }, diff --git a/processor/processorhelper/metadata.yaml b/processor/processorhelper/metadata.yaml index b9ead8f95f4..90e0992efbf 100644 --- a/processor/processorhelper/metadata.yaml +++ b/processor/processorhelper/metadata.yaml @@ -10,50 +10,18 @@ status: telemetry: metrics: - processor_incoming_spans: + processor_incoming_items: enabled: true - description: Number of spans passed to the processor. - unit: "{spans}" - sum: - value_type: int - monotonic: true - - processor_outgoing_spans: - enabled: true - description: Number of spans emitted from the processor. - unit: "{spans}" - sum: - value_type: int - monotonic: true - - processor_incoming_metric_points: - enabled: true - description: Number of metric points passed to the processor. - unit: "{datapoints}" + description: Number of items passed to the processor. + unit: "{items}" sum: value_type: int monotonic: true - processor_outgoing_metric_points: + processor_outgoing_items: enabled: true - description: Number of metric points emitted from the processor. - unit: "{datapoints}" - sum: - value_type: int - monotonic: true - - processor_incoming_log_records: - enabled: true - description: Number of log records passed to the processor. - unit: "{records}" - sum: - value_type: int - monotonic: true - - processor_outgoing_log_records: - enabled: true - description: Number of log records emitted from the processor. - unit: "{records}" + description: Number of items emitted from the processor. + unit: "{items}" sum: value_type: int monotonic: true diff --git a/processor/processorhelper/metrics.go b/processor/processorhelper/metrics.go index 1d8771394b0..f98db1e240a 100644 --- a/processor/processorhelper/metrics.go +++ b/processor/processorhelper/metrics.go @@ -7,6 +7,7 @@ import ( "context" "errors" + "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/trace" "go.opentelemetry.io/collector/component" @@ -46,6 +47,7 @@ func NewMetricsProcessor( if err != nil { return nil, err } + obs.otelAttrs = append(obs.otelAttrs, attribute.String("otel.signal", "metrics")) eventOptions := spanAttributes(set.ID) bs := fromOptions(options) @@ -63,7 +65,7 @@ func NewMetricsProcessor( return err } pointsOut := md.DataPointCount() - obs.recordInOut(ctx, component.DataTypeMetrics, pointsIn, pointsOut) + obs.recordInOut(ctx, pointsIn, pointsOut) return nextConsumer.ConsumeMetrics(ctx, md) }, bs.consumerOptions...) if err != nil { diff --git a/processor/processorhelper/metrics_test.go b/processor/processorhelper/metrics_test.go index 110d72fbc18..db59e4be030 100644 --- a/processor/processorhelper/metrics_test.go +++ b/processor/processorhelper/metrics_test.go @@ -97,31 +97,31 @@ func TestMetricsProcessor_RecordInOut(t *testing.T) { testTelemetry.assertMetrics(t, []metricdata.Metrics{ { - Name: "otelcol_processor_incoming_metric_points", - Description: "Number of metric points passed to the processor.", - Unit: "{datapoints}", + Name: "otelcol_processor_incoming_items", + Description: "Number of items passed to the processor.", + Unit: "{items}", Data: metricdata.Sum[int64]{ Temporality: metricdata.CumulativeTemporality, IsMonotonic: true, DataPoints: []metricdata.DataPoint[int64]{ { Value: 2, - Attributes: attribute.NewSet(attribute.String("processor", "processorhelper")), + Attributes: attribute.NewSet(attribute.String("processor", "processorhelper"), attribute.String("otel.signal", "metrics")), }, }, }, }, { - Name: "otelcol_processor_outgoing_metric_points", - Description: "Number of metric points emitted from the processor.", - Unit: "{datapoints}", + Name: "otelcol_processor_outgoing_items", + Description: "Number of items emitted from the processor.", + Unit: "{items}", Data: metricdata.Sum[int64]{ Temporality: metricdata.CumulativeTemporality, IsMonotonic: true, DataPoints: []metricdata.DataPoint[int64]{ { Value: 3, - Attributes: attribute.NewSet(attribute.String("processor", "processorhelper")), + Attributes: attribute.NewSet(attribute.String("processor", "processorhelper"), attribute.String("otel.signal", "metrics")), }, }, }, diff --git a/processor/processorhelper/obsreport.go b/processor/processorhelper/obsreport.go index d8fffafaf94..791822e0aa7 100644 --- a/processor/processorhelper/obsreport.go +++ b/processor/processorhelper/obsreport.go @@ -60,22 +60,9 @@ func newObsReport(cfg ObsReportSettings) (*ObsReport, error) { }, nil } -func (or *ObsReport) recordInOut(ctx context.Context, dataType component.DataType, incoming, outgoing int) { - var incomingCount, outgoingCount metric.Int64Counter - switch dataType { - case component.DataTypeTraces: - incomingCount = or.telemetryBuilder.ProcessorIncomingSpans - outgoingCount = or.telemetryBuilder.ProcessorOutgoingSpans - case component.DataTypeMetrics: - incomingCount = or.telemetryBuilder.ProcessorIncomingMetricPoints - outgoingCount = or.telemetryBuilder.ProcessorOutgoingMetricPoints - case component.DataTypeLogs: - incomingCount = or.telemetryBuilder.ProcessorIncomingLogRecords - outgoingCount = or.telemetryBuilder.ProcessorOutgoingLogRecords - } - - incomingCount.Add(ctx, int64(incoming), metric.WithAttributes(or.otelAttrs...)) - outgoingCount.Add(ctx, int64(outgoing), metric.WithAttributes(or.otelAttrs...)) +func (or *ObsReport) recordInOut(ctx context.Context, incoming, outgoing int) { + or.telemetryBuilder.ProcessorIncomingItems.Add(ctx, int64(incoming), metric.WithAttributes(or.otelAttrs...)) + or.telemetryBuilder.ProcessorOutgoingItems.Add(ctx, int64(outgoing), metric.WithAttributes(or.otelAttrs...)) } func (or *ObsReport) recordData(ctx context.Context, dataType component.DataType, accepted, refused, dropped int64) { diff --git a/processor/processorhelper/traces.go b/processor/processorhelper/traces.go index b9988f5db55..b2b52c58c76 100644 --- a/processor/processorhelper/traces.go +++ b/processor/processorhelper/traces.go @@ -7,6 +7,7 @@ import ( "context" "errors" + "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/trace" "go.opentelemetry.io/collector/component" @@ -46,6 +47,7 @@ func NewTracesProcessor( if err != nil { return nil, err } + obs.otelAttrs = append(obs.otelAttrs, attribute.String("otel.signal", "traces")) eventOptions := spanAttributes(set.ID) bs := fromOptions(options) @@ -63,7 +65,7 @@ func NewTracesProcessor( return err } spansOut := td.SpanCount() - obs.recordInOut(ctx, component.DataTypeTraces, spansIn, spansOut) + obs.recordInOut(ctx, spansIn, spansOut) return nextConsumer.ConsumeTraces(ctx, td) }, bs.consumerOptions...) diff --git a/processor/processorhelper/traces_test.go b/processor/processorhelper/traces_test.go index ec45568890b..1e11564cdfc 100644 --- a/processor/processorhelper/traces_test.go +++ b/processor/processorhelper/traces_test.go @@ -97,31 +97,31 @@ func TestTracesProcessor_RecordInOut(t *testing.T) { testTelemetry.assertMetrics(t, []metricdata.Metrics{ { - Name: "otelcol_processor_incoming_spans", - Description: "Number of spans passed to the processor.", - Unit: "{spans}", + Name: "otelcol_processor_incoming_items", + Description: "Number of items passed to the processor.", + Unit: "{items}", Data: metricdata.Sum[int64]{ Temporality: metricdata.CumulativeTemporality, IsMonotonic: true, DataPoints: []metricdata.DataPoint[int64]{ { Value: 4, - Attributes: attribute.NewSet(attribute.String("processor", "processorhelper")), + Attributes: attribute.NewSet(attribute.String("processor", "processorhelper"), attribute.String("otel.signal", "traces")), }, }, }, }, { - Name: "otelcol_processor_outgoing_spans", - Description: "Number of spans emitted from the processor.", - Unit: "{spans}", + Name: "otelcol_processor_outgoing_items", + Description: "Number of items emitted from the processor.", + Unit: "{items}", Data: metricdata.Sum[int64]{ Temporality: metricdata.CumulativeTemporality, IsMonotonic: true, DataPoints: []metricdata.DataPoint[int64]{ { Value: 1, - Attributes: attribute.NewSet(attribute.String("processor", "processorhelper")), + Attributes: attribute.NewSet(attribute.String("processor", "processorhelper"), attribute.String("otel.signal", "traces")), }, }, }, From 6029f3176705fdc0cb63849b73bafbc6bc9214fb Mon Sep 17 00:00:00 2001 From: Braydon Kains <93549768+braydonk@users.noreply.github.com> Date: Mon, 16 Sep 2024 05:36:51 -0400 Subject: [PATCH 09/17] otelcol: fix windows event log core placement (#11051) #### Description In the CollectorSettings LoggingOptions, when the options are `zap.WrapCore`, the final core wrapped will end up running first. For this reason, the windowsEventLogCore must be the first option in the list of user supplied options, to ensure user supplied options are run before the core that writes to the Windows Event Log. Prior art: I fixed this before in #5298. #### Link to tracking issue #5297 #### Testing Testing was manual by running the Collector as a service after this change. I tried to add a unit test but could not find an effective way to do that due to all the type indirection done by the `zap` package. I was hoping to find an easy way to tell that the `windowsEventLogCore` is the first core wrapped in the options but I could not find a way to pull that off. Open to ideas if anyone can find a way. --- .../fix_windows_service_event_log_core.yaml | 25 +++++++++++++++++++ otelcol/collector_windows.go | 19 +++++++++++--- otelcol/collector_windows_service_test.go | 13 +++++++++- ...-to-file.yaml => otelcol-log-to-file.yaml} | 0 4 files changed, 52 insertions(+), 5 deletions(-) create mode 100644 .chloggen/fix_windows_service_event_log_core.yaml rename otelcol/testdata/{otel-log-to-file.yaml => otelcol-log-to-file.yaml} (100%) diff --git a/.chloggen/fix_windows_service_event_log_core.yaml b/.chloggen/fix_windows_service_event_log_core.yaml new file mode 100644 index 00000000000..7b33776084e --- /dev/null +++ b/.chloggen/fix_windows_service_event_log_core.yaml @@ -0,0 +1,25 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: bug_fix + +# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) +component: otelcol + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Fix the Windows Event Log configuration when running the Collector as a Windows service. + +# One or more tracking issues or pull requests related to the change +issues: [5297, 11051] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: + +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Include 'api' if there is a change to a library API. +# Default: '[user]' +change_logs: [] diff --git a/otelcol/collector_windows.go b/otelcol/collector_windows.go index 3df08386bbf..7e9099e02a9 100644 --- a/otelcol/collector_windows.go +++ b/otelcol/collector_windows.go @@ -99,10 +99,7 @@ func (s *windowsService) start(elog *eventlog.Log, colErrorChannel chan error) e // only read at the time of the Run method call. To work around this, we pass the // serviceConfig as a pointer to the logging options, and then read its value // when the zap.Logger is created by the telemetry. - s.col.set.LoggingOptions = append( - s.col.set.LoggingOptions, - zap.WrapCore(withWindowsCore(elog, &s.col.serviceConfig)), - ) + s.col.set.LoggingOptions = loggingOptionsWithEventLogCore(elog, &s.col.serviceConfig, s.col.set.LoggingOptions) // col.Run blocks until receiving a SIGTERM signal, so needs to be started // asynchronously, but it will exit early if an error occurs on startup @@ -141,6 +138,20 @@ func openEventLog(serviceName string) (*eventlog.Log, error) { return elog, nil } +func loggingOptionsWithEventLogCore( + elog *eventlog.Log, + serviceConfig **service.Config, + userOptions []zap.Option, +) []zap.Option { + return append( + // The order below must be preserved - see PR #11051 + // The event log core must run *after* any user provided options, so it + // must be the first option in this list. + []zap.Option{zap.WrapCore(withWindowsCore(elog, serviceConfig))}, + userOptions..., + ) +} + var _ zapcore.Core = (*windowsEventLogCore)(nil) type windowsEventLogCore struct { diff --git a/otelcol/collector_windows_service_test.go b/otelcol/collector_windows_service_test.go index 999fa87bbbc..7b4cdb93b68 100644 --- a/otelcol/collector_windows_service_test.go +++ b/otelcol/collector_windows_service_test.go @@ -25,6 +25,17 @@ const ( // Test the collector as a Windows service. // The test assumes that the service and respective event source are already created. +// +// To test locally: +// * Build the binary: +// - make otelcorecol +// +// * Install the Windows service +// - New-Service -Name "otelcorecol" -StartupType "Manual" -BinaryPathName "${PWD}\bin\otelcorecol_windows_amd64 --config ${PWD}\examples\local\otel-config.yaml" +// +// * Create event log source +// - eventcreate.exe /t information /id 1 /l application /d "Creating event provider for 'otelcorecol'" /so otelcorecol +// // The test also must be executed with administrative privileges. func TestCollectorAsService(t *testing.T) { collector_executable, err := filepath.Abs(filepath.Join("..", "bin", "otelcorecol_windows_amd64")) @@ -58,7 +69,7 @@ func TestCollectorAsService(t *testing.T) { }, { name: "LogToFile", - configFile: filepath.Join(".", "testdata", "otel-log-to-file.yaml"), + configFile: filepath.Join(".", "testdata", "otelcol-log-to-file.yaml"), customSetup: func(t *testing.T) { // Create the folder and clean the log file if it exists programDataPath := os.Getenv("ProgramData") diff --git a/otelcol/testdata/otel-log-to-file.yaml b/otelcol/testdata/otelcol-log-to-file.yaml similarity index 100% rename from otelcol/testdata/otel-log-to-file.yaml rename to otelcol/testdata/otelcol-log-to-file.yaml From 232dff7f7c457ce3327d8087a860e623a98e9054 Mon Sep 17 00:00:00 2001 From: Jade Guiton Date: Mon, 16 Sep 2024 15:46:45 +0200 Subject: [PATCH 10/17] [otlpexporter] Document incidental breaking change on Config struct (#11178) #### Description My PR #11132 introduced a small breaking change in the API of `otlpexporter`, which I failed to notice at the time. This PR adds a release note about this. Specifically, the `TimeoutSettings` field in `otlpexporter.Config` was renamed to `TimeoutConfig` ([link to the new code](https://github.com/jade-guiton-dd/opentelemetry-collector/blob/543c4f510d3bbcd50e914f4e5d7f22c5fcbda92d/exporter/otlpexporter/config.go#L23)). As this is an embedded field, renaming the type of the field renamed the field itself. (Another option would have been to de-embed the field, and keep the old name. This has less potential for breakage, but would technically also be a breaking change.) #### Link to tracking issue Indirectly related to #6767 --- .chloggen/6767-embedded-field-rename.yaml | 25 +++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .chloggen/6767-embedded-field-rename.yaml diff --git a/.chloggen/6767-embedded-field-rename.yaml b/.chloggen/6767-embedded-field-rename.yaml new file mode 100644 index 00000000000..bdc5b13883a --- /dev/null +++ b/.chloggen/6767-embedded-field-rename.yaml @@ -0,0 +1,25 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: breaking + +# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) +component: otlpexporter + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: The `TimeoutSettings` field in `otlpexporter.Config` was renamed to `TimeoutConfig`. + +# One or more tracking issues or pull requests related to the change +issues: [11132] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: + +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Include 'api' if there is a change to a library API. +# Default: '[user]' +change_logs: [api] From 74729e731d3b795ab81f33875e62753cbba5d791 Mon Sep 17 00:00:00 2001 From: Jade Guiton Date: Mon, 16 Sep 2024 16:36:58 +0200 Subject: [PATCH 11/17] [mdatagen] Fix metric tests on boolean attributes (#11169) #### Description Since commit 8f3ca8a, `mdatagen` improperly generates metric tests: boolean attributes are always expected to be `true` in the output, no matter what the injected test value was. For example, [this line in collector-contrib](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/19b01db307d984e62f81f1880b63327ba092cd81/receiver/apachesparkreceiver/internal/metadata/generated_metrics_test.go#L1250) is incorrectly changed to expect `true` instead of `false` after updating mdatagen and running it again. The reason is [this line](https://github.com/open-telemetry/opentelemetry-collector/blob/8f3ca8aaf58539e5afab54d365f97624efe7cbc3/cmd/mdatagen/templates/metrics_test.go.tmpl#L182), which attempts to generate `assert.True` or `assert.False` based on the expected test value. However, `(attributeInfo $attr).TestValue` does not return a boolean but the *string* `true` or `false`, both of which are considered "truthy" by the templating engine. #### Testing I manually rebuilt mdatagen, ran `make generate` in collector-contrib, and ran the tests, to confirm that the test related to the previously mentioned change was no longer failing. --- .chloggen/fix-mdatagen-metrics-bool-attr.yaml | 25 +++++++++++++++++++ .../internal/samplereceiver/documentation.md | 1 + .../internal/metadata/generated_metrics.go | 7 +++--- .../metadata/generated_metrics_test.go | 5 +++- .../internal/samplereceiver/metadata.yaml | 16 ++++++++---- cmd/mdatagen/loader_test.go | 9 ++++++- cmd/mdatagen/templates/metrics_test.go.tmpl | 2 +- 7 files changed, 54 insertions(+), 11 deletions(-) create mode 100644 .chloggen/fix-mdatagen-metrics-bool-attr.yaml diff --git a/.chloggen/fix-mdatagen-metrics-bool-attr.yaml b/.chloggen/fix-mdatagen-metrics-bool-attr.yaml new file mode 100644 index 00000000000..5f78068bb71 --- /dev/null +++ b/.chloggen/fix-mdatagen-metrics-bool-attr.yaml @@ -0,0 +1,25 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: bug_fix + +# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) +component: mdatagen + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Fix incorrect generation of metric tests with boolean attributes. + +# One or more tracking issues or pull requests related to the change +issues: [11169] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: + +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Include 'api' if there is a change to a library API. +# Default: '[user]' +change_logs: [] diff --git a/cmd/mdatagen/internal/samplereceiver/documentation.md b/cmd/mdatagen/internal/samplereceiver/documentation.md index 003a4cebbdb..f2370f811a5 100644 --- a/cmd/mdatagen/internal/samplereceiver/documentation.md +++ b/cmd/mdatagen/internal/samplereceiver/documentation.md @@ -84,6 +84,7 @@ metrics: | ---- | ----------- | ------ | | string_attr | Attribute with any string value. | Any Str | | boolean_attr | Attribute with a boolean value. | Any Bool | +| boolean_attr2 | Another attribute with a boolean value. | Any Bool | ### optional.metric.empty_unit diff --git a/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_metrics.go b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_metrics.go index 1e345a799b7..3baf1125eba 100644 --- a/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_metrics.go +++ b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_metrics.go @@ -225,7 +225,7 @@ func (m *metricOptionalMetric) init() { m.data.Gauge().DataPoints().EnsureCapacity(m.capacity) } -func (m *metricOptionalMetric) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val float64, stringAttrAttributeValue string, booleanAttrAttributeValue bool) { +func (m *metricOptionalMetric) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val float64, stringAttrAttributeValue string, booleanAttrAttributeValue bool, booleanAttr2AttributeValue bool) { if !m.config.Enabled { return } @@ -235,6 +235,7 @@ func (m *metricOptionalMetric) recordDataPoint(start pcommon.Timestamp, ts pcomm dp.SetDoubleValue(val) dp.Attributes().PutStr("string_attr", stringAttrAttributeValue) dp.Attributes().PutBool("boolean_attr", booleanAttrAttributeValue) + dp.Attributes().PutBool("boolean_attr2", booleanAttr2AttributeValue) } // updateCapacity saves max length of data point slices that will be used for the slice capacity. @@ -559,8 +560,8 @@ func (mb *MetricsBuilder) RecordMetricInputTypeDataPoint(ts pcommon.Timestamp, i } // RecordOptionalMetricDataPoint adds a data point to optional.metric metric. -func (mb *MetricsBuilder) RecordOptionalMetricDataPoint(ts pcommon.Timestamp, val float64, stringAttrAttributeValue string, booleanAttrAttributeValue bool) { - mb.metricOptionalMetric.recordDataPoint(mb.startTime, ts, val, stringAttrAttributeValue, booleanAttrAttributeValue) +func (mb *MetricsBuilder) RecordOptionalMetricDataPoint(ts pcommon.Timestamp, val float64, stringAttrAttributeValue string, booleanAttrAttributeValue bool, booleanAttr2AttributeValue bool) { + mb.metricOptionalMetric.recordDataPoint(mb.startTime, ts, val, stringAttrAttributeValue, booleanAttrAttributeValue, booleanAttr2AttributeValue) } // RecordOptionalMetricEmptyUnitDataPoint adds a data point to optional.metric.empty_unit metric. diff --git a/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_metrics_test.go b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_metrics_test.go index f4100521330..61d7f4c9caf 100644 --- a/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_metrics_test.go +++ b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_metrics_test.go @@ -110,7 +110,7 @@ func TestMetricsBuilder(t *testing.T) { mb.RecordMetricInputTypeDataPoint(ts, "1", "string_attr-val", 19, AttributeEnumAttrRed, []any{"slice_attr-item1", "slice_attr-item2"}, map[string]any{"key1": "map_attr-val1", "key2": "map_attr-val2"}) allMetricsCount++ - mb.RecordOptionalMetricDataPoint(ts, 1, "string_attr-val", true) + mb.RecordOptionalMetricDataPoint(ts, 1, "string_attr-val", true, false) allMetricsCount++ mb.RecordOptionalMetricEmptyUnitDataPoint(ts, 1, "string_attr-val", true) @@ -236,6 +236,9 @@ func TestMetricsBuilder(t *testing.T) { attrVal, ok = dp.Attributes().Get("boolean_attr") assert.True(t, ok) assert.True(t, attrVal.Bool()) + attrVal, ok = dp.Attributes().Get("boolean_attr2") + assert.True(t, ok) + assert.False(t, attrVal.Bool()) case "optional.metric.empty_unit": assert.False(t, validatedMetrics["optional.metric.empty_unit"], "Found a duplicate in the metrics slice: optional.metric.empty_unit") validatedMetrics["optional.metric.empty_unit"] = true diff --git a/cmd/mdatagen/internal/samplereceiver/metadata.yaml b/cmd/mdatagen/internal/samplereceiver/metadata.yaml index 5a6df8fb734..51548d18511 100644 --- a/cmd/mdatagen/internal/samplereceiver/metadata.yaml +++ b/cmd/mdatagen/internal/samplereceiver/metadata.yaml @@ -43,27 +43,27 @@ resource_attributes: map.resource.attr: description: Resource attribute with a map value. - type: map + type: map enabled: true string.resource.attr_disable_warning: description: Resource attribute with any string value. type: string - enabled: true + enabled: true warnings: if_enabled_not_set: This resource_attribute will be disabled by default soon. string.resource.attr_remove_warning: description: Resource attribute with any string value. type: string - enabled: false + enabled: false warnings: if_configured: This resource_attribute is deprecated and will be removed soon. string.resource.attr_to_be_removed: description: Resource attribute with any string value. type: string - enabled: true + enabled: true warnings: if_enabled: This resource_attribute is deprecated and will be removed soon. @@ -86,6 +86,12 @@ attributes: description: Attribute with a boolean value. type: bool + # This 2nd boolean attribute allows us to test both values for boolean attributes, + # as test values are based on the parity of the attribute name length. + boolean_attr2: + description: Another attribute with a boolean value. + type: bool + slice_attr: description: Attribute with a slice value. type: slice @@ -114,7 +120,7 @@ metrics: unit: "1" gauge: value_type: double - attributes: [string_attr, boolean_attr] + attributes: [string_attr, boolean_attr, boolean_attr2] warnings: if_configured: This metric is deprecated and will be removed soon. diff --git a/cmd/mdatagen/loader_test.go b/cmd/mdatagen/loader_test.go index 7d6927d3105..68dcfb84e0f 100644 --- a/cmd/mdatagen/loader_test.go +++ b/cmd/mdatagen/loader_test.go @@ -149,6 +149,13 @@ func TestLoadMetadata(t *testing.T) { }, FullName: "boolean_attr", }, + "boolean_attr2": { + Description: "Another attribute with a boolean value.", + Type: ValueType{ + ValueType: pcommon.ValueTypeBool, + }, + FullName: "boolean_attr2", + }, "slice_attr": { Description: "Attribute with a slice value.", Type: ValueType{ @@ -190,7 +197,7 @@ func TestLoadMetadata(t *testing.T) { Gauge: &gauge{ MetricValueType: MetricValueType{pmetric.NumberDataPointValueTypeDouble}, }, - Attributes: []attributeName{"string_attr", "boolean_attr"}, + Attributes: []attributeName{"string_attr", "boolean_attr", "boolean_attr2"}, }, "optional.metric.empty_unit": { Enabled: false, diff --git a/cmd/mdatagen/templates/metrics_test.go.tmpl b/cmd/mdatagen/templates/metrics_test.go.tmpl index ecb7008960e..ce9931227e9 100644 --- a/cmd/mdatagen/templates/metrics_test.go.tmpl +++ b/cmd/mdatagen/templates/metrics_test.go.tmpl @@ -179,7 +179,7 @@ func TestMetricsBuilder(t *testing.T) { attrVal, ok {{ if eq $i 0 }}:{{ end }}= dp.Attributes().Get("{{ (attributeInfo $attr).Name }}") assert.True(t, ok) {{- if eq (attributeInfo $attr).Type.String "Bool"}} - assert.{{- if (attributeInfo $attr).TestValue }}True{{ else }}False{{- end }}(t, attrVal.{{ (attributeInfo $attr).Type }}() + assert.{{- if eq (attributeInfo $attr).TestValue "true" }}True{{ else }}False{{- end }}(t, attrVal.{{ (attributeInfo $attr).Type }}() {{- else }} assert.EqualValues(t, {{ (attributeInfo $attr).TestValue }}, attrVal.{{ (attributeInfo $attr).Type }}() {{- end }} From d3a171889c53169e41760b25c6693bd91d206b6d Mon Sep 17 00:00:00 2001 From: Alex Boten <223565+codeboten@users.noreply.github.com> Date: Mon, 16 Sep 2024 10:14:16 -0700 Subject: [PATCH 12/17] [chore] update internal dep (#11180) This is done to allow contrib dependencies to work. Otherwise, otelcoltest ends up picking up an old dependency that looks for localhostgate which has been removed. Here's an example error: ``` go: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/azureeventhubreceiver tested by github.com/open-telemetry/opentelemetry-collector-contrib/receiver/azureeventhubreceiver.test imports go.opentelemetry.io/collector/otelcol/otelcoltest imports go.opentelemetry.io/collector/otelcol imports go.opentelemetry.io/collector/service tested by go.opentelemetry.io/collector/service.test imports go.opentelemetry.io/collector/config/confighttp imports go.opentelemetry.io/collector/config/internal imports go.opentelemetry.io/collector/internal/localhostgate: package go.opentelemetry.io/collector/internal/localhostgate provided by go.opentelemetry.io/collector at latest version v0.109.0 but not at required version v0.109.1-0.20240916143658-74729e731d3b ``` Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com> --- cmd/otelcorecol/go.mod | 2 +- config/configgrpc/go.mod | 2 +- config/confighttp/go.mod | 2 +- exporter/otlpexporter/go.mod | 2 +- exporter/otlphttpexporter/go.mod | 2 +- extension/zpagesextension/go.mod | 2 +- internal/e2e/go.mod | 2 +- receiver/otlpreceiver/go.mod | 2 +- service/go.mod | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cmd/otelcorecol/go.mod b/cmd/otelcorecol/go.mod index 5de90ac84fd..a2f7bc3d691 100644 --- a/cmd/otelcorecol/go.mod +++ b/cmd/otelcorecol/go.mod @@ -92,7 +92,7 @@ require ( go.opentelemetry.io/collector/config/configretry v1.15.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.109.0 // indirect go.opentelemetry.io/collector/config/configtls v1.15.0 // indirect - go.opentelemetry.io/collector/config/internal v0.109.0 // indirect + go.opentelemetry.io/collector/config/internal v0.109.1-0.20240916143658-74729e731d3b // indirect go.opentelemetry.io/collector/connector/connectorprofiles v0.109.0 // indirect go.opentelemetry.io/collector/consumer v0.109.0 // indirect go.opentelemetry.io/collector/consumer/consumerprofiles v0.109.0 // indirect diff --git a/config/configgrpc/go.mod b/config/configgrpc/go.mod index c5ac470b783..88be3af7595 100644 --- a/config/configgrpc/go.mod +++ b/config/configgrpc/go.mod @@ -13,7 +13,7 @@ require ( go.opentelemetry.io/collector/config/configopaque v1.15.0 go.opentelemetry.io/collector/config/configtelemetry v0.109.0 go.opentelemetry.io/collector/config/configtls v1.15.0 - go.opentelemetry.io/collector/config/internal v0.109.0 + go.opentelemetry.io/collector/config/internal v0.109.1-0.20240916143658-74729e731d3b go.opentelemetry.io/collector/extension/auth v0.109.0 go.opentelemetry.io/collector/featuregate v1.15.0 go.opentelemetry.io/collector/internal/globalgates v0.109.0 diff --git a/config/confighttp/go.mod b/config/confighttp/go.mod index edad28f0bb7..ce6775e98f7 100644 --- a/config/confighttp/go.mod +++ b/config/confighttp/go.mod @@ -14,7 +14,7 @@ require ( go.opentelemetry.io/collector/config/configopaque v1.15.0 go.opentelemetry.io/collector/config/configtelemetry v0.109.0 go.opentelemetry.io/collector/config/configtls v1.15.0 - go.opentelemetry.io/collector/config/internal v0.109.0 + go.opentelemetry.io/collector/config/internal v0.109.1-0.20240916143658-74729e731d3b go.opentelemetry.io/collector/extension/auth v0.109.0 go.opentelemetry.io/collector/featuregate v1.15.0 go.opentelemetry.io/collector/internal/globalgates v0.109.0 diff --git a/exporter/otlpexporter/go.mod b/exporter/otlpexporter/go.mod index 17b2f95f785..ba4e1661fe0 100644 --- a/exporter/otlpexporter/go.mod +++ b/exporter/otlpexporter/go.mod @@ -56,7 +56,7 @@ require ( go.opentelemetry.io/collector/client v1.15.0 // indirect go.opentelemetry.io/collector/config/confignet v0.109.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.109.0 // indirect - go.opentelemetry.io/collector/config/internal v0.109.0 // indirect + go.opentelemetry.io/collector/config/internal v0.109.1-0.20240916143658-74729e731d3b // indirect go.opentelemetry.io/collector/consumer/consumerprofiles v0.109.0 // indirect go.opentelemetry.io/collector/consumer/consumertest v0.109.0 // indirect go.opentelemetry.io/collector/exporter/exporterprofiles v0.109.0 // indirect diff --git a/exporter/otlphttpexporter/go.mod b/exporter/otlphttpexporter/go.mod index fd09a924fcb..82ecf37c57f 100644 --- a/exporter/otlphttpexporter/go.mod +++ b/exporter/otlphttpexporter/go.mod @@ -55,7 +55,7 @@ require ( go.opentelemetry.io/collector/client v1.15.0 // indirect go.opentelemetry.io/collector/config/configauth v0.109.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.109.0 // indirect - go.opentelemetry.io/collector/config/internal v0.109.0 // indirect + go.opentelemetry.io/collector/config/internal v0.109.1-0.20240916143658-74729e731d3b // indirect go.opentelemetry.io/collector/consumer/consumerprofiles v0.109.0 // indirect go.opentelemetry.io/collector/consumer/consumertest v0.109.0 // indirect go.opentelemetry.io/collector/exporter/exporterprofiles v0.109.0 // indirect diff --git a/extension/zpagesextension/go.mod b/extension/zpagesextension/go.mod index 6632d81b00a..544bbb029aa 100644 --- a/extension/zpagesextension/go.mod +++ b/extension/zpagesextension/go.mod @@ -49,7 +49,7 @@ require ( go.opentelemetry.io/collector/config/configopaque v1.15.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.109.0 // indirect go.opentelemetry.io/collector/config/configtls v1.15.0 // indirect - go.opentelemetry.io/collector/config/internal v0.109.0 // indirect + go.opentelemetry.io/collector/config/internal v0.109.1-0.20240916143658-74729e731d3b // indirect go.opentelemetry.io/collector/extension/auth v0.109.0 // indirect go.opentelemetry.io/collector/featuregate v1.15.0 // indirect go.opentelemetry.io/collector/internal/globalgates v0.109.0 // indirect diff --git a/internal/e2e/go.mod b/internal/e2e/go.mod index 515b9e89963..e792cfa73e9 100644 --- a/internal/e2e/go.mod +++ b/internal/e2e/go.mod @@ -75,7 +75,7 @@ require ( go.opentelemetry.io/collector/config/configauth v0.109.0 // indirect go.opentelemetry.io/collector/config/configcompression v1.15.0 // indirect go.opentelemetry.io/collector/config/confignet v0.109.0 // indirect - go.opentelemetry.io/collector/config/internal v0.109.0 // indirect + go.opentelemetry.io/collector/config/internal v0.109.1-0.20240916143658-74729e731d3b // indirect go.opentelemetry.io/collector/connector/connectorprofiles v0.109.0 // indirect go.opentelemetry.io/collector/consumer/consumerprofiles v0.109.0 // indirect go.opentelemetry.io/collector/exporter/exporterprofiles v0.109.0 // indirect diff --git a/receiver/otlpreceiver/go.mod b/receiver/otlpreceiver/go.mod index 40182efcd8a..f0e05ee63ff 100644 --- a/receiver/otlpreceiver/go.mod +++ b/receiver/otlpreceiver/go.mod @@ -60,7 +60,7 @@ require ( go.opentelemetry.io/collector/config/configcompression v1.15.0 // indirect go.opentelemetry.io/collector/config/configopaque v1.15.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.109.0 // indirect - go.opentelemetry.io/collector/config/internal v0.109.0 // indirect + go.opentelemetry.io/collector/config/internal v0.109.1-0.20240916143658-74729e731d3b // indirect go.opentelemetry.io/collector/consumer/consumerprofiles v0.109.0 // indirect go.opentelemetry.io/collector/extension v0.109.0 // indirect go.opentelemetry.io/collector/extension/auth v0.109.0 // indirect diff --git a/service/go.mod b/service/go.mod index 14591fba060..e1582d2d2cf 100644 --- a/service/go.mod +++ b/service/go.mod @@ -92,7 +92,7 @@ require ( go.opentelemetry.io/collector/config/configcompression v1.15.0 // indirect go.opentelemetry.io/collector/config/configopaque v1.15.0 // indirect go.opentelemetry.io/collector/config/configtls v1.15.0 // indirect - go.opentelemetry.io/collector/config/internal v0.109.0 // indirect + go.opentelemetry.io/collector/config/internal v0.109.1-0.20240916143658-74729e731d3b // indirect go.opentelemetry.io/collector/extension/auth v0.109.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect go.opentelemetry.io/contrib/zpages v0.54.0 // indirect From 8db93c260d6223e96779ea21fd90b531c46bcbe7 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Mon, 16 Sep 2024 13:23:34 -0700 Subject: [PATCH 13/17] [pdata]: Add support to MoveTo for Map, allow avoiding copies (#11175) #### Description Can be used to remove unnecessary copies from places like https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/c52a9a7ae1563127254530d416a8c569c54750bd/pkg/ottl/ottlfuncs/func_replace_all_patterns.go#L100 Signed-off-by: Bogdan Drutu --- .chloggen/add-map-moveto.yaml | 20 ++++++++++++++++++++ pdata/pcommon/map.go | 9 +++++++++ pdata/pcommon/map_test.go | 19 ++++++++++++++++++- 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 .chloggen/add-map-moveto.yaml diff --git a/.chloggen/add-map-moveto.yaml b/.chloggen/add-map-moveto.yaml new file mode 100644 index 00000000000..ecb169f5527 --- /dev/null +++ b/.chloggen/add-map-moveto.yaml @@ -0,0 +1,20 @@ +# Use this changelog template to create an entry for release notes. + +# 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: pdata + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Add support to MoveTo for Map, allow avoiding copies + +# One or more tracking issues or pull requests related to the change +issues: [11175] + +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Include 'api' if there is a change to a library API. +# Default: '[user]' +change_logs: [api, user] diff --git a/pdata/pcommon/map.go b/pdata/pcommon/map.go index 5bbfab962b0..91b803922a3 100644 --- a/pdata/pcommon/map.go +++ b/pdata/pcommon/map.go @@ -225,6 +225,15 @@ func (m Map) Range(f func(k string, v Value) bool) { } } +// MoveTo moves all key/values from the current map overriding the destination and +// resetting the current instance to its zero value +func (m Map) MoveTo(dest Map) { + m.getState().AssertMutable() + dest.getState().AssertMutable() + *dest.getOrig() = *m.getOrig() + *m.getOrig() = nil +} + // CopyTo copies all elements from the current map overriding the destination. func (m Map) CopyTo(dest Map) { dest.getState().AssertMutable() diff --git a/pdata/pcommon/map_test.go b/pdata/pcommon/map_test.go index a60d650fdc0..c3eafb25acd 100644 --- a/pdata/pcommon/map_test.go +++ b/pdata/pcommon/map_test.go @@ -375,11 +375,28 @@ func TestMap_FromRaw(t *testing.T) { }, v.Map().AsRaw()) } +func TestMap_MoveTo(t *testing.T) { + dest := NewMap() + // Test MoveTo to empty + NewMap().MoveTo(dest) + assert.Equal(t, 0, dest.Len()) + + // Test MoveTo larger slice + src := Map(internal.GenerateTestMap()) + src.MoveTo(dest) + assert.EqualValues(t, Map(internal.GenerateTestMap()), dest) + assert.Equal(t, 0, src.Len()) + + // Test MoveTo from empty to non-empty + NewMap().MoveTo(dest) + assert.Equal(t, 0, dest.Len()) +} + func TestMap_CopyTo(t *testing.T) { dest := NewMap() // Test CopyTo to empty NewMap().CopyTo(dest) - assert.EqualValues(t, 0, dest.Len()) + assert.Equal(t, 0, dest.Len()) // Test CopyTo larger slice Map(internal.GenerateTestMap()).CopyTo(dest) From 2c0941f0f144de3b05979076caec7b8db65a51d4 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Mon, 16 Sep 2024 13:58:56 -0700 Subject: [PATCH 14/17] [chore] Move mdatagen code to internal, no public API needed (#11181) Signed-off-by: Bogdan Drutu --- cmd/mdatagen/README.md | 4 +- .../{ => internal}/embeded_templates.go | 6 +- .../{ => internal}/embeded_templates_test.go | 4 +- cmd/mdatagen/{ => internal}/lint.go | 6 +- cmd/mdatagen/{ => internal}/lint_test.go | 4 +- cmd/mdatagen/{ => internal}/loader.go | 64 +++++++++---------- cmd/mdatagen/{ => internal}/loader_test.go | 40 ++++++------ cmd/mdatagen/{ => internal}/metricdata.go | 4 +- .../{ => internal}/metricdata_test.go | 2 +- cmd/mdatagen/{ => internal}/statusdata.go | 4 +- .../{ => internal}/statusdata_test.go | 2 +- .../component_telemetry_test.go.tmpl | 0 .../templates/component_test.go.tmpl | 0 .../{ => internal}/templates/config.go.tmpl | 0 .../templates/config_test.go.tmpl | 0 .../templates/documentation.md.tmpl | 0 .../{ => internal}/templates/metrics.go.tmpl | 0 .../templates/metrics_test.go.tmpl | 0 .../templates/package_test.go.tmpl | 0 .../{ => internal}/templates/readme.md.tmpl | 0 .../{ => internal}/templates/resource.go.tmpl | 0 .../templates/resource_test.go.tmpl | 0 .../{ => internal}/templates/status.go.tmpl | 0 .../templates/telemetry.go.tmpl | 0 .../templates/telemetry_test.go.tmpl | 0 .../templates/testdata/config.yaml.tmpl | 0 .../{ => internal}/testdata/async_metric.yaml | 0 .../{ => internal}/testdata/invalid.yaml | 0 .../testdata/invalid_aggregation.yaml | 0 .../testdata/invalid_class.yaml | 0 .../testdata/invalid_input_type.yaml | 0 .../testdata/invalid_stability.yaml | 0 .../testdata/invalid_stability_component.yaml | 0 ...etry_missing_value_type_for_histogram.yaml | 0 .../testdata/invalid_type_attr.yaml | 0 .../testdata/invalid_type_rattr.yaml | 0 .../testdata/metrics_and_type.yaml | 0 .../testdata/no_aggregation.yaml | 0 .../{ => internal}/testdata/no_class.yaml | 0 .../testdata/no_description_attr.yaml | 0 .../testdata/no_description_rattr.yaml | 0 .../{ => internal}/testdata/no_enabled.yaml | 0 .../testdata/no_metric_description.yaml | 0 .../testdata/no_metric_type.yaml | 0 .../testdata/no_metric_unit.yaml | 0 .../{ => internal}/testdata/no_monotonic.yaml | 0 .../{ => internal}/testdata/no_stability.yaml | 0 .../testdata/no_stability_component.yaml | 0 .../{ => internal}/testdata/no_status.yaml | 0 .../{ => internal}/testdata/no_type.yaml | 0 .../{ => internal}/testdata/no_type_attr.yaml | 0 .../testdata/no_type_rattr.yaml | 0 .../testdata/no_value_type.yaml | 0 .../{ => internal}/testdata/parent.yaml | 0 .../testdata/readme_with_cmd_class.md | 0 .../testdata/readme_with_multiple_signals.md | 0 .../testdata/readme_with_status.md | 0 .../testdata/readme_with_status_codeowners.md | 0 ...dme_with_status_codeowners_and_emeritus.md | 0 ..._with_status_codeowners_and_seeking_new.md | 0 .../testdata/readme_with_status_extension.md | 0 .../testdata/readme_with_warnings.md | 0 .../testdata/readme_without_status.md | 0 .../testdata/resource_attributes_only.yaml | 0 .../{ => internal}/testdata/status_only.yaml | 0 .../testdata/two_metric_types.yaml | 0 .../testdata/unknown_metric_attribute.yaml | 0 .../testdata/unknown_value_type.yaml | 0 .../testdata/unused_attribute.yaml | 0 .../testdata/with_goleak_ignores.yaml | 0 .../testdata/with_goleak_setup.yaml | 0 .../testdata/with_goleak_skip.yaml | 0 .../testdata/with_goleak_teardown.yaml | 0 .../testdata/with_telemetry.yaml | 0 .../testdata/with_tests_connector.yaml | 0 .../testdata/with_tests_exporter.yaml | 0 .../testdata/with_tests_extension.yaml | 0 .../testdata/with_tests_processor.yaml | 0 .../testdata/with_tests_receiver.yaml | 0 cmd/mdatagen/{ => internal}/validate.go | 24 +++---- cmd/mdatagen/{ => internal}/validate_test.go | 8 +-- cmd/mdatagen/main.go | 28 ++++---- cmd/mdatagen/main_test.go | 37 +++++------ 83 files changed, 120 insertions(+), 117 deletions(-) rename cmd/mdatagen/{ => internal}/embeded_templates.go (64%) rename cmd/mdatagen/{ => internal}/embeded_templates_test.go (94%) rename cmd/mdatagen/{ => internal}/lint.go (87%) rename cmd/mdatagen/{ => internal}/lint_test.go (94%) rename cmd/mdatagen/{ => internal}/loader.go (86%) rename cmd/mdatagen/{ => internal}/loader_test.go (94%) rename cmd/mdatagen/{ => internal}/metricdata.go (97%) rename cmd/mdatagen/{ => internal}/metricdata_test.go (99%) rename cmd/mdatagen/{ => internal}/statusdata.go (96%) rename cmd/mdatagen/{ => internal}/statusdata_test.go (98%) rename cmd/mdatagen/{ => internal}/templates/component_telemetry_test.go.tmpl (100%) rename cmd/mdatagen/{ => internal}/templates/component_test.go.tmpl (100%) rename cmd/mdatagen/{ => internal}/templates/config.go.tmpl (100%) rename cmd/mdatagen/{ => internal}/templates/config_test.go.tmpl (100%) rename cmd/mdatagen/{ => internal}/templates/documentation.md.tmpl (100%) rename cmd/mdatagen/{ => internal}/templates/metrics.go.tmpl (100%) rename cmd/mdatagen/{ => internal}/templates/metrics_test.go.tmpl (100%) rename cmd/mdatagen/{ => internal}/templates/package_test.go.tmpl (100%) rename cmd/mdatagen/{ => internal}/templates/readme.md.tmpl (100%) rename cmd/mdatagen/{ => internal}/templates/resource.go.tmpl (100%) rename cmd/mdatagen/{ => internal}/templates/resource_test.go.tmpl (100%) rename cmd/mdatagen/{ => internal}/templates/status.go.tmpl (100%) rename cmd/mdatagen/{ => internal}/templates/telemetry.go.tmpl (100%) rename cmd/mdatagen/{ => internal}/templates/telemetry_test.go.tmpl (100%) rename cmd/mdatagen/{ => internal}/templates/testdata/config.yaml.tmpl (100%) rename cmd/mdatagen/{ => internal}/testdata/async_metric.yaml (100%) rename cmd/mdatagen/{ => internal}/testdata/invalid.yaml (100%) rename cmd/mdatagen/{ => internal}/testdata/invalid_aggregation.yaml (100%) rename cmd/mdatagen/{ => internal}/testdata/invalid_class.yaml (100%) rename cmd/mdatagen/{ => internal}/testdata/invalid_input_type.yaml (100%) rename cmd/mdatagen/{ => internal}/testdata/invalid_stability.yaml (100%) rename cmd/mdatagen/{ => internal}/testdata/invalid_stability_component.yaml (100%) rename cmd/mdatagen/{ => internal}/testdata/invalid_telemetry_missing_value_type_for_histogram.yaml (100%) rename cmd/mdatagen/{ => internal}/testdata/invalid_type_attr.yaml (100%) rename cmd/mdatagen/{ => internal}/testdata/invalid_type_rattr.yaml (100%) rename cmd/mdatagen/{ => internal}/testdata/metrics_and_type.yaml (100%) rename cmd/mdatagen/{ => internal}/testdata/no_aggregation.yaml (100%) rename cmd/mdatagen/{ => internal}/testdata/no_class.yaml (100%) rename cmd/mdatagen/{ => internal}/testdata/no_description_attr.yaml (100%) rename cmd/mdatagen/{ => internal}/testdata/no_description_rattr.yaml (100%) rename cmd/mdatagen/{ => internal}/testdata/no_enabled.yaml (100%) rename cmd/mdatagen/{ => internal}/testdata/no_metric_description.yaml (100%) rename cmd/mdatagen/{ => internal}/testdata/no_metric_type.yaml (100%) rename cmd/mdatagen/{ => internal}/testdata/no_metric_unit.yaml (100%) rename cmd/mdatagen/{ => internal}/testdata/no_monotonic.yaml (100%) rename cmd/mdatagen/{ => internal}/testdata/no_stability.yaml (100%) rename cmd/mdatagen/{ => internal}/testdata/no_stability_component.yaml (100%) rename cmd/mdatagen/{ => internal}/testdata/no_status.yaml (100%) rename cmd/mdatagen/{ => internal}/testdata/no_type.yaml (100%) rename cmd/mdatagen/{ => internal}/testdata/no_type_attr.yaml (100%) rename cmd/mdatagen/{ => internal}/testdata/no_type_rattr.yaml (100%) rename cmd/mdatagen/{ => internal}/testdata/no_value_type.yaml (100%) rename cmd/mdatagen/{ => internal}/testdata/parent.yaml (100%) rename cmd/mdatagen/{ => internal}/testdata/readme_with_cmd_class.md (100%) rename cmd/mdatagen/{ => internal}/testdata/readme_with_multiple_signals.md (100%) rename cmd/mdatagen/{ => internal}/testdata/readme_with_status.md (100%) rename cmd/mdatagen/{ => internal}/testdata/readme_with_status_codeowners.md (100%) rename cmd/mdatagen/{ => internal}/testdata/readme_with_status_codeowners_and_emeritus.md (100%) rename cmd/mdatagen/{ => internal}/testdata/readme_with_status_codeowners_and_seeking_new.md (100%) rename cmd/mdatagen/{ => internal}/testdata/readme_with_status_extension.md (100%) rename cmd/mdatagen/{ => internal}/testdata/readme_with_warnings.md (100%) rename cmd/mdatagen/{ => internal}/testdata/readme_without_status.md (100%) rename cmd/mdatagen/{ => internal}/testdata/resource_attributes_only.yaml (100%) rename cmd/mdatagen/{ => internal}/testdata/status_only.yaml (100%) rename cmd/mdatagen/{ => internal}/testdata/two_metric_types.yaml (100%) rename cmd/mdatagen/{ => internal}/testdata/unknown_metric_attribute.yaml (100%) rename cmd/mdatagen/{ => internal}/testdata/unknown_value_type.yaml (100%) rename cmd/mdatagen/{ => internal}/testdata/unused_attribute.yaml (100%) rename cmd/mdatagen/{ => internal}/testdata/with_goleak_ignores.yaml (100%) rename cmd/mdatagen/{ => internal}/testdata/with_goleak_setup.yaml (100%) rename cmd/mdatagen/{ => internal}/testdata/with_goleak_skip.yaml (100%) rename cmd/mdatagen/{ => internal}/testdata/with_goleak_teardown.yaml (100%) rename cmd/mdatagen/{ => internal}/testdata/with_telemetry.yaml (100%) rename cmd/mdatagen/{ => internal}/testdata/with_tests_connector.yaml (100%) rename cmd/mdatagen/{ => internal}/testdata/with_tests_exporter.yaml (100%) rename cmd/mdatagen/{ => internal}/testdata/with_tests_extension.yaml (100%) rename cmd/mdatagen/{ => internal}/testdata/with_tests_processor.yaml (100%) rename cmd/mdatagen/{ => internal}/testdata/with_tests_receiver.yaml (100%) rename cmd/mdatagen/{ => internal}/validate.go (88%) rename cmd/mdatagen/{ => internal}/validate_test.go (95%) diff --git a/cmd/mdatagen/README.md b/cmd/mdatagen/README.md index 63cc5260401..075a1fa9674 100644 --- a/cmd/mdatagen/README.md +++ b/cmd/mdatagen/README.md @@ -57,10 +57,10 @@ You can run `cd cmd/mdatagen && $(GOCMD) install .` to install the `mdatagen` to ## Contributing to the Metadata Generator -The code for generating the documentation can be found in [loader.go](./loader.go) and the templates for rendering the documentation can be found in [templates](./templates). +The code for generating the documentation can be found in [loader.go](./internal/loader.go) and the templates for rendering the documentation can be found in [templates](internal/templates). When making updates to the metadata generator or introducing support for new functionality: -1. Ensure the [metadata-schema.yaml](./metadata-schema.yaml) and [./metadata.yaml](metadata.yaml) files reflect the changes. +1. Ensure the [metadata-schema.yaml](./metadata-schema.yaml) and [metadata.yaml](./metadata.yaml) files reflect the changes. 2. Run `make mdatagen-test`. 3. Make sure all tests are passing including [generated tests](./internal/samplereceiver/internal/metadata/generated_metrics_test.go). 4. Run `make generate`. diff --git a/cmd/mdatagen/embeded_templates.go b/cmd/mdatagen/internal/embeded_templates.go similarity index 64% rename from cmd/mdatagen/embeded_templates.go rename to cmd/mdatagen/internal/embeded_templates.go index dace6c43f32..9aca0fe6a90 100644 --- a/cmd/mdatagen/embeded_templates.go +++ b/cmd/mdatagen/internal/embeded_templates.go @@ -1,13 +1,13 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package main +package internal // import "go.opentelemetry.io/collector/cmd/mdatagen/internal" import "embed" -// templateFS ensures that the files needed +// TemplateFS ensures that the files needed // to generate metadata as an embedded filesystem since // `go get` doesn't require these files to be downloaded. // //go:embed templates/*.tmpl templates/testdata/*.tmpl -var templateFS embed.FS +var TemplateFS embed.FS diff --git a/cmd/mdatagen/embeded_templates_test.go b/cmd/mdatagen/internal/embeded_templates_test.go similarity index 94% rename from cmd/mdatagen/embeded_templates_test.go rename to cmd/mdatagen/internal/embeded_templates_test.go index 40562297e30..ab4124f3d6b 100644 --- a/cmd/mdatagen/embeded_templates_test.go +++ b/cmd/mdatagen/internal/embeded_templates_test.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package main +package internal import ( "io/fs" @@ -38,7 +38,7 @@ func TestEnsureTemplatesLoaded(t *testing.T) { } count = 0 ) - assert.NoError(t, fs.WalkDir(templateFS, ".", func(path string, d fs.DirEntry, _ error) error { + assert.NoError(t, fs.WalkDir(TemplateFS, ".", func(path string, d fs.DirEntry, _ error) error { if d != nil && d.IsDir() { return nil } diff --git a/cmd/mdatagen/lint.go b/cmd/mdatagen/internal/lint.go similarity index 87% rename from cmd/mdatagen/lint.go rename to cmd/mdatagen/internal/lint.go index f169ac4fdbb..5dfcfb4e0a2 100644 --- a/cmd/mdatagen/lint.go +++ b/cmd/mdatagen/internal/lint.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package main +package internal // import "go.opentelemetry.io/collector/cmd/mdatagen/internal" import ( "errors" @@ -11,8 +11,8 @@ import ( "go.opentelemetry.io/collector/cmd/mdatagen/third_party/golint" ) -// formatIdentifier variable in a go-safe way -func formatIdentifier(s string, exported bool) (string, error) { +// FormatIdentifier variable in a go-safe way +func FormatIdentifier(s string, exported bool) (string, error) { if s == "" { return "", errors.New("string cannot be empty") } diff --git a/cmd/mdatagen/lint_test.go b/cmd/mdatagen/internal/lint_test.go similarity index 94% rename from cmd/mdatagen/lint_test.go rename to cmd/mdatagen/internal/lint_test.go index f05d6615ea3..24789d1011b 100644 --- a/cmd/mdatagen/lint_test.go +++ b/cmd/mdatagen/internal/lint_test.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package main +package internal import ( "testing" @@ -37,7 +37,7 @@ func TestFormatIdentifier(t *testing.T) { } for _, tt := range tests { t.Run(tt.input, func(t *testing.T) { - got, err := formatIdentifier(tt.input, tt.exported) + got, err := FormatIdentifier(tt.input, tt.exported) if tt.wantErr != "" { require.EqualError(t, err, tt.wantErr) diff --git a/cmd/mdatagen/loader.go b/cmd/mdatagen/internal/loader.go similarity index 86% rename from cmd/mdatagen/loader.go rename to cmd/mdatagen/internal/loader.go index 451bc0c5b4d..1df1a0d06bb 100644 --- a/cmd/mdatagen/loader.go +++ b/cmd/mdatagen/internal/loader.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package main +package internal // import "go.opentelemetry.io/collector/cmd/mdatagen/internal" import ( "context" @@ -19,24 +19,24 @@ import ( "go.opentelemetry.io/collector/pdata/pcommon" ) -type metricName string +type MetricName string -func (mn metricName) Render() (string, error) { - return formatIdentifier(string(mn), true) +func (mn MetricName) Render() (string, error) { + return FormatIdentifier(string(mn), true) } -func (mn metricName) RenderUnexported() (string, error) { - return formatIdentifier(string(mn), false) +func (mn MetricName) RenderUnexported() (string, error) { + return FormatIdentifier(string(mn), false) } -type attributeName string +type AttributeName string -func (mn attributeName) Render() (string, error) { - return formatIdentifier(string(mn), true) +func (mn AttributeName) Render() (string, error) { + return FormatIdentifier(string(mn), true) } -func (mn attributeName) RenderUnexported() (string, error) { - return formatIdentifier(string(mn), false) +func (mn AttributeName) RenderUnexported() (string, error) { + return FormatIdentifier(string(mn), false) } // ValueType defines an attribute value type. @@ -97,7 +97,7 @@ func (mvt ValueType) Primitive() string { } } -type metric struct { +type Metric struct { // Enabled defines whether the metric is enabled by default. Enabled bool `mapstructure:"enabled"` @@ -126,7 +126,7 @@ type metric struct { Histogram *histogram `mapstructure:"histogram,omitempty"` // Attributes is the list of attributes that the metric emits. - Attributes []attributeName `mapstructure:"attributes"` + Attributes []AttributeName `mapstructure:"attributes"` // Level specifies the minimum `configtelemetry.Level` for which // the metric will be emitted. This only applies to internal telemetry @@ -134,13 +134,13 @@ type metric struct { Level configtelemetry.Level `mapstructure:"level"` } -func (m *metric) Unmarshal(parser *confmap.Conf) error { +func (m *Metric) Unmarshal(parser *confmap.Conf) error { if !parser.IsSet("enabled") { return errors.New("missing required field: `enabled`") } return parser.Unmarshal(m) } -func (m metric) Data() MetricData { +func (m Metric) Data() MetricData { if m.Sum != nil { return m.Sum } @@ -162,7 +162,7 @@ type warnings struct { IfConfigured string `mapstructure:"if_configured"` } -type attribute struct { +type Attribute struct { // Description describes the purpose of the attribute. Description string `mapstructure:"description"` // NameOverride can be used to override the attribute name. @@ -178,20 +178,20 @@ type attribute struct { // Type is an attribute type. Type ValueType `mapstructure:"type"` // FullName is the attribute name populated from the map key. - FullName attributeName `mapstructure:"-"` + FullName AttributeName `mapstructure:"-"` // Warnings that will be shown to user under specified conditions. Warnings warnings `mapstructure:"warnings"` } // Name returns actual name of the attribute that is set on the metric after applying NameOverride. -func (a attribute) Name() attributeName { +func (a Attribute) Name() AttributeName { if a.NameOverride != "" { - return attributeName(a.NameOverride) + return AttributeName(a.NameOverride) } return a.FullName } -func (a attribute) TestValue() string { +func (a Attribute) TestValue() string { if a.Enum != nil { return fmt.Sprintf(`"%s"`, a.Enum[0]) } @@ -239,7 +239,7 @@ type tests struct { type telemetry struct { Level configtelemetry.Level `mapstructure:"level"` - Metrics map[metricName]metric `mapstructure:"metrics"` + Metrics map[MetricName]Metric `mapstructure:"metrics"` } func (t telemetry) Levels() map[string]interface{} { @@ -250,7 +250,7 @@ func (t telemetry) Levels() map[string]interface{} { return levels } -type metadata struct { +type Metadata struct { // Type of the component. Type string `mapstructure:"type"` // Type of the parent component (applicable to subcomponents). @@ -262,11 +262,11 @@ type metadata struct { // SemConvVersion is a version number of OpenTelemetry semantic conventions applied to the scraped metrics. SemConvVersion string `mapstructure:"sem_conv_version"` // ResourceAttributes that can be emitted by the component. - ResourceAttributes map[attributeName]attribute `mapstructure:"resource_attributes"` + ResourceAttributes map[AttributeName]Attribute `mapstructure:"resource_attributes"` // Attributes emitted by one or more metrics. - Attributes map[attributeName]attribute `mapstructure:"attributes"` + Attributes map[AttributeName]Attribute `mapstructure:"attributes"` // Metrics that can be emitted by the component. - Metrics map[metricName]metric `mapstructure:"metrics"` + Metrics map[MetricName]Metric `mapstructure:"metrics"` // GithubProject is the project where the component README lives in the format of org/repo, defaults to open-telemetry/opentelemetry-collector-contrib GithubProject string `mapstructure:"github_project"` // ScopeName of the metrics emitted by the component. @@ -277,31 +277,31 @@ type metadata struct { Tests tests `mapstructure:"tests"` } -func setAttributesFullName(attrs map[attributeName]attribute) { +func setAttributesFullName(attrs map[AttributeName]Attribute) { for k, v := range attrs { v.FullName = k attrs[k] = v } } -type templateContext struct { - metadata +type TemplateContext struct { + Metadata // Package name for generated code. Package string } -func loadMetadata(filePath string) (metadata, error) { +func LoadMetadata(filePath string) (Metadata, error) { cp, err := fileprovider.NewFactory().Create(confmaptest.NewNopProviderSettings()).Retrieve(context.Background(), "file:"+filePath, nil) if err != nil { - return metadata{}, err + return Metadata{}, err } conf, err := cp.AsConf() if err != nil { - return metadata{}, err + return Metadata{}, err } - md := metadata{ShortFolderName: shortFolderName(filePath), Tests: tests{Host: "componenttest.NewNopHost()"}} + md := Metadata{ShortFolderName: shortFolderName(filePath), Tests: tests{Host: "componenttest.NewNopHost()"}} if err = conf.Unmarshal(&md); err != nil { return md, err } diff --git a/cmd/mdatagen/loader_test.go b/cmd/mdatagen/internal/loader_test.go similarity index 94% rename from cmd/mdatagen/loader_test.go rename to cmd/mdatagen/internal/loader_test.go index 68dcfb84e0f..6bb7c1f7485 100644 --- a/cmd/mdatagen/loader_test.go +++ b/cmd/mdatagen/internal/loader_test.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package main +package internal import ( "testing" @@ -16,12 +16,12 @@ import ( func TestLoadMetadata(t *testing.T) { tests := []struct { name string - want metadata + want Metadata wantErr string }{ { - name: "internal/samplereceiver/metadata.yaml", - want: metadata{ + name: "samplereceiver/metadata.yaml", + want: Metadata{ GithubProject: "open-telemetry/opentelemetry-collector", Type: "sample", SemConvVersion: "1.9.0", @@ -39,7 +39,7 @@ func TestLoadMetadata(t *testing.T) { Warnings: []string{"Any additional information that should be brought to the consumer's attention"}, UnsupportedPlatforms: []string{"freebsd", "illumos"}, }, - ResourceAttributes: map[attributeName]attribute{ + ResourceAttributes: map[AttributeName]Attribute{ "string.resource.attr": { Description: "Resource attribute with any string value.", Enabled: true, @@ -116,7 +116,7 @@ func TestLoadMetadata(t *testing.T) { }, }, - Attributes: map[attributeName]attribute{ + Attributes: map[AttributeName]Attribute{ "enum_attr": { Description: "Attribute with a known set of string values.", NameOverride: "", @@ -171,7 +171,7 @@ func TestLoadMetadata(t *testing.T) { FullName: "map_attr", }, }, - Metrics: map[metricName]metric{ + Metrics: map[MetricName]Metric{ "default.metric": { Enabled: true, Description: "Monotonic cumulative sum int metric enabled by default.", @@ -185,7 +185,7 @@ func TestLoadMetadata(t *testing.T) { AggregationTemporality: AggregationTemporality{Aggregation: pmetric.AggregationTemporalityCumulative}, Mono: Mono{Monotonic: true}, }, - Attributes: []attributeName{"string_attr", "overridden_int_attr", "enum_attr", "slice_attr", "map_attr"}, + Attributes: []AttributeName{"string_attr", "overridden_int_attr", "enum_attr", "slice_attr", "map_attr"}, }, "optional.metric": { Enabled: false, @@ -197,7 +197,7 @@ func TestLoadMetadata(t *testing.T) { Gauge: &gauge{ MetricValueType: MetricValueType{pmetric.NumberDataPointValueTypeDouble}, }, - Attributes: []attributeName{"string_attr", "boolean_attr", "boolean_attr2"}, + Attributes: []AttributeName{"string_attr", "boolean_attr", "boolean_attr2"}, }, "optional.metric.empty_unit": { Enabled: false, @@ -209,7 +209,7 @@ func TestLoadMetadata(t *testing.T) { Gauge: &gauge{ MetricValueType: MetricValueType{pmetric.NumberDataPointValueTypeDouble}, }, - Attributes: []attributeName{"string_attr", "boolean_attr"}, + Attributes: []AttributeName{"string_attr", "boolean_attr"}, }, "default.metric.to_be_removed": { @@ -236,11 +236,11 @@ func TestLoadMetadata(t *testing.T) { AggregationTemporality: AggregationTemporality{Aggregation: pmetric.AggregationTemporalityCumulative}, Mono: Mono{Monotonic: true}, }, - Attributes: []attributeName{"string_attr", "overridden_int_attr", "enum_attr", "slice_attr", "map_attr"}, + Attributes: []AttributeName{"string_attr", "overridden_int_attr", "enum_attr", "slice_attr", "map_attr"}, }, }, Telemetry: telemetry{ - Metrics: map[metricName]metric{ + Metrics: map[MetricName]Metric{ "batch_size_trigger_send": { Enabled: true, Description: "Number of times the batch was sent due to a size trigger", @@ -293,27 +293,27 @@ func TestLoadMetadata(t *testing.T) { }, { name: "testdata/parent.yaml", - want: metadata{ + want: Metadata{ Type: "subcomponent", Parent: "parentComponent", - ScopeName: "go.opentelemetry.io/collector/cmd/mdatagen", + ScopeName: "go.opentelemetry.io/collector/cmd/mdatagen/internal", ShortFolderName: "testdata", Tests: tests{Host: "componenttest.NewNopHost()"}, }, }, { name: "testdata/invalid_type_rattr.yaml", - want: metadata{}, + want: Metadata{}, wantErr: "decoding failed due to the following error(s):\n\nerror decoding 'resource_attributes[string.resource.attr].type': invalid type: \"invalidtype\"", }, { name: "testdata/no_enabled.yaml", - want: metadata{}, + want: Metadata{}, wantErr: "decoding failed due to the following error(s):\n\nerror decoding 'metrics[system.cpu.time]': missing required field: `enabled`", }, { name: "testdata/no_value_type.yaml", - want: metadata{}, + want: Metadata{}, wantErr: "decoding failed due to the following error(s):\n\nerror decoding 'metrics[system.cpu.time]': decoding failed due to the following error(s):\n\n" + "error decoding 'sum': missing required field: `value_type`", }, @@ -323,18 +323,18 @@ func TestLoadMetadata(t *testing.T) { }, { name: "testdata/invalid_aggregation.yaml", - want: metadata{}, + want: Metadata{}, wantErr: "decoding failed due to the following error(s):\n\nerror decoding 'metrics[default.metric]': decoding failed due to the following error(s):\n\nerror decoding 'sum': decoding failed due to the following error(s):\n\nerror decoding 'aggregation_temporality': invalid aggregation: \"invalidaggregation\"", }, { name: "testdata/invalid_type_attr.yaml", - want: metadata{}, + want: Metadata{}, wantErr: "decoding failed due to the following error(s):\n\nerror decoding 'attributes[used_attr].type': invalid type: \"invalidtype\"", }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - got, err := loadMetadata(tt.name) + got, err := LoadMetadata(tt.name) if tt.wantErr != "" { require.Error(t, err) require.EqualError(t, err, tt.wantErr) diff --git a/cmd/mdatagen/metricdata.go b/cmd/mdatagen/internal/metricdata.go similarity index 97% rename from cmd/mdatagen/metricdata.go rename to cmd/mdatagen/internal/metricdata.go index 4749e03e608..ae69f6bc2ad 100644 --- a/cmd/mdatagen/metricdata.go +++ b/cmd/mdatagen/internal/metricdata.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package main +package internal // import "go.opentelemetry.io/collector/cmd/mdatagen/internal" import ( "errors" @@ -179,7 +179,7 @@ func (d *sum) Unmarshal(parser *confmap.Conf) error { } // TODO: Currently, this func will not be called because of https://github.com/open-telemetry/opentelemetry-collector/issues/6671. Uncomment function and -// add a test case to Test_loadMetadata for file no_monotonic.yaml once the issue is solved. +// add a test case to Test_LoadMetadata for file no_monotonic.yaml once the issue is solved. // // Unmarshal is a custom unmarshaler for Mono. // func (m *Mono) Unmarshal(parser *confmap.Conf) error { diff --git a/cmd/mdatagen/metricdata_test.go b/cmd/mdatagen/internal/metricdata_test.go similarity index 99% rename from cmd/mdatagen/metricdata_test.go rename to cmd/mdatagen/internal/metricdata_test.go index 1e56afff27c..4e889044e42 100644 --- a/cmd/mdatagen/metricdata_test.go +++ b/cmd/mdatagen/internal/metricdata_test.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package main +package internal import ( "testing" diff --git a/cmd/mdatagen/statusdata.go b/cmd/mdatagen/internal/statusdata.go similarity index 96% rename from cmd/mdatagen/statusdata.go rename to cmd/mdatagen/internal/statusdata.go index f09c68f98e9..56938d79e83 100644 --- a/cmd/mdatagen/statusdata.go +++ b/cmd/mdatagen/internal/statusdata.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package main +package internal // import "go.opentelemetry.io/collector/cmd/mdatagen/internal" import ( "errors" @@ -16,7 +16,7 @@ import ( // The rules below apply to every distribution added to this list: // - The distribution is open source and maintained by the OpenTelemetry project. // - The link must point to a publicly accessible repository. -var distros = map[string]string{ +var Distros = map[string]string{ "core": "https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol", "contrib": "https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib", "k8s": "https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-k8s", diff --git a/cmd/mdatagen/statusdata_test.go b/cmd/mdatagen/internal/statusdata_test.go similarity index 98% rename from cmd/mdatagen/statusdata_test.go rename to cmd/mdatagen/internal/statusdata_test.go index 947065b1d6f..30813d8d851 100644 --- a/cmd/mdatagen/statusdata_test.go +++ b/cmd/mdatagen/internal/statusdata_test.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package main +package internal import ( "testing" diff --git a/cmd/mdatagen/templates/component_telemetry_test.go.tmpl b/cmd/mdatagen/internal/templates/component_telemetry_test.go.tmpl similarity index 100% rename from cmd/mdatagen/templates/component_telemetry_test.go.tmpl rename to cmd/mdatagen/internal/templates/component_telemetry_test.go.tmpl diff --git a/cmd/mdatagen/templates/component_test.go.tmpl b/cmd/mdatagen/internal/templates/component_test.go.tmpl similarity index 100% rename from cmd/mdatagen/templates/component_test.go.tmpl rename to cmd/mdatagen/internal/templates/component_test.go.tmpl diff --git a/cmd/mdatagen/templates/config.go.tmpl b/cmd/mdatagen/internal/templates/config.go.tmpl similarity index 100% rename from cmd/mdatagen/templates/config.go.tmpl rename to cmd/mdatagen/internal/templates/config.go.tmpl diff --git a/cmd/mdatagen/templates/config_test.go.tmpl b/cmd/mdatagen/internal/templates/config_test.go.tmpl similarity index 100% rename from cmd/mdatagen/templates/config_test.go.tmpl rename to cmd/mdatagen/internal/templates/config_test.go.tmpl diff --git a/cmd/mdatagen/templates/documentation.md.tmpl b/cmd/mdatagen/internal/templates/documentation.md.tmpl similarity index 100% rename from cmd/mdatagen/templates/documentation.md.tmpl rename to cmd/mdatagen/internal/templates/documentation.md.tmpl diff --git a/cmd/mdatagen/templates/metrics.go.tmpl b/cmd/mdatagen/internal/templates/metrics.go.tmpl similarity index 100% rename from cmd/mdatagen/templates/metrics.go.tmpl rename to cmd/mdatagen/internal/templates/metrics.go.tmpl diff --git a/cmd/mdatagen/templates/metrics_test.go.tmpl b/cmd/mdatagen/internal/templates/metrics_test.go.tmpl similarity index 100% rename from cmd/mdatagen/templates/metrics_test.go.tmpl rename to cmd/mdatagen/internal/templates/metrics_test.go.tmpl diff --git a/cmd/mdatagen/templates/package_test.go.tmpl b/cmd/mdatagen/internal/templates/package_test.go.tmpl similarity index 100% rename from cmd/mdatagen/templates/package_test.go.tmpl rename to cmd/mdatagen/internal/templates/package_test.go.tmpl diff --git a/cmd/mdatagen/templates/readme.md.tmpl b/cmd/mdatagen/internal/templates/readme.md.tmpl similarity index 100% rename from cmd/mdatagen/templates/readme.md.tmpl rename to cmd/mdatagen/internal/templates/readme.md.tmpl diff --git a/cmd/mdatagen/templates/resource.go.tmpl b/cmd/mdatagen/internal/templates/resource.go.tmpl similarity index 100% rename from cmd/mdatagen/templates/resource.go.tmpl rename to cmd/mdatagen/internal/templates/resource.go.tmpl diff --git a/cmd/mdatagen/templates/resource_test.go.tmpl b/cmd/mdatagen/internal/templates/resource_test.go.tmpl similarity index 100% rename from cmd/mdatagen/templates/resource_test.go.tmpl rename to cmd/mdatagen/internal/templates/resource_test.go.tmpl diff --git a/cmd/mdatagen/templates/status.go.tmpl b/cmd/mdatagen/internal/templates/status.go.tmpl similarity index 100% rename from cmd/mdatagen/templates/status.go.tmpl rename to cmd/mdatagen/internal/templates/status.go.tmpl diff --git a/cmd/mdatagen/templates/telemetry.go.tmpl b/cmd/mdatagen/internal/templates/telemetry.go.tmpl similarity index 100% rename from cmd/mdatagen/templates/telemetry.go.tmpl rename to cmd/mdatagen/internal/templates/telemetry.go.tmpl diff --git a/cmd/mdatagen/templates/telemetry_test.go.tmpl b/cmd/mdatagen/internal/templates/telemetry_test.go.tmpl similarity index 100% rename from cmd/mdatagen/templates/telemetry_test.go.tmpl rename to cmd/mdatagen/internal/templates/telemetry_test.go.tmpl diff --git a/cmd/mdatagen/templates/testdata/config.yaml.tmpl b/cmd/mdatagen/internal/templates/testdata/config.yaml.tmpl similarity index 100% rename from cmd/mdatagen/templates/testdata/config.yaml.tmpl rename to cmd/mdatagen/internal/templates/testdata/config.yaml.tmpl diff --git a/cmd/mdatagen/testdata/async_metric.yaml b/cmd/mdatagen/internal/testdata/async_metric.yaml similarity index 100% rename from cmd/mdatagen/testdata/async_metric.yaml rename to cmd/mdatagen/internal/testdata/async_metric.yaml diff --git a/cmd/mdatagen/testdata/invalid.yaml b/cmd/mdatagen/internal/testdata/invalid.yaml similarity index 100% rename from cmd/mdatagen/testdata/invalid.yaml rename to cmd/mdatagen/internal/testdata/invalid.yaml diff --git a/cmd/mdatagen/testdata/invalid_aggregation.yaml b/cmd/mdatagen/internal/testdata/invalid_aggregation.yaml similarity index 100% rename from cmd/mdatagen/testdata/invalid_aggregation.yaml rename to cmd/mdatagen/internal/testdata/invalid_aggregation.yaml diff --git a/cmd/mdatagen/testdata/invalid_class.yaml b/cmd/mdatagen/internal/testdata/invalid_class.yaml similarity index 100% rename from cmd/mdatagen/testdata/invalid_class.yaml rename to cmd/mdatagen/internal/testdata/invalid_class.yaml diff --git a/cmd/mdatagen/testdata/invalid_input_type.yaml b/cmd/mdatagen/internal/testdata/invalid_input_type.yaml similarity index 100% rename from cmd/mdatagen/testdata/invalid_input_type.yaml rename to cmd/mdatagen/internal/testdata/invalid_input_type.yaml diff --git a/cmd/mdatagen/testdata/invalid_stability.yaml b/cmd/mdatagen/internal/testdata/invalid_stability.yaml similarity index 100% rename from cmd/mdatagen/testdata/invalid_stability.yaml rename to cmd/mdatagen/internal/testdata/invalid_stability.yaml diff --git a/cmd/mdatagen/testdata/invalid_stability_component.yaml b/cmd/mdatagen/internal/testdata/invalid_stability_component.yaml similarity index 100% rename from cmd/mdatagen/testdata/invalid_stability_component.yaml rename to cmd/mdatagen/internal/testdata/invalid_stability_component.yaml diff --git a/cmd/mdatagen/testdata/invalid_telemetry_missing_value_type_for_histogram.yaml b/cmd/mdatagen/internal/testdata/invalid_telemetry_missing_value_type_for_histogram.yaml similarity index 100% rename from cmd/mdatagen/testdata/invalid_telemetry_missing_value_type_for_histogram.yaml rename to cmd/mdatagen/internal/testdata/invalid_telemetry_missing_value_type_for_histogram.yaml diff --git a/cmd/mdatagen/testdata/invalid_type_attr.yaml b/cmd/mdatagen/internal/testdata/invalid_type_attr.yaml similarity index 100% rename from cmd/mdatagen/testdata/invalid_type_attr.yaml rename to cmd/mdatagen/internal/testdata/invalid_type_attr.yaml diff --git a/cmd/mdatagen/testdata/invalid_type_rattr.yaml b/cmd/mdatagen/internal/testdata/invalid_type_rattr.yaml similarity index 100% rename from cmd/mdatagen/testdata/invalid_type_rattr.yaml rename to cmd/mdatagen/internal/testdata/invalid_type_rattr.yaml diff --git a/cmd/mdatagen/testdata/metrics_and_type.yaml b/cmd/mdatagen/internal/testdata/metrics_and_type.yaml similarity index 100% rename from cmd/mdatagen/testdata/metrics_and_type.yaml rename to cmd/mdatagen/internal/testdata/metrics_and_type.yaml diff --git a/cmd/mdatagen/testdata/no_aggregation.yaml b/cmd/mdatagen/internal/testdata/no_aggregation.yaml similarity index 100% rename from cmd/mdatagen/testdata/no_aggregation.yaml rename to cmd/mdatagen/internal/testdata/no_aggregation.yaml diff --git a/cmd/mdatagen/testdata/no_class.yaml b/cmd/mdatagen/internal/testdata/no_class.yaml similarity index 100% rename from cmd/mdatagen/testdata/no_class.yaml rename to cmd/mdatagen/internal/testdata/no_class.yaml diff --git a/cmd/mdatagen/testdata/no_description_attr.yaml b/cmd/mdatagen/internal/testdata/no_description_attr.yaml similarity index 100% rename from cmd/mdatagen/testdata/no_description_attr.yaml rename to cmd/mdatagen/internal/testdata/no_description_attr.yaml diff --git a/cmd/mdatagen/testdata/no_description_rattr.yaml b/cmd/mdatagen/internal/testdata/no_description_rattr.yaml similarity index 100% rename from cmd/mdatagen/testdata/no_description_rattr.yaml rename to cmd/mdatagen/internal/testdata/no_description_rattr.yaml diff --git a/cmd/mdatagen/testdata/no_enabled.yaml b/cmd/mdatagen/internal/testdata/no_enabled.yaml similarity index 100% rename from cmd/mdatagen/testdata/no_enabled.yaml rename to cmd/mdatagen/internal/testdata/no_enabled.yaml diff --git a/cmd/mdatagen/testdata/no_metric_description.yaml b/cmd/mdatagen/internal/testdata/no_metric_description.yaml similarity index 100% rename from cmd/mdatagen/testdata/no_metric_description.yaml rename to cmd/mdatagen/internal/testdata/no_metric_description.yaml diff --git a/cmd/mdatagen/testdata/no_metric_type.yaml b/cmd/mdatagen/internal/testdata/no_metric_type.yaml similarity index 100% rename from cmd/mdatagen/testdata/no_metric_type.yaml rename to cmd/mdatagen/internal/testdata/no_metric_type.yaml diff --git a/cmd/mdatagen/testdata/no_metric_unit.yaml b/cmd/mdatagen/internal/testdata/no_metric_unit.yaml similarity index 100% rename from cmd/mdatagen/testdata/no_metric_unit.yaml rename to cmd/mdatagen/internal/testdata/no_metric_unit.yaml diff --git a/cmd/mdatagen/testdata/no_monotonic.yaml b/cmd/mdatagen/internal/testdata/no_monotonic.yaml similarity index 100% rename from cmd/mdatagen/testdata/no_monotonic.yaml rename to cmd/mdatagen/internal/testdata/no_monotonic.yaml diff --git a/cmd/mdatagen/testdata/no_stability.yaml b/cmd/mdatagen/internal/testdata/no_stability.yaml similarity index 100% rename from cmd/mdatagen/testdata/no_stability.yaml rename to cmd/mdatagen/internal/testdata/no_stability.yaml diff --git a/cmd/mdatagen/testdata/no_stability_component.yaml b/cmd/mdatagen/internal/testdata/no_stability_component.yaml similarity index 100% rename from cmd/mdatagen/testdata/no_stability_component.yaml rename to cmd/mdatagen/internal/testdata/no_stability_component.yaml diff --git a/cmd/mdatagen/testdata/no_status.yaml b/cmd/mdatagen/internal/testdata/no_status.yaml similarity index 100% rename from cmd/mdatagen/testdata/no_status.yaml rename to cmd/mdatagen/internal/testdata/no_status.yaml diff --git a/cmd/mdatagen/testdata/no_type.yaml b/cmd/mdatagen/internal/testdata/no_type.yaml similarity index 100% rename from cmd/mdatagen/testdata/no_type.yaml rename to cmd/mdatagen/internal/testdata/no_type.yaml diff --git a/cmd/mdatagen/testdata/no_type_attr.yaml b/cmd/mdatagen/internal/testdata/no_type_attr.yaml similarity index 100% rename from cmd/mdatagen/testdata/no_type_attr.yaml rename to cmd/mdatagen/internal/testdata/no_type_attr.yaml diff --git a/cmd/mdatagen/testdata/no_type_rattr.yaml b/cmd/mdatagen/internal/testdata/no_type_rattr.yaml similarity index 100% rename from cmd/mdatagen/testdata/no_type_rattr.yaml rename to cmd/mdatagen/internal/testdata/no_type_rattr.yaml diff --git a/cmd/mdatagen/testdata/no_value_type.yaml b/cmd/mdatagen/internal/testdata/no_value_type.yaml similarity index 100% rename from cmd/mdatagen/testdata/no_value_type.yaml rename to cmd/mdatagen/internal/testdata/no_value_type.yaml diff --git a/cmd/mdatagen/testdata/parent.yaml b/cmd/mdatagen/internal/testdata/parent.yaml similarity index 100% rename from cmd/mdatagen/testdata/parent.yaml rename to cmd/mdatagen/internal/testdata/parent.yaml diff --git a/cmd/mdatagen/testdata/readme_with_cmd_class.md b/cmd/mdatagen/internal/testdata/readme_with_cmd_class.md similarity index 100% rename from cmd/mdatagen/testdata/readme_with_cmd_class.md rename to cmd/mdatagen/internal/testdata/readme_with_cmd_class.md diff --git a/cmd/mdatagen/testdata/readme_with_multiple_signals.md b/cmd/mdatagen/internal/testdata/readme_with_multiple_signals.md similarity index 100% rename from cmd/mdatagen/testdata/readme_with_multiple_signals.md rename to cmd/mdatagen/internal/testdata/readme_with_multiple_signals.md diff --git a/cmd/mdatagen/testdata/readme_with_status.md b/cmd/mdatagen/internal/testdata/readme_with_status.md similarity index 100% rename from cmd/mdatagen/testdata/readme_with_status.md rename to cmd/mdatagen/internal/testdata/readme_with_status.md diff --git a/cmd/mdatagen/testdata/readme_with_status_codeowners.md b/cmd/mdatagen/internal/testdata/readme_with_status_codeowners.md similarity index 100% rename from cmd/mdatagen/testdata/readme_with_status_codeowners.md rename to cmd/mdatagen/internal/testdata/readme_with_status_codeowners.md diff --git a/cmd/mdatagen/testdata/readme_with_status_codeowners_and_emeritus.md b/cmd/mdatagen/internal/testdata/readme_with_status_codeowners_and_emeritus.md similarity index 100% rename from cmd/mdatagen/testdata/readme_with_status_codeowners_and_emeritus.md rename to cmd/mdatagen/internal/testdata/readme_with_status_codeowners_and_emeritus.md diff --git a/cmd/mdatagen/testdata/readme_with_status_codeowners_and_seeking_new.md b/cmd/mdatagen/internal/testdata/readme_with_status_codeowners_and_seeking_new.md similarity index 100% rename from cmd/mdatagen/testdata/readme_with_status_codeowners_and_seeking_new.md rename to cmd/mdatagen/internal/testdata/readme_with_status_codeowners_and_seeking_new.md diff --git a/cmd/mdatagen/testdata/readme_with_status_extension.md b/cmd/mdatagen/internal/testdata/readme_with_status_extension.md similarity index 100% rename from cmd/mdatagen/testdata/readme_with_status_extension.md rename to cmd/mdatagen/internal/testdata/readme_with_status_extension.md diff --git a/cmd/mdatagen/testdata/readme_with_warnings.md b/cmd/mdatagen/internal/testdata/readme_with_warnings.md similarity index 100% rename from cmd/mdatagen/testdata/readme_with_warnings.md rename to cmd/mdatagen/internal/testdata/readme_with_warnings.md diff --git a/cmd/mdatagen/testdata/readme_without_status.md b/cmd/mdatagen/internal/testdata/readme_without_status.md similarity index 100% rename from cmd/mdatagen/testdata/readme_without_status.md rename to cmd/mdatagen/internal/testdata/readme_without_status.md diff --git a/cmd/mdatagen/testdata/resource_attributes_only.yaml b/cmd/mdatagen/internal/testdata/resource_attributes_only.yaml similarity index 100% rename from cmd/mdatagen/testdata/resource_attributes_only.yaml rename to cmd/mdatagen/internal/testdata/resource_attributes_only.yaml diff --git a/cmd/mdatagen/testdata/status_only.yaml b/cmd/mdatagen/internal/testdata/status_only.yaml similarity index 100% rename from cmd/mdatagen/testdata/status_only.yaml rename to cmd/mdatagen/internal/testdata/status_only.yaml diff --git a/cmd/mdatagen/testdata/two_metric_types.yaml b/cmd/mdatagen/internal/testdata/two_metric_types.yaml similarity index 100% rename from cmd/mdatagen/testdata/two_metric_types.yaml rename to cmd/mdatagen/internal/testdata/two_metric_types.yaml diff --git a/cmd/mdatagen/testdata/unknown_metric_attribute.yaml b/cmd/mdatagen/internal/testdata/unknown_metric_attribute.yaml similarity index 100% rename from cmd/mdatagen/testdata/unknown_metric_attribute.yaml rename to cmd/mdatagen/internal/testdata/unknown_metric_attribute.yaml diff --git a/cmd/mdatagen/testdata/unknown_value_type.yaml b/cmd/mdatagen/internal/testdata/unknown_value_type.yaml similarity index 100% rename from cmd/mdatagen/testdata/unknown_value_type.yaml rename to cmd/mdatagen/internal/testdata/unknown_value_type.yaml diff --git a/cmd/mdatagen/testdata/unused_attribute.yaml b/cmd/mdatagen/internal/testdata/unused_attribute.yaml similarity index 100% rename from cmd/mdatagen/testdata/unused_attribute.yaml rename to cmd/mdatagen/internal/testdata/unused_attribute.yaml diff --git a/cmd/mdatagen/testdata/with_goleak_ignores.yaml b/cmd/mdatagen/internal/testdata/with_goleak_ignores.yaml similarity index 100% rename from cmd/mdatagen/testdata/with_goleak_ignores.yaml rename to cmd/mdatagen/internal/testdata/with_goleak_ignores.yaml diff --git a/cmd/mdatagen/testdata/with_goleak_setup.yaml b/cmd/mdatagen/internal/testdata/with_goleak_setup.yaml similarity index 100% rename from cmd/mdatagen/testdata/with_goleak_setup.yaml rename to cmd/mdatagen/internal/testdata/with_goleak_setup.yaml diff --git a/cmd/mdatagen/testdata/with_goleak_skip.yaml b/cmd/mdatagen/internal/testdata/with_goleak_skip.yaml similarity index 100% rename from cmd/mdatagen/testdata/with_goleak_skip.yaml rename to cmd/mdatagen/internal/testdata/with_goleak_skip.yaml diff --git a/cmd/mdatagen/testdata/with_goleak_teardown.yaml b/cmd/mdatagen/internal/testdata/with_goleak_teardown.yaml similarity index 100% rename from cmd/mdatagen/testdata/with_goleak_teardown.yaml rename to cmd/mdatagen/internal/testdata/with_goleak_teardown.yaml diff --git a/cmd/mdatagen/testdata/with_telemetry.yaml b/cmd/mdatagen/internal/testdata/with_telemetry.yaml similarity index 100% rename from cmd/mdatagen/testdata/with_telemetry.yaml rename to cmd/mdatagen/internal/testdata/with_telemetry.yaml diff --git a/cmd/mdatagen/testdata/with_tests_connector.yaml b/cmd/mdatagen/internal/testdata/with_tests_connector.yaml similarity index 100% rename from cmd/mdatagen/testdata/with_tests_connector.yaml rename to cmd/mdatagen/internal/testdata/with_tests_connector.yaml diff --git a/cmd/mdatagen/testdata/with_tests_exporter.yaml b/cmd/mdatagen/internal/testdata/with_tests_exporter.yaml similarity index 100% rename from cmd/mdatagen/testdata/with_tests_exporter.yaml rename to cmd/mdatagen/internal/testdata/with_tests_exporter.yaml diff --git a/cmd/mdatagen/testdata/with_tests_extension.yaml b/cmd/mdatagen/internal/testdata/with_tests_extension.yaml similarity index 100% rename from cmd/mdatagen/testdata/with_tests_extension.yaml rename to cmd/mdatagen/internal/testdata/with_tests_extension.yaml diff --git a/cmd/mdatagen/testdata/with_tests_processor.yaml b/cmd/mdatagen/internal/testdata/with_tests_processor.yaml similarity index 100% rename from cmd/mdatagen/testdata/with_tests_processor.yaml rename to cmd/mdatagen/internal/testdata/with_tests_processor.yaml diff --git a/cmd/mdatagen/testdata/with_tests_receiver.yaml b/cmd/mdatagen/internal/testdata/with_tests_receiver.yaml similarity index 100% rename from cmd/mdatagen/testdata/with_tests_receiver.yaml rename to cmd/mdatagen/internal/testdata/with_tests_receiver.yaml diff --git a/cmd/mdatagen/validate.go b/cmd/mdatagen/internal/validate.go similarity index 88% rename from cmd/mdatagen/validate.go rename to cmd/mdatagen/internal/validate.go index 4685b1e2b1c..e28f629b7f6 100644 --- a/cmd/mdatagen/validate.go +++ b/cmd/mdatagen/internal/validate.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package main +package internal // import "go.opentelemetry.io/collector/cmd/mdatagen/internal" import ( "errors" @@ -11,7 +11,7 @@ import ( "go.opentelemetry.io/collector/pdata/pcommon" ) -func (md *metadata) Validate() error { +func (md *Metadata) Validate() error { var errs error if err := md.validateType(); err != nil { errs = errors.Join(errs, err) @@ -35,7 +35,7 @@ func (md *metadata) Validate() error { // This must be kept in sync with the regex in component/config.go. var typeRegexp = regexp.MustCompile(`^[a-zA-Z][0-9a-zA-Z_]{0,62}$`) -func (md *metadata) validateType() error { +func (md *Metadata) validateType() error { if md.Type == "" { return errors.New("missing type") } @@ -51,7 +51,7 @@ func (md *metadata) validateType() error { return nil } -func (md *metadata) validateStatus() error { +func (md *Metadata) validateStatus() error { if md.Parent != "" && md.Status == nil { // status is not required for subcomponents. return nil @@ -112,7 +112,7 @@ func (s *Status) validateStability() error { return errs } -func (md *metadata) validateResourceAttributes() error { +func (md *Metadata) validateResourceAttributes() error { var errs error for name, attr := range md.ResourceAttributes { if attr.Description == "" { @@ -126,16 +126,16 @@ func (md *metadata) validateResourceAttributes() error { return errs } -func (md *metadata) validateMetrics() error { +func (md *Metadata) validateMetrics() error { var errs error - usedAttrs := map[attributeName]bool{} + usedAttrs := map[AttributeName]bool{} errs = errors.Join(errs, validateMetrics(md.Metrics, md.Attributes, usedAttrs), validateMetrics(md.Telemetry.Metrics, md.Attributes, usedAttrs), md.validateAttributes(usedAttrs)) return errs } -func (m *metric) validate() error { +func (m *Metric) validate() error { var errs error if m.Description == "" { errs = errors.Join(errs, errors.New(`missing metric description`)) @@ -159,9 +159,9 @@ func (mit MetricInputType) Validate() error { return nil } -func (md *metadata) validateAttributes(usedAttrs map[attributeName]bool) error { +func (md *Metadata) validateAttributes(usedAttrs map[AttributeName]bool) error { var errs error - unusedAttrs := make([]attributeName, 0, len(md.Attributes)) + unusedAttrs := make([]AttributeName, 0, len(md.Attributes)) for attrName, attr := range md.Attributes { if attr.Description == "" { errs = errors.Join(errs, fmt.Errorf(`missing attribute description for: %v`, attrName)) @@ -180,7 +180,7 @@ func (md *metadata) validateAttributes(usedAttrs map[attributeName]bool) error { return errs } -func validateMetrics(metrics map[metricName]metric, attributes map[attributeName]attribute, usedAttrs map[attributeName]bool) error { +func validateMetrics(metrics map[MetricName]Metric, attributes map[AttributeName]Attribute, usedAttrs map[AttributeName]bool) error { var errs error for mn, m := range metrics { if m.Sum == nil && m.Gauge == nil && m.Histogram == nil { @@ -197,7 +197,7 @@ func validateMetrics(metrics map[metricName]metric, attributes map[attributeName errs = errors.Join(errs, fmt.Errorf(`metric "%v": %w`, mn, err)) continue } - unknownAttrs := make([]attributeName, 0, len(m.Attributes)) + unknownAttrs := make([]AttributeName, 0, len(m.Attributes)) for _, attr := range m.Attributes { if _, ok := attributes[attr]; ok { usedAttrs[attr] = true diff --git a/cmd/mdatagen/validate_test.go b/cmd/mdatagen/internal/validate_test.go similarity index 95% rename from cmd/mdatagen/validate_test.go rename to cmd/mdatagen/internal/validate_test.go index fcc62428648..4c71c272338 100644 --- a/cmd/mdatagen/validate_test.go +++ b/cmd/mdatagen/internal/validate_test.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package main +package internal import ( "fmt" @@ -99,7 +99,7 @@ func TestValidate(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - _, err := loadMetadata(tt.name) + _, err := LoadMetadata(tt.name) require.Error(t, err) require.EqualError(t, err, tt.wantErr) }) @@ -113,9 +113,9 @@ func TestValidateMetricDuplicates(t *testing.T) { "container.uptime": {"docker_stats", "kubeletstats"}, } allMetrics := map[string][]string{} - err := filepath.Walk("../../receiver", func(path string, info fs.FileInfo, _ error) error { + err := filepath.Walk("../../../receiver", func(path string, info fs.FileInfo, _ error) error { if info.Name() == "metadata.yaml" { - md, err := loadMetadata(path) + md, err := LoadMetadata(path) require.NoError(t, err) if len(md.Metrics) > 0 { for metricName := range md.Metrics { diff --git a/cmd/mdatagen/main.go b/cmd/mdatagen/main.go index 66f97ae54da..0f27b925fce 100644 --- a/cmd/mdatagen/main.go +++ b/cmd/mdatagen/main.go @@ -20,6 +20,8 @@ import ( "golang.org/x/text/cases" "golang.org/x/text/language" + + "go.opentelemetry.io/collector/cmd/mdatagen/internal" ) const ( @@ -51,7 +53,7 @@ func run(ymlPath string) error { ymlDir := filepath.Dir(ymlPath) packageName := filepath.Base(ymlDir) - md, err := loadMetadata(ymlPath) + md, err := internal.LoadMetadata(ymlPath) if err != nil { return fmt.Errorf("failed loading %v: %w", ymlPath, err) } @@ -143,25 +145,25 @@ func run(ymlPath string) error { return nil } -func templatize(tmplFile string, md metadata) *template.Template { +func templatize(tmplFile string, md internal.Metadata) *template.Template { return template.Must( template. New(filepath.Base(tmplFile)). Option("missingkey=error"). Funcs(map[string]any{ "publicVar": func(s string) (string, error) { - return formatIdentifier(s, true) + return internal.FormatIdentifier(s, true) }, - "attributeInfo": func(an attributeName) attribute { + "attributeInfo": func(an internal.AttributeName) internal.Attribute { return md.Attributes[an] }, - "metricInfo": func(mn metricName) metric { + "metricInfo": func(mn internal.MetricName) internal.Metric { return md.Metrics[mn] }, - "telemetryInfo": func(mn metricName) metric { + "telemetryInfo": func(mn internal.MetricName) internal.Metric { return md.Telemetry.Metrics[mn] }, - "parseImportsRequired": func(metrics map[metricName]metric) bool { + "parseImportsRequired": func(metrics map[internal.MetricName]internal.Metric) bool { for _, m := range metrics { if m.Data().HasMetricInputType() { return true @@ -195,7 +197,7 @@ func templatize(tmplFile string, md metadata) *template.Template { }, "inc": func(i int) int { return i + 1 }, "distroURL": func(name string) string { - return distros[name] + return internal.Distros[name] }, "isExporter": func() bool { return md.Status.Class == "exporter" @@ -342,10 +344,10 @@ func templatize(tmplFile string, md metadata) *template.Template { // which uses the `\` as a special character. // Meaning on windows based machines, the `\` needs to be replaced // with a `/` for it to find the file. - }).ParseFS(templateFS, strings.ReplaceAll(tmplFile, "\\", "/"))) + }).ParseFS(internal.TemplateFS, strings.ReplaceAll(tmplFile, "\\", "/"))) } -func inlineReplace(tmplFile string, outputFile string, md metadata, start string, end string) error { +func inlineReplace(tmplFile string, outputFile string, md internal.Metadata, start string, end string) error { var readmeContents []byte var err error if readmeContents, err = os.ReadFile(outputFile); err != nil { // nolint: gosec @@ -364,7 +366,7 @@ func inlineReplace(tmplFile string, outputFile string, md metadata, start string md.GithubProject = "open-telemetry/opentelemetry-collector-contrib" } - if err := tmpl.Execute(&buf, templateContext{metadata: md, Package: "metadata"}); err != nil { + if err := tmpl.Execute(&buf, internal.TemplateContext{Metadata: md, Package: "metadata"}); err != nil { return fmt.Errorf("failed executing template: %w", err) } @@ -378,11 +380,11 @@ func inlineReplace(tmplFile string, outputFile string, md metadata, start string return nil } -func generateFile(tmplFile string, outputFile string, md metadata, goPackage string) error { +func generateFile(tmplFile string, outputFile string, md internal.Metadata, goPackage string) error { tmpl := templatize(tmplFile, md) buf := bytes.Buffer{} - if err := tmpl.Execute(&buf, templateContext{metadata: md, Package: goPackage}); err != nil { + if err := tmpl.Execute(&buf, internal.TemplateContext{Metadata: md, Package: goPackage}); err != nil { return fmt.Errorf("failed executing template: %w", err) } diff --git a/cmd/mdatagen/main_test.go b/cmd/mdatagen/main_test.go index aec9ec132dc..dfdcabab7fe 100644 --- a/cmd/mdatagen/main_test.go +++ b/cmd/mdatagen/main_test.go @@ -14,6 +14,7 @@ import ( "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/cmd/mdatagen/internal" "go.opentelemetry.io/collector/component" ) @@ -111,7 +112,7 @@ func TestRunContents(t *testing.T) { tmpdir := filepath.Join(t.TempDir(), "shortname") err := os.MkdirAll(tmpdir, 0750) require.NoError(t, err) - ymlContent, err := os.ReadFile(filepath.Join("testdata", tt.yml)) + ymlContent, err := os.ReadFile(filepath.Join("internal/testdata", tt.yml)) require.NoError(t, err) metadataFile := filepath.Join(tmpdir, "metadata.yaml") require.NoError(t, os.WriteFile(metadataFile, ymlContent, 0600)) @@ -265,7 +266,7 @@ func TestInlineReplace(t *testing.T) { warnings []string stability map[component.StabilityLevel][]string distros []string - codeowners *Codeowners + codeowners *internal.Codeowners githubProject string }{ { @@ -307,7 +308,7 @@ Some info about a component outputFile: "readme_with_status_codeowners_and_seeking_new.md", componentClass: "receiver", distros: []string{"contrib"}, - codeowners: &Codeowners{ + codeowners: &internal.Codeowners{ Active: []string{"foo"}, SeekingNew: true, }, @@ -324,7 +325,7 @@ Some info about a component outputFile: "readme_with_status_codeowners_and_emeritus.md", componentClass: "receiver", distros: []string{"contrib"}, - codeowners: &Codeowners{ + codeowners: &internal.Codeowners{ Active: []string{"foo"}, Emeritus: []string{"bar"}, }, @@ -341,7 +342,7 @@ Some info about a component outputFile: "readme_with_status_codeowners.md", componentClass: "receiver", distros: []string{"contrib"}, - codeowners: &Codeowners{ + codeowners: &internal.Codeowners{ Active: []string{"foo"}, }, }, @@ -425,11 +426,11 @@ Some info about a component if len(tt.stability) > 0 { stability = tt.stability } - md := metadata{ + md := internal.Metadata{ GithubProject: tt.githubProject, Type: "foo", ShortFolderName: "foo", - Status: &Status{ + Status: &internal.Status{ Stability: stability, Distributions: tt.distros, Class: tt.componentClass, @@ -449,7 +450,7 @@ Some info about a component got, err := os.ReadFile(filepath.Join(tmpdir, "README.md")) // nolint: gosec require.NoError(t, err) got = bytes.ReplaceAll(got, []byte("\r\n"), []byte("\n")) - expected, err := os.ReadFile(filepath.Join("testdata", tt.outputFile)) + expected, err := os.ReadFile(filepath.Join("internal/testdata", tt.outputFile)) require.NoError(t, err) expected = bytes.ReplaceAll(expected, []byte("\r\n"), []byte("\n")) fmt.Println(string(got)) @@ -463,14 +464,14 @@ func TestGenerateStatusMetadata(t *testing.T) { tests := []struct { name string output string - md metadata + md internal.Metadata expected string }{ { name: "foo component with beta status", - md: metadata{ + md: internal.Metadata{ Type: "foo", - Status: &Status{ + Status: &internal.Status{ Stability: map[component.StabilityLevel][]string{ component.StabilityLevelBeta: {"metrics"}, }, @@ -498,9 +499,9 @@ const ( }, { name: "foo component with alpha status", - md: metadata{ + md: internal.Metadata{ Type: "foo", - Status: &Status{ + Status: &internal.Status{ Stability: map[component.StabilityLevel][]string{ component.StabilityLevelAlpha: {"metrics"}, }, @@ -545,14 +546,14 @@ func TestGenerateTelemetryMetadata(t *testing.T) { tests := []struct { name string output string - md metadata + md internal.Metadata expected string }{ { name: "foo component with beta status", - md: metadata{ + md: internal.Metadata{ Type: "foo", - Status: &Status{ + Status: &internal.Status{ Stability: map[component.StabilityLevel][]string{ component.StabilityLevelBeta: {"metrics"}, }, @@ -589,9 +590,9 @@ func Tracer(settings component.TelemetrySettings) trace.Tracer { }, { name: "foo component with alpha status", - md: metadata{ + md: internal.Metadata{ Type: "foo", - Status: &Status{ + Status: &internal.Status{ Stability: map[component.StabilityLevel][]string{ component.StabilityLevelAlpha: {"metrics"}, }, From 1339c014733ebe49c75c9b17de6753a52f0c6411 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Mon, 16 Sep 2024 16:56:34 -0700 Subject: [PATCH 15/17] [chore] Remove prometheus need to check test metrics in componenttest (#11172) Signed-off-by: Bogdan Drutu --- cmd/mdatagen/go.mod | 9 - cmd/mdatagen/go.sum | 20 -- component/componenttest/obsreporttest.go | 49 ++--- component/componenttest/otelchecker.go | 197 +++++++++++++++++ .../componenttest/otelprometheuschecker.go | 200 ------------------ .../otelprometheuschecker_test.go | 119 ----------- .../testdata/prometheus_response | 81 ------- component/go.mod | 9 - component/go.sum | 20 -- config/configauth/go.sum | 18 -- config/configgrpc/go.mod | 8 - config/configgrpc/go.sum | 18 -- config/confighttp/go.mod | 8 - config/confighttp/go.sum | 18 -- connector/forwardconnector/go.mod | 9 - connector/forwardconnector/go.sum | 20 -- connector/go.mod | 9 - connector/go.sum | 20 -- exporter/debugexporter/go.mod | 9 - exporter/debugexporter/go.sum | 20 -- exporter/go.mod | 9 - exporter/go.sum | 20 -- exporter/loggingexporter/go.mod | 9 - exporter/loggingexporter/go.sum | 20 -- exporter/nopexporter/go.mod | 9 - exporter/nopexporter/go.sum | 20 -- exporter/otlpexporter/go.mod | 8 - exporter/otlpexporter/go.sum | 18 -- exporter/otlphttpexporter/go.mod | 8 - exporter/otlphttpexporter/go.sum | 18 -- extension/auth/go.mod | 9 - extension/auth/go.sum | 20 -- extension/go.mod | 9 - extension/go.sum | 20 -- extension/memorylimiterextension/go.mod | 9 - extension/memorylimiterextension/go.sum | 20 -- extension/zpagesextension/go.mod | 8 - extension/zpagesextension/go.sum | 18 -- go.mod | 9 - go.sum | 20 -- processor/batchprocessor/go.mod | 9 - processor/batchprocessor/go.sum | 20 -- processor/go.mod | 9 - processor/go.sum | 20 -- processor/memorylimiterprocessor/go.mod | 9 - processor/memorylimiterprocessor/go.sum | 20 -- receiver/go.mod | 9 - receiver/go.sum | 20 -- receiver/nopreceiver/go.mod | 9 - receiver/nopreceiver/go.sum | 20 -- receiver/otlpreceiver/go.mod | 8 - receiver/otlpreceiver/go.sum | 18 -- 52 files changed, 215 insertions(+), 1098 deletions(-) create mode 100644 component/componenttest/otelchecker.go delete mode 100644 component/componenttest/otelprometheuschecker.go delete mode 100644 component/componenttest/otelprometheuschecker_test.go delete mode 100644 component/componenttest/testdata/prometheus_response diff --git a/cmd/mdatagen/go.mod b/cmd/mdatagen/go.mod index 5e4d0d93e12..6b7b08d6898 100644 --- a/cmd/mdatagen/go.mod +++ b/cmd/mdatagen/go.mod @@ -24,8 +24,6 @@ require ( ) require ( - github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect @@ -33,7 +31,6 @@ require ( github.com/gogo/protobuf v1.3.2 // indirect github.com/google/uuid v1.6.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.17.9 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect github.com/knadh/koanf/providers/confmap v0.1.0 // indirect github.com/knadh/koanf/v2 v2.1.1 // indirect @@ -41,17 +38,11 @@ require ( github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.20.3 // indirect - github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.59.1 // indirect - github.com/prometheus/procfs v0.15.1 // indirect go.opentelemetry.io/collector/consumer/consumerprofiles v0.109.0 // indirect go.opentelemetry.io/collector/pdata/pprofile v0.109.0 // indirect go.opentelemetry.io/collector/receiver/receiverprofiles v0.109.0 // indirect go.opentelemetry.io/otel v1.30.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect go.opentelemetry.io/otel/sdk v1.30.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.28.0 // indirect diff --git a/cmd/mdatagen/go.sum b/cmd/mdatagen/go.sum index 1dd1a3915b5..b20a3798f78 100644 --- a/cmd/mdatagen/go.sum +++ b/cmd/mdatagen/go.sum @@ -1,7 +1,3 @@ -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -23,8 +19,6 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= -github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= @@ -35,8 +29,6 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= @@ -46,18 +38,8 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= -github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= -github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= -github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= -github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= -github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= -github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -68,8 +50,6 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= diff --git a/component/componenttest/obsreporttest.go b/component/componenttest/obsreporttest.go index 3662c640671..d26ecf2ab8e 100644 --- a/component/componenttest/obsreporttest.go +++ b/component/componenttest/obsreporttest.go @@ -6,10 +6,7 @@ package componenttest // import "go.opentelemetry.io/collector/component/compone import ( "context" - "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/client_golang/prometheus/promhttp" "go.opentelemetry.io/otel/attribute" - otelprom "go.opentelemetry.io/otel/exporters/prometheus" "go.opentelemetry.io/otel/metric" sdkmetric "go.opentelemetry.io/otel/sdk/metric" "go.opentelemetry.io/otel/sdk/resource" @@ -40,86 +37,86 @@ type TestTelemetry struct { id component.ID SpanRecorder *tracetest.SpanRecorder - prometheusChecker *prometheusChecker - meterProvider *sdkmetric.MeterProvider + reader *sdkmetric.ManualReader + meterProvider *sdkmetric.MeterProvider } // CheckExporterTraces checks that for the current exported values for trace exporter metrics match given values. // Note: SetupTelemetry must be called before this function. func (tts *TestTelemetry) CheckExporterTraces(sentSpans, sendFailedSpans int64) error { - return tts.prometheusChecker.checkExporterTraces(tts.id, sentSpans, sendFailedSpans) + return checkExporterTraces(tts.reader, tts.id, sentSpans, sendFailedSpans) } // CheckExporterMetrics checks that for the current exported values for metrics exporter metrics match given values. // Note: SetupTelemetry must be called before this function. func (tts *TestTelemetry) CheckExporterMetrics(sentMetricsPoints, sendFailedMetricsPoints int64) error { - return tts.prometheusChecker.checkExporterMetrics(tts.id, sentMetricsPoints, sendFailedMetricsPoints) + return checkExporterMetrics(tts.reader, tts.id, sentMetricsPoints, sendFailedMetricsPoints) } func (tts *TestTelemetry) CheckExporterEnqueueFailedMetrics(enqueueFailed int64) error { - return tts.prometheusChecker.checkExporterEnqueueFailed(tts.id, "metric_points", enqueueFailed) + return checkExporterEnqueueFailed(tts.reader, tts.id, "metric_points", enqueueFailed) } func (tts *TestTelemetry) CheckExporterEnqueueFailedTraces(enqueueFailed int64) error { - return tts.prometheusChecker.checkExporterEnqueueFailed(tts.id, "spans", enqueueFailed) + return checkExporterEnqueueFailed(tts.reader, tts.id, "spans", enqueueFailed) } func (tts *TestTelemetry) CheckExporterEnqueueFailedLogs(enqueueFailed int64) error { - return tts.prometheusChecker.checkExporterEnqueueFailed(tts.id, "log_records", enqueueFailed) + return checkExporterEnqueueFailed(tts.reader, tts.id, "log_records", enqueueFailed) } // CheckExporterLogs checks that for the current exported values for logs exporter metrics match given values. // Note: SetupTelemetry must be called before this function. func (tts *TestTelemetry) CheckExporterLogs(sentLogRecords, sendFailedLogRecords int64) error { - return tts.prometheusChecker.checkExporterLogs(tts.id, sentLogRecords, sendFailedLogRecords) + return checkExporterLogs(tts.reader, tts.id, sentLogRecords, sendFailedLogRecords) } func (tts *TestTelemetry) CheckExporterMetricGauge(metric string, val int64, extraAttrs ...attribute.KeyValue) error { attrs := attributesForExporterMetrics(tts.id) attrs = append(attrs, extraAttrs...) - return tts.prometheusChecker.checkGauge(metric, val, attrs) + return checkIntGauge(tts.reader, metric, val, attrs) } // CheckProcessorTraces checks that for the current exported values for trace exporter metrics match given values. // Note: SetupTelemetry must be called before this function. func (tts *TestTelemetry) CheckProcessorTraces(acceptedSpans, refusedSpans, droppedSpans int64) error { - return tts.prometheusChecker.checkProcessorTraces(tts.id, acceptedSpans, refusedSpans, droppedSpans) + return checkProcessorTraces(tts.reader, tts.id, acceptedSpans, refusedSpans, droppedSpans) } // CheckProcessorMetrics checks that for the current exported values for metrics exporter metrics match given values. // Note: SetupTelemetry must be called before this function. func (tts *TestTelemetry) CheckProcessorMetrics(acceptedMetricPoints, refusedMetricPoints, droppedMetricPoints int64) error { - return tts.prometheusChecker.checkProcessorMetrics(tts.id, acceptedMetricPoints, refusedMetricPoints, droppedMetricPoints) + return checkProcessorMetrics(tts.reader, tts.id, acceptedMetricPoints, refusedMetricPoints, droppedMetricPoints) } // CheckProcessorLogs checks that for the current exported values for logs exporter metrics match given values. // Note: SetupTelemetry must be called before this function. func (tts *TestTelemetry) CheckProcessorLogs(acceptedLogRecords, refusedLogRecords, droppedLogRecords int64) error { - return tts.prometheusChecker.checkProcessorLogs(tts.id, acceptedLogRecords, refusedLogRecords, droppedLogRecords) + return checkProcessorLogs(tts.reader, tts.id, acceptedLogRecords, refusedLogRecords, droppedLogRecords) } // CheckReceiverTraces checks that for the current exported values for trace receiver metrics match given values. // Note: SetupTelemetry must be called before this function. func (tts *TestTelemetry) CheckReceiverTraces(protocol string, acceptedSpans, droppedSpans int64) error { - return tts.prometheusChecker.checkReceiverTraces(tts.id, protocol, acceptedSpans, droppedSpans) + return checkReceiverTraces(tts.reader, tts.id, protocol, acceptedSpans, droppedSpans) } // CheckReceiverLogs checks that for the current exported values for logs receiver metrics match given values. // Note: SetupTelemetry must be called before this function. func (tts *TestTelemetry) CheckReceiverLogs(protocol string, acceptedLogRecords, droppedLogRecords int64) error { - return tts.prometheusChecker.checkReceiverLogs(tts.id, protocol, acceptedLogRecords, droppedLogRecords) + return checkReceiverLogs(tts.reader, tts.id, protocol, acceptedLogRecords, droppedLogRecords) } // CheckReceiverMetrics checks that for the current exported values for metrics receiver metrics match given values. // Note: SetupTelemetry must be called before this function. func (tts *TestTelemetry) CheckReceiverMetrics(protocol string, acceptedMetricPoints, droppedMetricPoints int64) error { - return tts.prometheusChecker.checkReceiverMetrics(tts.id, protocol, acceptedMetricPoints, droppedMetricPoints) + return checkReceiverMetrics(tts.reader, tts.id, protocol, acceptedMetricPoints, droppedMetricPoints) } // CheckScraperMetrics checks that for the current exported values for metrics scraper metrics match given values. // Note: SetupTelemetry must be called before this function. func (tts *TestTelemetry) CheckScraperMetrics(receiver component.ID, scraper component.ID, scrapedMetricPoints, erroredMetricPoints int64) error { - return tts.prometheusChecker.checkScraperMetrics(receiver, scraper, scrapedMetricPoints, erroredMetricPoints) + return checkScraperMetrics(tts.reader, receiver, scraper, scrapedMetricPoints, erroredMetricPoints) } // Shutdown unregisters any views and shuts down the SpanRecorder @@ -151,24 +148,14 @@ func SetupTelemetry(id component.ID) (TestTelemetry, error) { } settings.ts.TracerProvider = tp - promRegOtel := prometheus.NewRegistry() - - exp, err := otelprom.New(otelprom.WithRegisterer(promRegOtel), otelprom.WithoutUnits(), otelprom.WithoutScopeInfo(), otelprom.WithoutCounterSuffixes()) - if err != nil { - return settings, err - } - + settings.reader = sdkmetric.NewManualReader() settings.meterProvider = sdkmetric.NewMeterProvider( sdkmetric.WithResource(resource.Empty()), - sdkmetric.WithReader(exp), + sdkmetric.WithReader(settings.reader), ) settings.ts.LeveledMeterProvider = func(_ configtelemetry.Level) metric.MeterProvider { return settings.meterProvider } - settings.prometheusChecker = &prometheusChecker{ - otelHandler: promhttp.HandlerFor(promRegOtel, promhttp.HandlerOpts{}), - } - return settings, nil } diff --git a/component/componenttest/otelchecker.go b/component/componenttest/otelchecker.go new file mode 100644 index 00000000000..275ad35f45c --- /dev/null +++ b/component/componenttest/otelchecker.go @@ -0,0 +1,197 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package componenttest // import "go.opentelemetry.io/collector/component/componenttest" + +import ( + "context" + "fmt" + + "go.opentelemetry.io/otel/attribute" + sdkmetric "go.opentelemetry.io/otel/sdk/metric" + "go.opentelemetry.io/otel/sdk/metric/metricdata" + "go.uber.org/multierr" + + "go.opentelemetry.io/collector/component" +) + +func checkScraperMetrics(reader *sdkmetric.ManualReader, receiver component.ID, scraper component.ID, scrapedMetricPoints, erroredMetricPoints int64) error { + scraperAttrs := attributesForScraperMetrics(receiver, scraper) + return multierr.Combine( + checkIntSum(reader, "otelcol_scraper_scraped_metric_points", scrapedMetricPoints, scraperAttrs), + checkIntSum(reader, "otelcol_scraper_errored_metric_points", erroredMetricPoints, scraperAttrs)) +} + +func checkReceiverTraces(reader *sdkmetric.ManualReader, receiver component.ID, protocol string, accepted, dropped int64) error { + return checkReceiver(reader, receiver, "spans", protocol, accepted, dropped) +} + +func checkReceiverLogs(reader *sdkmetric.ManualReader, receiver component.ID, protocol string, accepted, dropped int64) error { + return checkReceiver(reader, receiver, "log_records", protocol, accepted, dropped) +} + +func checkReceiverMetrics(reader *sdkmetric.ManualReader, receiver component.ID, protocol string, accepted, dropped int64) error { + return checkReceiver(reader, receiver, "metric_points", protocol, accepted, dropped) +} + +func checkReceiver(reader *sdkmetric.ManualReader, receiver component.ID, datatype, protocol string, acceptedMetricPoints, droppedMetricPoints int64) error { + receiverAttrs := attributesForReceiverMetrics(receiver, protocol) + return multierr.Combine( + checkIntSum(reader, fmt.Sprintf("otelcol_receiver_accepted_%s", datatype), acceptedMetricPoints, receiverAttrs), + checkIntSum(reader, fmt.Sprintf("otelcol_receiver_refused_%s", datatype), droppedMetricPoints, receiverAttrs)) +} + +func checkProcessorTraces(reader *sdkmetric.ManualReader, processor component.ID, accepted, refused, dropped int64) error { + return checkProcessor(reader, processor, "spans", accepted, refused, dropped) +} + +func checkProcessorMetrics(reader *sdkmetric.ManualReader, processor component.ID, accepted, refused, dropped int64) error { + return checkProcessor(reader, processor, "metric_points", accepted, refused, dropped) +} + +func checkProcessorLogs(reader *sdkmetric.ManualReader, processor component.ID, accepted, refused, dropped int64) error { + return checkProcessor(reader, processor, "log_records", accepted, refused, dropped) +} + +func checkProcessor(reader *sdkmetric.ManualReader, processor component.ID, datatype string, accepted, refused, dropped int64) error { + processorAttrs := attributesForProcessorMetrics(processor) + return multierr.Combine( + checkIntSum(reader, fmt.Sprintf("otelcol_processor_accepted_%s", datatype), accepted, processorAttrs), + checkIntSum(reader, fmt.Sprintf("otelcol_processor_refused_%s", datatype), refused, processorAttrs), + checkIntSum(reader, fmt.Sprintf("otelcol_processor_dropped_%s", datatype), dropped, processorAttrs), + ) +} + +func checkExporterTraces(reader *sdkmetric.ManualReader, exporter component.ID, sent, sendFailed int64) error { + return checkExporter(reader, exporter, "spans", sent, sendFailed) +} + +func checkExporterLogs(reader *sdkmetric.ManualReader, exporter component.ID, sent, sendFailed int64) error { + return checkExporter(reader, exporter, "log_records", sent, sendFailed) +} + +func checkExporterMetrics(reader *sdkmetric.ManualReader, exporter component.ID, sent, sendFailed int64) error { + return checkExporter(reader, exporter, "metric_points", sent, sendFailed) +} + +func checkExporter(reader *sdkmetric.ManualReader, exporter component.ID, datatype string, sent, sendFailed int64) error { + exporterAttrs := attributesForExporterMetrics(exporter) + errs := checkIntSum(reader, fmt.Sprintf("otelcol_exporter_sent_%s", datatype), sent, exporterAttrs) + if sendFailed > 0 { + errs = multierr.Append(errs, + checkIntSum(reader, fmt.Sprintf("otelcol_exporter_send_failed_%s", datatype), sendFailed, exporterAttrs)) + } + return errs +} + +func checkExporterEnqueueFailed(reader *sdkmetric.ManualReader, exporter component.ID, datatype string, enqueueFailed int64) error { + if enqueueFailed == 0 { + return nil + } + exporterAttrs := attributesForExporterMetrics(exporter) + return checkIntSum(reader, fmt.Sprintf("otelcol_exporter_enqueue_failed_%s", datatype), enqueueFailed, exporterAttrs) +} + +func checkIntGauge(reader *sdkmetric.ManualReader, metric string, expected int64, attrs []attribute.KeyValue) error { + dp, err := getGaugeDataPoint[int64](reader, metric, attrs) + if err != nil { + return err + } + + if dp.Value != expected { + return fmt.Errorf("values for metric '%s' did not match, expected '%d' got '%d'", metric, expected, dp.Value) + } + + return nil +} + +func checkIntSum(reader *sdkmetric.ManualReader, expectedMetric string, expected int64, attrs []attribute.KeyValue) error { + dp, err := getSumDataPoint[int64](reader, expectedMetric, attrs) + if err != nil { + return err + } + + if dp.Value != expected { + return fmt.Errorf("values for metric '%s' did not match, expected '%d' got '%d'", expectedMetric, expected, dp.Value) + } + + return nil +} + +func getSumDataPoint[N int64 | float64](reader *sdkmetric.ManualReader, expectedName string, expectedAttrs []attribute.KeyValue) (metricdata.DataPoint[N], error) { + m, err := getMetric(reader, expectedName) + if err != nil { + return metricdata.DataPoint[N]{}, err + } + + switch a := m.Data.(type) { + case metricdata.Sum[N]: + return getDataPoint(a.DataPoints, expectedName, expectedAttrs) + default: + return metricdata.DataPoint[N]{}, fmt.Errorf("unknown metric type: %T", a) + } +} + +func getGaugeDataPoint[N int64 | float64](reader *sdkmetric.ManualReader, expectedName string, expectedAttrs []attribute.KeyValue) (metricdata.DataPoint[N], error) { + m, err := getMetric(reader, expectedName) + if err != nil { + return metricdata.DataPoint[N]{}, err + } + + switch a := m.Data.(type) { + case metricdata.Gauge[N]: + return getDataPoint(a.DataPoints, expectedName, expectedAttrs) + default: + return metricdata.DataPoint[N]{}, fmt.Errorf("unknown metric type: %T", a) + } +} + +func getDataPoint[N int64 | float64](dps []metricdata.DataPoint[N], expectedName string, expectedAttrs []attribute.KeyValue) (metricdata.DataPoint[N], error) { + expectedSet := attribute.NewSet(expectedAttrs...) + for _, dp := range dps { + if expectedSet.Equals(&dp.Attributes) { + return dp, nil + } + } + return metricdata.DataPoint[N]{}, fmt.Errorf("metric '%s' doesn't have a data point with the given attributes: %s", expectedName, expectedSet.Encoded(attribute.DefaultEncoder())) +} + +func getMetric(reader *sdkmetric.ManualReader, expectedName string) (metricdata.Metrics, error) { + var rm metricdata.ResourceMetrics + if err := reader.Collect(context.Background(), &rm); err != nil { + return metricdata.Metrics{}, err + } + + for _, sm := range rm.ScopeMetrics { + for _, m := range sm.Metrics { + if m.Name == expectedName { + return m, nil + } + } + } + return metricdata.Metrics{}, fmt.Errorf("metric '%s' not found", expectedName) +} + +func attributesForScraperMetrics(receiver component.ID, scraper component.ID) []attribute.KeyValue { + return []attribute.KeyValue{ + attribute.String(receiverTag, receiver.String()), + attribute.String(scraperTag, scraper.String()), + } +} + +// attributesForReceiverMetrics returns the attributes that are needed for the receiver metrics. +func attributesForReceiverMetrics(receiver component.ID, transport string) []attribute.KeyValue { + return []attribute.KeyValue{ + attribute.String(receiverTag, receiver.String()), + attribute.String(transportTag, transport), + } +} + +func attributesForProcessorMetrics(processor component.ID) []attribute.KeyValue { + return []attribute.KeyValue{attribute.String(processorTag, processor.String())} +} + +// attributesForExporterMetrics returns the attributes that are needed for the receiver metrics. +func attributesForExporterMetrics(exporter component.ID) []attribute.KeyValue { + return []attribute.KeyValue{attribute.String(exporterTag, exporter.String())} +} diff --git a/component/componenttest/otelprometheuschecker.go b/component/componenttest/otelprometheuschecker.go deleted file mode 100644 index 14b357b9704..00000000000 --- a/component/componenttest/otelprometheuschecker.go +++ /dev/null @@ -1,200 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package componenttest // import "go.opentelemetry.io/collector/component/componenttest" - -import ( - "fmt" - "math" - "net/http" - "net/http/httptest" - - io_prometheus_client "github.com/prometheus/client_model/go" - "github.com/prometheus/common/expfmt" - "go.opentelemetry.io/otel/attribute" - "go.uber.org/multierr" - - "go.opentelemetry.io/collector/component" -) - -// prometheusChecker is used to assert exported metrics from a prometheus handler. -type prometheusChecker struct { - otelHandler http.Handler -} - -func (pc *prometheusChecker) checkScraperMetrics(receiver component.ID, scraper component.ID, scrapedMetricPoints, erroredMetricPoints int64) error { - scraperAttrs := attributesForScraperMetrics(receiver, scraper) - return multierr.Combine( - pc.checkCounter("scraper_scraped_metric_points", scrapedMetricPoints, scraperAttrs), - pc.checkCounter("scraper_errored_metric_points", erroredMetricPoints, scraperAttrs)) -} - -func (pc *prometheusChecker) checkReceiverTraces(receiver component.ID, protocol string, accepted, dropped int64) error { - return pc.checkReceiver(receiver, "spans", protocol, accepted, dropped) -} - -func (pc *prometheusChecker) checkReceiverLogs(receiver component.ID, protocol string, accepted, dropped int64) error { - return pc.checkReceiver(receiver, "log_records", protocol, accepted, dropped) -} - -func (pc *prometheusChecker) checkReceiverMetrics(receiver component.ID, protocol string, accepted, dropped int64) error { - return pc.checkReceiver(receiver, "metric_points", protocol, accepted, dropped) -} - -func (pc *prometheusChecker) checkReceiver(receiver component.ID, datatype, protocol string, acceptedMetricPoints, droppedMetricPoints int64) error { - receiverAttrs := attributesForReceiverMetrics(receiver, protocol) - return multierr.Combine( - pc.checkCounter(fmt.Sprintf("receiver_accepted_%s", datatype), acceptedMetricPoints, receiverAttrs), - pc.checkCounter(fmt.Sprintf("receiver_refused_%s", datatype), droppedMetricPoints, receiverAttrs)) -} - -func (pc *prometheusChecker) checkProcessorTraces(processor component.ID, accepted, refused, dropped int64) error { - return pc.checkProcessor(processor, "spans", accepted, refused, dropped) -} - -func (pc *prometheusChecker) checkProcessorMetrics(processor component.ID, accepted, refused, dropped int64) error { - return pc.checkProcessor(processor, "metric_points", accepted, refused, dropped) -} - -func (pc *prometheusChecker) checkProcessorLogs(processor component.ID, accepted, refused, dropped int64) error { - return pc.checkProcessor(processor, "log_records", accepted, refused, dropped) -} - -func (pc *prometheusChecker) checkProcessor(processor component.ID, datatype string, accepted, refused, dropped int64) error { - processorAttrs := attributesForProcessorMetrics(processor) - return multierr.Combine( - pc.checkCounter(fmt.Sprintf("processor_accepted_%s", datatype), accepted, processorAttrs), - pc.checkCounter(fmt.Sprintf("processor_refused_%s", datatype), refused, processorAttrs), - pc.checkCounter(fmt.Sprintf("processor_dropped_%s", datatype), dropped, processorAttrs), - ) -} - -func (pc *prometheusChecker) checkExporterTraces(exporter component.ID, sent, sendFailed int64) error { - return pc.checkExporter(exporter, "spans", sent, sendFailed) -} - -func (pc *prometheusChecker) checkExporterLogs(exporter component.ID, sent, sendFailed int64) error { - return pc.checkExporter(exporter, "log_records", sent, sendFailed) -} - -func (pc *prometheusChecker) checkExporterMetrics(exporter component.ID, sent, sendFailed int64) error { - return pc.checkExporter(exporter, "metric_points", sent, sendFailed) -} - -func (pc *prometheusChecker) checkExporter(exporter component.ID, datatype string, sent, sendFailed int64) error { - exporterAttrs := attributesForExporterMetrics(exporter) - errs := pc.checkCounter(fmt.Sprintf("exporter_sent_%s", datatype), sent, exporterAttrs) - if sendFailed > 0 { - errs = multierr.Append(errs, - pc.checkCounter(fmt.Sprintf("exporter_send_failed_%s", datatype), sendFailed, exporterAttrs)) - } - return errs -} - -func (pc *prometheusChecker) checkExporterEnqueueFailed(exporter component.ID, datatype string, enqueueFailed int64) error { - if enqueueFailed == 0 { - return nil - } - exporterAttrs := attributesForExporterMetrics(exporter) - return pc.checkCounter(fmt.Sprintf("exporter_enqueue_failed_%s", datatype), enqueueFailed, exporterAttrs) -} - -func (pc *prometheusChecker) checkGauge(metric string, val int64, attrs []attribute.KeyValue) error { - ts, err := pc.getMetric(metric, io_prometheus_client.MetricType_GAUGE, attrs) - if err != nil { - return err - } - - expected := float64(val) - if math.Abs(ts.GetGauge().GetValue()-expected) > 0.0001 { - return fmt.Errorf("values for metric '%s' did not match, expected '%f' got '%f'", metric, expected, ts.GetGauge().GetValue()) - } - - return nil -} - -func (pc *prometheusChecker) checkCounter(expectedMetric string, value int64, attrs []attribute.KeyValue) error { - ts, err := pc.getMetric(fmt.Sprintf("otelcol_%s", expectedMetric), io_prometheus_client.MetricType_COUNTER, attrs) - if err != nil { - return err - } - - expected := float64(value) - if math.Abs(expected-ts.GetCounter().GetValue()) > 0.0001 { - return fmt.Errorf("values for metric '%s' did not match, expected '%f' got '%f'", expectedMetric, expected, ts.GetCounter().GetValue()) - } - - return nil -} - -// getMetric returns the metric time series that matches the given name, type and set of attributes -// it fetches data from the prometheus endpoint and parse them, ideally OTel Go should provide a MeterRecorder of some kind. -func (pc *prometheusChecker) getMetric(expectedName string, expectedType io_prometheus_client.MetricType, expectedAttrs []attribute.KeyValue) (*io_prometheus_client.Metric, error) { - parsed, err := fetchPrometheusMetrics(pc.otelHandler) - if err != nil { - return nil, err - } - - metricFamily, ok := parsed[expectedName] - if !ok { - return nil, fmt.Errorf("metric '%s' not found", expectedName) - } - - if metricFamily.Type.String() != expectedType.String() { - return nil, fmt.Errorf("metric '%v' has type '%s' instead of '%s'", expectedName, metricFamily.Type.String(), expectedType.String()) - } - - expectedSet := attribute.NewSet(expectedAttrs...) - - for _, metric := range metricFamily.Metric { - var attrs []attribute.KeyValue - - for _, label := range metric.Label { - attrs = append(attrs, attribute.String(label.GetName(), label.GetValue())) - } - set := attribute.NewSet(attrs...) - - if expectedSet.Equals(&set) { - return metric, nil - } - } - - return nil, fmt.Errorf("metric '%s' doesn't have a timeseries with the given attributes: %s", expectedName, expectedSet.Encoded(attribute.DefaultEncoder())) -} - -func fetchPrometheusMetrics(handler http.Handler) (map[string]*io_prometheus_client.MetricFamily, error) { - req, err := http.NewRequest(http.MethodGet, "/metrics", nil) - if err != nil { - return nil, err - } - - rr := httptest.NewRecorder() - handler.ServeHTTP(rr, req) - - var parser expfmt.TextParser - return parser.TextToMetricFamilies(rr.Body) -} - -func attributesForScraperMetrics(receiver component.ID, scraper component.ID) []attribute.KeyValue { - return []attribute.KeyValue{ - attribute.String(receiverTag, receiver.String()), - attribute.String(scraperTag, scraper.String()), - } -} - -// attributesForReceiverMetrics returns the attributes that are needed for the receiver metrics. -func attributesForReceiverMetrics(receiver component.ID, transport string) []attribute.KeyValue { - return []attribute.KeyValue{ - attribute.String(receiverTag, receiver.String()), - attribute.String(transportTag, transport), - } -} - -func attributesForProcessorMetrics(processor component.ID) []attribute.KeyValue { - return []attribute.KeyValue{attribute.String(processorTag, processor.String())} -} - -// attributesForExporterMetrics returns the attributes that are needed for the receiver metrics. -func attributesForExporterMetrics(exporter component.ID) []attribute.KeyValue { - return []attribute.KeyValue{attribute.String(exporterTag, exporter.String())} -} diff --git a/component/componenttest/otelprometheuschecker_test.go b/component/componenttest/otelprometheuschecker_test.go deleted file mode 100644 index d7176134f54..00000000000 --- a/component/componenttest/otelprometheuschecker_test.go +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package componenttest // import "go.opentelemetry.io/collector/component/componenttest" - -import ( - "net/http" - "os" - "path/filepath" - "strings" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "go.opentelemetry.io/otel/attribute" - - "go.opentelemetry.io/collector/component" -) - -func newStubPromChecker() (prometheusChecker, error) { - promBytes, err := os.ReadFile(filepath.Join("testdata", "prometheus_response")) - if err != nil { - return prometheusChecker{}, err - } - - promResponse := strings.ReplaceAll(string(promBytes), "\r\n", "\n") - - return prometheusChecker{ - otelHandler: http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { - _, _ = w.Write([]byte(promResponse)) - }), - }, nil -} - -func TestPromChecker(t *testing.T) { - pc, err := newStubPromChecker() - require.NoError(t, err) - - scraper := component.MustNewID("fakeScraper") - receiver := component.MustNewID("fakeReceiver") - processor := component.MustNewID("fakeProcessor") - exporter := component.MustNewID("fakeExporter") - transport := "fakeTransport" - - assert.NoError(t, - pc.checkCounter("receiver_accepted_spans", 42, []attribute.KeyValue{attribute.String("receiver", receiver.String()), attribute.String("transport", transport)}), - "correct assertion should return no error", - ) - - assert.Error(t, - pc.checkCounter("receiver_accepted_spans", 15, []attribute.KeyValue{attribute.String("receiver", receiver.String()), attribute.String("transport", transport)}), - "invalid value should return error", - ) - - assert.Error(t, - pc.checkCounter("invalid_name", 42, []attribute.KeyValue{attribute.String("receiver", receiver.String()), attribute.String("transport", transport)}), - "invalid name should return error", - ) - - assert.Error(t, - pc.checkCounter("receiver_accepted_spans", 42, []attribute.KeyValue{attribute.String("receiver", "notFakeReceiver"), attribute.String("transport", transport)}), - "invalid attributes should return error", - ) - - assert.Error(t, - pc.checkCounter("gauge_metric", 49, nil), - "invalid metric type should return error", - ) - - assert.NoError(t, - pc.checkScraperMetrics(receiver, scraper, 7, 41), - "metrics from Scraper Metrics should be valid", - ) - - assert.NoError(t, - pc.checkReceiverTraces(receiver, transport, 42, 13), - "metrics from Receiver Traces should be valid", - ) - - assert.NoError(t, - pc.checkReceiverMetrics(receiver, transport, 7, 41), - "metrics from Receiver Metrics should be valid", - ) - - assert.NoError(t, - pc.checkReceiverLogs(receiver, transport, 102, 35), - "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", - ) - - assert.NoError(t, - pc.checkExporterMetrics(exporter, 8, 42), - "metrics from Exporter Metrics should be valid", - ) - - assert.NoError(t, - pc.checkExporterLogs(exporter, 103, 36), - "metrics from Exporter Logs should be valid", - ) -} diff --git a/component/componenttest/testdata/prometheus_response b/component/componenttest/testdata/prometheus_response deleted file mode 100644 index 9d0eb69ee7f..00000000000 --- a/component/componenttest/testdata/prometheus_response +++ /dev/null @@ -1,81 +0,0 @@ -# HELP otelcol_exporter_send_failed_spans Number of spans in failed attempts to send to destination. -# TYPE otelcol_exporter_send_failed_spans counter -otelcol_exporter_send_failed_spans{exporter="fakeExporter"} 14 -# HELP otelcol_exporter_sent_spans Number of spans successfully sent to destination. -# TYPE otelcol_exporter_sent_spans counter -otelcol_exporter_sent_spans{exporter="fakeExporter"} 43 -# HELP otelcol_exporter_send_failed_metric_points Number of metrics in failed attempts to send to destination. -# TYPE otelcol_exporter_send_failed_metric_points counter -otelcol_exporter_send_failed_metric_points{exporter="fakeExporter"} 42 -# HELP otelcol_exporter_sent_metric_points Number of metrics successfully sent to destination. -# TYPE otelcol_exporter_sent_metric_points counter -otelcol_exporter_sent_metric_points{exporter="fakeExporter"} 8 -# HELP otelcol_exporter_send_failed_log_records Number of logs in failed attempts to send to destination. -# TYPE otelcol_exporter_send_failed_log_records counter -otelcol_exporter_send_failed_log_records{exporter="fakeExporter"} 36 -# HELP otelcol_exporter_sent_log_records Number of logs successfully sent to destination. -# TYPE otelcol_exporter_sent_log_records counter -otelcol_exporter_sent_log_records{exporter="fakeExporter"} 103 -# HELP otelcol_processor_accepted_spans Number of spans successfully pushed into the next component in the pipeline. -# TYPE otelcol_processor_accepted_spans counter -otelcol_processor_accepted_spans{processor="fakeProcessor"} 42 -# HELP otelcol_processor_refused_spans Number of spans that were rejected by the next component in the pipeline. -# TYPE otelcol_processor_refused_spans counter -otelcol_processor_refused_spans{processor="fakeProcessor"} 13 -# HELP otelcol_processor_dropped_spans Number of spans that were dropped. -# TYPE otelcol_processor_dropped_spans counter -otelcol_processor_dropped_spans{processor="fakeProcessor"} 7 -# HELP otelcol_processor_inserted_spans Number of spans that were inserted. -# TYPE otelcol_processor_inserted_spans counter -otelcol_processor_inserted_spans{processor="fakeProcessor"} 5 -# HELP otelcol_processor_accepted_metric_points Number of metric points successfully pushed into the next component in the pipeline. -# TYPE otelcol_processor_accepted_metric_points counter -otelcol_processor_accepted_metric_points{processor="fakeProcessor"} 7 -# HELP otelcol_processor_refused_metric_points Number of metric points that were rejected by the next component in the pipeline. -# TYPE otelcol_processor_refused_metric_points counter -otelcol_processor_refused_metric_points{processor="fakeProcessor"} 41 -# HELP otelcol_processor_dropped_metric_points Number of metric points that were dropped. -# TYPE otelcol_processor_dropped_metric_points counter -otelcol_processor_dropped_metric_points{processor="fakeProcessor"} 13 -# HELP otelcol_processor_inserted_metric_points Number of metric points that were inserted. -# TYPE otelcol_processor_inserted_metric_points counter -otelcol_processor_inserted_metric_points{processor="fakeProcessor"} 4 -# HELP otelcol_processor_accepted_log_records Number of log records successfully pushed into the next component in the pipeline. -# TYPE otelcol_processor_accepted_log_records counter -otelcol_processor_accepted_log_records{processor="fakeProcessor"} 102 -# HELP otelcol_processor_refused_log_records Number of log records that were rejected by the next component in the pipeline. -# TYPE otelcol_processor_refused_log_records counter -otelcol_processor_refused_log_records{processor="fakeProcessor"} 35 -# HELP otelcol_processor_dropped_log_records Number of log records that were dropped. -# TYPE otelcol_processor_dropped_log_records counter -otelcol_processor_dropped_log_records{processor="fakeProcessor"} 14 -# HELP otelcol_processor_inserted_log_records Number of log records that were inserted. -# TYPE otelcol_processor_inserted_log_records counter -otelcol_processor_inserted_log_records{processor="fakeProcessor"} 3 -# HELP otelcol_receiver_accepted_log_records Number of log records successfully pushed into the pipeline. -# TYPE otelcol_receiver_accepted_log_records counter -otelcol_receiver_accepted_log_records{receiver="fakeReceiver",transport="fakeTransport"} 102 -# HELP otelcol_receiver_accepted_metric_points Number of metric points successfully pushed into the pipeline. -# TYPE otelcol_receiver_accepted_metric_points counter -otelcol_receiver_accepted_metric_points{receiver="fakeReceiver",transport="fakeTransport"} 7 -# HELP otelcol_receiver_accepted_spans Number of spans successfully pushed into the pipeline. -# TYPE otelcol_receiver_accepted_spans counter -otelcol_receiver_accepted_spans{receiver="fakeReceiver",transport="fakeTransport"} 42 -# HELP otelcol_receiver_refused_log_records Number of log records that could not be pushed into the pipeline. -# TYPE otelcol_receiver_refused_log_records counter -otelcol_receiver_refused_log_records{receiver="fakeReceiver",transport="fakeTransport"} 35 -# HELP otelcol_receiver_refused_metric_points Number of metric points that could not be pushed into the pipeline. -# TYPE otelcol_receiver_refused_metric_points counter -otelcol_receiver_refused_metric_points{receiver="fakeReceiver",transport="fakeTransport"} 41 -# HELP otelcol_receiver_refused_spans Number of spans that could not be pushed into the pipeline. -# TYPE otelcol_receiver_refused_spans counter -otelcol_receiver_refused_spans{receiver="fakeReceiver",transport="fakeTransport"} 13 -# HELP otelcol_scraper_scraped_metric_points Number of metric points successfully scraped. -# TYPE otelcol_scraper_scraped_metric_points counter -otelcol_scraper_scraped_metric_points{receiver="fakeReceiver",scraper="fakeScraper"} 7 -# HELP otelcol_scraper_errored_metric_points Number of metric points that were unable to be scraped. -# TYPE otelcol_scraper_errored_metric_points counter -otelcol_scraper_errored_metric_points{receiver="fakeReceiver",scraper="fakeScraper"} 41 -# HELP gauge_metric A simple gauge metric -# TYPE gauge_metric gauge -gauge_metric 49 diff --git a/component/go.mod b/component/go.mod index 8b83b1c2f2b..62148f8642b 100644 --- a/component/go.mod +++ b/component/go.mod @@ -3,14 +3,10 @@ module go.opentelemetry.io/collector/component go 1.22.0 require ( - github.com/prometheus/client_golang v1.20.3 - github.com/prometheus/client_model v0.6.1 - github.com/prometheus/common v0.59.1 github.com/stretchr/testify v1.9.0 go.opentelemetry.io/collector/config/configtelemetry v0.109.0 go.opentelemetry.io/collector/pdata v1.15.0 go.opentelemetry.io/otel v1.30.0 - go.opentelemetry.io/otel/exporters/prometheus v0.52.0 go.opentelemetry.io/otel/metric v1.30.0 go.opentelemetry.io/otel/sdk v1.30.0 go.opentelemetry.io/otel/sdk/metric v1.30.0 @@ -21,17 +17,12 @@ require ( ) require ( - github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/google/uuid v1.6.0 // indirect - github.com/klauspost/compress v1.17.9 // indirect - github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/procfs v0.15.1 // indirect golang.org/x/net v0.28.0 // indirect golang.org/x/sys v0.25.0 // indirect golang.org/x/text v0.17.0 // indirect diff --git a/component/go.sum b/component/go.sum index dc25c056423..6a8f77d63c9 100644 --- a/component/go.sum +++ b/component/go.sum @@ -1,7 +1,3 @@ -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= @@ -17,26 +13,12 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= -github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= -github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= -github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= -github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= -github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= -github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= -github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= @@ -45,8 +27,6 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= diff --git a/config/configauth/go.sum b/config/configauth/go.sum index 69f293e7bf3..6c424b20035 100644 --- a/config/configauth/go.sum +++ b/config/configauth/go.sum @@ -1,7 +1,3 @@ -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= @@ -16,24 +12,12 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= -github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= -github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= -github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= -github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= -github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= -github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= -github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= @@ -42,8 +26,6 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= diff --git a/config/configgrpc/go.mod b/config/configgrpc/go.mod index 88be3af7595..ee6a147fc74 100644 --- a/config/configgrpc/go.mod +++ b/config/configgrpc/go.mod @@ -27,8 +27,6 @@ require ( ) require ( - github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/go-logr/logr v1.4.2 // indirect @@ -41,15 +39,9 @@ require ( github.com/klauspost/compress v1.17.9 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.20.3 // indirect - github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.59.1 // indirect - github.com/prometheus/procfs v0.15.1 // indirect go.opentelemetry.io/collector/extension v0.109.0 // indirect go.opentelemetry.io/collector/pdata/pprofile v0.109.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect go.opentelemetry.io/otel/metric v1.30.0 // indirect go.opentelemetry.io/otel/sdk v1.30.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect diff --git a/config/configgrpc/go.sum b/config/configgrpc/go.sum index 39bfa0a61db..196635d4924 100644 --- a/config/configgrpc/go.sum +++ b/config/configgrpc/go.sum @@ -1,7 +1,3 @@ -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -33,8 +29,6 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -42,18 +36,8 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/mostynb/go-grpc-compression v1.2.3 h1:42/BKWMy0KEJGSdWvzqIyOZ95YcR9mLPqKctH7Uo//I= github.com/mostynb/go-grpc-compression v1.2.3/go.mod h1:AghIxF3P57umzqM9yz795+y1Vjs47Km/Y2FE6ouQ7Lg= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= -github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= -github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= -github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= -github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= -github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= -github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -66,8 +50,6 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.5 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0/go.mod h1:B9yO6b04uB80CzjedvewuqDhxJxi11s7/GtiGa8bAjI= go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= diff --git a/config/confighttp/go.mod b/config/confighttp/go.mod index ce6775e98f7..d7822dcb215 100644 --- a/config/confighttp/go.mod +++ b/config/confighttp/go.mod @@ -27,8 +27,6 @@ require ( ) require ( - github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect @@ -37,15 +35,9 @@ require ( github.com/gogo/protobuf v1.3.2 // indirect github.com/google/uuid v1.6.0 // indirect github.com/hashicorp/go-version v1.7.0 // indirect - github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.20.3 // indirect - github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.59.1 // indirect - github.com/prometheus/procfs v0.15.1 // indirect go.opentelemetry.io/collector/extension v0.109.0 // indirect go.opentelemetry.io/collector/pdata v1.15.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect go.opentelemetry.io/otel/sdk v1.30.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect go.opentelemetry.io/otel/trace v1.30.0 // indirect diff --git a/config/confighttp/go.sum b/config/confighttp/go.sum index 0a5b63ac7c5..87e9c7f3ab5 100644 --- a/config/confighttp/go.sum +++ b/config/confighttp/go.sum @@ -1,7 +1,3 @@ -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= @@ -33,24 +29,12 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= -github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= -github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= -github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= -github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= -github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= -github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= @@ -63,8 +47,6 @@ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 h1:TT4fX+n go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0/go.mod h1:L7UH0GbB0p47T4Rri3uHjbpCFYrVrwc1I25QhNPiGK8= go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= diff --git a/connector/forwardconnector/go.mod b/connector/forwardconnector/go.mod index a40c074e75e..7bc162eb459 100644 --- a/connector/forwardconnector/go.mod +++ b/connector/forwardconnector/go.mod @@ -14,8 +14,6 @@ require ( ) require ( - github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect @@ -23,7 +21,6 @@ require ( github.com/gogo/protobuf v1.3.2 // indirect github.com/google/uuid v1.6.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.17.9 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect github.com/knadh/koanf/providers/confmap v0.1.0 // indirect github.com/knadh/koanf/v2 v2.1.1 // indirect @@ -31,12 +28,7 @@ require ( github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.20.3 // indirect - github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.59.1 // indirect - github.com/prometheus/procfs v0.15.1 // indirect go.opentelemetry.io/collector v0.109.0 // indirect go.opentelemetry.io/collector/component/componentprofiles v0.109.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.109.0 // indirect @@ -44,7 +36,6 @@ require ( go.opentelemetry.io/collector/consumer/consumerprofiles v0.109.0 // indirect go.opentelemetry.io/collector/pdata/pprofile v0.109.0 // indirect go.opentelemetry.io/otel v1.30.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect go.opentelemetry.io/otel/metric v1.30.0 // indirect go.opentelemetry.io/otel/sdk v1.30.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect diff --git a/connector/forwardconnector/go.sum b/connector/forwardconnector/go.sum index ac12e3d31e7..dedb71eaf65 100644 --- a/connector/forwardconnector/go.sum +++ b/connector/forwardconnector/go.sum @@ -1,7 +1,3 @@ -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -23,8 +19,6 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= -github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= @@ -35,8 +29,6 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= @@ -46,18 +38,8 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= -github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= -github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= -github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= -github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= -github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= -github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -68,8 +50,6 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= diff --git a/connector/go.mod b/connector/go.mod index 35ef7f7e441..535636888e2 100644 --- a/connector/go.mod +++ b/connector/go.mod @@ -20,25 +20,16 @@ require ( ) require ( - github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.17.9 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.20.3 // indirect - github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.59.1 // indirect - github.com/prometheus/procfs v0.15.1 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.109.0 // indirect go.opentelemetry.io/otel v1.30.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect go.opentelemetry.io/otel/metric v1.30.0 // indirect go.opentelemetry.io/otel/sdk v1.30.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect diff --git a/connector/go.sum b/connector/go.sum index 2fb10b5d6d7..f1c43e1a810 100644 --- a/connector/go.sum +++ b/connector/go.sum @@ -1,7 +1,3 @@ -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -21,31 +17,17 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= -github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= -github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= -github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= -github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= -github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= -github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= -github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -56,8 +38,6 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= diff --git a/exporter/debugexporter/go.mod b/exporter/debugexporter/go.mod index 88f4dd3818f..2dbeba59a28 100644 --- a/exporter/debugexporter/go.mod +++ b/exporter/debugexporter/go.mod @@ -16,9 +16,7 @@ require ( ) require ( - github.com/beorn7/perks v1.0.1 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect @@ -26,7 +24,6 @@ require ( github.com/gogo/protobuf v1.3.2 // indirect github.com/google/uuid v1.6.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.17.9 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect github.com/knadh/koanf/providers/confmap v0.1.0 // indirect github.com/knadh/koanf/v2 v2.1.1 // indirect @@ -34,12 +31,7 @@ require ( github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.20.3 // indirect - github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.59.1 // indirect - github.com/prometheus/procfs v0.15.1 // indirect go.opentelemetry.io/collector/config/configretry v1.15.0 // indirect go.opentelemetry.io/collector/consumer/consumerprofiles v0.109.0 // indirect go.opentelemetry.io/collector/consumer/consumertest v0.109.0 // indirect @@ -50,7 +42,6 @@ require ( go.opentelemetry.io/collector/receiver v0.109.0 // indirect go.opentelemetry.io/collector/receiver/receiverprofiles v0.109.0 // indirect go.opentelemetry.io/otel v1.30.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect go.opentelemetry.io/otel/metric v1.30.0 // indirect go.opentelemetry.io/otel/sdk v1.30.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect diff --git a/exporter/debugexporter/go.sum b/exporter/debugexporter/go.sum index 6890ef19e46..7362aa12179 100644 --- a/exporter/debugexporter/go.sum +++ b/exporter/debugexporter/go.sum @@ -1,9 +1,5 @@ -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -25,8 +21,6 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= -github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= @@ -37,8 +31,6 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= @@ -48,18 +40,8 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= -github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= -github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= -github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= -github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= -github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= -github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -70,8 +52,6 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= diff --git a/exporter/go.mod b/exporter/go.mod index 9fa3d2f6cab..810ae975681 100644 --- a/exporter/go.mod +++ b/exporter/go.mod @@ -32,24 +32,15 @@ require ( ) require ( - github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.17.9 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.20.3 // indirect - github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.59.1 // indirect - github.com/prometheus/procfs v0.15.1 // indirect go.opentelemetry.io/collector/receiver/receiverprofiles v0.109.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect golang.org/x/net v0.28.0 // indirect golang.org/x/text v0.17.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd // indirect diff --git a/exporter/go.sum b/exporter/go.sum index 369679016e1..e1a8c130283 100644 --- a/exporter/go.sum +++ b/exporter/go.sum @@ -1,9 +1,5 @@ -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -23,31 +19,17 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= -github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= -github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= -github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= -github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= -github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= -github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= -github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -58,8 +40,6 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= diff --git a/exporter/loggingexporter/go.mod b/exporter/loggingexporter/go.mod index fd226a6073e..95dd32723c5 100644 --- a/exporter/loggingexporter/go.mod +++ b/exporter/loggingexporter/go.mod @@ -15,9 +15,7 @@ require ( ) require ( - github.com/beorn7/perks v1.0.1 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect @@ -25,7 +23,6 @@ require ( github.com/gogo/protobuf v1.3.2 // indirect github.com/google/uuid v1.6.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.17.9 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect github.com/knadh/koanf/providers/confmap v0.1.0 // indirect github.com/knadh/koanf/v2 v2.1.1 // indirect @@ -33,12 +30,7 @@ require ( github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.20.3 // indirect - github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.59.1 // indirect - github.com/prometheus/procfs v0.15.1 // indirect go.opentelemetry.io/collector/config/configretry v1.15.0 // indirect go.opentelemetry.io/collector/consumer v0.109.0 // indirect go.opentelemetry.io/collector/consumer/consumerprofiles v0.109.0 // indirect @@ -50,7 +42,6 @@ require ( go.opentelemetry.io/collector/receiver v0.109.0 // indirect go.opentelemetry.io/collector/receiver/receiverprofiles v0.109.0 // indirect go.opentelemetry.io/otel v1.30.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect go.opentelemetry.io/otel/metric v1.30.0 // indirect go.opentelemetry.io/otel/sdk v1.30.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect diff --git a/exporter/loggingexporter/go.sum b/exporter/loggingexporter/go.sum index 6890ef19e46..7362aa12179 100644 --- a/exporter/loggingexporter/go.sum +++ b/exporter/loggingexporter/go.sum @@ -1,9 +1,5 @@ -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -25,8 +21,6 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= -github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= @@ -37,8 +31,6 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= @@ -48,18 +40,8 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= -github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= -github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= -github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= -github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= -github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= -github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -70,8 +52,6 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= diff --git a/exporter/nopexporter/go.mod b/exporter/nopexporter/go.mod index f45e33b3c31..4da6bfe4a7f 100644 --- a/exporter/nopexporter/go.mod +++ b/exporter/nopexporter/go.mod @@ -13,8 +13,6 @@ require ( ) require ( - github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect @@ -22,7 +20,6 @@ require ( github.com/gogo/protobuf v1.3.2 // indirect github.com/google/uuid v1.6.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.17.9 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect github.com/knadh/koanf/providers/confmap v0.1.0 // indirect github.com/knadh/koanf/v2 v2.1.1 // indirect @@ -30,12 +27,7 @@ require ( github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.20.3 // indirect - github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.59.1 // indirect - github.com/prometheus/procfs v0.15.1 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.109.0 // indirect go.opentelemetry.io/collector/consumer v0.109.0 // indirect go.opentelemetry.io/collector/consumer/consumerprofiles v0.109.0 // indirect @@ -44,7 +36,6 @@ require ( go.opentelemetry.io/collector/receiver v0.109.0 // indirect go.opentelemetry.io/collector/receiver/receiverprofiles v0.109.0 // indirect go.opentelemetry.io/otel v1.30.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect go.opentelemetry.io/otel/metric v1.30.0 // indirect go.opentelemetry.io/otel/sdk v1.30.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect diff --git a/exporter/nopexporter/go.sum b/exporter/nopexporter/go.sum index 6890ef19e46..7362aa12179 100644 --- a/exporter/nopexporter/go.sum +++ b/exporter/nopexporter/go.sum @@ -1,9 +1,5 @@ -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -25,8 +21,6 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= -github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= @@ -37,8 +31,6 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= @@ -48,18 +40,8 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= -github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= -github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= -github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= -github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= -github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= -github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -70,8 +52,6 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= diff --git a/exporter/otlpexporter/go.mod b/exporter/otlpexporter/go.mod index ba4e1661fe0..014822d736b 100644 --- a/exporter/otlpexporter/go.mod +++ b/exporter/otlpexporter/go.mod @@ -25,9 +25,7 @@ require ( ) require ( - github.com/beorn7/perks v1.0.1 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/go-logr/logr v1.4.2 // indirect @@ -47,12 +45,7 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/mostynb/go-grpc-compression v1.2.3 // indirect - github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.20.3 // indirect - github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.59.1 // indirect - github.com/prometheus/procfs v0.15.1 // indirect go.opentelemetry.io/collector/client v1.15.0 // indirect go.opentelemetry.io/collector/config/confignet v0.109.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.109.0 // indirect @@ -70,7 +63,6 @@ require ( go.opentelemetry.io/collector/receiver/receiverprofiles v0.109.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 // indirect go.opentelemetry.io/otel v1.30.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect go.opentelemetry.io/otel/metric v1.30.0 // indirect go.opentelemetry.io/otel/sdk v1.30.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect diff --git a/exporter/otlpexporter/go.sum b/exporter/otlpexporter/go.sum index edf7b021678..ef4d8a7d85b 100644 --- a/exporter/otlpexporter/go.sum +++ b/exporter/otlpexporter/go.sum @@ -1,9 +1,5 @@ -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -43,8 +39,6 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= @@ -56,18 +50,8 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/mostynb/go-grpc-compression v1.2.3 h1:42/BKWMy0KEJGSdWvzqIyOZ95YcR9mLPqKctH7Uo//I= github.com/mostynb/go-grpc-compression v1.2.3/go.mod h1:AghIxF3P57umzqM9yz795+y1Vjs47Km/Y2FE6ouQ7Lg= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= -github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= -github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= -github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= -github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= -github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= -github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -80,8 +64,6 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.5 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0/go.mod h1:B9yO6b04uB80CzjedvewuqDhxJxi11s7/GtiGa8bAjI= go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= diff --git a/exporter/otlphttpexporter/go.mod b/exporter/otlphttpexporter/go.mod index 82ecf37c57f..909bec139aa 100644 --- a/exporter/otlphttpexporter/go.mod +++ b/exporter/otlphttpexporter/go.mod @@ -23,9 +23,7 @@ require ( ) require ( - github.com/beorn7/perks v1.0.1 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect @@ -45,12 +43,7 @@ require ( github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.20.3 // indirect - github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.59.1 // indirect - github.com/prometheus/procfs v0.15.1 // indirect github.com/rs/cors v1.11.1 // indirect go.opentelemetry.io/collector/client v1.15.0 // indirect go.opentelemetry.io/collector/config/configauth v0.109.0 // indirect @@ -69,7 +62,6 @@ require ( go.opentelemetry.io/collector/receiver/receiverprofiles v0.109.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect go.opentelemetry.io/otel v1.30.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect go.opentelemetry.io/otel/metric v1.30.0 // indirect go.opentelemetry.io/otel/sdk v1.30.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect diff --git a/exporter/otlphttpexporter/go.sum b/exporter/otlphttpexporter/go.sum index f06be19ff12..eab6989f9d7 100644 --- a/exporter/otlphttpexporter/go.sum +++ b/exporter/otlphttpexporter/go.sum @@ -1,9 +1,5 @@ -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -45,8 +41,6 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= @@ -56,18 +50,8 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= -github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= -github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= -github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= -github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= -github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= -github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= @@ -82,8 +66,6 @@ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 h1:TT4fX+n go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0/go.mod h1:L7UH0GbB0p47T4Rri3uHjbpCFYrVrwc1I25QhNPiGK8= go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= diff --git a/extension/auth/go.mod b/extension/auth/go.mod index cb0cecd9e82..f19c52b0976 100644 --- a/extension/auth/go.mod +++ b/extension/auth/go.mod @@ -11,24 +11,15 @@ require ( ) require ( - github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/google/uuid v1.6.0 // indirect - github.com/klauspost/compress v1.17.9 // indirect - github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.20.3 // indirect - github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.59.1 // indirect - github.com/prometheus/procfs v0.15.1 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.109.0 // indirect go.opentelemetry.io/collector/pdata v1.15.0 // indirect go.opentelemetry.io/otel v1.30.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect go.opentelemetry.io/otel/metric v1.30.0 // indirect go.opentelemetry.io/otel/sdk v1.30.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect diff --git a/extension/auth/go.sum b/extension/auth/go.sum index dc25c056423..6a8f77d63c9 100644 --- a/extension/auth/go.sum +++ b/extension/auth/go.sum @@ -1,7 +1,3 @@ -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= @@ -17,26 +13,12 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= -github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= -github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= -github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= -github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= -github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= -github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= -github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= @@ -45,8 +27,6 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= diff --git a/extension/go.mod b/extension/go.mod index 0c495fbeada..c931427d42a 100644 --- a/extension/go.mod +++ b/extension/go.mod @@ -10,23 +10,14 @@ require ( ) require ( - github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/klauspost/compress v1.17.9 // indirect - github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.20.3 // indirect - github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.59.1 // indirect - github.com/prometheus/procfs v0.15.1 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.109.0 // indirect go.opentelemetry.io/collector/pdata v1.15.0 // indirect go.opentelemetry.io/otel v1.30.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect go.opentelemetry.io/otel/metric v1.30.0 // indirect go.opentelemetry.io/otel/sdk v1.30.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect diff --git a/extension/go.sum b/extension/go.sum index dc25c056423..6a8f77d63c9 100644 --- a/extension/go.sum +++ b/extension/go.sum @@ -1,7 +1,3 @@ -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= @@ -17,26 +13,12 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= -github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= -github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= -github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= -github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= -github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= -github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= -github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= @@ -45,8 +27,6 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= diff --git a/extension/memorylimiterextension/go.mod b/extension/memorylimiterextension/go.mod index bed21c8dc20..cc39a2357e2 100644 --- a/extension/memorylimiterextension/go.mod +++ b/extension/memorylimiterextension/go.mod @@ -13,8 +13,6 @@ require ( ) require ( - github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect @@ -22,20 +20,14 @@ require ( github.com/go-viper/mapstructure/v2 v2.1.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/google/uuid v1.6.0 // indirect - github.com/klauspost/compress v1.17.9 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect github.com/knadh/koanf/providers/confmap v0.1.0 // indirect github.com/knadh/koanf/v2 v2.1.1 // indirect github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect - github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect - github.com/prometheus/client_golang v1.20.3 // indirect - github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.59.1 // indirect - github.com/prometheus/procfs v0.15.1 // indirect github.com/shirou/gopsutil/v4 v4.24.8 // indirect github.com/tklauser/go-sysconf v0.3.12 // indirect github.com/tklauser/numcpus v0.6.1 // indirect @@ -43,7 +35,6 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.109.0 // indirect go.opentelemetry.io/collector/pdata v1.15.0 // indirect go.opentelemetry.io/otel v1.30.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect go.opentelemetry.io/otel/metric v1.30.0 // indirect go.opentelemetry.io/otel/sdk v1.30.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect diff --git a/extension/memorylimiterextension/go.sum b/extension/memorylimiterextension/go.sum index 97f09cd34bd..31f67636c7f 100644 --- a/extension/memorylimiterextension/go.sum +++ b/extension/memorylimiterextension/go.sum @@ -1,7 +1,3 @@ -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= @@ -22,8 +18,6 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= -github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= @@ -34,28 +28,16 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= -github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= -github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= -github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= -github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= -github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= -github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= -github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/shirou/gopsutil/v4 v4.24.8 h1:pVQjIenQkIhqO81mwTaXjTzOMT7d3TZkf43PlVFHENI= @@ -72,8 +54,6 @@ github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= diff --git a/extension/zpagesextension/go.mod b/extension/zpagesextension/go.mod index 544bbb029aa..99dbeb3b079 100644 --- a/extension/zpagesextension/go.mod +++ b/extension/zpagesextension/go.mod @@ -19,8 +19,6 @@ require ( ) require ( - github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect @@ -37,12 +35,7 @@ require ( github.com/knadh/koanf/v2 v2.1.1 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect - github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.20.3 // indirect - github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.59.1 // indirect - github.com/prometheus/procfs v0.15.1 // indirect github.com/rs/cors v1.11.1 // indirect go.opentelemetry.io/collector/client v1.15.0 // indirect go.opentelemetry.io/collector/config/configcompression v1.15.0 // indirect @@ -56,7 +49,6 @@ require ( go.opentelemetry.io/collector/pdata v1.15.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect go.opentelemetry.io/otel v1.30.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect go.opentelemetry.io/otel/metric v1.30.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect go.uber.org/multierr v1.11.0 // indirect diff --git a/extension/zpagesextension/go.sum b/extension/zpagesextension/go.sum index 479bcbe4f1e..66c27382780 100644 --- a/extension/zpagesextension/go.sum +++ b/extension/zpagesextension/go.sum @@ -1,7 +1,3 @@ -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= @@ -41,8 +37,6 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= @@ -51,18 +45,8 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= -github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= -github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= -github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= -github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= -github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= -github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= @@ -77,8 +61,6 @@ go.opentelemetry.io/contrib/zpages v0.54.0 h1:tSfm/LEK5E46sd5qx/Y9o4iQ65ipLubV0U go.opentelemetry.io/contrib/zpages v0.54.0/go.mod h1:sbe4/RH3CFKkdM5zuGwfziKjvkqUOK9hSgLFckiVZUI= go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= diff --git a/go.mod b/go.mod index 5ff241af35e..8d0b53689bc 100644 --- a/go.mod +++ b/go.mod @@ -29,8 +29,6 @@ require ( ) require ( - github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect @@ -39,7 +37,6 @@ require ( github.com/gogo/protobuf v1.3.2 // indirect github.com/google/uuid v1.6.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.17.9 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect github.com/knadh/koanf/providers/confmap v0.1.0 // indirect github.com/knadh/koanf/v2 v2.1.1 // indirect @@ -48,20 +45,14 @@ require ( github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect - github.com/prometheus/client_golang v1.20.3 // indirect - github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.59.1 // indirect - github.com/prometheus/procfs v0.15.1 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/tklauser/go-sysconf v0.3.12 // indirect github.com/tklauser/numcpus v0.6.1 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.109.0 // indirect go.opentelemetry.io/otel v1.30.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect go.opentelemetry.io/otel/metric v1.30.0 // indirect go.opentelemetry.io/otel/sdk v1.30.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect diff --git a/go.sum b/go.sum index 556ddb58cb8..e9ba3a707e8 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,3 @@ -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -26,8 +22,6 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= -github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= @@ -38,8 +32,6 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= @@ -51,20 +43,10 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= -github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= -github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= -github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= -github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= -github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= -github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= -github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/shirou/gopsutil/v4 v4.24.8 h1:pVQjIenQkIhqO81mwTaXjTzOMT7d3TZkf43PlVFHENI= @@ -83,8 +65,6 @@ github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= diff --git a/processor/batchprocessor/go.mod b/processor/batchprocessor/go.mod index 557defcc6c3..d4983ff1a74 100644 --- a/processor/batchprocessor/go.mod +++ b/processor/batchprocessor/go.mod @@ -22,8 +22,6 @@ require ( ) require ( - github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect @@ -31,7 +29,6 @@ require ( github.com/gogo/protobuf v1.3.2 // indirect github.com/google/uuid v1.6.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.17.9 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect github.com/knadh/koanf/providers/confmap v0.1.0 // indirect github.com/knadh/koanf/v2 v2.1.1 // indirect @@ -39,17 +36,11 @@ require ( github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.20.3 // indirect - github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.59.1 // indirect - github.com/prometheus/procfs v0.15.1 // indirect go.opentelemetry.io/collector/component/componentstatus v0.109.0 // indirect go.opentelemetry.io/collector/consumer/consumerprofiles v0.109.0 // indirect go.opentelemetry.io/collector/pdata/pprofile v0.109.0 // indirect go.opentelemetry.io/collector/processor/processorprofiles v0.109.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect go.opentelemetry.io/otel/sdk v1.30.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.28.0 // indirect diff --git a/processor/batchprocessor/go.sum b/processor/batchprocessor/go.sum index 923e7d7ba7f..3f545b81c90 100644 --- a/processor/batchprocessor/go.sum +++ b/processor/batchprocessor/go.sum @@ -1,7 +1,3 @@ -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -23,8 +19,6 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= -github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= @@ -35,8 +29,6 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= @@ -46,18 +38,8 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= -github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= -github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= -github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= -github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= -github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= -github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -68,8 +50,6 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= diff --git a/processor/go.mod b/processor/go.mod index 726c6aff708..b7d9909f165 100644 --- a/processor/go.mod +++ b/processor/go.mod @@ -23,23 +23,14 @@ require ( ) require ( - github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.17.9 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.20.3 // indirect - github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.59.1 // indirect - github.com/prometheus/procfs v0.15.1 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect go.opentelemetry.io/otel/sdk v1.30.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect diff --git a/processor/go.sum b/processor/go.sum index 46c53d70967..de81b161d10 100644 --- a/processor/go.sum +++ b/processor/go.sum @@ -1,7 +1,3 @@ -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -21,31 +17,17 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= -github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= -github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= -github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= -github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= -github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= -github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= -github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -56,8 +38,6 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= diff --git a/processor/memorylimiterprocessor/go.mod b/processor/memorylimiterprocessor/go.mod index 32e125c5222..e6228cd56a5 100644 --- a/processor/memorylimiterprocessor/go.mod +++ b/processor/memorylimiterprocessor/go.mod @@ -15,8 +15,6 @@ require ( ) require ( - github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect @@ -25,7 +23,6 @@ require ( github.com/gogo/protobuf v1.3.2 // indirect github.com/google/uuid v1.6.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.17.9 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect github.com/knadh/koanf/providers/confmap v0.1.0 // indirect github.com/knadh/koanf/v2 v2.1.1 // indirect @@ -34,13 +31,8 @@ require ( github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect - github.com/prometheus/client_golang v1.20.3 // indirect - github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.59.1 // indirect - github.com/prometheus/procfs v0.15.1 // indirect github.com/shirou/gopsutil/v4 v4.24.8 // indirect github.com/tklauser/go-sysconf v0.3.12 // indirect github.com/tklauser/numcpus v0.6.1 // indirect @@ -52,7 +44,6 @@ require ( go.opentelemetry.io/collector/pdata/testdata v0.109.0 // indirect go.opentelemetry.io/collector/processor/processorprofiles v0.109.0 // indirect go.opentelemetry.io/otel v1.30.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect go.opentelemetry.io/otel/metric v1.30.0 // indirect go.opentelemetry.io/otel/sdk v1.30.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect diff --git a/processor/memorylimiterprocessor/go.sum b/processor/memorylimiterprocessor/go.sum index 556ddb58cb8..e9ba3a707e8 100644 --- a/processor/memorylimiterprocessor/go.sum +++ b/processor/memorylimiterprocessor/go.sum @@ -1,7 +1,3 @@ -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -26,8 +22,6 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= -github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= @@ -38,8 +32,6 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= @@ -51,20 +43,10 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= -github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= -github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= -github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= -github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= -github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= -github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= -github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/shirou/gopsutil/v4 v4.24.8 h1:pVQjIenQkIhqO81mwTaXjTzOMT7d3TZkf43PlVFHENI= @@ -83,8 +65,6 @@ github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= diff --git a/receiver/go.mod b/receiver/go.mod index 4a3b2b2f7ee..5df2db0ea6a 100644 --- a/receiver/go.mod +++ b/receiver/go.mod @@ -23,24 +23,15 @@ require ( ) require ( - github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.17.9 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.20.3 // indirect - github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.59.1 // indirect - github.com/prometheus/procfs v0.15.1 // indirect go.opentelemetry.io/collector/pdata/pprofile v0.109.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect golang.org/x/net v0.28.0 // indirect golang.org/x/sys v0.25.0 // indirect golang.org/x/text v0.17.0 // indirect diff --git a/receiver/go.sum b/receiver/go.sum index 46c53d70967..de81b161d10 100644 --- a/receiver/go.sum +++ b/receiver/go.sum @@ -1,7 +1,3 @@ -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -21,31 +17,17 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= -github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= -github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= -github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= -github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= -github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= -github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= -github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -56,8 +38,6 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= diff --git a/receiver/nopreceiver/go.mod b/receiver/nopreceiver/go.mod index 80857581489..146f0f3e0d5 100644 --- a/receiver/nopreceiver/go.mod +++ b/receiver/nopreceiver/go.mod @@ -13,8 +13,6 @@ require ( ) require ( - github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect @@ -22,7 +20,6 @@ require ( github.com/gogo/protobuf v1.3.2 // indirect github.com/google/uuid v1.6.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.17.9 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect github.com/knadh/koanf/providers/confmap v0.1.0 // indirect github.com/knadh/koanf/v2 v2.1.1 // indirect @@ -30,19 +27,13 @@ require ( github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.20.3 // indirect - github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.59.1 // indirect - github.com/prometheus/procfs v0.15.1 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.109.0 // indirect go.opentelemetry.io/collector/consumer/consumerprofiles v0.109.0 // indirect go.opentelemetry.io/collector/pdata v1.15.0 // indirect go.opentelemetry.io/collector/pdata/pprofile v0.109.0 // indirect go.opentelemetry.io/collector/receiver/receiverprofiles v0.109.0 // indirect go.opentelemetry.io/otel v1.30.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect go.opentelemetry.io/otel/metric v1.30.0 // indirect go.opentelemetry.io/otel/sdk v1.30.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect diff --git a/receiver/nopreceiver/go.sum b/receiver/nopreceiver/go.sum index 923e7d7ba7f..3f545b81c90 100644 --- a/receiver/nopreceiver/go.sum +++ b/receiver/nopreceiver/go.sum @@ -1,7 +1,3 @@ -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -23,8 +19,6 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= -github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= @@ -35,8 +29,6 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= @@ -46,18 +38,8 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= -github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= -github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= -github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= -github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= -github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= -github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -68,8 +50,6 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= diff --git a/receiver/otlpreceiver/go.mod b/receiver/otlpreceiver/go.mod index f0e05ee63ff..9afe036af6a 100644 --- a/receiver/otlpreceiver/go.mod +++ b/receiver/otlpreceiver/go.mod @@ -29,8 +29,6 @@ require ( ) require ( - github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect @@ -49,12 +47,7 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/mostynb/go-grpc-compression v1.2.3 // indirect - github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.20.3 // indirect - github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.59.1 // indirect - github.com/prometheus/procfs v0.15.1 // indirect github.com/rs/cors v1.11.1 // indirect go.opentelemetry.io/collector/client v1.15.0 // indirect go.opentelemetry.io/collector/config/configcompression v1.15.0 // indirect @@ -70,7 +63,6 @@ require ( go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect go.opentelemetry.io/otel v1.30.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect go.opentelemetry.io/otel/metric v1.30.0 // indirect go.opentelemetry.io/otel/sdk v1.30.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect diff --git a/receiver/otlpreceiver/go.sum b/receiver/otlpreceiver/go.sum index 89ec05c98f8..17cfac39fe4 100644 --- a/receiver/otlpreceiver/go.sum +++ b/receiver/otlpreceiver/go.sum @@ -1,7 +1,3 @@ -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -43,8 +39,6 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= @@ -56,18 +50,8 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/mostynb/go-grpc-compression v1.2.3 h1:42/BKWMy0KEJGSdWvzqIyOZ95YcR9mLPqKctH7Uo//I= github.com/mostynb/go-grpc-compression v1.2.3/go.mod h1:AghIxF3P57umzqM9yz795+y1Vjs47Km/Y2FE6ouQ7Lg= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= -github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= -github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= -github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= -github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= -github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= -github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= @@ -84,8 +68,6 @@ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 h1:TT4fX+n go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0/go.mod h1:L7UH0GbB0p47T4Rri3uHjbpCFYrVrwc1I25QhNPiGK8= go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= -go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= From 792a4015b01f1a5f9d28f970e41ca6fe66fe4865 Mon Sep 17 00:00:00 2001 From: "John L. Peterson (Jack)" Date: Tue, 17 Sep 2024 03:50:45 -0400 Subject: [PATCH 16/17] [chore] Update ocb README.md to v0.109.0 (#11170) #### Description update builder readme to reflect latest version number #### Documentation README.md --------- Co-authored-by: Bogdan Drutu Co-authored-by: Pablo Baeyens --- cmd/builder/README.md | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/cmd/builder/README.md b/cmd/builder/README.md index b64a4d4cdc0..be4be596646 100644 --- a/cmd/builder/README.md +++ b/cmd/builder/README.md @@ -5,22 +5,28 @@ This program generates a custom OpenTelemetry Collector binary based on a given ## TL;DR ```console -$ go install go.opentelemetry.io/collector/cmd/builder@v0.107.0 +$ go install go.opentelemetry.io/collector/cmd/builder@v0.109.0 $ cat > otelcol-builder.yaml < /tmp/otelcol.yaml < Date: Tue, 17 Sep 2024 10:59:12 +0200 Subject: [PATCH 17/17] Profiles support in OTLP receiver (#11071) #### Description This adds profiles support to the OTLP receiver. cc @mx-psi --- .chloggen/otlpreceiver-profiles.yaml | 25 +++++ cmd/mdatagen/internal/validate.go | 8 ++ pdata/pprofile/pb.go | 31 ++++++ pdata/pprofile/pb_test.go | 78 +++++++++++++++ pdata/pprofile/profiles_test.go | 61 ++++++++++++ pdata/testdata/profile.go | 18 ++++ receiver/otlpreceiver/README.md | 32 +++--- receiver/otlpreceiver/encoder.go | 23 +++++ receiver/otlpreceiver/factory.go | 33 ++++++- receiver/otlpreceiver/factory_test.go | 99 +++++++++++++++++++ receiver/otlpreceiver/go.mod | 6 +- .../internal/metadata/generated_status.go | 7 +- .../otlpreceiver/internal/profiles/otlp.go | 48 +++++++++ .../internal/profiles/otlp_test.go | 97 ++++++++++++++++++ .../internal/profiles/package_test.go | 14 +++ receiver/otlpreceiver/metadata.yaml | 1 + receiver/otlpreceiver/otlp.go | 38 +++++-- receiver/otlpreceiver/otlp_test.go | 45 ++++++++- receiver/otlpreceiver/otlphttp.go | 32 ++++++ receiver/otlpreceiver/testdata/config.yaml | 2 +- .../testdata/invalid_profiles_path.yaml | 3 + receiver/receiverhelper/metadata.yaml | 2 +- 22 files changed, 667 insertions(+), 36 deletions(-) create mode 100644 .chloggen/otlpreceiver-profiles.yaml create mode 100644 pdata/pprofile/pb.go create mode 100644 pdata/pprofile/pb_test.go create mode 100644 receiver/otlpreceiver/internal/profiles/otlp.go create mode 100644 receiver/otlpreceiver/internal/profiles/otlp_test.go create mode 100644 receiver/otlpreceiver/internal/profiles/package_test.go create mode 100644 receiver/otlpreceiver/testdata/invalid_profiles_path.yaml diff --git a/.chloggen/otlpreceiver-profiles.yaml b/.chloggen/otlpreceiver-profiles.yaml new file mode 100644 index 00000000000..e0d866fb92b --- /dev/null +++ b/.chloggen/otlpreceiver-profiles.yaml @@ -0,0 +1,25 @@ +# Use this changelog template to create an entry for release notes. + +# 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: otlpreceiver + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Support profiles in the OTLP receiver + +# One or more tracking issues or pull requests related to the change +issues: [11071] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: + +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Include 'api' if there is a change to a library API. +# Default: '[user]' +change_logs: [api] diff --git a/cmd/mdatagen/internal/validate.go b/cmd/mdatagen/internal/validate.go index e28f629b7f6..b784a94fbba 100644 --- a/cmd/mdatagen/internal/validate.go +++ b/cmd/mdatagen/internal/validate.go @@ -95,15 +95,23 @@ func (s *Status) validateStability() error { if c != "metrics" && c != "traces" && c != "logs" && + c != "profiles" && c != "traces_to_traces" && c != "traces_to_metrics" && c != "traces_to_logs" && + c != "traces_to_profiles" && c != "metrics_to_traces" && c != "metrics_to_metrics" && c != "metrics_to_logs" && + c != "metrics_to_profiles" && c != "logs_to_traces" && c != "logs_to_metrics" && c != "logs_to_logs" && + c != "logs_to_profiles" && + c != "profiles_to_profiles" && + c != "profiles_to_traces" && + c != "profiles_to_metrics" && + c != "profiles_to_logs" && c != "extension" { errs = errors.Join(errs, fmt.Errorf("invalid component: %v", c)) } diff --git a/pdata/pprofile/pb.go b/pdata/pprofile/pb.go new file mode 100644 index 00000000000..b9c8bacd14c --- /dev/null +++ b/pdata/pprofile/pb.go @@ -0,0 +1,31 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package pprofile // import "go.opentelemetry.io/collector/pdata/pprofile" + +import ( + "go.opentelemetry.io/collector/pdata/internal" + otlpprofile "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" +) + +var _ MarshalSizer = (*ProtoMarshaler)(nil) + +type ProtoMarshaler struct{} + +func (e *ProtoMarshaler) MarshalProfiles(td Profiles) ([]byte, error) { + pb := internal.ProfilesToProto(internal.Profiles(td)) + return pb.Marshal() +} + +func (e *ProtoMarshaler) ProfilesSize(td Profiles) int { + pb := internal.ProfilesToProto(internal.Profiles(td)) + return pb.Size() +} + +type ProtoUnmarshaler struct{} + +func (d *ProtoUnmarshaler) UnmarshalProfiles(buf []byte) (Profiles, error) { + pb := otlpprofile.ProfilesData{} + err := pb.Unmarshal(buf) + return Profiles(internal.ProfilesFromProto(pb)), err +} diff --git a/pdata/pprofile/pb_test.go b/pdata/pprofile/pb_test.go new file mode 100644 index 00000000000..622510a629c --- /dev/null +++ b/pdata/pprofile/pb_test.go @@ -0,0 +1,78 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package pprofile + +import ( + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestProtoProfilesUnmarshalerError(t *testing.T) { + p := &ProtoUnmarshaler{} + _, err := p.UnmarshalProfiles([]byte("+$%")) + assert.Error(t, err) +} + +func TestProtoSizer(t *testing.T) { + marshaler := &ProtoMarshaler{} + td := NewProfiles() + td.ResourceProfiles().AppendEmpty(). + ScopeProfiles().AppendEmpty(). + Profiles().AppendEmpty(). + Profile(). + StringTable().Append("foobar") + + size := marshaler.ProfilesSize(td) + + bytes, err := marshaler.MarshalProfiles(td) + require.NoError(t, err) + assert.Equal(t, len(bytes), size) +} + +func TestProtoSizerEmptyProfiles(t *testing.T) { + sizer := &ProtoMarshaler{} + assert.Equal(t, 0, sizer.ProfilesSize(NewProfiles())) +} + +func BenchmarkProfilesToProto(b *testing.B) { + marshaler := &ProtoMarshaler{} + profiles := generateBenchmarkProfiles(128) + b.ResetTimer() + for n := 0; n < b.N; n++ { + buf, err := marshaler.MarshalProfiles(profiles) + require.NoError(b, err) + assert.NotEmpty(b, buf) + } +} + +func BenchmarkProfilesFromProto(b *testing.B) { + marshaler := &ProtoMarshaler{} + unmarshaler := &ProtoUnmarshaler{} + baseProfiles := generateBenchmarkProfiles(128) + buf, err := marshaler.MarshalProfiles(baseProfiles) + require.NoError(b, err) + assert.NotEmpty(b, buf) + b.ResetTimer() + b.ReportAllocs() + for n := 0; n < b.N; n++ { + profiles, err := unmarshaler.UnmarshalProfiles(buf) + require.NoError(b, err) + assert.Equal(b, baseProfiles.ResourceProfiles().Len(), profiles.ResourceProfiles().Len()) + } +} + +func generateBenchmarkProfiles(samplesCount int) Profiles { + md := NewProfiles() + ilm := md.ResourceProfiles().AppendEmpty().ScopeProfiles().AppendEmpty().Profiles().AppendEmpty().Profile() + ilm.Sample().EnsureCapacity(samplesCount) + for i := 0; i < samplesCount; i++ { + im := ilm.Sample().AppendEmpty() + im.LocationIndex().Append(1) + im.SetLocationsStartIndex(2) + im.SetLocationsLength(10) + } + return md +} diff --git a/pdata/pprofile/profiles_test.go b/pdata/pprofile/profiles_test.go index 0e78b713b5e..a03398967c3 100644 --- a/pdata/pprofile/profiles_test.go +++ b/pdata/pprofile/profiles_test.go @@ -10,6 +10,8 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/pdata/internal/data" + otlpcollectorprofile "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/profiles/v1experimental" + otlpprofile "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" "go.opentelemetry.io/collector/pdata/pcommon" ) @@ -23,6 +25,65 @@ func TestReadOnlyProfilesInvalidUsage(t *testing.T) { assert.Panics(t, func() { res.Attributes().PutStr("k2", "v2") }) } +func TestSampleCount(t *testing.T) { + profiles := NewProfiles() + assert.EqualValues(t, 0, profiles.SampleCount()) + + rs := profiles.ResourceProfiles().AppendEmpty() + assert.EqualValues(t, 0, profiles.SampleCount()) + + ils := rs.ScopeProfiles().AppendEmpty() + assert.EqualValues(t, 0, profiles.SampleCount()) + + ps := ils.Profiles().AppendEmpty().Profile() + assert.EqualValues(t, 0, profiles.SampleCount()) + + ps.Sample().AppendEmpty() + assert.EqualValues(t, 1, profiles.SampleCount()) + + rms := profiles.ResourceProfiles() + rms.EnsureCapacity(3) + rms.AppendEmpty().ScopeProfiles().AppendEmpty() + ilss := rms.AppendEmpty().ScopeProfiles().AppendEmpty().Profiles().AppendEmpty().Profile().Sample() + for i := 0; i < 5; i++ { + ilss.AppendEmpty() + } + // 5 + 1 (from rms.At(0) initialized first) + assert.EqualValues(t, 6, profiles.SampleCount()) +} + +func TestSampleCountWithEmpty(t *testing.T) { + assert.EqualValues(t, 0, newProfiles(&otlpcollectorprofile.ExportProfilesServiceRequest{ + ResourceProfiles: []*otlpprofile.ResourceProfiles{{}}, + }).SampleCount()) + assert.EqualValues(t, 0, newProfiles(&otlpcollectorprofile.ExportProfilesServiceRequest{ + ResourceProfiles: []*otlpprofile.ResourceProfiles{ + { + ScopeProfiles: []*otlpprofile.ScopeProfiles{{}}, + }, + }, + }).SampleCount()) + assert.EqualValues(t, 1, newProfiles(&otlpcollectorprofile.ExportProfilesServiceRequest{ + ResourceProfiles: []*otlpprofile.ResourceProfiles{ + { + ScopeProfiles: []*otlpprofile.ScopeProfiles{ + { + Profiles: []*otlpprofile.ProfileContainer{ + { + Profile: otlpprofile.Profile{ + Sample: []otlpprofile.Sample{ + {}, + }, + }, + }, + }, + }, + }, + }, + }, + }).SampleCount()) +} + func BenchmarkProfilesUsage(b *testing.B) { profiles := NewProfiles() fillTestResourceProfilesSlice(profiles.ResourceProfiles()) diff --git a/pdata/testdata/profile.go b/pdata/testdata/profile.go index 67233b700c6..9a85b3373e0 100644 --- a/pdata/testdata/profile.go +++ b/pdata/testdata/profile.go @@ -37,10 +37,28 @@ func fillProfileOne(profile pprofile.ProfileContainer) { profile.SetStartTime(profileStartTimestamp) profile.SetEndTime(profileEndTimestamp) profile.SetDroppedAttributesCount(1) + + sample := profile.Profile().Sample().AppendEmpty() + sample.LocationIndex().Append(1) + sample.SetLocationsStartIndex(2) + sample.SetLocationsLength(10) + sample.SetStacktraceIdIndex(3) + sample.Value().Append(4) + sample.SetLink(42) + sample.Attributes().Append(5) } func fillProfileTwo(profile pprofile.ProfileContainer) { profile.SetProfileID([16]byte{0x02, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10}) profile.SetStartTime(profileStartTimestamp) profile.SetEndTime(profileEndTimestamp) + + sample := profile.Profile().Sample().AppendEmpty() + sample.LocationIndex().Append(6) + sample.SetLocationsStartIndex(7) + sample.SetLocationsLength(20) + sample.SetStacktraceIdIndex(8) + sample.Value().Append(9) + sample.SetLink(44) + sample.Attributes().Append(10) } diff --git a/receiver/otlpreceiver/README.md b/receiver/otlpreceiver/README.md index 5c9984e023c..22814dd007b 100644 --- a/receiver/otlpreceiver/README.md +++ b/receiver/otlpreceiver/README.md @@ -3,11 +3,13 @@ | Status | | | ------------- |-----------| -| Stability | [beta]: logs | +| Stability | [development]: profiles | +| | [beta]: logs | | | [stable]: traces, metrics | | Distributions | [core], [contrib], [k8s] | | Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector?query=is%3Aissue%20is%3Aopen%20label%3Areceiver%2Fotlp%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector/issues?q=is%3Aopen+is%3Aissue+label%3Areceiver%2Fotlp) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector?query=is%3Aissue%20is%3Aclosed%20label%3Areceiver%2Fotlp%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector/issues?q=is%3Aclosed+is%3Aissue+label%3Areceiver%2Fotlp) | +[development]: https://github.com/open-telemetry/opentelemetry-collector#development [beta]: https://github.com/open-telemetry/opentelemetry-collector#beta [stable]: https://github.com/open-telemetry/opentelemetry-collector#stable [core]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol @@ -37,8 +39,8 @@ The following settings are configurable: - `endpoint` (default = localhost:4317 for grpc protocol, localhost:4318 http protocol): host:port to which the receiver is going to receive data. The valid syntax is - described at https://github.com/grpc/grpc/blob/master/doc/naming.md. The - `component.UseLocalHostAsDefaultHost` feature gate changes these to localhost:4317 and + described at https://github.com/grpc/grpc/blob/master/doc/naming.md. The + `component.UseLocalHostAsDefaultHost` feature gate changes these to localhost:4317 and localhost:4318 respectively. This will become the default in a future release. ## Advanced Configuration @@ -56,15 +58,21 @@ The OTLP receiver can receive trace export calls via HTTP/JSON in addition to gRPC. The HTTP/JSON address is the same as gRPC as the protocol is recognized and processed accordingly. Note the serialization format needs to be [OTLP JSON](https://opentelemetry.io/docs/specs/otlp/#json-protobuf-encoding). -The HTTP/JSON configuration also provides `traces_url_path`, `metrics_url_path`, and `logs_url_path` -configuration to allow the URL paths that signal data needs to be sent to be modified per signal type. These default to -`/v1/traces`, `/v1/metrics`, and `/v1/logs` respectively. - -To write traces with HTTP/JSON, `POST` to `[address]/[traces_url_path]` for traces, -to `[address]/[metrics_url_path]` for metrics, to `[address]/[logs_url_path]` for logs. -The default port is `4318`. When using the `otlphttpexporter` peer to communicate with this component, -use the `traces_endpoint`, `metrics_endpoint`, and `logs_endpoint` settings in the `otlphttpexporter` to set the -proper URL to match the address and URL signal path on the `otlpreceiver`. +The HTTP/JSON configuration also provides `traces_url_path`, +`metrics_url_path`, `logs_url_path`, and `profiles_url_path` configurations to +allow the URL paths that signal data needs to be sent to be modified per signal +type. These default to `/v1/traces`, `/v1/metrics`, `/v1/logs`, and +`/v1/profiles` respectively. + +To write traces with HTTP/JSON, `POST` to `[address]/[traces_url_path]` for +traces, to `[address]/[metrics_url_path]` for metrics, to +`[address]/[logs_url_path]` for logs, and to `[address]/[profiles_url_path] for +profiles. +The default port is `4318`. When using the `otlphttpexporter` peer to +communicate with this component, use the `traces_endpoint`, +`metrics_endpoint`, `logs_endpoint`, and `profiles_endpoint` settings in the +`otlphttpexporter` to set the proper URL to match the address and URL signal +path on the `otlpreceiver`. ### CORS (Cross-origin resource sharing) diff --git a/receiver/otlpreceiver/encoder.go b/receiver/otlpreceiver/encoder.go index d37437c7ca9..6462aec745d 100644 --- a/receiver/otlpreceiver/encoder.go +++ b/receiver/otlpreceiver/encoder.go @@ -12,6 +12,7 @@ import ( "go.opentelemetry.io/collector/pdata/plog/plogotlp" "go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp" + "go.opentelemetry.io/collector/pdata/pprofile/pprofileotlp" "go.opentelemetry.io/collector/pdata/ptrace/ptraceotlp" ) @@ -30,10 +31,12 @@ type encoder interface { unmarshalTracesRequest(buf []byte) (ptraceotlp.ExportRequest, error) unmarshalMetricsRequest(buf []byte) (pmetricotlp.ExportRequest, error) unmarshalLogsRequest(buf []byte) (plogotlp.ExportRequest, error) + unmarshalProfilesRequest(buf []byte) (pprofileotlp.ExportRequest, error) marshalTracesResponse(ptraceotlp.ExportResponse) ([]byte, error) marshalMetricsResponse(pmetricotlp.ExportResponse) ([]byte, error) marshalLogsResponse(plogotlp.ExportResponse) ([]byte, error) + marshalProfilesResponse(pprofileotlp.ExportResponse) ([]byte, error) marshalStatus(rsp *spb.Status) ([]byte, error) @@ -60,6 +63,12 @@ func (protoEncoder) unmarshalLogsRequest(buf []byte) (plogotlp.ExportRequest, er return req, err } +func (protoEncoder) unmarshalProfilesRequest(buf []byte) (pprofileotlp.ExportRequest, error) { + req := pprofileotlp.NewExportRequest() + err := req.UnmarshalProto(buf) + return req, err +} + func (protoEncoder) marshalTracesResponse(resp ptraceotlp.ExportResponse) ([]byte, error) { return resp.MarshalProto() } @@ -72,6 +81,10 @@ func (protoEncoder) marshalLogsResponse(resp plogotlp.ExportResponse) ([]byte, e return resp.MarshalProto() } +func (protoEncoder) marshalProfilesResponse(resp pprofileotlp.ExportResponse) ([]byte, error) { + return resp.MarshalProto() +} + func (protoEncoder) marshalStatus(resp *spb.Status) ([]byte, error) { return proto.Marshal(resp) } @@ -100,6 +113,12 @@ func (jsonEncoder) unmarshalLogsRequest(buf []byte) (plogotlp.ExportRequest, err return req, err } +func (jsonEncoder) unmarshalProfilesRequest(buf []byte) (pprofileotlp.ExportRequest, error) { + req := pprofileotlp.NewExportRequest() + err := req.UnmarshalJSON(buf) + return req, err +} + func (jsonEncoder) marshalTracesResponse(resp ptraceotlp.ExportResponse) ([]byte, error) { return resp.MarshalJSON() } @@ -112,6 +131,10 @@ func (jsonEncoder) marshalLogsResponse(resp plogotlp.ExportResponse) ([]byte, er return resp.MarshalJSON() } +func (jsonEncoder) marshalProfilesResponse(resp pprofileotlp.ExportResponse) ([]byte, error) { + return resp.MarshalJSON() +} + func (jsonEncoder) marshalStatus(resp *spb.Status) ([]byte, error) { buf := new(bytes.Buffer) err := jsonPbMarshaler.Marshal(buf, resp) diff --git a/receiver/otlpreceiver/factory.go b/receiver/otlpreceiver/factory.go index 8ba2e6d9092..465dd7dc676 100644 --- a/receiver/otlpreceiver/factory.go +++ b/receiver/otlpreceiver/factory.go @@ -12,19 +12,22 @@ import ( "go.opentelemetry.io/collector/config/confighttp" "go.opentelemetry.io/collector/config/confignet" "go.opentelemetry.io/collector/consumer" + "go.opentelemetry.io/collector/consumer/consumerprofiles" "go.opentelemetry.io/collector/internal/globalgates" "go.opentelemetry.io/collector/internal/sharedcomponent" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/otlpreceiver/internal/metadata" + "go.opentelemetry.io/collector/receiver/receiverprofiles" ) const ( grpcPort = 4317 httpPort = 4318 - defaultTracesURLPath = "/v1/traces" - defaultMetricsURLPath = "/v1/metrics" - defaultLogsURLPath = "/v1/logs" + defaultTracesURLPath = "/v1/traces" + defaultMetricsURLPath = "/v1/metrics" + defaultLogsURLPath = "/v1/logs" + defaultProfilesURLPath = "/v1development/profiles" ) // NewFactory creates a new OTLP receiver factory. @@ -35,6 +38,7 @@ func NewFactory() receiver.Factory { receiver.WithTraces(createTraces, metadata.TracesStability), receiver.WithMetrics(createMetrics, metadata.MetricsStability), receiver.WithLogs(createLog, metadata.LogsStability), + receiverprofiles.WithProfiles(createProfiles, metadata.ProfilesStability), ) } @@ -131,6 +135,29 @@ func createLog( return r, nil } +// createProfiles creates a trace receiver based on provided config. +func createProfiles( + _ context.Context, + set receiver.Settings, + cfg component.Config, + nextConsumer consumerprofiles.Profiles, +) (receiverprofiles.Profiles, error) { + oCfg := cfg.(*Config) + r, err := receivers.LoadOrStore( + oCfg, + func() (*otlpReceiver, error) { + return newOtlpReceiver(oCfg, &set) + }, + &set.TelemetrySettings, + ) + if err != nil { + return nil, err + } + + r.Unwrap().registerProfilesConsumer(nextConsumer) + return r, nil +} + // This is the map of already created OTLP receivers for particular configurations. // We maintain this map because the Factory is asked trace and metric receivers separately // when it gets CreateTracesReceiver() and CreateMetricsReceiver() but they must not diff --git a/receiver/otlpreceiver/factory_test.go b/receiver/otlpreceiver/factory_test.go index 530c61548c3..a4e2f6d999c 100644 --- a/receiver/otlpreceiver/factory_test.go +++ b/receiver/otlpreceiver/factory_test.go @@ -15,6 +15,7 @@ import ( "go.opentelemetry.io/collector/config/confighttp" "go.opentelemetry.io/collector/config/confignet" "go.opentelemetry.io/collector/consumer" + "go.opentelemetry.io/collector/consumer/consumerprofiles" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/internal/testutil" "go.opentelemetry.io/collector/receiver/receivertest" @@ -46,8 +47,13 @@ func TestCreateSameReceiver(t *testing.T) { assert.NotNil(t, lReceiver) assert.NoError(t, err) + pReceiver, err := factory.CreateProfilesReceiver(context.Background(), creationSet, cfg, consumertest.NewNop()) + assert.NotNil(t, pReceiver) + assert.NoError(t, err) + assert.Same(t, tReceiver, mReceiver) assert.Same(t, tReceiver, lReceiver) + assert.Same(t, tReceiver, pReceiver) } func TestCreateTracesReceiver(t *testing.T) { @@ -332,6 +338,99 @@ func TestCreateLogReceiver(t *testing.T) { } } +func TestCreateProfilesReceiver(t *testing.T) { + factory := NewFactory() + defaultGRPCSettings := &configgrpc.ServerConfig{ + NetAddr: confignet.AddrConfig{ + Endpoint: testutil.GetAvailableLocalAddress(t), + Transport: confignet.TransportTypeTCP, + }, + } + defaultServerConfig := confighttp.NewDefaultServerConfig() + defaultServerConfig.Endpoint = testutil.GetAvailableLocalAddress(t) + defaultHTTPSettings := &HTTPConfig{ + ServerConfig: &defaultServerConfig, + TracesURLPath: defaultTracesURLPath, + MetricsURLPath: defaultMetricsURLPath, + LogsURLPath: defaultLogsURLPath, + } + + tests := []struct { + name string + cfg *Config + wantStartErr bool + wantErr bool + sink consumerprofiles.Profiles + }{ + { + name: "default", + cfg: &Config{ + Protocols: Protocols{ + GRPC: defaultGRPCSettings, + HTTP: defaultHTTPSettings, + }, + }, + sink: consumertest.NewNop(), + }, + { + name: "invalid_grpc_port", + cfg: &Config{ + Protocols: Protocols{ + GRPC: &configgrpc.ServerConfig{ + NetAddr: confignet.AddrConfig{ + Endpoint: "localhost:112233", + Transport: confignet.TransportTypeTCP, + }, + }, + HTTP: defaultHTTPSettings, + }, + }, + wantStartErr: true, + sink: consumertest.NewNop(), + }, + { + name: "invalid_http_port", + cfg: &Config{ + Protocols: Protocols{ + GRPC: defaultGRPCSettings, + HTTP: &HTTPConfig{ + ServerConfig: &confighttp.ServerConfig{ + Endpoint: "localhost:112233", + }, + }, + }, + }, + wantStartErr: true, + sink: consumertest.NewNop(), + }, + { + name: "no_http_or_grcp_config", + cfg: &Config{ + Protocols: Protocols{}, + }, + sink: consumertest.NewNop(), + }, + } + ctx := context.Background() + creationSet := receivertest.NewNopSettings() + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + tr, err := factory.CreateProfilesReceiver(ctx, creationSet, tt.cfg, tt.sink) + if tt.wantErr { + assert.Error(t, err) + return + } + assert.NoError(t, err) + if tt.wantStartErr { + assert.Error(t, tr.Start(context.Background(), componenttest.NewNopHost())) + } else { + assert.NoError(t, tr.Start(context.Background(), componenttest.NewNopHost())) + assert.NoError(t, tr.Shutdown(context.Background())) + } + }) + } +} + func TestEndpointForPort(t *testing.T) { tests := []struct { port int diff --git a/receiver/otlpreceiver/go.mod b/receiver/otlpreceiver/go.mod index 9afe036af6a..87eb0799b54 100644 --- a/receiver/otlpreceiver/go.mod +++ b/receiver/otlpreceiver/go.mod @@ -16,11 +16,14 @@ require ( go.opentelemetry.io/collector/config/configtls v1.15.0 go.opentelemetry.io/collector/confmap v1.15.0 go.opentelemetry.io/collector/consumer v0.109.0 + go.opentelemetry.io/collector/consumer/consumerprofiles v0.109.0 go.opentelemetry.io/collector/consumer/consumertest v0.109.0 go.opentelemetry.io/collector/internal/globalgates v0.109.0 go.opentelemetry.io/collector/pdata v1.15.0 + go.opentelemetry.io/collector/pdata/pprofile v0.109.0 go.opentelemetry.io/collector/pdata/testdata v0.109.0 go.opentelemetry.io/collector/receiver v0.109.0 + go.opentelemetry.io/collector/receiver/receiverprofiles v0.109.0 go.uber.org/goleak v1.3.0 go.uber.org/zap v1.27.0 google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd @@ -54,12 +57,9 @@ require ( go.opentelemetry.io/collector/config/configopaque v1.15.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.109.0 // indirect go.opentelemetry.io/collector/config/internal v0.109.1-0.20240916143658-74729e731d3b // indirect - go.opentelemetry.io/collector/consumer/consumerprofiles v0.109.0 // indirect go.opentelemetry.io/collector/extension v0.109.0 // indirect go.opentelemetry.io/collector/extension/auth v0.109.0 // indirect go.opentelemetry.io/collector/featuregate v1.15.0 // indirect - go.opentelemetry.io/collector/pdata/pprofile v0.109.0 // indirect - go.opentelemetry.io/collector/receiver/receiverprofiles v0.109.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect go.opentelemetry.io/otel v1.30.0 // indirect diff --git a/receiver/otlpreceiver/internal/metadata/generated_status.go b/receiver/otlpreceiver/internal/metadata/generated_status.go index 02715c16850..5fe9771f5dd 100644 --- a/receiver/otlpreceiver/internal/metadata/generated_status.go +++ b/receiver/otlpreceiver/internal/metadata/generated_status.go @@ -12,7 +12,8 @@ var ( ) const ( - LogsStability = component.StabilityLevelBeta - TracesStability = component.StabilityLevelStable - MetricsStability = component.StabilityLevelStable + ProfilesStability = component.StabilityLevelDevelopment + LogsStability = component.StabilityLevelBeta + TracesStability = component.StabilityLevelStable + MetricsStability = component.StabilityLevelStable ) diff --git a/receiver/otlpreceiver/internal/profiles/otlp.go b/receiver/otlpreceiver/internal/profiles/otlp.go new file mode 100644 index 00000000000..1b6a5af407c --- /dev/null +++ b/receiver/otlpreceiver/internal/profiles/otlp.go @@ -0,0 +1,48 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package profiles // import "go.opentelemetry.io/collector/receiver/otlpreceiver/internal/profiles" + +import ( + "context" + + "go.opentelemetry.io/collector/consumer/consumerprofiles" + "go.opentelemetry.io/collector/pdata/pprofile/pprofileotlp" + "go.opentelemetry.io/collector/receiver/otlpreceiver/internal/errors" +) + +// Receiver is the type used to handle spans from OpenTelemetry exporters. +type Receiver struct { + pprofileotlp.UnimplementedGRPCServer + nextConsumer consumerprofiles.Profiles +} + +// New creates a new Receiver reference. +func New(nextConsumer consumerprofiles.Profiles) *Receiver { + return &Receiver{ + nextConsumer: nextConsumer, + } +} + +// Export implements the service Export profiles func. +func (r *Receiver) Export(ctx context.Context, req pprofileotlp.ExportRequest) (pprofileotlp.ExportResponse, error) { + td := req.Profiles() + // We need to ensure that it propagates the receiver name as a tag + numProfiles := td.SampleCount() + if numProfiles == 0 { + return pprofileotlp.NewExportResponse(), nil + } + + err := r.nextConsumer.ConsumeProfiles(ctx, td) + // Use appropriate status codes for permanent/non-permanent errors + // If we return the error straightaway, then the grpc implementation will set status code to Unknown + // Refer: https://github.com/grpc/grpc-go/blob/v1.59.0/server.go#L1345 + // So, convert the error to appropriate grpc status and return the error + // NonPermanent errors will be converted to codes.Unavailable (equivalent to HTTP 503) + // Permanent errors will be converted to codes.InvalidArgument (equivalent to HTTP 400) + if err != nil { + return pprofileotlp.NewExportResponse(), errors.GetStatusFromError(err) + } + + return pprofileotlp.NewExportResponse(), nil +} diff --git a/receiver/otlpreceiver/internal/profiles/otlp_test.go b/receiver/otlpreceiver/internal/profiles/otlp_test.go new file mode 100644 index 00000000000..8d253c7f24b --- /dev/null +++ b/receiver/otlpreceiver/internal/profiles/otlp_test.go @@ -0,0 +1,97 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package profiles + +import ( + "context" + "errors" + "net" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/credentials/insecure" + "google.golang.org/grpc/status" + + "go.opentelemetry.io/collector/consumer/consumererror" + "go.opentelemetry.io/collector/consumer/consumerprofiles" + "go.opentelemetry.io/collector/consumer/consumertest" + "go.opentelemetry.io/collector/pdata/pprofile/pprofileotlp" + "go.opentelemetry.io/collector/pdata/testdata" +) + +func TestExport(t *testing.T) { + td := testdata.GenerateProfiles(1) + req := pprofileotlp.NewExportRequestFromProfiles(td) + + profileSink := new(consumertest.ProfilesSink) + profileClient := makeProfileServiceClient(t, profileSink) + resp, err := profileClient.Export(context.Background(), req) + require.NoError(t, err, "Failed to export profile: %v", err) + require.NotNil(t, resp, "The response is missing") + + require.Len(t, profileSink.AllProfiles(), 1) + assert.EqualValues(t, td, profileSink.AllProfiles()[0]) +} + +func TestExport_EmptyRequest(t *testing.T) { + profileSink := new(consumertest.ProfilesSink) + profileClient := makeProfileServiceClient(t, profileSink) + resp, err := profileClient.Export(context.Background(), pprofileotlp.NewExportRequest()) + assert.NoError(t, err, "Failed to export profile: %v", err) + assert.NotNil(t, resp, "The response is missing") +} + +func TestExport_NonPermanentErrorConsumer(t *testing.T) { + td := testdata.GenerateProfiles(1) + req := pprofileotlp.NewExportRequestFromProfiles(td) + + profileClient := makeProfileServiceClient(t, consumertest.NewErr(errors.New("my error"))) + resp, err := profileClient.Export(context.Background(), req) + assert.EqualError(t, err, "rpc error: code = Unavailable desc = my error") + assert.IsType(t, status.Error(codes.Unknown, ""), err) + assert.Equal(t, pprofileotlp.ExportResponse{}, resp) +} +func TestExport_PermanentErrorConsumer(t *testing.T) { + ld := testdata.GenerateProfiles(1) + req := pprofileotlp.NewExportRequestFromProfiles(ld) + + profileClient := makeProfileServiceClient(t, consumertest.NewErr(consumererror.NewPermanent(errors.New("my error")))) + resp, err := profileClient.Export(context.Background(), req) + assert.EqualError(t, err, "rpc error: code = Internal desc = Permanent error: my error") + assert.IsType(t, status.Error(codes.Unknown, ""), err) + assert.Equal(t, pprofileotlp.ExportResponse{}, resp) +} + +func makeProfileServiceClient(t *testing.T, tc consumerprofiles.Profiles) pprofileotlp.GRPCClient { + addr := otlpReceiverOnGRPCServer(t, tc) + cc, err := grpc.NewClient(addr.String(), grpc.WithTransportCredentials(insecure.NewCredentials())) + require.NoError(t, err, "Failed to create the profileServiceClient: %v", err) + t.Cleanup(func() { + require.NoError(t, cc.Close()) + }) + + return pprofileotlp.NewGRPCClient(cc) +} + +func otlpReceiverOnGRPCServer(t *testing.T, tc consumerprofiles.Profiles) net.Addr { + ln, err := net.Listen("tcp", "localhost:") + require.NoError(t, err, "Failed to find an available address to run the gRPC server: %v", err) + + t.Cleanup(func() { + require.NoError(t, ln.Close()) + }) + + r := New(tc) + // Now run it as a gRPC server + srv := grpc.NewServer() + pprofileotlp.RegisterGRPCServer(srv, r) + go func() { + _ = srv.Serve(ln) + }() + + return ln.Addr() +} diff --git a/receiver/otlpreceiver/internal/profiles/package_test.go b/receiver/otlpreceiver/internal/profiles/package_test.go new file mode 100644 index 00000000000..6a8cf783554 --- /dev/null +++ b/receiver/otlpreceiver/internal/profiles/package_test.go @@ -0,0 +1,14 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package profiles + +import ( + "testing" + + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} diff --git a/receiver/otlpreceiver/metadata.yaml b/receiver/otlpreceiver/metadata.yaml index 115355e784d..c65af6e6a5a 100644 --- a/receiver/otlpreceiver/metadata.yaml +++ b/receiver/otlpreceiver/metadata.yaml @@ -6,4 +6,5 @@ status: stability: stable: [traces, metrics] beta: [logs] + development: [profiles] distributions: [core, contrib, k8s] diff --git a/receiver/otlpreceiver/otlp.go b/receiver/otlpreceiver/otlp.go index f22c9bc9a7e..a4c5f08c7a9 100644 --- a/receiver/otlpreceiver/otlp.go +++ b/receiver/otlpreceiver/otlp.go @@ -17,12 +17,15 @@ import ( "go.opentelemetry.io/collector/component/componentstatus" "go.opentelemetry.io/collector/config/confighttp" "go.opentelemetry.io/collector/consumer" + "go.opentelemetry.io/collector/consumer/consumerprofiles" "go.opentelemetry.io/collector/pdata/plog/plogotlp" "go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp" + "go.opentelemetry.io/collector/pdata/pprofile/pprofileotlp" "go.opentelemetry.io/collector/pdata/ptrace/ptraceotlp" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/otlpreceiver/internal/logs" "go.opentelemetry.io/collector/receiver/otlpreceiver/internal/metrics" + "go.opentelemetry.io/collector/receiver/otlpreceiver/internal/profiles" "go.opentelemetry.io/collector/receiver/otlpreceiver/internal/trace" "go.opentelemetry.io/collector/receiver/receiverhelper" ) @@ -33,10 +36,11 @@ type otlpReceiver struct { serverGRPC *grpc.Server serverHTTP *http.Server - nextTraces consumer.Traces - nextMetrics consumer.Metrics - nextLogs consumer.Logs - shutdownWG sync.WaitGroup + nextTraces consumer.Traces + nextMetrics consumer.Metrics + nextLogs consumer.Logs + nextProfiles consumerprofiles.Profiles + shutdownWG sync.WaitGroup obsrepGRPC *receiverhelper.ObsReport obsrepHTTP *receiverhelper.ObsReport @@ -49,11 +53,12 @@ type otlpReceiver struct { // as the various Stop*Reception methods to end it. func newOtlpReceiver(cfg *Config, set *receiver.Settings) (*otlpReceiver, error) { r := &otlpReceiver{ - cfg: cfg, - nextTraces: nil, - nextMetrics: nil, - nextLogs: nil, - settings: set, + cfg: cfg, + nextTraces: nil, + nextMetrics: nil, + nextLogs: nil, + nextProfiles: nil, + settings: set, } var err error @@ -100,6 +105,10 @@ func (r *otlpReceiver) startGRPCServer(host component.Host) error { plogotlp.RegisterGRPCServer(r.serverGRPC, logs.New(r.nextLogs, r.obsrepGRPC)) } + if r.nextProfiles != nil { + pprofileotlp.RegisterGRPCServer(r.serverGRPC, profiles.New(r.nextProfiles)) + } + r.settings.Logger.Info("Starting GRPC server", zap.String("endpoint", r.cfg.GRPC.NetAddr.Endpoint)) var gln net.Listener if gln, err = r.cfg.GRPC.NetAddr.Listen(context.Background()); err != nil { @@ -145,6 +154,13 @@ func (r *otlpReceiver) startHTTPServer(ctx context.Context, host component.Host) }) } + if r.nextProfiles != nil { + httpProfilesReceiver := profiles.New(r.nextProfiles) + httpMux.HandleFunc(defaultProfilesURLPath, func(resp http.ResponseWriter, req *http.Request) { + handleProfiles(resp, req, httpProfilesReceiver) + }) + } + var err error if r.serverHTTP, err = r.cfg.HTTP.ToServer(ctx, host, r.settings.TelemetrySettings, httpMux, confighttp.WithErrorHandler(errorHandler)); err != nil { return err @@ -210,3 +226,7 @@ func (r *otlpReceiver) registerMetricsConsumer(mc consumer.Metrics) { func (r *otlpReceiver) registerLogsConsumer(lc consumer.Logs) { r.nextLogs = lc } + +func (r *otlpReceiver) registerProfilesConsumer(tc consumerprofiles.Profiles) { + r.nextProfiles = tc +} diff --git a/receiver/otlpreceiver/otlp_test.go b/receiver/otlpreceiver/otlp_test.go index 0b475771074..42f7ba71553 100644 --- a/receiver/otlpreceiver/otlp_test.go +++ b/receiver/otlpreceiver/otlp_test.go @@ -40,6 +40,7 @@ import ( "go.opentelemetry.io/collector/internal/testutil" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/pprofile" "go.opentelemetry.io/collector/pdata/ptrace" "go.opentelemetry.io/collector/pdata/ptrace/ptraceotlp" "go.opentelemetry.io/collector/pdata/testdata" @@ -844,6 +845,7 @@ func newReceiver(t *testing.T, settings component.TelemetrySettings, cfg *Config r.registerTraceConsumer(c) r.registerMetricsConsumer(c) r.registerLogsConsumer(c) + r.registerProfilesConsumer(c) return r } @@ -855,7 +857,7 @@ type dataRequest struct { } func generateDataRequests(t *testing.T) []dataRequest { - return []dataRequest{generateTracesRequest(t), generateMetricsRequests(t), generateLogsRequest(t)} + return []dataRequest{generateTracesRequest(t), generateMetricsRequests(t), generateLogsRequest(t), generateProfilesRequest(t)} } func generateTracesRequest(t *testing.T) dataRequest { @@ -900,6 +902,20 @@ func generateLogsRequest(t *testing.T) dataRequest { return dataRequest{data: ld, path: defaultLogsURLPath, jsonBytes: logJSON, protoBytes: logProto} } +func generateProfilesRequest(t *testing.T) dataRequest { + protoMarshaler := &pprofile.ProtoMarshaler{} + jsonMarshaler := &pprofile.JSONMarshaler{} + + md := testdata.GenerateProfiles(2) + profileProto, err := protoMarshaler.MarshalProfiles(md) + require.NoError(t, err) + + profileJSON, err := jsonMarshaler.MarshalProfiles(md) + require.NoError(t, err) + + return dataRequest{data: md, path: defaultProfilesURLPath, jsonBytes: profileJSON, protoBytes: profileProto} +} + func doHTTPRequest( t *testing.T, url string, @@ -1101,15 +1117,17 @@ type errOrSinkConsumer struct { *consumertest.TracesSink *consumertest.MetricsSink *consumertest.LogsSink + *consumertest.ProfilesSink mu sync.Mutex consumeError error // to be returned by ConsumeTraces, if set } func newErrOrSinkConsumer() *errOrSinkConsumer { return &errOrSinkConsumer{ - TracesSink: new(consumertest.TracesSink), - MetricsSink: new(consumertest.MetricsSink), - LogsSink: new(consumertest.LogsSink), + TracesSink: new(consumertest.TracesSink), + MetricsSink: new(consumertest.MetricsSink), + LogsSink: new(consumertest.LogsSink), + ProfilesSink: new(consumertest.ProfilesSink), } } @@ -1160,6 +1178,18 @@ func (esc *errOrSinkConsumer) ConsumeLogs(ctx context.Context, ld plog.Logs) err return esc.LogsSink.ConsumeLogs(ctx, ld) } +// ConsumeProfiles stores profiles to this sink. +func (esc *errOrSinkConsumer) ConsumeProfiles(ctx context.Context, md pprofile.Profiles) error { + esc.mu.Lock() + defer esc.mu.Unlock() + + if esc.consumeError != nil { + return esc.consumeError + } + + return esc.ProfilesSink.ConsumeProfiles(ctx, md) +} + // Reset deletes any stored in the sinks, resets error to nil. func (esc *errOrSinkConsumer) Reset() { esc.mu.Lock() @@ -1169,6 +1199,7 @@ func (esc *errOrSinkConsumer) Reset() { esc.TracesSink.Reset() esc.MetricsSink.Reset() esc.LogsSink.Reset() + esc.ProfilesSink.Reset() } // Reset deletes any stored in the sinks, resets error to nil. @@ -1192,5 +1223,11 @@ func (esc *errOrSinkConsumer) checkData(t *testing.T, data any, len int) { if len > 0 { require.Equal(t, allLogs[0], data) } + case pprofile.Profiles: + allProfiles := esc.ProfilesSink.AllProfiles() + require.Len(t, allProfiles, len) + if len > 0 { + require.Equal(t, allProfiles[0], data) + } } } diff --git a/receiver/otlpreceiver/otlphttp.go b/receiver/otlpreceiver/otlphttp.go index b895b8d2e7c..4c9c8231fe7 100644 --- a/receiver/otlpreceiver/otlphttp.go +++ b/receiver/otlpreceiver/otlphttp.go @@ -16,6 +16,7 @@ import ( "go.opentelemetry.io/collector/receiver/otlpreceiver/internal/errors" "go.opentelemetry.io/collector/receiver/otlpreceiver/internal/logs" "go.opentelemetry.io/collector/receiver/otlpreceiver/internal/metrics" + "go.opentelemetry.io/collector/receiver/otlpreceiver/internal/profiles" "go.opentelemetry.io/collector/receiver/otlpreceiver/internal/trace" ) @@ -117,6 +118,37 @@ func handleLogs(resp http.ResponseWriter, req *http.Request, logsReceiver *logs. writeResponse(resp, enc.contentType(), http.StatusOK, msg) } +func handleProfiles(resp http.ResponseWriter, req *http.Request, profilesReceiver *profiles.Receiver) { + enc, ok := readContentType(resp, req) + if !ok { + return + } + + body, ok := readAndCloseBody(resp, req, enc) + if !ok { + return + } + + otlpReq, err := enc.unmarshalProfilesRequest(body) + if err != nil { + writeError(resp, enc, err, http.StatusBadRequest) + return + } + + otlpResp, err := profilesReceiver.Export(req.Context(), otlpReq) + if err != nil { + writeError(resp, enc, err, http.StatusInternalServerError) + return + } + + msg, err := enc.marshalProfilesResponse(otlpResp) + if err != nil { + writeError(resp, enc, err, http.StatusInternalServerError) + return + } + writeResponse(resp, enc.contentType(), http.StatusOK, msg) +} + func readContentType(resp http.ResponseWriter, req *http.Request) (encoder, bool) { if req.Method != http.MethodPost { handleUnmatchedMethod(resp) diff --git a/receiver/otlpreceiver/testdata/config.yaml b/receiver/otlpreceiver/testdata/config.yaml index 65d64781814..066ab41ad5d 100644 --- a/receiver/otlpreceiver/testdata/config.yaml +++ b/receiver/otlpreceiver/testdata/config.yaml @@ -41,7 +41,7 @@ protocols: - https://*.test.com # Wildcard subdomain. Allows domains like https://www.test.com and https://foo.test.com but not https://wwwtest.com. - https://test.com # Fully qualified domain name. Allows https://test.com only. max_age: 7200 - + # The following shows URL paths for endpoints where signals are listened for bt the OTLP receiver traces_url_path: traces metrics_url_path: /v2/metrics diff --git a/receiver/otlpreceiver/testdata/invalid_profiles_path.yaml b/receiver/otlpreceiver/testdata/invalid_profiles_path.yaml new file mode 100644 index 00000000000..16b050c646e --- /dev/null +++ b/receiver/otlpreceiver/testdata/invalid_profiles_path.yaml @@ -0,0 +1,3 @@ +protocols: + http: + profiles_url_path: ":invalid" diff --git a/receiver/receiverhelper/metadata.yaml b/receiver/receiverhelper/metadata.yaml index e2efe523e37..ddafb8a0522 100644 --- a/receiver/receiverhelper/metadata.yaml +++ b/receiver/receiverhelper/metadata.yaml @@ -56,4 +56,4 @@ telemetry: unit: "{records}" sum: value_type: int - monotonic: true \ No newline at end of file + monotonic: true