diff --git a/.chloggen/deprecate-extension-name.yaml b/.chloggen/deprecate-extension-name.yaml new file mode 100644 index 00000000000..d68bec03cf1 --- /dev/null +++ b/.chloggen/deprecate-extension-name.yaml @@ -0,0 +1,27 @@ +# 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: extension + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Deprecate funcs that repeat extension in name + +# One or more tracking issues or pull requests related to the change +issues: [11413] + +# (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: | + Factory.CreateExtension -> Factory.Create | + Factory.ExtensionStability -> Factory.Stability + +# 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/.chloggen/mdatagen_package_gen.yaml b/.chloggen/mdatagen_package_gen.yaml new file mode 100644 index 00000000000..4f061be1295 --- /dev/null +++ b/.chloggen/mdatagen_package_gen.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: Added generated_package_name config field to support custom generated package name. + +# One or more tracking issues or pull requests related to the change +issues: [11231] + +# (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: [user] diff --git a/.chloggen/movecomponentprofiles.yaml b/.chloggen/movecomponentprofiles.yaml new file mode 100644 index 00000000000..8d59cfb6372 --- /dev/null +++ b/.chloggen/movecomponentprofiles.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: componentprofiles + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Move componentprofiles to pipelineprofiles + +# One or more tracking issues or pull requests related to the change +issues: [11421] + +# (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/.chloggen/rm-stable-gate.yaml b/.chloggen/rm-stable-gate.yaml new file mode 100644 index 00000000000..18cab1bdffd --- /dev/null +++ b/.chloggen/rm-stable-gate.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: service + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Remove stable gate component.UseLocalHostAsDefaultHost + +# One or more tracking issues or pull requests related to the change +issues: [11412] + +# (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: [user] diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 9d4b1d84296..11230941ae7 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -56,7 +56,7 @@ jobs: # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: "Upload artifact" - uses: actions/upload-artifact@84480863f228bb9747b473957fcc9e309aa96097 # v4.4.2 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: SARIF file path: results.sarif diff --git a/.golangci.yml b/.golangci.yml index 1af55d5af28..01c82c7329c 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -126,10 +126,10 @@ linters-settings: linters: enable: + - copyloopvar - depguard - errcheck - errorlint - - exportloopref - gocritic - gofmt - goimports diff --git a/Makefile b/Makefile index 210b4a7c455..522bfbdeaa0 100644 --- a/Makefile +++ b/Makefile @@ -264,7 +264,6 @@ check-contrib: -replace go.opentelemetry.io/collector/client=$(CURDIR)/client \ -replace go.opentelemetry.io/collector/cmd/mdatagen=$(CURDIR)/cmd/mdatagen \ -replace go.opentelemetry.io/collector/component=$(CURDIR)/component \ - -replace go.opentelemetry.io/collector/component/componentprofiles=$(CURDIR)/component/componentprofiles \ -replace go.opentelemetry.io/collector/component/componentstatus=$(CURDIR)/component/componentstatus \ -replace go.opentelemetry.io/collector/config/configauth=$(CURDIR)/config/configauth \ -replace go.opentelemetry.io/collector/config/configcompression=$(CURDIR)/config/configcompression \ @@ -303,7 +302,6 @@ check-contrib: -replace go.opentelemetry.io/collector/extension/zpagesextension=$(CURDIR)/extension/zpagesextension \ -replace go.opentelemetry.io/collector/featuregate=$(CURDIR)/featuregate \ -replace go.opentelemetry.io/collector/filter=$(CURDIR)/filter \ - -replace go.opentelemetry.io/collector/internal/globalgates=$(CURDIR)/internal/globalgates \ -replace go.opentelemetry.io/collector/internal/globalsignal=$(CURDIR)/internal/globalsignal \ -replace go.opentelemetry.io/collector/otelcol=$(CURDIR)/otelcol \ -replace go.opentelemetry.io/collector/otelcol/otelcoltest=$(CURDIR)/otelcol/otelcoltest \ @@ -311,6 +309,7 @@ check-contrib: -replace go.opentelemetry.io/collector/pdata/testdata=$(CURDIR)/pdata/testdata \ -replace go.opentelemetry.io/collector/pdata/pprofile=$(CURDIR)/pdata/pprofile \ -replace go.opentelemetry.io/collector/pipeline=$(CURDIR)/pipeline \ + -replace go.opentelemetry.io/collector/pipeline/pipelineprofiles=$(CURDIR)/pipeline/pipelineprofiles \ -replace go.opentelemetry.io/collector/processor=$(CURDIR)/processor \ -replace go.opentelemetry.io/collector/processor/batchprocessor=$(CURDIR)/processor/batchprocessor \ -replace go.opentelemetry.io/collector/processor/memorylimiterprocessor=$(CURDIR)/processor/memorylimiterprocessor \ @@ -336,7 +335,6 @@ restore-contrib: -dropreplace go.opentelemetry.io/collector/client \ -dropreplace go.opentelemetry.io/collector/cmd/mdatagen \ -dropreplace go.opentelemetry.io/collector/component \ - -dropreplace go.opentelemetry.io/collector/component/componentprofiles \ -dropreplace go.opentelemetry.io/collector/component/componentstatus \ -dropreplace go.opentelemetry.io/collector/config/configauth \ -dropreplace go.opentelemetry.io/collector/config/configcompression \ @@ -372,7 +370,6 @@ restore-contrib: -dropreplace go.opentelemetry.io/collector/extension/zpagesextension \ -dropreplace go.opentelemetry.io/collector/featuregate \ -dropreplace go.opentelemetry.io/collector/filter \ - -dropreplace go.opentelemetry.io/collector/internal/globalgates \ -dropreplace go.opentelemetry.io/collector/internal/globalsignal \ -dropreplace go.opentelemetry.io/collector/otelcol \ -dropreplace go.opentelemetry.io/collector/otelcol/otelcoltest \ @@ -380,6 +377,7 @@ restore-contrib: -dropreplace go.opentelemetry.io/collector/pdata/testdata \ -dropreplace go.opentelemetry.io/collector/pdata/pprofile \ -dropreplace go.opentelemetry.io/collector/pipeline \ + -dropreplace go.opentelemetry.io/collector/pipeline/pipelineprofiles \ -dropreplace go.opentelemetry.io/collector/processor \ -dropreplace go.opentelemetry.io/collector/processor/batchprocessor \ -dropreplace go.opentelemetry.io/collector/processor/memorylimiterprocessor \ diff --git a/cmd/builder/internal/builder/main_test.go b/cmd/builder/internal/builder/main_test.go index 4f0e34ba440..5d7162e8c34 100644 --- a/cmd/builder/internal/builder/main_test.go +++ b/cmd/builder/internal/builder/main_test.go @@ -41,7 +41,6 @@ var ( replaceModules = []string{ "", "/component", - "/component/componentprofiles", "/component/componentstatus", "/client", "/config/configauth", @@ -77,9 +76,9 @@ var ( "/extension/extensioncapabilities", "/extension/zpagesextension", "/featuregate", - "/internal/globalgates", "/internal/globalsignal", "/pipeline", + "/pipeline/pipelineprofiles", "/processor", "/processor/batchprocessor", "/processor/memorylimiterprocessor", diff --git a/cmd/builder/test/core.builder.yaml b/cmd/builder/test/core.builder.yaml index f00dff95596..fc33f39e078 100644 --- a/cmd/builder/test/core.builder.yaml +++ b/cmd/builder/test/core.builder.yaml @@ -15,7 +15,6 @@ replaces: - go.opentelemetry.io/collector => ${WORKSPACE_DIR} - go.opentelemetry.io/collector/client => ${WORKSPACE_DIR}/client - go.opentelemetry.io/collector/component => ${WORKSPACE_DIR}/component - - go.opentelemetry.io/collector/component/componentprofiles => ${WORKSPACE_DIR}/component/componentprofiles - go.opentelemetry.io/collector/component/componentstatus => ${WORKSPACE_DIR}/component/componentstatus - go.opentelemetry.io/collector/config/configauth => ${WORKSPACE_DIR}/config/configauth - go.opentelemetry.io/collector/config/configcompression => ${WORKSPACE_DIR}/config/configcompression @@ -47,7 +46,6 @@ replaces: - go.opentelemetry.io/collector/extension/extensioncapabilities => ${WORKSPACE_DIR}/extension/extensioncapabilities - go.opentelemetry.io/collector/extension/zpagesextension => ${WORKSPACE_DIR}/extension/zpagesextension - go.opentelemetry.io/collector/featuregate => ${WORKSPACE_DIR}/featuregate - - go.opentelemetry.io/collector/internal/globalgates => ${WORKSPACE_DIR}/internal/globalgates - go.opentelemetry.io/collector/internal/globalsignal => ${WORKSPACE_DIR}/internal/globalsignal - go.opentelemetry.io/collector/otelcol => ${WORKSPACE_DIR}/otelcol - go.opentelemetry.io/collector/otelcol/otelcoltest => ${WORKSPACE_DIR}/otelcol/otelcoltest @@ -55,6 +53,7 @@ replaces: - go.opentelemetry.io/collector/pdata/pprofile => ${WORKSPACE_DIR}/pdata/pprofile - go.opentelemetry.io/collector/pdata/testdata => ${WORKSPACE_DIR}/pdata/testdata - go.opentelemetry.io/collector/pipeline => ${WORKSPACE_DIR}/pipeline + - go.opentelemetry.io/collector/pipeline/pipelineprofiles => ${WORKSPACE_DIR}/pipeline/pipelineprofiles - go.opentelemetry.io/collector/processor => ${WORKSPACE_DIR}/processor - go.opentelemetry.io/collector/processor/processorprofiles => ${WORKSPACE_DIR}/processor/processorprofiles - go.opentelemetry.io/collector/receiver => ${WORKSPACE_DIR}/receiver diff --git a/cmd/mdatagen/README.md b/cmd/mdatagen/README.md index 5eb7586596e..19170ada72a 100644 --- a/cmd/mdatagen/README.md +++ b/cmd/mdatagen/README.md @@ -26,7 +26,7 @@ An example of how this generated documentation looks can be found in [documentat ## Using the Metadata Generator In order for a component to benefit from the metadata generator (`mdatagen`) these requirements need to be met: -1. A `metadata.yaml` file containing the metadata needs to be included in the component +1. A yaml file containing the metadata that needs to be included in the component 2. The component should declare a `go:generate mdatagen` directive which tells `mdatagen` what to generate As an example, here is a minimal `metadata.yaml` for the [OTLP receiver](https://github.com/open-telemetry/opentelemetry-collector/tree/main/receiver/otlpreceiver): @@ -55,6 +55,31 @@ Below are some more examples that can be used for reference: You can run `cd cmd/mdatagen && $(GOCMD) install .` to install the `mdatagen` tool in `GOBIN` and then run `mdatagen metadata.yaml` to generate documentation for a specific component or you can run `make generate` to generate documentation for all components. +### Generate multiple metadata packages + +By default, `mdatagen` will generate a package called `metadata` in the `internal` directory. If you want to generate a package with a different name, you can use the `generated_package_name` configuration field to provide an alternate name. + +```yaml +type: otlp +generated_package_name: customname +status: + class: receiver + stability: + beta: [logs] + stable: [metrics, traces] +``` + +The most common scenario for this would be making major changes to a receiver's metadata without breaking what exists. In this scenario, `mdatagen` could produce separate packages for different metadata specs in the same receiver: + +```go +//go:generate mdatagen metadata.yaml +//go:generate mdatagen custom.yaml + +package main +``` + +With two different packages generated, the behaviour for which metadata is used can be easily controlled via featuregate or a similar mechanism. + ## Contributing to the Metadata Generator 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). diff --git a/cmd/mdatagen/go.mod b/cmd/mdatagen/go.mod index ffada07aaa9..86b2287aa08 100644 --- a/cmd/mdatagen/go.mod +++ b/cmd/mdatagen/go.mod @@ -17,9 +17,9 @@ require ( go.opentelemetry.io/collector/processor v0.111.0 go.opentelemetry.io/collector/receiver v0.111.0 go.opentelemetry.io/collector/semconv v0.111.0 - go.opentelemetry.io/otel/metric v1.30.0 - go.opentelemetry.io/otel/sdk/metric v1.30.0 - go.opentelemetry.io/otel/trace v1.30.0 + go.opentelemetry.io/otel/metric v1.31.0 + go.opentelemetry.io/otel/sdk/metric v1.31.0 + go.opentelemetry.io/otel/trace v1.31.0 go.uber.org/goleak v1.3.0 go.uber.org/zap v1.27.0 golang.org/x/text v0.19.0 @@ -29,7 +29,7 @@ require ( 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/go-viper/mapstructure/v2 v2.1.0 // indirect + github.com/go-viper/mapstructure/v2 v2.2.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/google/uuid v1.6.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect @@ -51,11 +51,11 @@ require ( go.opentelemetry.io/collector/pipeline v0.111.0 // indirect go.opentelemetry.io/collector/processor/processorprofiles v0.111.0 // indirect go.opentelemetry.io/collector/receiver/receiverprofiles v0.111.0 // indirect - go.opentelemetry.io/otel v1.30.0 // indirect - go.opentelemetry.io/otel/sdk v1.30.0 // indirect + go.opentelemetry.io/otel v1.31.0 // indirect + go.opentelemetry.io/otel/sdk v1.31.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.25.0 // indirect + golang.org/x/sys v0.26.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd // indirect google.golang.org/grpc v1.67.1 // indirect google.golang.org/protobuf v1.35.1 // indirect diff --git a/cmd/mdatagen/go.sum b/cmd/mdatagen/go.sum index 0ac16cd6349..63a09ea0586 100644 --- a/cmd/mdatagen/go.sum +++ b/cmd/mdatagen/go.sum @@ -7,8 +7,8 @@ github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-viper/mapstructure/v2 v2.1.0 h1:gHnMa2Y/pIxElCH2GlZZ1lZSsn6XMtufpGyP1XxdC/w= -github.com/go-viper/mapstructure/v2 v2.1.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= @@ -56,16 +56,16 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 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/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= -go.opentelemetry.io/otel/sdk v1.30.0/go.mod h1:p14X4Ok8S+sygzblytT1nqG98QG2KYKv++HE0LY/mhg= -go.opentelemetry.io/otel/sdk/metric v1.30.0 h1:QJLT8Pe11jyHBHfSAgYH7kEmT24eX792jZO1bo4BXkM= -go.opentelemetry.io/otel/sdk/metric v1.30.0/go.mod h1:waS6P3YqFNzeP01kuo/MBBYqaoBJl7efRQHOaydhy1Y= -go.opentelemetry.io/otel/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc= -go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o= +go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= +go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= +go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= +go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= +go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= +go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= +go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc= +go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8= +go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= +go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= @@ -89,8 +89,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= -golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= diff --git a/cmd/mdatagen/internal/command.go b/cmd/mdatagen/internal/command.go index 8758c8a6ddf..5abe033a943 100644 --- a/cmd/mdatagen/internal/command.go +++ b/cmd/mdatagen/internal/command.go @@ -74,7 +74,7 @@ func run(ymlPath string) error { tmplDir := "templates" - codeDir := filepath.Join(ymlDir, "internal", "metadata") + codeDir := filepath.Join(ymlDir, "internal", md.GeneratedPackageName) if err = os.MkdirAll(codeDir, 0700); err != nil { return fmt.Errorf("unable to create output directory %q: %w", codeDir, err) } @@ -99,7 +99,7 @@ func run(ymlPath string) error { if err = inlineReplace( filepath.Join(tmplDir, "readme.md.tmpl"), filepath.Join(ymlDir, "README.md"), - md, statusStart, statusEnd); err != nil { + md, statusStart, statusEnd, md.GeneratedPackageName); err != nil { return err } } @@ -151,7 +151,7 @@ func run(ymlPath string) error { } for tmpl, dst := range toGenerate { - if err = generateFile(tmpl, dst, md, "metadata"); err != nil { + if err = generateFile(tmpl, dst, md, md.GeneratedPackageName); err != nil { return err } } @@ -371,7 +371,7 @@ func executeTemplate(tmplFile string, md Metadata, goPackage string) ([]byte, er return buf.Bytes(), nil } -func inlineReplace(tmplFile string, outputFile string, md Metadata, start string, end string) error { +func inlineReplace(tmplFile string, outputFile string, md Metadata, start string, end string, goPackage string) error { var readmeContents []byte var err error if readmeContents, err = os.ReadFile(outputFile); err != nil { // nolint: gosec @@ -387,7 +387,7 @@ func inlineReplace(tmplFile string, outputFile string, md Metadata, start string md.GithubProject = "open-telemetry/opentelemetry-collector-contrib" } - buf, err := executeTemplate(tmplFile, md, "metadata") + buf, err := executeTemplate(tmplFile, md, goPackage) if err != nil { return err } diff --git a/cmd/mdatagen/internal/command_test.go b/cmd/mdatagen/internal/command_test.go index fdffe59cc25..27358666ed4 100644 --- a/cmd/mdatagen/internal/command_test.go +++ b/cmd/mdatagen/internal/command_test.go @@ -129,6 +129,10 @@ func TestRunContents(t *testing.T) { wantConfigGenerated: true, wantStatusGenerated: true, }, + { + yml: "custom_generated_package_name.yaml", + wantStatusGenerated: true, + }, } for _, tt := range tests { t.Run(tt.yml, func(t *testing.T) { @@ -151,12 +155,16 @@ foo } require.NoError(t, err) + md, err := LoadMetadata(metadataFile) + require.NoError(t, err) + generatedPackageDir := filepath.Join("internal", md.GeneratedPackageName) + var contents []byte if tt.wantMetricsGenerated { - require.FileExists(t, filepath.Join(tmpdir, "internal/metadata/generated_metrics.go")) - require.FileExists(t, filepath.Join(tmpdir, "internal/metadata/generated_metrics_test.go")) + require.FileExists(t, filepath.Join(tmpdir, generatedPackageDir, "generated_metrics.go")) + require.FileExists(t, filepath.Join(tmpdir, generatedPackageDir, "generated_metrics_test.go")) require.FileExists(t, filepath.Join(tmpdir, "documentation.md")) - contents, err = os.ReadFile(filepath.Join(tmpdir, "internal/metadata/generated_metrics.go")) // nolint: gosec + contents, err = os.ReadFile(filepath.Join(tmpdir, generatedPackageDir, "generated_metrics.go")) // nolint: gosec require.NoError(t, err) if tt.wantMetricsContext { require.Contains(t, string(contents), "\"context\"") @@ -164,23 +172,23 @@ foo require.NotContains(t, string(contents), "\"context\"") } } else { - require.NoFileExists(t, filepath.Join(tmpdir, "internal/metadata/generated_metrics.go")) - require.NoFileExists(t, filepath.Join(tmpdir, "internal/metadata/generated_metrics_test.go")) + require.NoFileExists(t, filepath.Join(tmpdir, generatedPackageDir, "generated_metrics.go")) + require.NoFileExists(t, filepath.Join(tmpdir, generatedPackageDir, "generated_metrics_test.go")) } if tt.wantConfigGenerated { - require.FileExists(t, filepath.Join(tmpdir, "internal/metadata/generated_config.go")) - require.FileExists(t, filepath.Join(tmpdir, "internal/metadata/generated_config_test.go")) + require.FileExists(t, filepath.Join(tmpdir, generatedPackageDir, "generated_config.go")) + require.FileExists(t, filepath.Join(tmpdir, generatedPackageDir, "generated_config_test.go")) } else { - require.NoFileExists(t, filepath.Join(tmpdir, "internal/metadata/generated_config.go")) - require.NoFileExists(t, filepath.Join(tmpdir, "internal/metadata/generated_config_test.go")) + require.NoFileExists(t, filepath.Join(tmpdir, generatedPackageDir, "generated_config.go")) + require.NoFileExists(t, filepath.Join(tmpdir, generatedPackageDir, "generated_config_test.go")) } if tt.wantTelemetryGenerated { - require.FileExists(t, filepath.Join(tmpdir, "internal/metadata/generated_telemetry.go")) - require.FileExists(t, filepath.Join(tmpdir, "internal/metadata/generated_telemetry_test.go")) + require.FileExists(t, filepath.Join(tmpdir, generatedPackageDir, "generated_telemetry.go")) + require.FileExists(t, filepath.Join(tmpdir, generatedPackageDir, "generated_telemetry_test.go")) require.FileExists(t, filepath.Join(tmpdir, "documentation.md")) - contents, err = os.ReadFile(filepath.Join(tmpdir, "internal/metadata/generated_telemetry.go")) // nolint: gosec + contents, err = os.ReadFile(filepath.Join(tmpdir, generatedPackageDir, "generated_telemetry.go")) // nolint: gosec require.NoError(t, err) if tt.wantMetricsContext { require.Contains(t, string(contents), "\"context\"") @@ -188,8 +196,8 @@ foo require.NotContains(t, string(contents), "\"context\"") } } else { - require.NoFileExists(t, filepath.Join(tmpdir, "internal/metadata/generated_telemetry.go")) - require.NoFileExists(t, filepath.Join(tmpdir, "internal/metadata/generated_telemetry_test.go")) + require.NoFileExists(t, filepath.Join(tmpdir, generatedPackageDir, "generated_telemetry.go")) + require.NoFileExists(t, filepath.Join(tmpdir, generatedPackageDir, "generated_telemetry_test.go")) } if !tt.wantMetricsGenerated && !tt.wantTelemetryGenerated && !tt.wantResourceAttributesGenerated { @@ -197,12 +205,12 @@ foo } if tt.wantStatusGenerated { - require.FileExists(t, filepath.Join(tmpdir, "internal/metadata/generated_status.go")) + require.FileExists(t, filepath.Join(tmpdir, generatedPackageDir, "generated_status.go")) contents, err = os.ReadFile(filepath.Join(tmpdir, "README.md")) // nolint: gosec require.NoError(t, err) require.NotContains(t, string(contents), "foo") } else { - require.NoFileExists(t, filepath.Join(tmpdir, "internal/metadata/generated_status.go")) + require.NoFileExists(t, filepath.Join(tmpdir, generatedPackageDir, "generated_status.go")) contents, err = os.ReadFile(filepath.Join(tmpdir, "README.md")) // nolint: gosec require.NoError(t, err) require.Contains(t, string(contents), "foo") @@ -466,7 +474,7 @@ Some info about a component readmeFile := filepath.Join(tmpdir, "README.md") require.NoError(t, os.WriteFile(readmeFile, []byte(tt.markdown), 0600)) - err := inlineReplace("templates/readme.md.tmpl", readmeFile, md, statusStart, statusEnd) + err := inlineReplace("templates/readme.md.tmpl", readmeFile, md, statusStart, statusEnd, "metadata") require.NoError(t, err) require.FileExists(t, filepath.Join(tmpdir, "README.md")) diff --git a/cmd/mdatagen/internal/loader.go b/cmd/mdatagen/internal/loader.go index cdc59066f4e..b51fc86f141 100644 --- a/cmd/mdatagen/internal/loader.go +++ b/cmd/mdatagen/internal/loader.go @@ -276,6 +276,8 @@ type Metadata struct { Parent string `mapstructure:"parent"` // Status information for the component. Status *Status `mapstructure:"status"` + // The name of the package that will be generated. + GeneratedPackageName string `mapstructure:"generated_package_name"` // Telemetry information for the component. Telemetry telemetry `mapstructure:"telemetry"` // SemConvVersion is a version number of OpenTelemetry semantic conventions applied to the scraped metrics. @@ -330,6 +332,9 @@ func LoadMetadata(filePath string) (Metadata, error) { return md, err } } + if md.GeneratedPackageName == "" { + md.GeneratedPackageName = "metadata" + } if err = md.Validate(); err != nil { return md, err diff --git a/cmd/mdatagen/internal/loader_test.go b/cmd/mdatagen/internal/loader_test.go index b99f088df3d..ed404744f75 100644 --- a/cmd/mdatagen/internal/loader_test.go +++ b/cmd/mdatagen/internal/loader_test.go @@ -22,9 +22,10 @@ func TestLoadMetadata(t *testing.T) { { name: "samplereceiver/metadata.yaml", want: Metadata{ - GithubProject: "open-telemetry/opentelemetry-collector", - Type: "sample", - SemConvVersion: "1.9.0", + GithubProject: "open-telemetry/opentelemetry-collector", + GeneratedPackageName: "metadata", + Type: "sample", + SemConvVersion: "1.9.0", Status: &Status{ Class: "receiver", Stability: map[component.StabilityLevel][]string{ @@ -297,11 +298,30 @@ func TestLoadMetadata(t *testing.T) { { name: "testdata/parent.yaml", want: Metadata{ - Type: "subcomponent", - Parent: "parentComponent", - ScopeName: "go.opentelemetry.io/collector/cmd/mdatagen/internal", - ShortFolderName: "testdata", - Tests: tests{Host: "componenttest.NewNopHost()"}, + Type: "subcomponent", + Parent: "parentComponent", + GeneratedPackageName: "metadata", + ScopeName: "go.opentelemetry.io/collector/cmd/mdatagen/internal", + ShortFolderName: "testdata", + Tests: tests{Host: "componenttest.NewNopHost()"}, + }, + }, + { + name: "testdata/generated_package_name.yaml", + want: Metadata{ + Type: "custom", + GeneratedPackageName: "customname", + ScopeName: "go.opentelemetry.io/collector/cmd/mdatagen/internal", + ShortFolderName: "testdata", + Tests: tests{Host: "componenttest.NewNopHost()"}, + Status: &Status{ + Class: "receiver", + Stability: map[component.StabilityLevel][]string{ + component.StabilityLevelDevelopment: {"logs"}, + component.StabilityLevelBeta: {"traces"}, + component.StabilityLevelStable: {"metrics"}, + }, + }, }, }, { diff --git a/cmd/mdatagen/internal/templates/component_test.go.tmpl b/cmd/mdatagen/internal/templates/component_test.go.tmpl index e766e3a3518..f224dec8aa3 100644 --- a/cmd/mdatagen/internal/templates/component_test.go.tmpl +++ b/cmd/mdatagen/internal/templates/component_test.go.tmpl @@ -338,7 +338,7 @@ func TestComponentLifecycle(t *testing.T) { {{- if not .Tests.SkipShutdown }} t.Run("shutdown", func(t *testing.T) { - e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopSettings(), cfg) + e, err := factory.Create(context.Background(), extensiontest.NewNopSettings(), cfg) require.NoError(t, err) err = e.Shutdown(context.Background()) require.NoError(t, err) @@ -347,12 +347,12 @@ func TestComponentLifecycle(t *testing.T) { {{- if not .Tests.SkipLifecycle }} t.Run("lifecycle", func(t *testing.T) { - firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopSettings(), cfg) + firstExt, err := factory.Create(context.Background(), extensiontest.NewNopSettings(), cfg) require.NoError(t, err) require.NoError(t, firstExt.Start(context.Background(), {{ .Tests.Host }})) require.NoError(t, firstExt.Shutdown(context.Background())) - secondExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopSettings(), cfg) + secondExt, err := factory.Create(context.Background(), extensiontest.NewNopSettings(), cfg) require.NoError(t, err) require.NoError(t, secondExt.Start(context.Background(), {{ .Tests.Host }})) require.NoError(t, secondExt.Shutdown(context.Background())) diff --git a/cmd/mdatagen/internal/testdata/custom_generated_package_name.yaml b/cmd/mdatagen/internal/testdata/custom_generated_package_name.yaml new file mode 100644 index 00000000000..9797baf3105 --- /dev/null +++ b/cmd/mdatagen/internal/testdata/custom_generated_package_name.yaml @@ -0,0 +1,17 @@ +type: metricreceiver + +generated_package_name: custom + +status: + class: receiver + stability: + development: [logs] + beta: [traces] + stable: [metrics] + distributions: [contrib] + warnings: + - Any additional information that should be brought to the consumer's attention + +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/cmd/mdatagen/internal/testdata/generated_package_name.yaml b/cmd/mdatagen/internal/testdata/generated_package_name.yaml new file mode 100644 index 00000000000..a880e69e608 --- /dev/null +++ b/cmd/mdatagen/internal/testdata/generated_package_name.yaml @@ -0,0 +1,10 @@ +type: custom + +generated_package_name: customname + +status: + class: receiver + stability: + development: [logs] + beta: [traces] + stable: [metrics] \ No newline at end of file diff --git a/cmd/mdatagen/metadata-schema.yaml b/cmd/mdatagen/metadata-schema.yaml index 4e30a31b7e2..afd1f09b62a 100644 --- a/cmd/mdatagen/metadata-schema.yaml +++ b/cmd/mdatagen/metadata-schema.yaml @@ -7,6 +7,9 @@ parent: string # Optional: Scope name for the telemetry generated by the component. If not set, name of the go package will be used. scope_name: string +# Optional: The name of the package that mdatagen generates. If not set, the name "metadata" will be used. +generated_package_name: string + # Required for components (Optional for subcomponents): A high-level view of the development status and use of this component status: # Required: The class of the component (For example receiver) diff --git a/cmd/otelcorecol/builder-config.yaml b/cmd/otelcorecol/builder-config.yaml index 62a8afaf186..b975754c5ca 100644 --- a/cmd/otelcorecol/builder-config.yaml +++ b/cmd/otelcorecol/builder-config.yaml @@ -39,12 +39,10 @@ providers: replaces: - go.opentelemetry.io/collector => ../../ - - go.opentelemetry.io/collector/internal/globalgates => ../../internal/globalgates - go.opentelemetry.io/collector/internal/globalsignal => ../../internal/globalsignal - go.opentelemetry.io/collector/client => ../../client - go.opentelemetry.io/collector/otelcol => ../../otelcol - go.opentelemetry.io/collector/component => ../../component - - go.opentelemetry.io/collector/component/componentprofiles => ../../component/componentprofiles - go.opentelemetry.io/collector/component/componentstatus => ../../component/componentstatus - go.opentelemetry.io/collector/config/configauth => ../../config/configauth - go.opentelemetry.io/collector/config/configcompression => ../../config/configcompression @@ -85,6 +83,7 @@ replaces: - go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata - go.opentelemetry.io/collector/pdata/pprofile => ../../pdata/pprofile - go.opentelemetry.io/collector/pipeline => ../../pipeline + - go.opentelemetry.io/collector/pipeline/pipelineprofiles => ../../pipeline/pipelineprofiles - go.opentelemetry.io/collector/processor => ../../processor - go.opentelemetry.io/collector/processor/batchprocessor => ../../processor/batchprocessor - go.opentelemetry.io/collector/processor/memorylimiterprocessor => ../../processor/memorylimiterprocessor diff --git a/cmd/otelcorecol/go.mod b/cmd/otelcorecol/go.mod index 7ccc15d0d98..3ed466cf0a8 100644 --- a/cmd/otelcorecol/go.mod +++ b/cmd/otelcorecol/go.mod @@ -45,7 +45,7 @@ require ( github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.2.6 // indirect - github.com/go-viper/mapstructure/v2 v2.1.0 // indirect + github.com/go-viper/mapstructure/v2 v2.2.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/uuid v1.6.0 // indirect @@ -53,7 +53,7 @@ require ( github.com/hashicorp/go-version v1.7.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.17.10 // indirect + github.com/klauspost/compress v1.17.11 // 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 @@ -81,7 +81,6 @@ require ( github.com/yusufpapurcu/wmi v1.2.4 // indirect go.opentelemetry.io/collector v0.111.0 // indirect go.opentelemetry.io/collector/client v1.17.0 // indirect - go.opentelemetry.io/collector/component/componentprofiles v0.111.0 // indirect go.opentelemetry.io/collector/component/componentstatus v0.111.0 // indirect go.opentelemetry.io/collector/config/configauth v0.111.0 // indirect go.opentelemetry.io/collector/config/configcompression v1.17.0 // indirect @@ -102,12 +101,12 @@ require ( go.opentelemetry.io/collector/extension/experimental/storage v0.111.0 // indirect go.opentelemetry.io/collector/extension/extensioncapabilities v0.111.0 // indirect go.opentelemetry.io/collector/featuregate v1.17.0 // indirect - go.opentelemetry.io/collector/internal/globalgates v0.111.0 // indirect go.opentelemetry.io/collector/internal/globalsignal v0.111.0 // indirect go.opentelemetry.io/collector/pdata v1.17.0 // indirect go.opentelemetry.io/collector/pdata/pprofile v0.111.0 // indirect go.opentelemetry.io/collector/pdata/testdata v0.111.0 // indirect go.opentelemetry.io/collector/pipeline v0.111.0 // indirect + go.opentelemetry.io/collector/pipeline/pipelineprofiles v0.111.0 // indirect go.opentelemetry.io/collector/processor/processorprofiles v0.111.0 // indirect go.opentelemetry.io/collector/receiver/receiverprofiles v0.111.0 // indirect go.opentelemetry.io/collector/semconv v0.111.0 // indirect @@ -117,23 +116,23 @@ require ( go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.55.0 // indirect go.opentelemetry.io/contrib/propagators/b3 v1.30.0 // indirect go.opentelemetry.io/contrib/zpages v0.55.0 // indirect - go.opentelemetry.io/otel v1.30.0 // indirect + go.opentelemetry.io/otel v1.31.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.6.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.30.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.30.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.31.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.31.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.30.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.30.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.30.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.53.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.6.0 // indirect - go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.30.0 // indirect + go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.31.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.30.0 // indirect go.opentelemetry.io/otel/log v0.6.0 // indirect - go.opentelemetry.io/otel/metric v1.30.0 // indirect - go.opentelemetry.io/otel/sdk v1.30.0 // indirect + go.opentelemetry.io/otel/metric v1.31.0 // indirect + go.opentelemetry.io/otel/sdk v1.31.0 // indirect go.opentelemetry.io/otel/sdk/log v0.6.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect - go.opentelemetry.io/otel/trace v1.30.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.31.0 // indirect + go.opentelemetry.io/otel/trace v1.31.0 // indirect go.opentelemetry.io/proto/otlp v1.3.1 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect @@ -141,8 +140,8 @@ require ( golang.org/x/net v0.30.0 // indirect golang.org/x/text v0.19.0 // indirect gonum.org/v1/gonum v0.15.1 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20241007155032-5fefd90f89a9 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9 // indirect google.golang.org/grpc v1.67.1 // indirect google.golang.org/protobuf v1.35.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect @@ -150,8 +149,6 @@ require ( replace go.opentelemetry.io/collector => ../../ -replace go.opentelemetry.io/collector/internal/globalgates => ../../internal/globalgates - replace go.opentelemetry.io/collector/internal/globalsignal => ../../internal/globalsignal replace go.opentelemetry.io/collector/client => ../../client @@ -160,8 +157,6 @@ replace go.opentelemetry.io/collector/otelcol => ../../otelcol replace go.opentelemetry.io/collector/component => ../../component -replace go.opentelemetry.io/collector/component/componentprofiles => ../../component/componentprofiles - replace go.opentelemetry.io/collector/component/componentstatus => ../../component/componentstatus replace go.opentelemetry.io/collector/config/configauth => ../../config/configauth @@ -242,6 +237,8 @@ replace go.opentelemetry.io/collector/pdata/pprofile => ../../pdata/pprofile replace go.opentelemetry.io/collector/pipeline => ../../pipeline +replace go.opentelemetry.io/collector/pipeline/pipelineprofiles => ../../pipeline/pipelineprofiles + replace go.opentelemetry.io/collector/processor => ../../processor replace go.opentelemetry.io/collector/processor/batchprocessor => ../../processor/batchprocessor diff --git a/cmd/otelcorecol/go.sum b/cmd/otelcorecol/go.sum index 2d3ba5c2eec..1b23eb41922 100644 --- a/cmd/otelcorecol/go.sum +++ b/cmd/otelcorecol/go.sum @@ -21,8 +21,8 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= -github.com/go-viper/mapstructure/v2 v2.1.0 h1:gHnMa2Y/pIxElCH2GlZZ1lZSsn6XMtufpGyP1XxdC/w= -github.com/go-viper/mapstructure/v2 v2.1.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= @@ -43,8 +43,8 @@ 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.10 h1:oXAz+Vh0PMUvJczoi+flxpnBEPxoER1IaAnU/NMPtT0= -github.com/klauspost/compress v1.17.10/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= +github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= +github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= 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= @@ -86,8 +86,8 @@ github.com/prometheus/common v0.60.0 h1:+V9PAREWNvJMAuJ1x1BaWl9dewMW4YrHZQbx0sJN github.com/prometheus/common v0.60.0/go.mod h1:h0LYf1R1deLSKtD4Vdg8gy4RuOvENW2J/h19V5NADQw= 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/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= +github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -119,40 +119,40 @@ go.opentelemetry.io/contrib/propagators/b3 v1.30.0 h1:vumy4r1KMyaoQRltX7cJ37p3nl go.opentelemetry.io/contrib/propagators/b3 v1.30.0/go.mod h1:fRbvRsaeVZ82LIl3u0rIvusIel2UUf+JcaaIpy5taho= go.opentelemetry.io/contrib/zpages v0.55.0 h1:F+xj261Ulwl79QC+2O+IO1b3NbwppUDwN+7LbDSdQcY= go.opentelemetry.io/contrib/zpages v0.55.0/go.mod h1:dDqDGDfbXSjt/k9orZk4Huulvz1letX1YWTKts5GQpo= -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 v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= +go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.6.0 h1:QSKmLBzbFULSyHzOdO9JsN9lpE4zkrz1byYGmJecdVE= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.6.0/go.mod h1:sTQ/NH8Yrirf0sJ5rWqVu+oT82i4zL9FaF6rWcqnptM= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.30.0 h1:WypxHH02KX2poqqbaadmkMYalGyy/vil4HE4PM4nRJc= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.30.0/go.mod h1:U79SV99vtvGSEBeeHnpgGJfTsnsdkWLpPN/CcHAzBSI= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.30.0 h1:VrMAbeJz4gnVDg2zEzjHG4dEH86j4jO6VYB+NgtGD8s= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.30.0/go.mod h1:qqN/uFdpeitTvm+JDqqnjm517pmQRYxTORbETHq5tOc= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.31.0 h1:FZ6ei8GFW7kyPYdxJaV2rgI6M+4tvZzhYsQ2wgyVC08= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.31.0/go.mod h1:MdEu/mC6j3D+tTEfvI15b5Ci2Fn7NneJ71YMoiS3tpI= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.31.0 h1:ZsXq73BERAiNuuFXYqP4MR5hBrjXfMGSO+Cx7qoOZiM= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.31.0/go.mod h1:hg1zaDMpyZJuUzjFxFsRYBoccE86tM9Uf4IqNMUxvrY= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.30.0 h1:lsInsfvhVIfOI6qHVyysXMNDnjO9Npvl7tlDPJFBVd4= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.30.0/go.mod h1:KQsVNh4OjgjTG0G6EiNi1jVpnaeeKsKMRwbLN+f1+8M= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.30.0 h1:m0yTiGDLUvVYaTFbAvCkVYIYcvwKt3G7OLoN77NUs/8= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.30.0/go.mod h1:wBQbT4UekBfegL2nx0Xk1vBcnzyBPsIVm9hRG4fYcr4= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.30.0 h1:umZgi92IyxfXd/l4kaDhnKgY8rnN/cZcF1LKc6I8OQ8= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.30.0/go.mod h1:4lVs6obhSVRb1EW5FhOuBTyiQhtRtAnnva9vD3yRfq8= -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/exporters/prometheus v0.53.0 h1:QXobPHrwiGLM4ufrY3EOmDPJpo2P90UuFau4CDPJA/I= +go.opentelemetry.io/otel/exporters/prometheus v0.53.0/go.mod h1:WOAXGr3D00CfzmFxtTV1eR0GpoHuPEu+HJT8UWW2SIU= go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.6.0 h1:bZHOb8k/CwwSt0DgvgaoOhBXWNdWqFWaIsGTtg1H3KE= go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.6.0/go.mod h1:XlV163j81kDdIt5b5BXCjdqVfqJFy/LJrHA697SorvQ= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.30.0 h1:IyFlqNsi8VT/nwYlLJfdM0y1gavxGpEvnf6FtVfZ6X4= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.30.0/go.mod h1:bxiX8eUeKoAEQmbq/ecUT8UqZwCjZW52yJrXJUSozsk= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.31.0 h1:HZgBIps9wH0RDrwjrmNa3DVbNRW60HEhdzqZFyAp3fI= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.31.0/go.mod h1:RDRhvt6TDG0eIXmonAx5bd9IcwpqCkziwkOClzWKwAQ= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.30.0 h1:kn1BudCgwtE7PxLqcZkErpD8GKqLZ6BSzeW9QihQJeM= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.30.0/go.mod h1:ljkUDtAMdleoi9tIG1R6dJUpVwDcYjw3J2Q6Q/SuiC0= go.opentelemetry.io/otel/log v0.6.0 h1:nH66tr+dmEgW5y+F9LanGJUBYPrRgP4g2EkmPE3LeK8= go.opentelemetry.io/otel/log v0.6.0/go.mod h1:KdySypjQHhP069JX0z/t26VHwa8vSwzgaKmXtIB3fJM= -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= -go.opentelemetry.io/otel/sdk v1.30.0/go.mod h1:p14X4Ok8S+sygzblytT1nqG98QG2KYKv++HE0LY/mhg= +go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= +go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= +go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= +go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= go.opentelemetry.io/otel/sdk/log v0.6.0 h1:4J8BwXY4EeDE9Mowg+CyhWVBhTSLXVXodiXxS/+PGqI= go.opentelemetry.io/otel/sdk/log v0.6.0/go.mod h1:L1DN8RMAduKkrwRAFDEX3E3TLOq46+XMGSbUfHU/+vE= -go.opentelemetry.io/otel/sdk/metric v1.30.0 h1:QJLT8Pe11jyHBHfSAgYH7kEmT24eX792jZO1bo4BXkM= -go.opentelemetry.io/otel/sdk/metric v1.30.0/go.mod h1:waS6P3YqFNzeP01kuo/MBBYqaoBJl7efRQHOaydhy1Y= -go.opentelemetry.io/otel/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc= -go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o= +go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc= +go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8= +go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= +go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= @@ -200,10 +200,10 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gonum.org/v1/gonum v0.15.1 h1:FNy7N6OUZVUaWG9pTiD+jlhdQ3lMP+/LcTpJ6+a8sQ0= gonum.org/v1/gonum v0.15.1/go.mod h1:eZTZuRFrzu5pcyjN5wJhcIhnUdNijYxX1T2IcrOGY0o= -google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 h1:hjSy6tcFQZ171igDaN5QHOw2n6vx40juYbC/x67CEhc= -google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:qpvKtACPCQhAdu3PyQgV4l3LMXZEtft7y8QcarRsp9I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= +google.golang.org/genproto/googleapis/api v0.0.0-20241007155032-5fefd90f89a9 h1:T6rh4haD3GVYsgEfWExoCZA2o2FmbNyKpTuAxbEFPTg= +google.golang.org/genproto/googleapis/api v0.0.0-20241007155032-5fefd90f89a9/go.mod h1:wp2WsuBYj6j8wUdo3ToZsdxxixbvQNAHqVJrTgi5E5M= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9 h1:QCqS/PdaHTSWGvupk2F/ehwHtGc0/GYkT+3GAcR1CCc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E= google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA= diff --git a/component/componentstatus/go.mod b/component/componentstatus/go.mod index a4c0f20d9bd..dd8bfafae26 100644 --- a/component/componentstatus/go.mod +++ b/component/componentstatus/go.mod @@ -15,13 +15,13 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.111.0 // indirect go.opentelemetry.io/collector/internal/globalsignal v0.111.0 // indirect go.opentelemetry.io/collector/pdata v1.17.0 // indirect - go.opentelemetry.io/otel v1.30.0 // indirect - go.opentelemetry.io/otel/metric v1.30.0 // indirect - go.opentelemetry.io/otel/trace v1.30.0 // indirect + go.opentelemetry.io/otel v1.31.0 // indirect + go.opentelemetry.io/otel/metric v1.31.0 // indirect + go.opentelemetry.io/otel/trace v1.31.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.25.0 // indirect + golang.org/x/sys v0.26.0 // indirect golang.org/x/text v0.17.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect google.golang.org/grpc v1.67.1 // indirect diff --git a/component/componentstatus/go.sum b/component/componentstatus/go.sum index 0c3f8798553..f3c515d7ec1 100644 --- a/component/componentstatus/go.sum +++ b/component/componentstatus/go.sum @@ -22,12 +22,12 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 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/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/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc= -go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o= +go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= +go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= +go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= +go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= +go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= +go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= @@ -51,8 +51,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= -golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= diff --git a/component/componentstatus/instance_test.go b/component/componentstatus/instance_test.go index 6a7edeb1dfa..dc722830748 100644 --- a/component/componentstatus/instance_test.go +++ b/component/componentstatus/instance_test.go @@ -14,9 +14,9 @@ import ( func TestInstanceID(t *testing.T) { traces := component.MustNewID("traces") - tracesA := pipeline.MustNewIDWithName("traces", "a") - tracesB := pipeline.MustNewIDWithName("traces", "b") - tracesC := pipeline.MustNewIDWithName("traces", "c") + tracesA := pipeline.NewIDWithName(pipeline.SignalTraces, "a") + tracesB := pipeline.NewIDWithName(pipeline.SignalTraces, "b") + tracesC := pipeline.NewIDWithName(pipeline.SignalTraces, "c") idTracesA := NewInstanceID(traces, component.KindReceiver, tracesA) idTracesAll := NewInstanceID(traces, component.KindReceiver, tracesA, tracesB, tracesC) @@ -74,9 +74,9 @@ func TestAllPipelineIDs(t *testing.T) { instanceID := NewInstanceID( component.MustNewID("traces"), component.KindReceiver, - pipeline.MustNewIDWithName("traces", "a"), - pipeline.MustNewIDWithName("traces", "b"), - pipeline.MustNewIDWithName("traces", "c"), + pipeline.NewIDWithName(pipeline.SignalTraces, "a"), + pipeline.NewIDWithName(pipeline.SignalTraces, "b"), + pipeline.NewIDWithName(pipeline.SignalTraces, "c"), ) count := 0 diff --git a/component/config.go b/component/config.go index 91898258f6a..d7eb0e005fd 100644 --- a/component/config.go +++ b/component/config.go @@ -86,7 +86,7 @@ func callValidateIfPossible(v reflect.Value) error { if reflect.PointerTo(v.Type()).Implements(configValidatorType) { // If not addressable, then create a new *V pointer and set the value to current v. if !v.CanAddr() { - pv := reflect.New(reflect.PtrTo(v.Type()).Elem()) + pv := reflect.New(reflect.PointerTo(v.Type()).Elem()) pv.Elem().Set(v) v = pv.Elem() } diff --git a/component/go.mod b/component/go.mod index afaa21db3a2..d8fb51d28da 100644 --- a/component/go.mod +++ b/component/go.mod @@ -6,11 +6,11 @@ require ( github.com/stretchr/testify v1.9.0 go.opentelemetry.io/collector/config/configtelemetry v0.111.0 go.opentelemetry.io/collector/pdata v1.17.0 - go.opentelemetry.io/otel v1.30.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 - go.opentelemetry.io/otel/trace v1.30.0 + go.opentelemetry.io/otel v1.31.0 + go.opentelemetry.io/otel/metric v1.31.0 + go.opentelemetry.io/otel/sdk v1.31.0 + go.opentelemetry.io/otel/sdk/metric v1.31.0 + go.opentelemetry.io/otel/trace v1.31.0 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.27.0 @@ -24,7 +24,7 @@ require ( github.com/google/uuid v1.6.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.25.0 // indirect + golang.org/x/sys v0.26.0 // indirect golang.org/x/text v0.17.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect google.golang.org/grpc v1.67.1 // indirect diff --git a/component/go.sum b/component/go.sum index f98e49f8bc2..fcd6f77cd0e 100644 --- a/component/go.sum +++ b/component/go.sum @@ -25,16 +25,16 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 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/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= -go.opentelemetry.io/otel/sdk v1.30.0/go.mod h1:p14X4Ok8S+sygzblytT1nqG98QG2KYKv++HE0LY/mhg= -go.opentelemetry.io/otel/sdk/metric v1.30.0 h1:QJLT8Pe11jyHBHfSAgYH7kEmT24eX792jZO1bo4BXkM= -go.opentelemetry.io/otel/sdk/metric v1.30.0/go.mod h1:waS6P3YqFNzeP01kuo/MBBYqaoBJl7efRQHOaydhy1Y= -go.opentelemetry.io/otel/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc= -go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o= +go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= +go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= +go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= +go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= +go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= +go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= +go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc= +go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8= +go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= +go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= @@ -58,8 +58,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= -golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= diff --git a/config/configauth/go.mod b/config/configauth/go.mod index 947c19ecd34..3405539076a 100644 --- a/config/configauth/go.mod +++ b/config/configauth/go.mod @@ -16,13 +16,13 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.111.0 // indirect go.opentelemetry.io/collector/pdata v1.17.0 // indirect - go.opentelemetry.io/otel v1.30.0 // indirect - go.opentelemetry.io/otel/metric v1.30.0 // indirect - go.opentelemetry.io/otel/trace v1.30.0 // indirect + go.opentelemetry.io/otel v1.31.0 // indirect + go.opentelemetry.io/otel/metric v1.31.0 // indirect + go.opentelemetry.io/otel/trace v1.31.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.25.0 // indirect + golang.org/x/sys v0.26.0 // indirect golang.org/x/text v0.17.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect google.golang.org/grpc v1.67.1 // indirect diff --git a/config/configauth/go.sum b/config/configauth/go.sum index c65e5ef650f..625463d8c27 100644 --- a/config/configauth/go.sum +++ b/config/configauth/go.sum @@ -24,16 +24,16 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 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/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= -go.opentelemetry.io/otel/sdk v1.30.0/go.mod h1:p14X4Ok8S+sygzblytT1nqG98QG2KYKv++HE0LY/mhg= -go.opentelemetry.io/otel/sdk/metric v1.30.0 h1:QJLT8Pe11jyHBHfSAgYH7kEmT24eX792jZO1bo4BXkM= -go.opentelemetry.io/otel/sdk/metric v1.30.0/go.mod h1:waS6P3YqFNzeP01kuo/MBBYqaoBJl7efRQHOaydhy1Y= -go.opentelemetry.io/otel/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc= -go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o= +go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= +go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= +go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= +go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= +go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= +go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= +go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc= +go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8= +go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= +go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= @@ -57,8 +57,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= -golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= diff --git a/config/configgrpc/go.mod b/config/configgrpc/go.mod index d7ff151fcbb..9c7e6d45525 100644 --- a/config/configgrpc/go.mod +++ b/config/configgrpc/go.mod @@ -18,7 +18,7 @@ require ( go.opentelemetry.io/collector/pdata v1.17.0 go.opentelemetry.io/collector/pdata/testdata v0.111.0 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.55.0 - go.opentelemetry.io/otel v1.30.0 + go.opentelemetry.io/otel v1.31.0 go.uber.org/goleak v1.3.0 go.uber.org/zap v1.27.0 google.golang.org/grpc v1.67.1 @@ -39,13 +39,13 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect go.opentelemetry.io/collector/extension v0.111.0 // indirect go.opentelemetry.io/collector/pdata/pprofile v0.111.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 - go.opentelemetry.io/otel/trace v1.30.0 // indirect + go.opentelemetry.io/otel/metric v1.31.0 // indirect + go.opentelemetry.io/otel/sdk v1.31.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.31.0 // indirect + go.opentelemetry.io/otel/trace v1.31.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.29.0 // indirect - golang.org/x/sys v0.25.0 // indirect + golang.org/x/sys v0.26.0 // indirect golang.org/x/text v0.18.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect google.golang.org/protobuf v1.35.1 // indirect diff --git a/config/configgrpc/go.sum b/config/configgrpc/go.sum index c1c3097a93d..4e367f21d5b 100644 --- a/config/configgrpc/go.sum +++ b/config/configgrpc/go.sum @@ -46,16 +46,16 @@ 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/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.55.0 h1:hCq2hNMwsegUvPzI7sPOvtO9cqyy5GbWt/Ybp2xrx8Q= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.55.0/go.mod h1:LqaApwGx/oUmzsbqxkzuBvyoPpkxk3JQWnqfVrJ3wCA= -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/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= -go.opentelemetry.io/otel/sdk v1.30.0/go.mod h1:p14X4Ok8S+sygzblytT1nqG98QG2KYKv++HE0LY/mhg= -go.opentelemetry.io/otel/sdk/metric v1.30.0 h1:QJLT8Pe11jyHBHfSAgYH7kEmT24eX792jZO1bo4BXkM= -go.opentelemetry.io/otel/sdk/metric v1.30.0/go.mod h1:waS6P3YqFNzeP01kuo/MBBYqaoBJl7efRQHOaydhy1Y= -go.opentelemetry.io/otel/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc= -go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o= +go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= +go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= +go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= +go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= +go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= +go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= +go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc= +go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8= +go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= +go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= @@ -79,8 +79,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= -golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= diff --git a/config/confighttp/compress_readcloser_test.go b/config/confighttp/compress_readcloser_test.go index fd97a15e242..70f9f6fccdc 100644 --- a/config/confighttp/compress_readcloser_test.go +++ b/config/confighttp/compress_readcloser_test.go @@ -53,7 +53,6 @@ func TestCompressReadCloser(t *testing.T) { errVal: "failed to close reader", }, } { - tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel() diff --git a/config/confighttp/compression_test.go b/config/confighttp/compression_test.go index 9f161a3f7c3..870e9ba8371 100644 --- a/config/confighttp/compression_test.go +++ b/config/confighttp/compression_test.go @@ -415,7 +415,6 @@ func TestDecompressorAvoidDecompressionBomb(t *testing.T) { compress: compressLz4, }, } { - tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel() diff --git a/config/confighttp/go.mod b/config/confighttp/go.mod index 44c20bee0e5..c90e12b9958 100644 --- a/config/confighttp/go.mod +++ b/config/confighttp/go.mod @@ -4,7 +4,7 @@ go 1.22.0 require ( github.com/golang/snappy v0.0.4 - github.com/klauspost/compress v1.17.10 + github.com/klauspost/compress v1.17.11 github.com/pierrec/lz4/v4 v4.1.21 github.com/rs/cors v1.11.1 github.com/stretchr/testify v1.9.0 @@ -18,8 +18,8 @@ require ( go.opentelemetry.io/collector/config/internal v0.111.0 go.opentelemetry.io/collector/extension/auth v0.111.0 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.55.0 - go.opentelemetry.io/otel v1.30.0 - go.opentelemetry.io/otel/metric v1.30.0 + go.opentelemetry.io/otel v1.31.0 + go.opentelemetry.io/otel/metric v1.31.0 go.uber.org/goleak v1.3.0 go.uber.org/zap v1.27.0 golang.org/x/net v0.30.0 @@ -36,9 +36,9 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect go.opentelemetry.io/collector/extension v0.111.0 // indirect go.opentelemetry.io/collector/pdata v1.17.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 + go.opentelemetry.io/otel/sdk v1.31.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.31.0 // indirect + go.opentelemetry.io/otel/trace v1.31.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/sys v0.26.0 // indirect golang.org/x/text v0.19.0 // indirect diff --git a/config/confighttp/go.sum b/config/confighttp/go.sum index d3e0097a5b4..dbf30aec059 100644 --- a/config/confighttp/go.sum +++ b/config/confighttp/go.sum @@ -21,8 +21,8 @@ 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.10 h1:oXAz+Vh0PMUvJczoi+flxpnBEPxoER1IaAnU/NMPtT0= -github.com/klauspost/compress v1.17.10/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= +github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= +github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= 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= @@ -45,16 +45,16 @@ 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/contrib/instrumentation/net/http/otelhttp v0.55.0 h1:ZIg3ZT/aQ7AfKqdwp7ECpOK6vHqquXXuyTjIO8ZdmPs= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.55.0/go.mod h1:DQAwmETtZV00skUwgD6+0U89g80NKsJE3DCKeLLPQMI= -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/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= -go.opentelemetry.io/otel/sdk v1.30.0/go.mod h1:p14X4Ok8S+sygzblytT1nqG98QG2KYKv++HE0LY/mhg= -go.opentelemetry.io/otel/sdk/metric v1.30.0 h1:QJLT8Pe11jyHBHfSAgYH7kEmT24eX792jZO1bo4BXkM= -go.opentelemetry.io/otel/sdk/metric v1.30.0/go.mod h1:waS6P3YqFNzeP01kuo/MBBYqaoBJl7efRQHOaydhy1Y= -go.opentelemetry.io/otel/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc= -go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o= +go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= +go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= +go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= +go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= +go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= +go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= +go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc= +go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8= +go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= +go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= diff --git a/confmap/confmap_test.go b/confmap/confmap_test.go index 5436e82036b..7055b683fa7 100644 --- a/confmap/confmap_test.go +++ b/confmap/confmap_test.go @@ -6,6 +6,7 @@ package confmap import ( "errors" "fmt" + "math" "os" "path/filepath" "reflect" @@ -213,14 +214,14 @@ func TestMapKeyStringToMapKeyTextUnmarshalerHookFunc(t *testing.T) { assert.Equal(t, map[TestID]string{"string": "this is a string"}, cfg.Map) } -type UintConfig struct { - UintTest uint32 `mapstructure:"uint_test"` +type Uint32Config struct { + Value uint32 `mapstructure:"value"` } -func TestUintUnmarshalerSuccess(t *testing.T) { +func TestUint32UnmarshalerSuccess(t *testing.T) { tests := []struct { name string - testValue int + testValue uint32 }{ { name: "Test convert 0 to uint", @@ -230,34 +231,50 @@ func TestUintUnmarshalerSuccess(t *testing.T) { name: "Test positive uint conversion", testValue: 1000, }, + { + name: "Test largest uint64 conversion", + testValue: math.MaxUint32, + }, } for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { stringMap := map[string]any{ - "uint_test": tt.testValue, + "value": int(tt.testValue), } conf := NewFromStringMap(stringMap) - cfg := &UintConfig{} + cfg := &Uint32Config{} err := conf.Unmarshal(cfg) require.NoError(t, err) - assert.Equal(t, cfg.UintTest, uint32(tt.testValue)) + assert.Equal(t, cfg.Value, tt.testValue) }) } } +func TestUint32UnmarshalerFailure(t *testing.T) { + testValue := -1000 + stringMap := map[string]any{ + "value": testValue, + } + conf := NewFromStringMap(stringMap) + cfg := &Uint32Config{} + err := conf.Unmarshal(cfg) + + assert.ErrorContains(t, err, fmt.Sprintf("decoding failed due to the following error(s):\n\ncannot parse 'value', %d overflows uint", testValue)) +} + +type Uint64Config struct { + Value uint64 `mapstructure:"value"` +} + func TestUint64Unmarshaler(t *testing.T) { - negativeInt := -1000 - testValue := uint64(negativeInt) + // Equivalent to -1000, but converted to uint64 + value := uint64(1000) + testValue := ^(value - 1) - type Uint64Config struct { - UintTest uint64 `mapstructure:"uint_test"` - } stringMap := map[string]any{ - "uint_test": testValue, + "value": testValue, } conf := NewFromStringMap(stringMap) @@ -265,19 +282,19 @@ func TestUint64Unmarshaler(t *testing.T) { err := conf.Unmarshal(cfg) require.NoError(t, err) - assert.Equal(t, cfg.UintTest, testValue) + assert.Equal(t, cfg.Value, testValue) } -func TestUintUnmarshalerFailure(t *testing.T) { +func TestUint64UnmarshalerFailure(t *testing.T) { testValue := -1000 stringMap := map[string]any{ - "uint_test": testValue, + "value": testValue, } conf := NewFromStringMap(stringMap) - cfg := &UintConfig{} + cfg := &Uint64Config{} err := conf.Unmarshal(cfg) - assert.ErrorContains(t, err, fmt.Sprintf("decoding failed due to the following error(s):\n\ncannot parse 'uint_test', %d overflows uint", testValue)) + assert.ErrorContains(t, err, fmt.Sprintf("decoding failed due to the following error(s):\n\ncannot parse 'value', %d overflows uint", testValue)) } func TestMapKeyStringToMapKeyTextUnmarshalerHookFuncDuplicateID(t *testing.T) { @@ -663,8 +680,6 @@ func TestZeroSliceHookFunc(t *testing.T) { } for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { cfg := NewFromStringMap(tt.cfg) diff --git a/confmap/converter/expandconverter/go.mod b/confmap/converter/expandconverter/go.mod index d8f55df1d14..8c387402bbf 100644 --- a/confmap/converter/expandconverter/go.mod +++ b/confmap/converter/expandconverter/go.mod @@ -13,7 +13,7 @@ require ( require ( github.com/davecgh/go-spew v1.1.1 // indirect - github.com/go-viper/mapstructure/v2 v2.1.0 // indirect + github.com/go-viper/mapstructure/v2 v2.2.1 // 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 diff --git a/confmap/converter/expandconverter/go.sum b/confmap/converter/expandconverter/go.sum index 3a051879bb3..6095cc50622 100644 --- a/confmap/converter/expandconverter/go.sum +++ b/confmap/converter/expandconverter/go.sum @@ -1,7 +1,7 @@ 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-viper/mapstructure/v2 v2.1.0 h1:gHnMa2Y/pIxElCH2GlZZ1lZSsn6XMtufpGyP1XxdC/w= -github.com/go-viper/mapstructure/v2 v2.1.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= 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= diff --git a/confmap/go.mod b/confmap/go.mod index 8b516e42c16..ad04cf6659a 100644 --- a/confmap/go.mod +++ b/confmap/go.mod @@ -3,7 +3,7 @@ module go.opentelemetry.io/collector/confmap go 1.22.0 require ( - github.com/go-viper/mapstructure/v2 v2.1.0 + github.com/go-viper/mapstructure/v2 v2.2.1 github.com/knadh/koanf/maps v0.1.1 github.com/knadh/koanf/providers/confmap v0.1.0 github.com/knadh/koanf/v2 v2.1.1 diff --git a/confmap/go.sum b/confmap/go.sum index d716a4a75f7..742fd976cc7 100644 --- a/confmap/go.sum +++ b/confmap/go.sum @@ -1,8 +1,8 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= 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-viper/mapstructure/v2 v2.1.0 h1:gHnMa2Y/pIxElCH2GlZZ1lZSsn6XMtufpGyP1XxdC/w= -github.com/go-viper/mapstructure/v2 v2.1.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= 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= diff --git a/confmap/internal/e2e/go.mod b/confmap/internal/e2e/go.mod index 5186290a151..1abc4283bc8 100644 --- a/confmap/internal/e2e/go.mod +++ b/confmap/internal/e2e/go.mod @@ -12,7 +12,7 @@ require ( require ( github.com/davecgh/go-spew v1.1.1 // indirect - github.com/go-viper/mapstructure/v2 v2.1.0 // indirect + github.com/go-viper/mapstructure/v2 v2.2.1 // 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 diff --git a/confmap/internal/e2e/go.sum b/confmap/internal/e2e/go.sum index 3a051879bb3..6095cc50622 100644 --- a/confmap/internal/e2e/go.sum +++ b/confmap/internal/e2e/go.sum @@ -1,7 +1,7 @@ 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-viper/mapstructure/v2 v2.1.0 h1:gHnMa2Y/pIxElCH2GlZZ1lZSsn6XMtufpGyP1XxdC/w= -github.com/go-viper/mapstructure/v2 v2.1.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= 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= diff --git a/confmap/internal/e2e/types_test.go b/confmap/internal/e2e/types_test.go index 6e335daaa6c..384ec092727 100644 --- a/confmap/internal/e2e/types_test.go +++ b/confmap/internal/e2e/types_test.go @@ -165,12 +165,12 @@ func TestStrictTypeCasting(t *testing.T) { { value: "t", targetField: TargetFieldBool, - unmarshalErr: "'field' expected type 'bool', got unconvertible type 'string', value: 't'", + unmarshalErr: "'field' expected type '%!s(bool=false)', got unconvertible type '\"t\"', value: '\"t\"'", }, { value: "23", targetField: TargetFieldBool, - unmarshalErr: "'field' expected type 'bool', got unconvertible type 'int', value: '23'", + unmarshalErr: "'field' expected type '%!s(bool=false)', got unconvertible type '23', value: '23'", }, { value: "{\"field\": 123}", diff --git a/confmap/provider/envprovider/go.mod b/confmap/provider/envprovider/go.mod index ddbe317641b..ae2f318cc1a 100644 --- a/confmap/provider/envprovider/go.mod +++ b/confmap/provider/envprovider/go.mod @@ -11,7 +11,7 @@ require ( require ( github.com/davecgh/go-spew v1.1.1 // indirect - github.com/go-viper/mapstructure/v2 v2.1.0 // indirect + github.com/go-viper/mapstructure/v2 v2.2.1 // 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 diff --git a/confmap/provider/envprovider/go.sum b/confmap/provider/envprovider/go.sum index 3a051879bb3..6095cc50622 100644 --- a/confmap/provider/envprovider/go.sum +++ b/confmap/provider/envprovider/go.sum @@ -1,7 +1,7 @@ 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-viper/mapstructure/v2 v2.1.0 h1:gHnMa2Y/pIxElCH2GlZZ1lZSsn6XMtufpGyP1XxdC/w= -github.com/go-viper/mapstructure/v2 v2.1.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= 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= diff --git a/confmap/provider/fileprovider/go.mod b/confmap/provider/fileprovider/go.mod index 9a98f83a00e..022219e1ad8 100644 --- a/confmap/provider/fileprovider/go.mod +++ b/confmap/provider/fileprovider/go.mod @@ -10,7 +10,7 @@ require ( require ( github.com/davecgh/go-spew v1.1.1 // indirect - github.com/go-viper/mapstructure/v2 v2.1.0 // indirect + github.com/go-viper/mapstructure/v2 v2.2.1 // 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 diff --git a/confmap/provider/fileprovider/go.sum b/confmap/provider/fileprovider/go.sum index 3a051879bb3..6095cc50622 100644 --- a/confmap/provider/fileprovider/go.sum +++ b/confmap/provider/fileprovider/go.sum @@ -1,7 +1,7 @@ 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-viper/mapstructure/v2 v2.1.0 h1:gHnMa2Y/pIxElCH2GlZZ1lZSsn6XMtufpGyP1XxdC/w= -github.com/go-viper/mapstructure/v2 v2.1.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= 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= diff --git a/confmap/provider/httpprovider/go.mod b/confmap/provider/httpprovider/go.mod index cae8da3f9fe..5e5e40137f7 100644 --- a/confmap/provider/httpprovider/go.mod +++ b/confmap/provider/httpprovider/go.mod @@ -10,7 +10,7 @@ require ( require ( github.com/davecgh/go-spew v1.1.1 // indirect - github.com/go-viper/mapstructure/v2 v2.1.0 // indirect + github.com/go-viper/mapstructure/v2 v2.2.1 // 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 diff --git a/confmap/provider/httpprovider/go.sum b/confmap/provider/httpprovider/go.sum index 3a051879bb3..6095cc50622 100644 --- a/confmap/provider/httpprovider/go.sum +++ b/confmap/provider/httpprovider/go.sum @@ -1,7 +1,7 @@ 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-viper/mapstructure/v2 v2.1.0 h1:gHnMa2Y/pIxElCH2GlZZ1lZSsn6XMtufpGyP1XxdC/w= -github.com/go-viper/mapstructure/v2 v2.1.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= 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= diff --git a/confmap/provider/httpsprovider/go.mod b/confmap/provider/httpsprovider/go.mod index e2400a3f601..e2b4c6499f6 100644 --- a/confmap/provider/httpsprovider/go.mod +++ b/confmap/provider/httpsprovider/go.mod @@ -10,7 +10,7 @@ require ( require ( github.com/davecgh/go-spew v1.1.1 // indirect - github.com/go-viper/mapstructure/v2 v2.1.0 // indirect + github.com/go-viper/mapstructure/v2 v2.2.1 // 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 diff --git a/confmap/provider/httpsprovider/go.sum b/confmap/provider/httpsprovider/go.sum index 3a051879bb3..6095cc50622 100644 --- a/confmap/provider/httpsprovider/go.sum +++ b/confmap/provider/httpsprovider/go.sum @@ -1,7 +1,7 @@ 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-viper/mapstructure/v2 v2.1.0 h1:gHnMa2Y/pIxElCH2GlZZ1lZSsn6XMtufpGyP1XxdC/w= -github.com/go-viper/mapstructure/v2 v2.1.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= 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= diff --git a/confmap/provider/yamlprovider/go.mod b/confmap/provider/yamlprovider/go.mod index f905dfec448..8c1426c0e8e 100644 --- a/confmap/provider/yamlprovider/go.mod +++ b/confmap/provider/yamlprovider/go.mod @@ -10,7 +10,7 @@ require ( require ( github.com/davecgh/go-spew v1.1.1 // indirect - github.com/go-viper/mapstructure/v2 v2.1.0 // indirect + github.com/go-viper/mapstructure/v2 v2.2.1 // 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 diff --git a/confmap/provider/yamlprovider/go.sum b/confmap/provider/yamlprovider/go.sum index 3a051879bb3..6095cc50622 100644 --- a/confmap/provider/yamlprovider/go.sum +++ b/confmap/provider/yamlprovider/go.sum @@ -1,7 +1,7 @@ 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-viper/mapstructure/v2 v2.1.0 h1:gHnMa2Y/pIxElCH2GlZZ1lZSsn6XMtufpGyP1XxdC/w= -github.com/go-viper/mapstructure/v2 v2.1.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= 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= diff --git a/connector/connectorprofiles/connector.go b/connector/connectorprofiles/connector.go index 6c2f3d7d7bf..589e3089b55 100644 --- a/connector/connectorprofiles/connector.go +++ b/connector/connectorprofiles/connector.go @@ -7,12 +7,12 @@ import ( "context" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componentprofiles" "go.opentelemetry.io/collector/connector" "go.opentelemetry.io/collector/connector/internal" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/consumer/consumerprofiles" "go.opentelemetry.io/collector/pipeline" + "go.opentelemetry.io/collector/pipeline/pipelineprofiles" ) type Factory interface { @@ -60,7 +60,7 @@ type CreateTracesToProfilesFunc func(context.Context, connector.Settings, compon // CreateTracesToProfiles implements Factory.CreateTracesToProfiles(). func (f CreateTracesToProfilesFunc) CreateTracesToProfiles(ctx context.Context, set connector.Settings, cfg component.Config, next consumerprofiles.Profiles) (connector.Traces, error) { if f == nil { - return nil, internal.ErrDataTypes(set.ID, pipeline.SignalTraces, componentprofiles.SignalProfiles) + return nil, internal.ErrDataTypes(set.ID, pipeline.SignalTraces, pipelineprofiles.SignalProfiles) } return f(ctx, set, cfg, next) } @@ -71,7 +71,7 @@ type CreateMetricsToProfilesFunc func(context.Context, connector.Settings, compo // CreateMetricsToProfiles implements Factory.CreateMetricsToProfiles(). func (f CreateMetricsToProfilesFunc) CreateMetricsToProfiles(ctx context.Context, set connector.Settings, cfg component.Config, next consumerprofiles.Profiles) (connector.Metrics, error) { if f == nil { - return nil, internal.ErrDataTypes(set.ID, pipeline.SignalMetrics, componentprofiles.SignalProfiles) + return nil, internal.ErrDataTypes(set.ID, pipeline.SignalMetrics, pipelineprofiles.SignalProfiles) } return f(ctx, set, cfg, next) } @@ -82,7 +82,7 @@ type CreateLogsToProfilesFunc func(context.Context, connector.Settings, componen // CreateLogsToProfiles implements Factory.CreateLogsToProfiles(). func (f CreateLogsToProfilesFunc) CreateLogsToProfiles(ctx context.Context, set connector.Settings, cfg component.Config, next consumerprofiles.Profiles) (connector.Logs, error) { if f == nil { - return nil, internal.ErrDataTypes(set.ID, pipeline.SignalLogs, componentprofiles.SignalProfiles) + return nil, internal.ErrDataTypes(set.ID, pipeline.SignalLogs, pipelineprofiles.SignalProfiles) } return f(ctx, set, cfg, next) } @@ -93,7 +93,7 @@ type CreateProfilesToProfilesFunc func(context.Context, connector.Settings, comp // CreateProfilesToProfiles implements Factory.CreateProfilesToProfiles(). func (f CreateProfilesToProfilesFunc) CreateProfilesToProfiles(ctx context.Context, set connector.Settings, cfg component.Config, next consumerprofiles.Profiles) (Profiles, error) { if f == nil { - return nil, internal.ErrDataTypes(set.ID, componentprofiles.SignalProfiles, componentprofiles.SignalProfiles) + return nil, internal.ErrDataTypes(set.ID, pipelineprofiles.SignalProfiles, pipelineprofiles.SignalProfiles) } return f(ctx, set, cfg, next) } @@ -104,7 +104,7 @@ type CreateProfilesToTracesFunc func(context.Context, connector.Settings, compon // CreateProfilesToTraces implements Factory.CreateProfilesToTraces(). func (f CreateProfilesToTracesFunc) CreateProfilesToTraces(ctx context.Context, set connector.Settings, cfg component.Config, next consumer.Traces) (Profiles, error) { if f == nil { - return nil, internal.ErrDataTypes(set.ID, componentprofiles.SignalProfiles, pipeline.SignalTraces) + return nil, internal.ErrDataTypes(set.ID, pipelineprofiles.SignalProfiles, pipeline.SignalTraces) } return f(ctx, set, cfg, next) } @@ -115,7 +115,7 @@ type CreateProfilesToMetricsFunc func(context.Context, connector.Settings, compo // CreateProfilesToMetrics implements Factory.CreateProfilesToMetrics(). func (f CreateProfilesToMetricsFunc) CreateProfilesToMetrics(ctx context.Context, set connector.Settings, cfg component.Config, next consumer.Metrics) (Profiles, error) { if f == nil { - return nil, internal.ErrDataTypes(set.ID, componentprofiles.SignalProfiles, pipeline.SignalMetrics) + return nil, internal.ErrDataTypes(set.ID, pipelineprofiles.SignalProfiles, pipeline.SignalMetrics) } return f(ctx, set, cfg, next) } @@ -126,7 +126,7 @@ type CreateProfilesToLogsFunc func(context.Context, connector.Settings, componen // CreateProfilesToLogs implements Factory.CreateProfilesToLogs(). func (f CreateProfilesToLogsFunc) CreateProfilesToLogs(ctx context.Context, set connector.Settings, cfg component.Config, next consumer.Logs) (Profiles, error) { if f == nil { - return nil, internal.ErrDataTypes(set.ID, componentprofiles.SignalProfiles, pipeline.SignalLogs) + return nil, internal.ErrDataTypes(set.ID, pipelineprofiles.SignalProfiles, pipeline.SignalLogs) } return f(ctx, set, cfg, next) } diff --git a/connector/connectorprofiles/connector_test.go b/connector/connectorprofiles/connector_test.go index d1435887c1e..9e351b7f468 100644 --- a/connector/connectorprofiles/connector_test.go +++ b/connector/connectorprofiles/connector_test.go @@ -11,13 +11,13 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componentprofiles" "go.opentelemetry.io/collector/connector" "go.opentelemetry.io/collector/connector/internal" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/consumer/consumerprofiles" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/pipeline" + "go.opentelemetry.io/collector/pipeline/pipelineprofiles" ) var ( @@ -32,18 +32,18 @@ func TestNewFactoryNoOptions(t *testing.T) { assert.EqualValues(t, &defaultCfg, factory.CreateDefaultConfig()) _, err := factory.CreateTracesToProfiles(context.Background(), connector.Settings{ID: testID}, &defaultCfg, consumertest.NewNop()) - assert.Equal(t, err, internal.ErrDataTypes(testID, pipeline.SignalTraces, componentprofiles.SignalProfiles)) + assert.Equal(t, err, internal.ErrDataTypes(testID, pipeline.SignalTraces, pipelineprofiles.SignalProfiles)) _, err = factory.CreateMetricsToProfiles(context.Background(), connector.Settings{ID: testID}, &defaultCfg, consumertest.NewNop()) - assert.Equal(t, err, internal.ErrDataTypes(testID, pipeline.SignalMetrics, componentprofiles.SignalProfiles)) + assert.Equal(t, err, internal.ErrDataTypes(testID, pipeline.SignalMetrics, pipelineprofiles.SignalProfiles)) _, err = factory.CreateLogsToProfiles(context.Background(), connector.Settings{ID: testID}, &defaultCfg, consumertest.NewNop()) - assert.Equal(t, err, internal.ErrDataTypes(testID, pipeline.SignalLogs, componentprofiles.SignalProfiles)) + assert.Equal(t, err, internal.ErrDataTypes(testID, pipeline.SignalLogs, pipelineprofiles.SignalProfiles)) _, err = factory.CreateProfilesToTraces(context.Background(), connector.Settings{ID: testID}, &defaultCfg, consumertest.NewNop()) - assert.Equal(t, err, internal.ErrDataTypes(testID, componentprofiles.SignalProfiles, pipeline.SignalTraces)) + assert.Equal(t, err, internal.ErrDataTypes(testID, pipelineprofiles.SignalProfiles, pipeline.SignalTraces)) _, err = factory.CreateProfilesToMetrics(context.Background(), connector.Settings{ID: testID}, &defaultCfg, consumertest.NewNop()) - assert.Equal(t, err, internal.ErrDataTypes(testID, componentprofiles.SignalProfiles, pipeline.SignalMetrics)) + assert.Equal(t, err, internal.ErrDataTypes(testID, pipelineprofiles.SignalProfiles, pipeline.SignalMetrics)) _, err = factory.CreateProfilesToLogs(context.Background(), connector.Settings{ID: testID}, &defaultCfg, consumertest.NewNop()) - assert.Equal(t, err, internal.ErrDataTypes(testID, componentprofiles.SignalProfiles, pipeline.SignalLogs)) + assert.Equal(t, err, internal.ErrDataTypes(testID, pipelineprofiles.SignalProfiles, pipeline.SignalLogs)) } func TestNewFactoryWithSameTypes(t *testing.T) { @@ -59,11 +59,11 @@ func TestNewFactoryWithSameTypes(t *testing.T) { require.NoError(t, err) _, err = factory.CreateProfilesToTraces(context.Background(), connector.Settings{ID: testID}, &defaultCfg, consumertest.NewNop()) - assert.Equal(t, err, internal.ErrDataTypes(testID, componentprofiles.SignalProfiles, pipeline.SignalTraces)) + assert.Equal(t, err, internal.ErrDataTypes(testID, pipelineprofiles.SignalProfiles, pipeline.SignalTraces)) _, err = factory.CreateProfilesToMetrics(context.Background(), connector.Settings{ID: testID}, &defaultCfg, consumertest.NewNop()) - assert.Equal(t, err, internal.ErrDataTypes(testID, componentprofiles.SignalProfiles, pipeline.SignalMetrics)) + assert.Equal(t, err, internal.ErrDataTypes(testID, pipelineprofiles.SignalProfiles, pipeline.SignalMetrics)) _, err = factory.CreateProfilesToLogs(context.Background(), connector.Settings{ID: testID}, &defaultCfg, consumertest.NewNop()) - assert.Equal(t, err, internal.ErrDataTypes(testID, componentprofiles.SignalProfiles, pipeline.SignalLogs)) + assert.Equal(t, err, internal.ErrDataTypes(testID, pipelineprofiles.SignalProfiles, pipeline.SignalLogs)) } func TestNewFactoryWithTranslateTypes(t *testing.T) { @@ -81,7 +81,7 @@ func TestNewFactoryWithTranslateTypes(t *testing.T) { assert.EqualValues(t, &defaultCfg, factory.CreateDefaultConfig()) _, err := factory.CreateProfilesToProfiles(context.Background(), connector.Settings{ID: testID}, &defaultCfg, consumertest.NewNop()) - assert.Equal(t, err, internal.ErrDataTypes(testID, componentprofiles.SignalProfiles, componentprofiles.SignalProfiles)) + assert.Equal(t, err, internal.ErrDataTypes(testID, pipelineprofiles.SignalProfiles, pipelineprofiles.SignalProfiles)) assert.Equal(t, component.StabilityLevelBeta, factory.TracesToProfilesStability()) _, err = factory.CreateTracesToProfiles(context.Background(), connector.Settings{ID: testID}, &defaultCfg, consumertest.NewNop()) diff --git a/connector/connectorprofiles/go.mod b/connector/connectorprofiles/go.mod index 7e710ad3319..1a699f44a3c 100644 --- a/connector/connectorprofiles/go.mod +++ b/connector/connectorprofiles/go.mod @@ -6,7 +6,6 @@ require ( github.com/stretchr/testify v1.9.0 go.opentelemetry.io/collector v0.111.0 go.opentelemetry.io/collector/component v0.111.0 - go.opentelemetry.io/collector/component/componentprofiles v0.111.0 go.opentelemetry.io/collector/connector v0.111.0 go.opentelemetry.io/collector/consumer v0.111.0 go.opentelemetry.io/collector/consumer/consumerprofiles v0.111.0 @@ -14,6 +13,7 @@ require ( go.opentelemetry.io/collector/pdata/pprofile v0.111.0 go.opentelemetry.io/collector/pdata/testdata v0.111.0 go.opentelemetry.io/collector/pipeline v0.111.0 + go.opentelemetry.io/collector/pipeline/pipelineprofiles v0.111.0 ) require ( @@ -26,13 +26,13 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.111.0 // indirect go.opentelemetry.io/collector/internal/globalsignal v0.111.0 // indirect go.opentelemetry.io/collector/pdata v1.17.0 // indirect - go.opentelemetry.io/otel v1.30.0 // indirect - go.opentelemetry.io/otel/metric v1.30.0 // indirect - go.opentelemetry.io/otel/trace v1.30.0 // indirect + go.opentelemetry.io/otel v1.31.0 // indirect + go.opentelemetry.io/otel/metric v1.31.0 // indirect + go.opentelemetry.io/otel/trace v1.31.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.25.0 // indirect + golang.org/x/sys v0.26.0 // indirect golang.org/x/text v0.17.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd // indirect google.golang.org/grpc v1.67.1 // indirect @@ -50,8 +50,6 @@ replace go.opentelemetry.io/collector/pdata/pprofile => ../../pdata/pprofile replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../../consumer/consumerprofiles -replace go.opentelemetry.io/collector/component/componentprofiles => ../../component/componentprofiles - replace go.opentelemetry.io/collector => ../.. replace go.opentelemetry.io/collector/confmap => ../../confmap @@ -69,3 +67,5 @@ replace go.opentelemetry.io/collector/component/componentstatus => ../../compone replace go.opentelemetry.io/collector/pipeline => ../../pipeline replace go.opentelemetry.io/collector/internal/globalsignal => ../../internal/globalsignal + +replace go.opentelemetry.io/collector/pipeline/pipelineprofiles => ../../pipeline/pipelineprofiles diff --git a/connector/connectorprofiles/go.sum b/connector/connectorprofiles/go.sum index 507c7eda1b2..664604cc0dd 100644 --- a/connector/connectorprofiles/go.sum +++ b/connector/connectorprofiles/go.sum @@ -33,12 +33,12 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 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/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/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc= -go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o= +go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= +go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= +go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= +go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= +go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= +go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= @@ -62,8 +62,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= -golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= diff --git a/connector/connectorprofiles/profiles_router_test.go b/connector/connectorprofiles/profiles_router_test.go index b28fc1a581e..1a0dd770976 100644 --- a/connector/connectorprofiles/profiles_router_test.go +++ b/connector/connectorprofiles/profiles_router_test.go @@ -18,6 +18,7 @@ import ( "go.opentelemetry.io/collector/pdata/pprofile" "go.opentelemetry.io/collector/pdata/testdata" "go.opentelemetry.io/collector/pipeline" + "go.opentelemetry.io/collector/pipeline/pipelineprofiles" ) type mutatingProfilesSink struct { @@ -50,7 +51,7 @@ func fuzzProfiles(numIDs, numCons, numProfiles int) func(*testing.T) { // If any consumer is mutating, the router must report mutating for i := 0; i < numCons; i++ { - allIDs = append(allIDs, pipeline.MustNewIDWithName("sink", strconv.Itoa(numCons))) + allIDs = append(allIDs, pipeline.NewIDWithName(pipelineprofiles.SignalProfiles, "sink_"+strconv.Itoa(numCons))) // Random chance for each consumer to be mutating if (numCons+numProfiles+i)%4 == 0 { allCons = append(allCons, &mutatingProfilesSink{ProfilesSink: new(consumertest.ProfilesSink)}) @@ -110,8 +111,8 @@ func TestProfilessRouterConsumer(t *testing.T) { ctx := context.Background() td := testdata.GenerateProfiles(1) - fooID := pipeline.MustNewID("foo") - barID := pipeline.MustNewID("bar") + fooID := pipeline.NewIDWithName(pipelineprofiles.SignalProfiles, "foo") + barID := pipeline.NewIDWithName(pipelineprofiles.SignalProfiles, "bar") foo := new(consumertest.ProfilesSink) bar := new(consumertest.ProfilesSink) @@ -152,7 +153,7 @@ func TestProfilessRouterConsumer(t *testing.T) { assert.Nil(t, none) require.Error(t, err) - fake, err := r.Consumer(pipeline.MustNewID("fake")) + fake, err := r.Consumer(pipeline.NewIDWithName(pipelineprofiles.SignalProfiles, "fake")) assert.Nil(t, fake) assert.Error(t, err) } diff --git a/connector/forwardconnector/go.mod b/connector/forwardconnector/go.mod index 8b075477969..d1aa8378784 100644 --- a/connector/forwardconnector/go.mod +++ b/connector/forwardconnector/go.mod @@ -18,7 +18,7 @@ require ( 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/go-viper/mapstructure/v2 v2.1.0 // indirect + github.com/go-viper/mapstructure/v2 v2.2.1 // indirect 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 @@ -31,21 +31,21 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect go.opentelemetry.io/collector v0.111.0 // indirect - go.opentelemetry.io/collector/component/componentprofiles v0.111.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.111.0 // indirect go.opentelemetry.io/collector/connector/connectorprofiles v0.111.0 // indirect go.opentelemetry.io/collector/consumer/consumerprofiles v0.111.0 // indirect go.opentelemetry.io/collector/internal/globalsignal v0.111.0 // indirect go.opentelemetry.io/collector/pdata/pprofile v0.111.0 // indirect - go.opentelemetry.io/otel v1.30.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 - go.opentelemetry.io/otel/trace v1.30.0 // indirect + go.opentelemetry.io/collector/pipeline/pipelineprofiles v0.111.0 // indirect + go.opentelemetry.io/otel v1.31.0 // indirect + go.opentelemetry.io/otel/metric v1.31.0 // indirect + go.opentelemetry.io/otel/sdk v1.31.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.31.0 // indirect + go.opentelemetry.io/otel/trace v1.31.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.25.0 // indirect + golang.org/x/sys v0.26.0 // indirect golang.org/x/text v0.17.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd // indirect google.golang.org/grpc v1.67.1 // indirect @@ -80,8 +80,6 @@ replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../../consume replace go.opentelemetry.io/collector/consumer/consumertest => ../../consumer/consumertest -replace go.opentelemetry.io/collector/component/componentprofiles => ../../component/componentprofiles - replace go.opentelemetry.io/collector/component/componentstatus => ../../component/componentstatus replace go.opentelemetry.io/collector/connector/connectorprofiles => ../connectorprofiles @@ -89,3 +87,5 @@ replace go.opentelemetry.io/collector/connector/connectorprofiles => ../connecto replace go.opentelemetry.io/collector/pipeline => ../../pipeline replace go.opentelemetry.io/collector/internal/globalsignal => ../../internal/globalsignal + +replace go.opentelemetry.io/collector/pipeline/pipelineprofiles => ../../pipeline/pipelineprofiles diff --git a/connector/forwardconnector/go.sum b/connector/forwardconnector/go.sum index 07338083046..eb3d52f2193 100644 --- a/connector/forwardconnector/go.sum +++ b/connector/forwardconnector/go.sum @@ -6,8 +6,8 @@ github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-viper/mapstructure/v2 v2.1.0 h1:gHnMa2Y/pIxElCH2GlZZ1lZSsn6XMtufpGyP1XxdC/w= -github.com/go-viper/mapstructure/v2 v2.1.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= @@ -48,16 +48,16 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 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/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= -go.opentelemetry.io/otel/sdk v1.30.0/go.mod h1:p14X4Ok8S+sygzblytT1nqG98QG2KYKv++HE0LY/mhg= -go.opentelemetry.io/otel/sdk/metric v1.30.0 h1:QJLT8Pe11jyHBHfSAgYH7kEmT24eX792jZO1bo4BXkM= -go.opentelemetry.io/otel/sdk/metric v1.30.0/go.mod h1:waS6P3YqFNzeP01kuo/MBBYqaoBJl7efRQHOaydhy1Y= -go.opentelemetry.io/otel/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc= -go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o= +go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= +go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= +go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= +go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= +go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= +go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= +go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc= +go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8= +go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= +go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= @@ -81,8 +81,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= -golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= diff --git a/connector/go.mod b/connector/go.mod index 84d820ae69a..e1ad96e3b0f 100644 --- a/connector/go.mod +++ b/connector/go.mod @@ -28,17 +28,17 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - go.opentelemetry.io/collector/component/componentprofiles v0.111.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.111.0 // indirect go.opentelemetry.io/collector/internal/globalsignal v0.111.0 // indirect - go.opentelemetry.io/otel v1.30.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 - go.opentelemetry.io/otel/trace v1.30.0 // indirect + go.opentelemetry.io/collector/pipeline/pipelineprofiles v0.111.0 // indirect + go.opentelemetry.io/otel v1.31.0 // indirect + go.opentelemetry.io/otel/metric v1.31.0 // indirect + go.opentelemetry.io/otel/sdk v1.31.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.31.0 // indirect + go.opentelemetry.io/otel/trace v1.31.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.25.0 // indirect + golang.org/x/sys v0.26.0 // indirect golang.org/x/text v0.17.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd // indirect google.golang.org/grpc v1.67.1 // indirect @@ -66,8 +66,6 @@ replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../consumer/c replace go.opentelemetry.io/collector/consumer/consumertest => ../consumer/consumertest -replace go.opentelemetry.io/collector/component/componentprofiles => ../component/componentprofiles - replace go.opentelemetry.io/collector/component/componentstatus => ../component/componentstatus replace go.opentelemetry.io/collector/connector/connectorprofiles => ./connectorprofiles @@ -75,3 +73,5 @@ replace go.opentelemetry.io/collector/connector/connectorprofiles => ./connector replace go.opentelemetry.io/collector/pipeline => ../pipeline replace go.opentelemetry.io/collector/internal/globalsignal => ../internal/globalsignal + +replace go.opentelemetry.io/collector/pipeline/pipelineprofiles => ../pipeline/pipelineprofiles diff --git a/connector/go.sum b/connector/go.sum index 3e984ab87df..f30393b8b58 100644 --- a/connector/go.sum +++ b/connector/go.sum @@ -36,16 +36,16 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 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/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= -go.opentelemetry.io/otel/sdk v1.30.0/go.mod h1:p14X4Ok8S+sygzblytT1nqG98QG2KYKv++HE0LY/mhg= -go.opentelemetry.io/otel/sdk/metric v1.30.0 h1:QJLT8Pe11jyHBHfSAgYH7kEmT24eX792jZO1bo4BXkM= -go.opentelemetry.io/otel/sdk/metric v1.30.0/go.mod h1:waS6P3YqFNzeP01kuo/MBBYqaoBJl7efRQHOaydhy1Y= -go.opentelemetry.io/otel/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc= -go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o= +go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= +go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= +go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= +go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= +go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= +go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= +go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc= +go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8= +go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= +go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= @@ -69,8 +69,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= -golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= diff --git a/connector/logs_router_test.go b/connector/logs_router_test.go index 591c25e6a7c..09edba76080 100644 --- a/connector/logs_router_test.go +++ b/connector/logs_router_test.go @@ -49,7 +49,7 @@ func fuzzLogs(numIDs, numCons, numLogs int) func(*testing.T) { // If any consumer is mutating, the router must report mutating for i := 0; i < numCons; i++ { - allIDs = append(allIDs, pipeline.MustNewIDWithName("sink", strconv.Itoa(numCons))) + allIDs = append(allIDs, pipeline.NewIDWithName(pipeline.SignalLogs, "sink_"+strconv.Itoa(numCons))) // Random chance for each consumer to be mutating if (numCons+numLogs+i)%4 == 0 { allCons = append(allCons, &mutatingLogsSink{LogsSink: new(consumertest.LogsSink)}) @@ -109,8 +109,8 @@ func TestLogsRouterConsumers(t *testing.T) { ctx := context.Background() ld := testdata.GenerateLogs(1) - fooID := pipeline.MustNewID("foo") - barID := pipeline.MustNewID("bar") + fooID := pipeline.NewIDWithName(pipeline.SignalLogs, "foo") + barID := pipeline.NewIDWithName(pipeline.SignalLogs, "bar") foo := new(consumertest.LogsSink) bar := new(consumertest.LogsSink) @@ -151,7 +151,7 @@ func TestLogsRouterConsumers(t *testing.T) { assert.Nil(t, none) require.Error(t, err) - fake, err := r.Consumer(pipeline.MustNewID("fake")) + fake, err := r.Consumer(pipeline.NewIDWithName(pipeline.SignalLogs, "fake")) assert.Nil(t, fake) assert.Error(t, err) } diff --git a/connector/metrics_router_test.go b/connector/metrics_router_test.go index 728174a3d41..f520691accd 100644 --- a/connector/metrics_router_test.go +++ b/connector/metrics_router_test.go @@ -49,7 +49,7 @@ func fuzzMetrics(numIDs, numCons, numMetrics int) func(*testing.T) { // If any consumer is mutating, the router must report mutating for i := 0; i < numCons; i++ { - allIDs = append(allIDs, pipeline.MustNewIDWithName("sink", strconv.Itoa(numCons))) + allIDs = append(allIDs, pipeline.NewIDWithName(pipeline.SignalMetrics, "sink_"+strconv.Itoa(numCons))) // Random chance for each consumer to be mutating if (numCons+numMetrics+i)%4 == 0 { allCons = append(allCons, &mutatingMetricsSink{MetricsSink: new(consumertest.MetricsSink)}) @@ -109,8 +109,8 @@ func TestMetricsRouterConsumers(t *testing.T) { ctx := context.Background() md := testdata.GenerateMetrics(1) - fooID := pipeline.MustNewID("foo") - barID := pipeline.MustNewID("bar") + fooID := pipeline.NewIDWithName(pipeline.SignalMetrics, "foo") + barID := pipeline.NewIDWithName(pipeline.SignalMetrics, "bar") foo := new(consumertest.MetricsSink) bar := new(consumertest.MetricsSink) @@ -151,7 +151,7 @@ func TestMetricsRouterConsumers(t *testing.T) { assert.Nil(t, none) require.Error(t, err) - fake, err := r.Consumer(pipeline.MustNewID("fake")) + fake, err := r.Consumer(pipeline.NewIDWithName(pipeline.SignalMetrics, "fake")) assert.Nil(t, fake) assert.Error(t, err) } diff --git a/connector/traces_router_test.go b/connector/traces_router_test.go index 125d159cabf..2034b306d2b 100644 --- a/connector/traces_router_test.go +++ b/connector/traces_router_test.go @@ -49,7 +49,7 @@ func fuzzTraces(numIDs, numCons, numTraces int) func(*testing.T) { // If any consumer is mutating, the router must report mutating for i := 0; i < numCons; i++ { - allIDs = append(allIDs, pipeline.MustNewIDWithName("sink", strconv.Itoa(numCons))) + allIDs = append(allIDs, pipeline.NewIDWithName(pipeline.SignalTraces, "sink_"+strconv.Itoa(numCons))) // Random chance for each consumer to be mutating if (numCons+numTraces+i)%4 == 0 { allCons = append(allCons, &mutatingTracesSink{TracesSink: new(consumertest.TracesSink)}) @@ -109,8 +109,8 @@ func TestTracesRouterConsumer(t *testing.T) { ctx := context.Background() td := testdata.GenerateTraces(1) - fooID := pipeline.MustNewID("foo") - barID := pipeline.MustNewID("bar") + fooID := pipeline.NewIDWithName(pipeline.SignalTraces, "foo") + barID := pipeline.NewIDWithName(pipeline.SignalTraces, "bar") foo := new(consumertest.TracesSink) bar := new(consumertest.TracesSink) @@ -151,7 +151,7 @@ func TestTracesRouterConsumer(t *testing.T) { assert.Nil(t, none) require.Error(t, err) - fake, err := r.Consumer(pipeline.MustNewID("fake")) + fake, err := r.Consumer(pipeline.NewIDWithName(pipeline.SignalTraces, "fake")) assert.Nil(t, fake) assert.Error(t, err) } diff --git a/consumer/consumererror/consumererrorprofiles/go.mod b/consumer/consumererror/consumererrorprofiles/go.mod index 517a94d17be..68c35440dd3 100644 --- a/consumer/consumererror/consumererrorprofiles/go.mod +++ b/consumer/consumererror/consumererrorprofiles/go.mod @@ -4,7 +4,7 @@ go 1.22.0 require ( github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector/consumer v0.109.0 + go.opentelemetry.io/collector/consumer v0.111.0 go.opentelemetry.io/collector/pdata/pprofile v0.111.0 go.opentelemetry.io/collector/pdata/testdata v0.111.0 ) diff --git a/exporter/debugexporter/go.mod b/exporter/debugexporter/go.mod index 863484872f0..c73a297f98d 100644 --- a/exporter/debugexporter/go.mod +++ b/exporter/debugexporter/go.mod @@ -22,7 +22,7 @@ require ( 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/go-viper/mapstructure/v2 v2.1.0 // indirect + github.com/go-viper/mapstructure/v2 v2.2.1 // indirect 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 @@ -44,11 +44,11 @@ require ( go.opentelemetry.io/collector/pipeline v0.111.0 // indirect go.opentelemetry.io/collector/receiver v0.111.0 // indirect go.opentelemetry.io/collector/receiver/receiverprofiles v0.111.0 // indirect - go.opentelemetry.io/otel v1.30.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 - go.opentelemetry.io/otel/trace v1.30.0 // indirect + go.opentelemetry.io/otel v1.31.0 // indirect + go.opentelemetry.io/otel/metric v1.31.0 // indirect + go.opentelemetry.io/otel/sdk v1.31.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.31.0 // indirect + go.opentelemetry.io/otel/trace v1.31.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.28.0 // indirect golang.org/x/text v0.17.0 // indirect diff --git a/exporter/debugexporter/go.sum b/exporter/debugexporter/go.sum index 59d16e28421..582e4ea6a3b 100644 --- a/exporter/debugexporter/go.sum +++ b/exporter/debugexporter/go.sum @@ -8,8 +8,8 @@ github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-viper/mapstructure/v2 v2.1.0 h1:gHnMa2Y/pIxElCH2GlZZ1lZSsn6XMtufpGyP1XxdC/w= -github.com/go-viper/mapstructure/v2 v2.1.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= @@ -50,16 +50,16 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 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/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= -go.opentelemetry.io/otel/sdk v1.30.0/go.mod h1:p14X4Ok8S+sygzblytT1nqG98QG2KYKv++HE0LY/mhg= -go.opentelemetry.io/otel/sdk/metric v1.30.0 h1:QJLT8Pe11jyHBHfSAgYH7kEmT24eX792jZO1bo4BXkM= -go.opentelemetry.io/otel/sdk/metric v1.30.0/go.mod h1:waS6P3YqFNzeP01kuo/MBBYqaoBJl7efRQHOaydhy1Y= -go.opentelemetry.io/otel/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc= -go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o= +go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= +go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= +go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= +go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= +go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= +go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= +go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc= +go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8= +go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= +go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= diff --git a/exporter/debugexporter/internal/otlptext/databuffer.go b/exporter/debugexporter/internal/otlptext/databuffer.go index 94b2f6551d4..4e73794da7a 100644 --- a/exporter/debugexporter/internal/otlptext/databuffer.go +++ b/exporter/debugexporter/internal/otlptext/databuffer.go @@ -202,9 +202,9 @@ func (b *dataBuffer) logExponentialHistogramDataPoints(ps pmetric.ExponentialHis for i := 0; i < negB.Len(); i++ { pos := negB.Len() - i - 1 - index := p.Negative().Offset() + int32(pos) - lower := math.Exp(float64(index) * factor) - upper := math.Exp(float64(index+1) * factor) + index := float64(p.Negative().Offset()) + float64(pos) + lower := math.Exp(index * factor) + upper := math.Exp((index + 1) * factor) b.logEntry("Bucket [%f, %f), Count: %d", -upper, -lower, negB.At(pos)) } @@ -213,9 +213,9 @@ func (b *dataBuffer) logExponentialHistogramDataPoints(ps pmetric.ExponentialHis } for pos := 0; pos < posB.Len(); pos++ { - index := p.Positive().Offset() + int32(pos) - lower := math.Exp(float64(index) * factor) - upper := math.Exp(float64(index+1) * factor) + index := float64(p.Positive().Offset()) + float64(pos) + lower := math.Exp(index * factor) + upper := math.Exp((index + 1) * factor) b.logEntry("Bucket (%f, %f], Count: %d", lower, upper, posB.At(pos)) } diff --git a/exporter/exporterhelper/internal/batch_sender_test.go b/exporter/exporterhelper/internal/batch_sender_test.go index c9f6cc084e2..456218fd914 100644 --- a/exporter/exporterhelper/internal/batch_sender_test.go +++ b/exporter/exporterhelper/internal/batch_sender_test.go @@ -75,7 +75,7 @@ func TestBatchSender_Merge(t *testing.T) { require.NoError(t, be.Send(context.Background(), &fakeRequest{items: 3, sink: sink, mergeErr: errors.New("merge error")})) - assert.Equal(t, uint64(1), sink.requestsCount.Load()) + assert.Equal(t, int64(1), sink.requestsCount.Load()) assert.Eventually(t, func() bool { return sink.requestsCount.Load() == 2 && sink.itemsCount.Load() == 15 }, 100*time.Millisecond, 10*time.Millisecond) @@ -89,8 +89,8 @@ func TestBatchSender_BatchExportError(t *testing.T) { tests := []struct { name string batcherOption Option - expectedRequests uint64 - expectedItems uint64 + expectedRequests int64 + expectedItems int64 }{ { name: "merge_only", @@ -131,7 +131,7 @@ func TestBatchSender_BatchExportError(t *testing.T) { // the first two requests should be blocked by the batchSender. time.Sleep(50 * time.Millisecond) - assert.Equal(t, uint64(0), sink.requestsCount.Load()) + assert.Equal(t, int64(0), sink.requestsCount.Load()) // the third request should trigger the export and cause an error. errReq := &fakeRequest{items: 20, exportErr: errors.New("transient error"), sink: sink} @@ -203,8 +203,8 @@ func TestBatchSender_Shutdown(t *testing.T) { require.NoError(t, be.Shutdown(context.Background())) // shutdown should force sending the batch - assert.Equal(t, uint64(1), sink.requestsCount.Load()) - assert.Equal(t, uint64(3), sink.itemsCount.Load()) + assert.Equal(t, int64(1), sink.requestsCount.Load()) + assert.Equal(t, int64(3), sink.itemsCount.Load()) } func TestBatchSender_Disabled(t *testing.T) { @@ -224,8 +224,8 @@ func TestBatchSender_Disabled(t *testing.T) { sink := newFakeRequestSink() // should be sent right away without splitting because batching is disabled. require.NoError(t, be.Send(context.Background(), &fakeRequest{items: 8, sink: sink})) - assert.Equal(t, uint64(1), sink.requestsCount.Load()) - assert.Equal(t, uint64(8), sink.itemsCount.Load()) + assert.Equal(t, int64(1), sink.requestsCount.Load()) + assert.Equal(t, int64(8), sink.itemsCount.Load()) } func TestBatchSender_InvalidMergeSplitFunc(t *testing.T) { @@ -270,8 +270,8 @@ func TestBatchSender_PostShutdown(t *testing.T) { // Closed batch sender should act as a pass-through to not block queue draining. sink := newFakeRequestSink() require.NoError(t, be.Send(context.Background(), &fakeRequest{items: 8, sink: sink})) - assert.Equal(t, uint64(1), sink.requestsCount.Load()) - assert.Equal(t, uint64(8), sink.itemsCount.Load()) + assert.Equal(t, int64(1), sink.requestsCount.Load()) + assert.Equal(t, int64(8), sink.itemsCount.Load()) } func TestBatchSender_ConcurrencyLimitReached(t *testing.T) { @@ -281,8 +281,8 @@ func TestBatchSender_ConcurrencyLimitReached(t *testing.T) { tests := []struct { name string batcherCfg exporterbatcher.Config - expectedRequests uint64 - expectedItems uint64 + expectedRequests int64 + expectedItems int64 }{ { name: "merge_only", @@ -318,7 +318,6 @@ func TestBatchSender_ConcurrencyLimitReached(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { qCfg := exporterqueue.NewDefaultConfig() qCfg.NumConsumers = 2 @@ -397,8 +396,8 @@ func TestBatchSender_BatchBlocking(t *testing.T) { wg.Wait() // should be sent in two batches since the batch size is 3 - assert.Equal(t, uint64(2), sink.requestsCount.Load()) - assert.Equal(t, uint64(6), sink.itemsCount.Load()) + assert.Equal(t, int64(2), sink.requestsCount.Load()) + assert.Equal(t, int64(6), sink.itemsCount.Load()) require.NoError(t, be.Shutdown(context.Background())) } @@ -433,8 +432,8 @@ func TestBatchSender_BatchCancelled(t *testing.T) { wg.Wait() // nothing should be delivered - assert.Equal(t, uint64(0), sink.requestsCount.Load()) - assert.Equal(t, uint64(0), sink.itemsCount.Load()) + assert.Equal(t, int64(0), sink.requestsCount.Load()) + assert.Equal(t, int64(0), sink.itemsCount.Load()) require.NoError(t, be.Shutdown(context.Background())) } @@ -468,8 +467,8 @@ func TestBatchSender_DrainActiveRequests(t *testing.T) { // It should take 120 milliseconds to complete. require.NoError(t, be.Shutdown(context.Background())) - assert.Equal(t, uint64(2), sink.requestsCount.Load()) - assert.Equal(t, uint64(3), sink.itemsCount.Load()) + assert.Equal(t, int64(2), sink.requestsCount.Load()) + assert.Equal(t, int64(3), sink.itemsCount.Load()) } func TestBatchSender_WithBatcherOption(t *testing.T) { @@ -654,7 +653,7 @@ func TestBatchSenderTimerResetNoConflict(t *testing.T) { // The batch should be sent either with the flush interval or by reaching the minimum items size with no conflict assert.EventuallyWithT(t, func(c *assert.CollectT) { - assert.LessOrEqual(c, uint64(1), sink.requestsCount.Load()) + assert.LessOrEqual(c, int64(1), sink.requestsCount.Load()) assert.EqualValues(c, 8, sink.itemsCount.Load()) }, 200*time.Millisecond, 10*time.Millisecond) @@ -683,7 +682,7 @@ func TestBatchSenderTimerFlush(t *testing.T) { assert.NoError(t, be.Send(context.Background(), &fakeRequest{items: 4, sink: sink})) }() assert.EventuallyWithT(t, func(c *assert.CollectT) { - assert.LessOrEqual(c, uint64(1), sink.requestsCount.Load()) + assert.LessOrEqual(c, int64(1), sink.requestsCount.Load()) assert.EqualValues(c, 8, sink.itemsCount.Load()) }, 30*time.Millisecond, 5*time.Millisecond) @@ -694,12 +693,12 @@ func TestBatchSenderTimerFlush(t *testing.T) { // Confirm that it is not flushed in 50ms time.Sleep(60 * time.Millisecond) - assert.LessOrEqual(t, uint64(1), sink.requestsCount.Load()) + assert.LessOrEqual(t, int64(1), sink.requestsCount.Load()) assert.EqualValues(t, 8, sink.itemsCount.Load()) // Confirm that it is flushed after 100ms (using 60+50=110 here to be safe) time.Sleep(50 * time.Millisecond) - assert.LessOrEqual(t, uint64(2), sink.requestsCount.Load()) + assert.LessOrEqual(t, int64(2), sink.requestsCount.Load()) assert.EqualValues(t, 12, sink.itemsCount.Load()) require.NoError(t, be.Shutdown(context.Background())) } @@ -711,3 +710,65 @@ func queueBatchExporter(t *testing.T, batchOption Option) *BaseExporter { require.NoError(t, err) return be } + +func fakeBatchMergeFunc(_ context.Context, r1 internal.Request, r2 internal.Request) (internal.Request, error) { + if r1 == nil { + return r2, nil + } + fr1 := r1.(*fakeRequest) + fr2 := r2.(*fakeRequest) + if fr2.mergeErr != nil { + return nil, fr2.mergeErr + } + return &fakeRequest{ + items: fr1.items + fr2.items, + sink: fr1.sink, + exportErr: fr2.exportErr, + delay: fr1.delay + fr2.delay, + }, nil +} + +func fakeBatchMergeSplitFunc(ctx context.Context, cfg exporterbatcher.MaxSizeConfig, r1 internal.Request, r2 internal.Request) ([]internal.Request, error) { + maxItems := cfg.MaxSizeItems + if maxItems == 0 { + r, err := fakeBatchMergeFunc(ctx, r1, r2) + return []internal.Request{r}, err + } + + if r2.(*fakeRequest).mergeErr != nil { + return nil, r2.(*fakeRequest).mergeErr + } + + fr2 := r2.(*fakeRequest) + fr2 = &fakeRequest{items: fr2.items, sink: fr2.sink, exportErr: fr2.exportErr, delay: fr2.delay} + var res []internal.Request + + // fill fr1 to maxItems if it's not nil + if r1 != nil { + fr1 := r1.(*fakeRequest) + fr1 = &fakeRequest{items: fr1.items, sink: fr1.sink, exportErr: fr1.exportErr, delay: fr1.delay} + if fr2.items <= maxItems-fr1.items { + fr1.items += fr2.items + if fr2.exportErr != nil { + fr1.exportErr = fr2.exportErr + } + return []internal.Request{fr1}, nil + } + // if split is needed, we don't propagate exportErr from fr2 to fr1 to test more cases + fr2.items -= maxItems - fr1.items + fr1.items = maxItems + res = append(res, fr1) + } + + // split fr2 to maxItems + for { + if fr2.items <= maxItems { + res = append(res, &fakeRequest{items: fr2.items, sink: fr2.sink, exportErr: fr2.exportErr, delay: fr2.delay}) + break + } + res = append(res, &fakeRequest{items: maxItems, sink: fr2.sink, exportErr: fr2.exportErr, delay: fr2.delay}) + fr2.items -= maxItems + } + + return res, nil +} diff --git a/exporter/exporterhelper/internal/request.go b/exporter/exporterhelper/internal/request.go index 266ce05c241..0ae94fcf45e 100644 --- a/exporter/exporterhelper/internal/request.go +++ b/exporter/exporterhelper/internal/request.go @@ -8,7 +8,6 @@ import ( "sync/atomic" "time" - "go.opentelemetry.io/collector/exporter/exporterbatcher" "go.opentelemetry.io/collector/exporter/internal" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" @@ -17,14 +16,14 @@ import ( ) type fakeRequestSink struct { - requestsCount *atomic.Uint64 - itemsCount *atomic.Uint64 + requestsCount *atomic.Int64 + itemsCount *atomic.Int64 } func newFakeRequestSink() *fakeRequestSink { return &fakeRequestSink{ - requestsCount: &atomic.Uint64{}, - itemsCount: &atomic.Uint64{}, + requestsCount: new(atomic.Int64), + itemsCount: new(atomic.Int64), } } @@ -47,7 +46,7 @@ func (r *fakeRequest) Export(ctx context.Context) error { } if r.sink != nil { r.sink.requestsCount.Add(1) - r.sink.itemsCount.Add(uint64(r.items)) + r.sink.itemsCount.Add(int64(r.items)) } return nil } @@ -56,68 +55,6 @@ func (r *fakeRequest) ItemsCount() int { return r.items } -func fakeBatchMergeFunc(_ context.Context, r1 internal.Request, r2 internal.Request) (internal.Request, error) { - if r1 == nil { - return r2, nil - } - fr1 := r1.(*fakeRequest) - fr2 := r2.(*fakeRequest) - if fr2.mergeErr != nil { - return nil, fr2.mergeErr - } - return &fakeRequest{ - items: fr1.items + fr2.items, - sink: fr1.sink, - exportErr: fr2.exportErr, - delay: fr1.delay + fr2.delay, - }, nil -} - -func fakeBatchMergeSplitFunc(ctx context.Context, cfg exporterbatcher.MaxSizeConfig, r1 internal.Request, r2 internal.Request) ([]internal.Request, error) { - maxItems := cfg.MaxSizeItems - if maxItems == 0 { - r, err := fakeBatchMergeFunc(ctx, r1, r2) - return []internal.Request{r}, err - } - - if r2.(*fakeRequest).mergeErr != nil { - return nil, r2.(*fakeRequest).mergeErr - } - - fr2 := r2.(*fakeRequest) - fr2 = &fakeRequest{items: fr2.items, sink: fr2.sink, exportErr: fr2.exportErr, delay: fr2.delay} - var res []internal.Request - - // fill fr1 to maxItems if it's not nil - if r1 != nil { - fr1 := r1.(*fakeRequest) - fr1 = &fakeRequest{items: fr1.items, sink: fr1.sink, exportErr: fr1.exportErr, delay: fr1.delay} - if fr2.items <= maxItems-fr1.items { - fr1.items += fr2.items - if fr2.exportErr != nil { - fr1.exportErr = fr2.exportErr - } - return []internal.Request{fr1}, nil - } - // if split is needed, we don't propagate exportErr from fr2 to fr1 to test more cases - fr2.items -= maxItems - fr1.items - fr1.items = maxItems - res = append(res, fr1) - } - - // split fr2 to maxItems - for { - if fr2.items <= maxItems { - res = append(res, &fakeRequest{items: fr2.items, sink: fr2.sink, exportErr: fr2.exportErr, delay: fr2.delay}) - break - } - res = append(res, &fakeRequest{items: maxItems, sink: fr2.sink, exportErr: fr2.exportErr, delay: fr2.delay}) - fr2.items -= maxItems - } - - return res, nil -} - type FakeRequestConverter struct { MetricsError error TracesError error diff --git a/exporter/exporterprofiles/go.mod b/exporter/exporterprofiles/go.mod index 0a983579d8a..defeb2e37c7 100644 --- a/exporter/exporterprofiles/go.mod +++ b/exporter/exporterprofiles/go.mod @@ -23,9 +23,9 @@ require ( go.opentelemetry.io/collector/internal/globalsignal v0.111.0 // indirect go.opentelemetry.io/collector/pdata v1.17.0 // indirect go.opentelemetry.io/collector/pdata/pprofile v0.111.0 // indirect - go.opentelemetry.io/otel v1.30.0 // indirect - go.opentelemetry.io/otel/metric v1.30.0 // indirect - go.opentelemetry.io/otel/trace v1.30.0 // indirect + go.opentelemetry.io/otel v1.31.0 // indirect + go.opentelemetry.io/otel/metric v1.31.0 // indirect + go.opentelemetry.io/otel/trace v1.31.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.28.0 // indirect diff --git a/exporter/exporterprofiles/go.sum b/exporter/exporterprofiles/go.sum index 51859206f7d..a151885f5c4 100644 --- a/exporter/exporterprofiles/go.sum +++ b/exporter/exporterprofiles/go.sum @@ -33,12 +33,12 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 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/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/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc= -go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o= +go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= +go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= +go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= +go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= +go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= +go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= diff --git a/exporter/go.mod b/exporter/go.mod index 94e5f2f0a22..144d567f37a 100644 --- a/exporter/go.mod +++ b/exporter/go.mod @@ -19,11 +19,11 @@ require ( go.opentelemetry.io/collector/pdata/testdata v0.111.0 go.opentelemetry.io/collector/pipeline v0.111.0 go.opentelemetry.io/collector/receiver v0.111.0 - go.opentelemetry.io/otel v1.30.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 - go.opentelemetry.io/otel/trace v1.30.0 + go.opentelemetry.io/otel v1.31.0 + go.opentelemetry.io/otel/metric v1.31.0 + go.opentelemetry.io/otel/sdk v1.31.0 + go.opentelemetry.io/otel/sdk/metric v1.31.0 + go.opentelemetry.io/otel/trace v1.31.0 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.27.0 diff --git a/exporter/go.sum b/exporter/go.sum index d80e0bf98fa..fe17027b364 100644 --- a/exporter/go.sum +++ b/exporter/go.sum @@ -38,16 +38,16 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 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/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= -go.opentelemetry.io/otel/sdk v1.30.0/go.mod h1:p14X4Ok8S+sygzblytT1nqG98QG2KYKv++HE0LY/mhg= -go.opentelemetry.io/otel/sdk/metric v1.30.0 h1:QJLT8Pe11jyHBHfSAgYH7kEmT24eX792jZO1bo4BXkM= -go.opentelemetry.io/otel/sdk/metric v1.30.0/go.mod h1:waS6P3YqFNzeP01kuo/MBBYqaoBJl7efRQHOaydhy1Y= -go.opentelemetry.io/otel/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc= -go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o= +go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= +go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= +go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= +go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= +go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= +go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= +go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc= +go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8= +go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= +go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= diff --git a/exporter/internal/queue/bounded_memory_queue.go b/exporter/internal/queue/bounded_memory_queue.go index ae62704ff5b..43b6baf7d02 100644 --- a/exporter/internal/queue/bounded_memory_queue.go +++ b/exporter/internal/queue/bounded_memory_queue.go @@ -40,17 +40,9 @@ func (q *boundedMemoryQueue[T]) Offer(ctx context.Context, req T) error { return q.sizedChannel.push(memQueueEl[T]{ctx: ctx, req: req}, q.sizer.Sizeof(req), nil) } -// Consume applies the provided function on the head of queue. -// The call blocks until there is an item available or the queue is stopped. -// The function returns true when an item is consumed or false if the queue is stopped and emptied. -func (q *boundedMemoryQueue[T]) Consume(consumeFunc func(context.Context, T) error) bool { +func (q *boundedMemoryQueue[T]) Read(_ context.Context) (uint64, context.Context, T, bool) { item, ok := q.sizedChannel.pop(func(el memQueueEl[T]) int64 { return q.sizer.Sizeof(el.req) }) - if !ok { - return false - } - // the memory queue doesn't handle consume errors - _ = consumeFunc(item.ctx, item.req) - return true + return 0, item.ctx, item.req, ok } // Should be called to remove the item of the given index from the queue once processing is finished. diff --git a/exporter/internal/queue/bounded_memory_queue_test.go b/exporter/internal/queue/bounded_memory_queue_test.go index 3884a50cc84..4ffbf0c9738 100644 --- a/exporter/internal/queue/bounded_memory_queue_test.go +++ b/exporter/internal/queue/bounded_memory_queue_test.go @@ -26,7 +26,7 @@ func TestBoundedQueue(t *testing.T) { require.NoError(t, q.Offer(context.Background(), "a")) numConsumed := 0 - assert.True(t, q.Consume(func(_ context.Context, item string) error { + assert.True(t, consume(q, func(_ context.Context, item string) error { assert.Equal(t, "a", item) numConsumed++ return nil @@ -42,7 +42,7 @@ func TestBoundedQueue(t *testing.T) { require.ErrorIs(t, q.Offer(context.Background(), "c"), ErrQueueIsFull) assert.Equal(t, 1, q.Size()) - assert.True(t, q.Consume(func(_ context.Context, item string) error { + assert.True(t, consume(q, func(_ context.Context, item string) error { assert.Equal(t, "b", item) numConsumed++ return nil @@ -51,7 +51,7 @@ func TestBoundedQueue(t *testing.T) { for _, toAddItem := range []string{"d", "e", "f"} { require.NoError(t, q.Offer(context.Background(), toAddItem)) - assert.True(t, q.Consume(func(_ context.Context, item string) error { + assert.True(t, consume(q, func(_ context.Context, item string) error { assert.Equal(t, toAddItem, item) numConsumed++ return nil @@ -59,7 +59,7 @@ func TestBoundedQueue(t *testing.T) { } assert.Equal(t, 5, numConsumed) require.NoError(t, q.Shutdown(context.Background())) - assert.False(t, q.Consume(func(_ context.Context, item string) error { + assert.False(t, consume(q, func(_ context.Context, item string) error { panic(item) })) } @@ -82,7 +82,7 @@ func TestShutdownWhileNotEmpty(t *testing.T) { assert.Equal(t, 10, q.Size()) numConsumed := 0 for i := 0; i < 10; i++ { - assert.True(t, q.Consume(func(_ context.Context, item string) error { + assert.True(t, consume(q, func(_ context.Context, item string) error { assert.Equal(t, strconv.FormatInt(int64(i), 10), item) numConsumed++ return nil @@ -91,7 +91,7 @@ func TestShutdownWhileNotEmpty(t *testing.T) { assert.Equal(t, 10, numConsumed) assert.Equal(t, 0, q.Size()) - assert.False(t, q.Consume(func(_ context.Context, item string) error { + assert.False(t, consume(q, func(_ context.Context, item string) error { panic(item) })) } diff --git a/exporter/internal/queue/consumers.go b/exporter/internal/queue/consumers.go index 7c57fea9620..8eab2db6bbe 100644 --- a/exporter/internal/queue/consumers.go +++ b/exporter/internal/queue/consumers.go @@ -40,9 +40,12 @@ func (qc *Consumers[T]) Start(ctx context.Context, host component.Host) error { startWG.Done() defer qc.stopWG.Done() for { - if !qc.queue.Consume(qc.consumeFunc) { + index, ctx, req, ok := qc.queue.Read(context.Background()) + if !ok { return } + consumeErr := qc.consumeFunc(ctx, req) + qc.queue.OnProcessingFinished(index, consumeErr) } }() } diff --git a/exporter/internal/queue/persistent_queue.go b/exporter/internal/queue/persistent_queue.go index 31133b4b2d6..e7637332ff8 100644 --- a/exporter/internal/queue/persistent_queue.go +++ b/exporter/internal/queue/persistent_queue.go @@ -166,6 +166,7 @@ func (pq *persistentQueue[T]) initPersistentContiguousStorage(ctx context.Contex initEls = make([]permanentQueueEl, initIndexSize) } + // nolint: gosec pq.sizedChannel = newSizedChannel[permanentQueueEl](pq.set.Capacity, initEls, int64(initQueueSize)) } @@ -189,37 +190,6 @@ func (pq *persistentQueue[T]) restoreQueueSizeFromStorage(ctx context.Context) ( return bytesToItemIndex(val) } -// Consume applies the provided function on the head of queue. -// The call blocks until there is an item available or the queue is stopped. -// The function returns true when an item is consumed or false if the queue is stopped. -func (pq *persistentQueue[T]) Consume(consumeFunc func(context.Context, T) error) bool { - for { - var ( - index uint64 - req T - consumed bool - ) - - // If we are stopped we still process all the other events in the channel before, but we - // return fast in the `getNextItem`, so we will free the channel fast and get to the stop. - _, ok := pq.sizedChannel.pop(func(permanentQueueEl) int64 { - index, req, consumed = pq.getNextItem(context.Background()) - if !consumed { - return 0 - } - return pq.set.Sizer.Sizeof(req) - }) - if !ok { - return false - } - if consumed { - consumeErr := consumeFunc(context.Background(), req) - pq.OnProcessingFinished(index, consumeErr) - return true - } - } -} - func (pq *persistentQueue[T]) Shutdown(ctx context.Context) error { // If the queue is not initialized, there is nothing to shut down. if pq.client == nil { @@ -244,6 +214,7 @@ func (pq *persistentQueue[T]) backupQueueSize(ctx context.Context) error { return nil } + // nolint: gosec return pq.client.Set(ctx, queueSizeKey, itemIndexToBytes(uint64(pq.Size()))) } @@ -304,6 +275,33 @@ func (pq *persistentQueue[T]) putInternal(ctx context.Context, req T) error { return nil } +func (pq *persistentQueue[T]) Read(ctx context.Context) (uint64, context.Context, T, bool) { + for { + var ( + index uint64 + req T + consumed bool + ) + _, ok := pq.sizedChannel.pop(func(permanentQueueEl) int64 { + size := int64(0) + index, req, consumed = pq.getNextItem(ctx) + if consumed { + size = pq.set.Sizer.Sizeof(req) + } + return size + }) + if !ok { + return 0, nil, req, false + } + if consumed { + return index, context.TODO(), req, true + } + + // If ok && !consumed, it means we are stopped. In this case, we still process all the other events + // in the channel before, so we will free the channel fast and get to the stop. + } +} + // getNextItem pulls the next available item from the persistent storage along with its index. Once processing is // finished, the index should be called with OnProcessingFinished to clean up the storage. If no new item is available, // returns false. @@ -528,6 +526,7 @@ func bytesToItemIndex(buf []byte) (uint64, error) { func itemIndexArrayToBytes(arr []uint64) []byte { size := len(arr) buf := make([]byte, 0, 4+size*8) + // nolint: gosec buf = binary.LittleEndian.AppendUint32(buf, uint32(size)) for _, item := range arr { buf = binary.LittleEndian.AppendUint64(buf, item) diff --git a/exporter/internal/queue/persistent_queue_test.go b/exporter/internal/queue/persistent_queue_test.go index b5a7cfa3d86..6890f25037f 100644 --- a/exporter/internal/queue/persistent_queue_test.go +++ b/exporter/internal/queue/persistent_queue_test.go @@ -327,7 +327,7 @@ func TestInvalidStorageExtensionType(t *testing.T) { factory := extensiontest.NewNopFactory() extConfig := factory.CreateDefaultConfig() settings := extensiontest.NewNopSettings() - extension, err := factory.CreateExtension(context.Background(), settings, extConfig) + extension, err := factory.Create(context.Background(), settings, extConfig) require.NoError(t, err) var extensions = map[component.ID]component.Component{ storageID: extension, @@ -413,7 +413,7 @@ func TestPersistentQueue_CorruptedData(t *testing.T) { require.NoError(t, err) } assert.Equal(t, 3, ps.Size()) - require.True(t, ps.Consume(func(context.Context, tracesRequest) error { + require.True(t, consume(ps, func(context.Context, tracesRequest) error { return experr.NewShutdownErr(nil) })) assert.Equal(t, 2, ps.Size()) @@ -486,7 +486,7 @@ func TestPersistentQueue_CurrentlyProcessedItems(t *testing.T) { // We should be able to pull all remaining items now for i := 0; i < 4; i++ { - newPs.Consume(func(_ context.Context, traces tracesRequest) error { + consume(newPs, func(_ context.Context, traces tracesRequest) error { assert.Equal(t, req, traces) return nil }) @@ -499,8 +499,8 @@ func TestPersistentQueue_CurrentlyProcessedItems(t *testing.T) { require.EqualValues(t, 6, newPs.writeIndex) // There should be no items left in the storage - for i := 0; i < int(newPs.writeIndex); i++ { - bb, err := newPs.client.Get(context.Background(), getItemKey(uint64(i))) + for i := uint64(0); i < newPs.writeIndex; i++ { + bb, err := newPs.client.Get(context.Background(), getItemKey(i)) require.NoError(t, err) require.Nil(t, bb) } @@ -520,7 +520,7 @@ func TestPersistentQueueStartWithNonDispatched(t *testing.T) { require.NoError(t, err) } - require.True(t, ps.Consume(func(context.Context, tracesRequest) error { + require.True(t, consume(ps, func(context.Context, tracesRequest) error { // put one more item in require.NoError(t, ps.Offer(context.Background(), req)) require.Equal(t, 5, ps.Size()) @@ -564,7 +564,7 @@ func TestPersistentQueueStartWithNonDispatchedConcurrent(t *testing.T) { go func() { defer conWg.Done() for i := 0; i < 10; i++ { - assert.True(t, pq.Consume(func(context.Context, tracesRequest) error { return nil })) + assert.True(t, consume(pq, func(context.Context, tracesRequest) error { return nil })) } }() } @@ -615,13 +615,13 @@ func TestPersistentQueue_PutCloseReadClose(t *testing.T) { require.Equal(t, 2, newPs.Size()) // Let's read both of the elements we put - newPs.Consume(func(_ context.Context, traces tracesRequest) error { + consume(newPs, func(_ context.Context, traces tracesRequest) error { require.Equal(t, req, traces) return nil }) assert.Equal(t, 1, newPs.Size()) - newPs.Consume(func(_ context.Context, traces tracesRequest) error { + consume(newPs, func(_ context.Context, traces tracesRequest) error { require.Equal(t, req, traces) return nil }) @@ -663,7 +663,7 @@ func BenchmarkPersistentQueue_TraceSpans(b *testing.B) { } for i := 0; i < bb.N; i++ { - require.True(bb, ps.Consume(func(context.Context, tracesRequest) error { return nil })) + require.True(bb, consume(ps, func(context.Context, tracesRequest) error { return nil })) } require.NoError(b, ext.Shutdown(context.Background())) }) @@ -781,7 +781,7 @@ func TestPersistentQueue_StorageFull(t *testing.T) { // Subsequent items succeed, as deleting the first item frees enough space for the state update reqCount-- for i := reqCount; i > 0; i-- { - require.True(t, ps.Consume(func(context.Context, tracesRequest) error { return nil })) + require.True(t, consume(ps, func(context.Context, tracesRequest) error { return nil })) } // We should be able to put a new item in @@ -856,7 +856,7 @@ func TestPersistentQueue_ItemsCapacityUsageRestoredOnShutdown(t *testing.T) { require.ErrorIs(t, pq.Offer(context.Background(), newTracesRequest(5, 5)), ErrQueueIsFull) assert.Equal(t, 100, pq.Size()) - assert.True(t, pq.Consume(func(_ context.Context, traces tracesRequest) error { + assert.True(t, consume(pq, func(_ context.Context, traces tracesRequest) error { assert.Equal(t, 40, traces.traces.SpanCount()) return nil })) @@ -874,13 +874,13 @@ func TestPersistentQueue_ItemsCapacityUsageRestoredOnShutdown(t *testing.T) { // Check the combined queue size. assert.Equal(t, 70, newPQ.Size()) - assert.True(t, newPQ.Consume(func(_ context.Context, traces tracesRequest) error { + assert.True(t, consume(newPQ, func(_ context.Context, traces tracesRequest) error { assert.Equal(t, 40, traces.traces.SpanCount()) return nil })) assert.Equal(t, 30, newPQ.Size()) - assert.True(t, newPQ.Consume(func(_ context.Context, traces tracesRequest) error { + assert.True(t, consume(newPQ, func(_ context.Context, traces tracesRequest) error { assert.Equal(t, 20, traces.traces.SpanCount()) return nil })) @@ -901,7 +901,7 @@ func TestPersistentQueue_ItemsCapacityUsageIsNotPreserved(t *testing.T) { assert.NoError(t, pq.Offer(context.Background(), newTracesRequest(5, 5))) assert.Equal(t, 3, pq.Size()) - assert.True(t, pq.Consume(func(_ context.Context, traces tracesRequest) error { + assert.True(t, consume(pq, func(_ context.Context, traces tracesRequest) error { assert.Equal(t, 40, traces.traces.SpanCount()) return nil })) @@ -920,14 +920,14 @@ func TestPersistentQueue_ItemsCapacityUsageIsNotPreserved(t *testing.T) { assert.Equal(t, 12, newPQ.Size()) // Consuming a restored request should reduce the restored size by 20 but it should not go to below zero - assert.True(t, newPQ.Consume(func(_ context.Context, traces tracesRequest) error { + assert.True(t, consume(newPQ, func(_ context.Context, traces tracesRequest) error { assert.Equal(t, 20, traces.traces.SpanCount()) return nil })) assert.Equal(t, 0, newPQ.Size()) // Consuming another restored request should not affect the restored size since it's already dropped to 0. - assert.True(t, newPQ.Consume(func(_ context.Context, traces tracesRequest) error { + assert.True(t, consume(newPQ, func(_ context.Context, traces tracesRequest) error { assert.Equal(t, 25, traces.traces.SpanCount()) return nil })) @@ -937,7 +937,7 @@ func TestPersistentQueue_ItemsCapacityUsageIsNotPreserved(t *testing.T) { require.NoError(t, newPQ.Offer(context.Background(), newTracesRequest(5, 5))) assert.Equal(t, 25, newPQ.Size()) - assert.True(t, newPQ.Consume(func(_ context.Context, traces tracesRequest) error { + assert.True(t, consume(newPQ, func(_ context.Context, traces tracesRequest) error { assert.Equal(t, 10, traces.traces.SpanCount()) return nil })) @@ -961,7 +961,7 @@ func TestPersistentQueue_RequestCapacityLessAfterRestart(t *testing.T) { // Read the first request just to populate the read index in the storage. // Otherwise, the write index won't be restored either. - assert.True(t, pq.Consume(func(_ context.Context, traces tracesRequest) error { + assert.True(t, consume(pq, func(_ context.Context, traces tracesRequest) error { assert.Equal(t, 40, traces.traces.SpanCount()) return nil })) @@ -979,7 +979,7 @@ func TestPersistentQueue_RequestCapacityLessAfterRestart(t *testing.T) { // Queue is full require.Error(t, newPQ.Offer(context.Background(), newTracesRequest(2, 5))) - assert.True(t, newPQ.Consume(func(_ context.Context, traces tracesRequest) error { + assert.True(t, consume(newPQ, func(_ context.Context, traces tracesRequest) error { assert.Equal(t, 20, traces.traces.SpanCount()) return nil })) @@ -988,7 +988,7 @@ func TestPersistentQueue_RequestCapacityLessAfterRestart(t *testing.T) { // Still full require.Error(t, newPQ.Offer(context.Background(), newTracesRequest(2, 5))) - assert.True(t, newPQ.Consume(func(_ context.Context, traces tracesRequest) error { + assert.True(t, consume(newPQ, func(_ context.Context, traces tracesRequest) error { assert.Equal(t, 25, traces.traces.SpanCount()) return nil })) @@ -1015,7 +1015,7 @@ func TestPersistentQueue_RestoredUsedSizeIsCorrectedOnDrain(t *testing.T) { // Consume 30 items for i := 0; i < 3; i++ { - assert.True(t, pq.Consume(func(context.Context, tracesRequest) error { return nil })) + assert.True(t, consume(pq, func(context.Context, tracesRequest) error { return nil })) } // The used size is now 30, but the snapshot should have 50, because it's taken every 5 read/writes. assert.Equal(t, 30, pq.Size()) @@ -1027,12 +1027,12 @@ func TestPersistentQueue_RestoredUsedSizeIsCorrectedOnDrain(t *testing.T) { // In reality the size should be 30. Once the queue is drained, it will be updated to the correct size. assert.Equal(t, 50, newPQ.Size()) - assert.True(t, newPQ.Consume(func(context.Context, tracesRequest) error { return nil })) - assert.True(t, newPQ.Consume(func(context.Context, tracesRequest) error { return nil })) + assert.True(t, consume(newPQ, func(context.Context, tracesRequest) error { return nil })) + assert.True(t, consume(newPQ, func(context.Context, tracesRequest) error { return nil })) assert.Equal(t, 30, newPQ.Size()) // Now the size must be correctly reflected - assert.True(t, newPQ.Consume(func(context.Context, tracesRequest) error { return nil })) + assert.True(t, consume(newPQ, func(context.Context, tracesRequest) error { return nil })) assert.Equal(t, 0, newPQ.Size()) assert.NoError(t, newPQ.Shutdown(context.Background())) diff --git a/exporter/internal/queue/queue.go b/exporter/internal/queue/queue.go index 54e8346a575..ee79408361a 100644 --- a/exporter/internal/queue/queue.go +++ b/exporter/internal/queue/queue.go @@ -25,14 +25,15 @@ type Queue[T any] interface { // without violating capacity restrictions. If success returns no error. // It returns ErrQueueIsFull if no space is currently available. Offer(ctx context.Context, item T) error - // Consume applies the provided function on the head of queue. - // The call blocks until there is an item available or the queue is stopped. - // The function returns true when an item is consumed or false if the queue is stopped. - Consume(func(ctx context.Context, item T) error) bool // Size returns the current Size of the queue Size() int // Capacity returns the capacity of the queue. Capacity() int + // Read pulls the next available item from the queue along with its index. Once processing is + // finished, the index should be called with OnProcessingFinished to clean up the storage. + // The function blocks until an item is available or if the queue is stopped. + // Returns false if reading failed or if the queue is stopped. + Read(context.Context) (uint64, context.Context, T, bool) // Should be called to remove the item of the given index from the queue once processing is finished. OnProcessingFinished(index uint64, consumeErr error) } diff --git a/exporter/internal/queue/queue_test.go b/exporter/internal/queue/queue_test.go new file mode 100644 index 00000000000..88276a82db9 --- /dev/null +++ b/exporter/internal/queue/queue_test.go @@ -0,0 +1,18 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package queue + +import ( + "context" +) + +func consume[T any](q Queue[T], consumeFunc func(context.Context, T) error) bool { + index, ctx, req, ok := q.Read(context.Background()) + if !ok { + return false + } + consumeErr := consumeFunc(ctx, req) + q.OnProcessingFinished(index, consumeErr) + return true +} diff --git a/exporter/nopexporter/go.mod b/exporter/nopexporter/go.mod index 3d02f4d993f..21b1a33f110 100644 --- a/exporter/nopexporter/go.mod +++ b/exporter/nopexporter/go.mod @@ -16,7 +16,7 @@ require ( 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/go-viper/mapstructure/v2 v2.1.0 // indirect + github.com/go-viper/mapstructure/v2 v2.2.1 // indirect 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 @@ -37,11 +37,11 @@ require ( go.opentelemetry.io/collector/pipeline v0.111.0 // indirect go.opentelemetry.io/collector/receiver v0.111.0 // indirect go.opentelemetry.io/collector/receiver/receiverprofiles v0.111.0 // indirect - go.opentelemetry.io/otel v1.30.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 - go.opentelemetry.io/otel/trace v1.30.0 // indirect + go.opentelemetry.io/otel v1.31.0 // indirect + go.opentelemetry.io/otel/metric v1.31.0 // indirect + go.opentelemetry.io/otel/sdk v1.31.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.31.0 // indirect + go.opentelemetry.io/otel/trace v1.31.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.28.0 // indirect diff --git a/exporter/nopexporter/go.sum b/exporter/nopexporter/go.sum index 59d16e28421..582e4ea6a3b 100644 --- a/exporter/nopexporter/go.sum +++ b/exporter/nopexporter/go.sum @@ -8,8 +8,8 @@ github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-viper/mapstructure/v2 v2.1.0 h1:gHnMa2Y/pIxElCH2GlZZ1lZSsn6XMtufpGyP1XxdC/w= -github.com/go-viper/mapstructure/v2 v2.1.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= @@ -50,16 +50,16 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 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/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= -go.opentelemetry.io/otel/sdk v1.30.0/go.mod h1:p14X4Ok8S+sygzblytT1nqG98QG2KYKv++HE0LY/mhg= -go.opentelemetry.io/otel/sdk/metric v1.30.0 h1:QJLT8Pe11jyHBHfSAgYH7kEmT24eX792jZO1bo4BXkM= -go.opentelemetry.io/otel/sdk/metric v1.30.0/go.mod h1:waS6P3YqFNzeP01kuo/MBBYqaoBJl7efRQHOaydhy1Y= -go.opentelemetry.io/otel/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc= -go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o= +go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= +go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= +go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= +go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= +go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= +go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= +go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc= +go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8= +go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= +go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= diff --git a/exporter/otlpexporter/go.mod b/exporter/otlpexporter/go.mod index 335119cb031..e5cefcbcb40 100644 --- a/exporter/otlpexporter/go.mod +++ b/exporter/otlpexporter/go.mod @@ -30,7 +30,7 @@ require ( github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/go-viper/mapstructure/v2 v2.1.0 // indirect + github.com/go-viper/mapstructure/v2 v2.2.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/uuid v1.6.0 // indirect @@ -61,11 +61,11 @@ require ( go.opentelemetry.io/collector/receiver v0.111.0 // indirect go.opentelemetry.io/collector/receiver/receiverprofiles v0.111.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.55.0 // indirect - go.opentelemetry.io/otel v1.30.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 - go.opentelemetry.io/otel/trace v1.30.0 // indirect + go.opentelemetry.io/otel v1.31.0 // indirect + go.opentelemetry.io/otel/metric v1.31.0 // indirect + go.opentelemetry.io/otel/sdk v1.31.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.31.0 // indirect + go.opentelemetry.io/otel/trace v1.31.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.29.0 // indirect golang.org/x/sys v0.26.0 // indirect diff --git a/exporter/otlpexporter/go.sum b/exporter/otlpexporter/go.sum index c61d1113f76..57011c88c0d 100644 --- a/exporter/otlpexporter/go.sum +++ b/exporter/otlpexporter/go.sum @@ -10,8 +10,8 @@ github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-viper/mapstructure/v2 v2.1.0 h1:gHnMa2Y/pIxElCH2GlZZ1lZSsn6XMtufpGyP1XxdC/w= -github.com/go-viper/mapstructure/v2 v2.1.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= @@ -60,16 +60,16 @@ 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/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.55.0 h1:hCq2hNMwsegUvPzI7sPOvtO9cqyy5GbWt/Ybp2xrx8Q= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.55.0/go.mod h1:LqaApwGx/oUmzsbqxkzuBvyoPpkxk3JQWnqfVrJ3wCA= -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/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= -go.opentelemetry.io/otel/sdk v1.30.0/go.mod h1:p14X4Ok8S+sygzblytT1nqG98QG2KYKv++HE0LY/mhg= -go.opentelemetry.io/otel/sdk/metric v1.30.0 h1:QJLT8Pe11jyHBHfSAgYH7kEmT24eX792jZO1bo4BXkM= -go.opentelemetry.io/otel/sdk/metric v1.30.0/go.mod h1:waS6P3YqFNzeP01kuo/MBBYqaoBJl7efRQHOaydhy1Y= -go.opentelemetry.io/otel/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc= -go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o= +go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= +go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= +go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= +go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= +go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= +go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= +go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc= +go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8= +go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= +go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= diff --git a/exporter/otlpexporter/otlp_test.go b/exporter/otlpexporter/otlp_test.go index 5dae9ded0f4..9f31c900973 100644 --- a/exporter/otlpexporter/otlp_test.go +++ b/exporter/otlpexporter/otlp_test.go @@ -42,8 +42,8 @@ import ( type mockReceiver struct { srv *grpc.Server - requestCount *atomic.Int32 - totalItems *atomic.Int32 + requestCount *atomic.Int64 + totalItems *atomic.Int64 mux sync.Mutex metadata metadata.MD exportError error @@ -69,9 +69,9 @@ type mockTracesReceiver struct { } func (r *mockTracesReceiver) Export(ctx context.Context, req ptraceotlp.ExportRequest) (ptraceotlp.ExportResponse, error) { - r.requestCount.Add(int32(1)) + r.requestCount.Add(1) td := req.Traces() - r.totalItems.Add(int32(td.SpanCount())) + r.totalItems.Add(int64(td.SpanCount())) r.mux.Lock() defer r.mux.Unlock() r.lastRequest = td @@ -110,8 +110,8 @@ func otlpTracesReceiverOnGRPCServer(ln net.Listener, useTLS bool) (*mockTracesRe rcv := &mockTracesReceiver{ mockReceiver: mockReceiver{ srv: grpc.NewServer(sopts...), - requestCount: &atomic.Int32{}, - totalItems: &atomic.Int32{}, + requestCount: new(atomic.Int64), + totalItems: new(atomic.Int64), }, exportResponse: ptraceotlp.NewExportResponse, } @@ -133,9 +133,9 @@ type mockLogsReceiver struct { } func (r *mockLogsReceiver) Export(ctx context.Context, req plogotlp.ExportRequest) (plogotlp.ExportResponse, error) { - r.requestCount.Add(int32(1)) + r.requestCount.Add(1) ld := req.Logs() - r.totalItems.Add(int32(ld.LogRecordCount())) + r.totalItems.Add(int64(ld.LogRecordCount())) r.mux.Lock() defer r.mux.Unlock() r.lastRequest = ld @@ -159,8 +159,8 @@ func otlpLogsReceiverOnGRPCServer(ln net.Listener) *mockLogsReceiver { rcv := &mockLogsReceiver{ mockReceiver: mockReceiver{ srv: grpc.NewServer(), - requestCount: &atomic.Int32{}, - totalItems: &atomic.Int32{}, + requestCount: new(atomic.Int64), + totalItems: new(atomic.Int64), }, exportResponse: plogotlp.NewExportResponse, } @@ -183,8 +183,8 @@ type mockMetricsReceiver struct { func (r *mockMetricsReceiver) Export(ctx context.Context, req pmetricotlp.ExportRequest) (pmetricotlp.ExportResponse, error) { md := req.Metrics() - r.requestCount.Add(int32(1)) - r.totalItems.Add(int32(md.DataPointCount())) + r.requestCount.Add(1) + r.totalItems.Add(int64(md.DataPointCount())) r.mux.Lock() defer r.mux.Unlock() r.lastRequest = md @@ -208,8 +208,8 @@ func otlpMetricsReceiverOnGRPCServer(ln net.Listener) *mockMetricsReceiver { rcv := &mockMetricsReceiver{ mockReceiver: mockReceiver{ srv: grpc.NewServer(), - requestCount: &atomic.Int32{}, - totalItems: &atomic.Int32{}, + requestCount: new(atomic.Int64), + totalItems: new(atomic.Int64), }, exportResponse: pmetricotlp.NewExportResponse, } diff --git a/exporter/otlphttpexporter/go.mod b/exporter/otlphttpexporter/go.mod index 6f37f110efd..acc49bf5bee 100644 --- a/exporter/otlphttpexporter/go.mod +++ b/exporter/otlphttpexporter/go.mod @@ -29,12 +29,12 @@ require ( github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/go-viper/mapstructure/v2 v2.1.0 // indirect + github.com/go-viper/mapstructure/v2 v2.2.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/uuid v1.6.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.17.10 // indirect + github.com/klauspost/compress v1.17.11 // 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 @@ -61,11 +61,11 @@ require ( go.opentelemetry.io/collector/receiver v0.111.0 // indirect go.opentelemetry.io/collector/receiver/receiverprofiles v0.111.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.55.0 // indirect - go.opentelemetry.io/otel v1.30.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 - go.opentelemetry.io/otel/trace v1.30.0 // indirect + go.opentelemetry.io/otel v1.31.0 // indirect + go.opentelemetry.io/otel/metric v1.31.0 // indirect + go.opentelemetry.io/otel/sdk v1.31.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.31.0 // indirect + go.opentelemetry.io/otel/trace v1.31.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.30.0 // indirect golang.org/x/sys v0.26.0 // indirect diff --git a/exporter/otlphttpexporter/go.sum b/exporter/otlphttpexporter/go.sum index d151e552cfe..e0173d316b8 100644 --- a/exporter/otlphttpexporter/go.sum +++ b/exporter/otlphttpexporter/go.sum @@ -12,8 +12,8 @@ github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-viper/mapstructure/v2 v2.1.0 h1:gHnMa2Y/pIxElCH2GlZZ1lZSsn6XMtufpGyP1XxdC/w= -github.com/go-viper/mapstructure/v2 v2.1.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= @@ -27,8 +27,8 @@ 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.10 h1:oXAz+Vh0PMUvJczoi+flxpnBEPxoER1IaAnU/NMPtT0= -github.com/klauspost/compress v1.17.10/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= +github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= +github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= 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= @@ -64,16 +64,16 @@ 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/contrib/instrumentation/net/http/otelhttp v0.55.0 h1:ZIg3ZT/aQ7AfKqdwp7ECpOK6vHqquXXuyTjIO8ZdmPs= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.55.0/go.mod h1:DQAwmETtZV00skUwgD6+0U89g80NKsJE3DCKeLLPQMI= -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/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= -go.opentelemetry.io/otel/sdk v1.30.0/go.mod h1:p14X4Ok8S+sygzblytT1nqG98QG2KYKv++HE0LY/mhg= -go.opentelemetry.io/otel/sdk/metric v1.30.0 h1:QJLT8Pe11jyHBHfSAgYH7kEmT24eX792jZO1bo4BXkM= -go.opentelemetry.io/otel/sdk/metric v1.30.0/go.mod h1:waS6P3YqFNzeP01kuo/MBBYqaoBJl7efRQHOaydhy1Y= -go.opentelemetry.io/otel/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc= -go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o= +go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= +go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= +go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= +go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= +go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= +go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= +go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc= +go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8= +go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= +go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= diff --git a/extension/auth/go.mod b/extension/auth/go.mod index fe6daafc345..7d8c20f1024 100644 --- a/extension/auth/go.mod +++ b/extension/auth/go.mod @@ -19,15 +19,15 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.111.0 // indirect go.opentelemetry.io/collector/pdata v1.17.0 // indirect - go.opentelemetry.io/otel v1.30.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 - go.opentelemetry.io/otel/trace v1.30.0 // indirect + go.opentelemetry.io/otel v1.31.0 // indirect + go.opentelemetry.io/otel/metric v1.31.0 // indirect + go.opentelemetry.io/otel/sdk v1.31.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.31.0 // indirect + go.opentelemetry.io/otel/trace v1.31.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.25.0 // indirect + golang.org/x/sys v0.26.0 // indirect golang.org/x/text v0.17.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect google.golang.org/protobuf v1.35.1 // indirect diff --git a/extension/auth/go.sum b/extension/auth/go.sum index f98e49f8bc2..fcd6f77cd0e 100644 --- a/extension/auth/go.sum +++ b/extension/auth/go.sum @@ -25,16 +25,16 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 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/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= -go.opentelemetry.io/otel/sdk v1.30.0/go.mod h1:p14X4Ok8S+sygzblytT1nqG98QG2KYKv++HE0LY/mhg= -go.opentelemetry.io/otel/sdk/metric v1.30.0 h1:QJLT8Pe11jyHBHfSAgYH7kEmT24eX792jZO1bo4BXkM= -go.opentelemetry.io/otel/sdk/metric v1.30.0/go.mod h1:waS6P3YqFNzeP01kuo/MBBYqaoBJl7efRQHOaydhy1Y= -go.opentelemetry.io/otel/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc= -go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o= +go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= +go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= +go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= +go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= +go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= +go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= +go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc= +go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8= +go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= +go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= @@ -58,8 +58,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= -golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= diff --git a/extension/experimental/storage/go.mod b/extension/experimental/storage/go.mod index 60078c65e38..2c296529f09 100644 --- a/extension/experimental/storage/go.mod +++ b/extension/experimental/storage/go.mod @@ -11,13 +11,13 @@ require ( github.com/gogo/protobuf v1.3.2 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.111.0 // indirect go.opentelemetry.io/collector/pdata v1.17.0 // indirect - go.opentelemetry.io/otel v1.30.0 // indirect - go.opentelemetry.io/otel/metric v1.30.0 // indirect - go.opentelemetry.io/otel/trace v1.30.0 // indirect + go.opentelemetry.io/otel v1.31.0 // indirect + go.opentelemetry.io/otel/metric v1.31.0 // indirect + go.opentelemetry.io/otel/trace v1.31.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.25.0 // indirect + golang.org/x/sys v0.26.0 // indirect golang.org/x/text v0.17.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect google.golang.org/grpc v1.67.1 // indirect diff --git a/extension/experimental/storage/go.sum b/extension/experimental/storage/go.sum index 042c38a5052..ffc0adbe313 100644 --- a/extension/experimental/storage/go.sum +++ b/extension/experimental/storage/go.sum @@ -16,12 +16,12 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 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/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/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc= -go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o= +go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= +go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= +go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= +go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= +go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= +go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= @@ -45,8 +45,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= -golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= diff --git a/extension/extension.go b/extension/extension.go index dd7b7a20bc5..a90df9763d1 100644 --- a/extension/extension.go +++ b/extension/extension.go @@ -41,18 +41,29 @@ type Settings struct { // CreateFunc is the equivalent of Factory.Create(...) function. type CreateFunc func(context.Context, Settings, component.Config) (Extension, error) -// CreateExtension implements Factory.Create. -func (f CreateFunc) CreateExtension(ctx context.Context, set Settings, cfg component.Config) (Extension, error) { +// Create implements Factory.Create. +func (f CreateFunc) Create(ctx context.Context, set Settings, cfg component.Config) (Extension, error) { return f(ctx, set, cfg) } +// Deprecated: [v0.112.0] use Create. +func (f CreateFunc) CreateExtension(ctx context.Context, set Settings, cfg component.Config) (Extension, error) { + return f.Create(ctx, set, cfg) +} + type Factory interface { component.Factory - // CreateExtension creates an extension based on the given config. + // Create an extension based on the given config. + Create(ctx context.Context, set Settings, cfg component.Config) (Extension, error) + + // Deprecated: [v0.112.0] use Create. CreateExtension(ctx context.Context, set Settings, cfg component.Config) (Extension, error) - // ExtensionStability gets the stability level of the Extension. + // Stability gets the stability level of the Extension. + Stability() component.StabilityLevel + + // Deprecated: [v0.112.0] use Stability. ExtensionStability() component.StabilityLevel unexportedFactoryFunc() @@ -71,6 +82,10 @@ func (f *factory) Type() component.Type { func (f *factory) unexportedFactoryFunc() {} +func (f *factory) Stability() component.StabilityLevel { + return f.extensionStability +} + func (f *factory) ExtensionStability() component.StabilityLevel { return f.extensionStability } diff --git a/extension/extension_test.go b/extension/extension_test.go index 83932a1d054..f86bf648b4d 100644 --- a/extension/extension_test.go +++ b/extension/extension_test.go @@ -34,8 +34,8 @@ func TestNewFactory(t *testing.T) { assert.EqualValues(t, testType, factory.Type()) assert.EqualValues(t, &defaultCfg, factory.CreateDefaultConfig()) - assert.Equal(t, component.StabilityLevelDevelopment, factory.ExtensionStability()) - ext, err := factory.CreateExtension(context.Background(), Settings{}, &defaultCfg) + assert.Equal(t, component.StabilityLevelDevelopment, factory.Stability()) + ext, err := factory.Create(context.Background(), Settings{}, &defaultCfg) require.NoError(t, err) assert.Same(t, nopExtensionInstance, ext) } diff --git a/extension/extensioncapabilities/go.mod b/extension/extensioncapabilities/go.mod index 8319f694920..93565456ac3 100644 --- a/extension/extensioncapabilities/go.mod +++ b/extension/extensioncapabilities/go.mod @@ -9,7 +9,7 @@ require ( ) require ( - github.com/go-viper/mapstructure/v2 v2.1.0 // indirect + github.com/go-viper/mapstructure/v2 v2.2.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect github.com/knadh/koanf/providers/confmap v0.1.0 // indirect @@ -18,13 +18,13 @@ require ( github.com/mitchellh/reflectwalk v1.0.2 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.111.0 // indirect go.opentelemetry.io/collector/pdata v1.17.0 // indirect - go.opentelemetry.io/otel v1.30.0 // indirect - go.opentelemetry.io/otel/metric v1.30.0 // indirect - go.opentelemetry.io/otel/trace v1.30.0 // indirect + go.opentelemetry.io/otel v1.31.0 // indirect + go.opentelemetry.io/otel/metric v1.31.0 // indirect + go.opentelemetry.io/otel/trace v1.31.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.25.0 // indirect + golang.org/x/sys v0.26.0 // indirect golang.org/x/text v0.17.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect google.golang.org/grpc v1.67.1 // indirect diff --git a/extension/extensioncapabilities/go.sum b/extension/extensioncapabilities/go.sum index 36231668761..4994ef4632f 100644 --- a/extension/extensioncapabilities/go.sum +++ b/extension/extensioncapabilities/go.sum @@ -4,8 +4,8 @@ github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-viper/mapstructure/v2 v2.1.0 h1:gHnMa2Y/pIxElCH2GlZZ1lZSsn6XMtufpGyP1XxdC/w= -github.com/go-viper/mapstructure/v2 v2.1.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= @@ -34,12 +34,12 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 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/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/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc= -go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o= +go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= +go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= +go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= +go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= +go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= +go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= @@ -63,8 +63,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= -golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= diff --git a/extension/extensiontest/nop_extension_test.go b/extension/extensiontest/nop_extension_test.go index 1e01f9076c1..b76df925343 100644 --- a/extension/extensiontest/nop_extension_test.go +++ b/extension/extensiontest/nop_extension_test.go @@ -21,7 +21,7 @@ func TestNewNopFactory(t *testing.T) { cfg := factory.CreateDefaultConfig() assert.Equal(t, &nopConfig{}, cfg) - traces, err := factory.CreateExtension(context.Background(), NewNopSettings(), cfg) + traces, err := factory.Create(context.Background(), NewNopSettings(), cfg) require.NoError(t, err) assert.NoError(t, traces.Start(context.Background(), componenttest.NewNopHost())) assert.NoError(t, traces.Shutdown(context.Background())) diff --git a/extension/go.mod b/extension/go.mod index d3fe68bf95f..58bbe2d6c63 100644 --- a/extension/go.mod +++ b/extension/go.mod @@ -17,15 +17,15 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.111.0 // indirect go.opentelemetry.io/collector/pdata v1.17.0 // indirect - go.opentelemetry.io/otel v1.30.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 - go.opentelemetry.io/otel/trace v1.30.0 // indirect + go.opentelemetry.io/otel v1.31.0 // indirect + go.opentelemetry.io/otel/metric v1.31.0 // indirect + go.opentelemetry.io/otel/sdk v1.31.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.31.0 // indirect + go.opentelemetry.io/otel/trace v1.31.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.25.0 // indirect + golang.org/x/sys v0.26.0 // indirect golang.org/x/text v0.17.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect google.golang.org/grpc v1.67.1 // indirect diff --git a/extension/go.sum b/extension/go.sum index f98e49f8bc2..fcd6f77cd0e 100644 --- a/extension/go.sum +++ b/extension/go.sum @@ -25,16 +25,16 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 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/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= -go.opentelemetry.io/otel/sdk v1.30.0/go.mod h1:p14X4Ok8S+sygzblytT1nqG98QG2KYKv++HE0LY/mhg= -go.opentelemetry.io/otel/sdk/metric v1.30.0 h1:QJLT8Pe11jyHBHfSAgYH7kEmT24eX792jZO1bo4BXkM= -go.opentelemetry.io/otel/sdk/metric v1.30.0/go.mod h1:waS6P3YqFNzeP01kuo/MBBYqaoBJl7efRQHOaydhy1Y= -go.opentelemetry.io/otel/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc= -go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o= +go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= +go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= +go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= +go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= +go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= +go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= +go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc= +go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8= +go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= +go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= @@ -58,8 +58,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= -golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= diff --git a/extension/memorylimiterextension/factory.go b/extension/memorylimiterextension/factory.go index b253e619483..197b112c7a3 100644 --- a/extension/memorylimiterextension/factory.go +++ b/extension/memorylimiterextension/factory.go @@ -18,7 +18,7 @@ func NewFactory() extension.Factory { return extension.NewFactory( metadata.Type, createDefaultConfig, - createExtension, + create, metadata.ExtensionStability) } @@ -28,6 +28,6 @@ func createDefaultConfig() component.Config { return &Config{} } -func createExtension(_ context.Context, set extension.Settings, cfg component.Config) (extension.Extension, error) { +func create(_ context.Context, set extension.Settings, cfg component.Config) (extension.Extension, error) { return newMemoryLimiter(cfg.(*Config), set.TelemetrySettings.Logger) } diff --git a/extension/memorylimiterextension/factory_test.go b/extension/memorylimiterextension/factory_test.go index 5c0acdc75a9..a5b3ca6302a 100644 --- a/extension/memorylimiterextension/factory_test.go +++ b/extension/memorylimiterextension/factory_test.go @@ -25,7 +25,7 @@ func TestCreateDefaultConfig(t *testing.T) { assert.NoError(t, componenttest.CheckConfigStruct(cfg)) } -func TestCreateExtension(t *testing.T) { +func TestCreate(t *testing.T) { factory := NewFactory() require.NotNil(t, factory) @@ -37,7 +37,7 @@ func TestCreateExtension(t *testing.T) { pCfg.MemorySpikeLimitMiB = 1907 pCfg.CheckInterval = 100 * time.Millisecond - tp, err := factory.CreateExtension(context.Background(), extensiontest.NewNopSettings(), cfg) + tp, err := factory.Create(context.Background(), extensiontest.NewNopSettings(), cfg) require.NoError(t, err) assert.NotNil(t, tp) // test if we can shutdown a monitoring routine that has not started diff --git a/extension/memorylimiterextension/generated_component_test.go b/extension/memorylimiterextension/generated_component_test.go index 51b6002e0a8..9f32e54cfa1 100644 --- a/extension/memorylimiterextension/generated_component_test.go +++ b/extension/memorylimiterextension/generated_component_test.go @@ -31,12 +31,12 @@ func TestComponentLifecycle(t *testing.T) { require.NoError(t, err) require.NoError(t, sub.Unmarshal(&cfg)) t.Run("lifecycle", func(t *testing.T) { - firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopSettings(), cfg) + firstExt, err := factory.Create(context.Background(), extensiontest.NewNopSettings(), cfg) require.NoError(t, err) require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost())) require.NoError(t, firstExt.Shutdown(context.Background())) - secondExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopSettings(), cfg) + secondExt, err := factory.Create(context.Background(), extensiontest.NewNopSettings(), cfg) require.NoError(t, err) require.NoError(t, secondExt.Start(context.Background(), componenttest.NewNopHost())) require.NoError(t, secondExt.Shutdown(context.Background())) diff --git a/extension/memorylimiterextension/go.mod b/extension/memorylimiterextension/go.mod index 519d7421cff..7f76a5fc732 100644 --- a/extension/memorylimiterextension/go.mod +++ b/extension/memorylimiterextension/go.mod @@ -18,7 +18,7 @@ require ( github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.2.6 // indirect - github.com/go-viper/mapstructure/v2 v2.1.0 // indirect + github.com/go-viper/mapstructure/v2 v2.2.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/google/uuid v1.6.0 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect @@ -35,14 +35,14 @@ require ( github.com/yusufpapurcu/wmi v1.2.4 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.111.0 // indirect go.opentelemetry.io/collector/pdata v1.17.0 // indirect - go.opentelemetry.io/otel v1.30.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 - go.opentelemetry.io/otel/trace v1.30.0 // indirect + go.opentelemetry.io/otel v1.31.0 // indirect + go.opentelemetry.io/otel/metric v1.31.0 // indirect + go.opentelemetry.io/otel/sdk v1.31.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.31.0 // indirect + go.opentelemetry.io/otel/trace v1.31.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.25.0 // indirect + golang.org/x/sys v0.26.0 // indirect golang.org/x/text v0.17.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd // indirect google.golang.org/grpc v1.67.1 // indirect diff --git a/extension/memorylimiterextension/go.sum b/extension/memorylimiterextension/go.sum index 5b28933f8eb..b676a947479 100644 --- a/extension/memorylimiterextension/go.sum +++ b/extension/memorylimiterextension/go.sum @@ -9,8 +9,8 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= -github.com/go-viper/mapstructure/v2 v2.1.0 h1:gHnMa2Y/pIxElCH2GlZZ1lZSsn6XMtufpGyP1XxdC/w= -github.com/go-viper/mapstructure/v2 v2.1.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -54,16 +54,16 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= 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/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= -go.opentelemetry.io/otel/sdk v1.30.0/go.mod h1:p14X4Ok8S+sygzblytT1nqG98QG2KYKv++HE0LY/mhg= -go.opentelemetry.io/otel/sdk/metric v1.30.0 h1:QJLT8Pe11jyHBHfSAgYH7kEmT24eX792jZO1bo4BXkM= -go.opentelemetry.io/otel/sdk/metric v1.30.0/go.mod h1:waS6P3YqFNzeP01kuo/MBBYqaoBJl7efRQHOaydhy1Y= -go.opentelemetry.io/otel/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc= -go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o= +go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= +go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= +go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= +go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= +go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= +go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= +go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc= +go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8= +go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= +go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= @@ -91,8 +91,8 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= -golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= diff --git a/extension/memorylimiterextension/memorylimiter_test.go b/extension/memorylimiterextension/memorylimiter_test.go index 96aa24e3ffe..da651bc492a 100644 --- a/extension/memorylimiterextension/memorylimiter_test.go +++ b/extension/memorylimiterextension/memorylimiter_test.go @@ -14,8 +14,8 @@ import ( "go.uber.org/zap" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/internal/iruntime" "go.opentelemetry.io/collector/internal/memorylimiter" + "go.opentelemetry.io/collector/internal/memorylimiter/iruntime" ) func TestMemoryPressureResponse(t *testing.T) { diff --git a/extension/zpagesextension/factory.go b/extension/zpagesextension/factory.go index b307de1821c..08e79541da1 100644 --- a/extension/zpagesextension/factory.go +++ b/extension/zpagesextension/factory.go @@ -18,7 +18,7 @@ const ( // NewFactory creates a factory for Z-Pages extension. func NewFactory() extension.Factory { - return extension.NewFactory(metadata.Type, createDefaultConfig, createExtension, metadata.ExtensionStability) + return extension.NewFactory(metadata.Type, createDefaultConfig, create, metadata.ExtensionStability) } func createDefaultConfig() component.Config { @@ -29,7 +29,7 @@ func createDefaultConfig() component.Config { } } -// createExtension creates the extension based on this config. -func createExtension(_ context.Context, set extension.Settings, cfg component.Config) (extension.Extension, error) { +// create creates the extension based on this config. +func create(_ context.Context, set extension.Settings, cfg component.Config) (extension.Extension, error) { return newServer(cfg.(*Config), set.TelemetrySettings), nil } diff --git a/extension/zpagesextension/factory_test.go b/extension/zpagesextension/factory_test.go index 0d851a98be6..ff718ac2e8b 100644 --- a/extension/zpagesextension/factory_test.go +++ b/extension/zpagesextension/factory_test.go @@ -26,16 +26,16 @@ func TestFactory_CreateDefaultConfig(t *testing.T) { cfg) require.NoError(t, componenttest.CheckConfigStruct(cfg)) - ext, err := createExtension(context.Background(), extensiontest.NewNopSettings(), cfg) + ext, err := create(context.Background(), extensiontest.NewNopSettings(), cfg) require.NoError(t, err) require.NotNil(t, ext) } -func TestFactory_CreateExtension(t *testing.T) { +func TestFactoryCreate(t *testing.T) { cfg := createDefaultConfig().(*Config) cfg.ServerConfig.Endpoint = testutil.GetAvailableLocalAddress(t) - ext, err := createExtension(context.Background(), extensiontest.NewNopSettings(), cfg) + ext, err := create(context.Background(), extensiontest.NewNopSettings(), cfg) require.NoError(t, err) require.NotNil(t, ext) } diff --git a/extension/zpagesextension/generated_component_test.go b/extension/zpagesextension/generated_component_test.go index fba4d348c4b..85ab73915e5 100644 --- a/extension/zpagesextension/generated_component_test.go +++ b/extension/zpagesextension/generated_component_test.go @@ -31,18 +31,18 @@ func TestComponentLifecycle(t *testing.T) { require.NoError(t, err) require.NoError(t, sub.Unmarshal(&cfg)) t.Run("shutdown", func(t *testing.T) { - e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopSettings(), cfg) + e, err := factory.Create(context.Background(), extensiontest.NewNopSettings(), cfg) require.NoError(t, err) err = e.Shutdown(context.Background()) require.NoError(t, err) }) t.Run("lifecycle", func(t *testing.T) { - firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopSettings(), cfg) + firstExt, err := factory.Create(context.Background(), extensiontest.NewNopSettings(), cfg) require.NoError(t, err) require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost())) require.NoError(t, firstExt.Shutdown(context.Background())) - secondExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopSettings(), cfg) + secondExt, err := factory.Create(context.Background(), extensiontest.NewNopSettings(), cfg) require.NoError(t, err) require.NoError(t, secondExt.Start(context.Background(), componenttest.NewNopHost())) require.NoError(t, secondExt.Shutdown(context.Background())) diff --git a/extension/zpagesextension/go.mod b/extension/zpagesextension/go.mod index baf6e8e2914..08533a99bda 100644 --- a/extension/zpagesextension/go.mod +++ b/extension/zpagesextension/go.mod @@ -12,8 +12,8 @@ require ( go.opentelemetry.io/collector/confmap v1.17.0 go.opentelemetry.io/collector/extension v0.111.0 go.opentelemetry.io/contrib/zpages v0.55.0 - go.opentelemetry.io/otel/sdk v1.30.0 - go.opentelemetry.io/otel/trace v1.30.0 + go.opentelemetry.io/otel/sdk v1.31.0 + go.opentelemetry.io/otel/trace v1.31.0 go.uber.org/goleak v1.3.0 go.uber.org/zap v1.27.0 ) @@ -24,11 +24,11 @@ require ( github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/go-viper/mapstructure/v2 v2.1.0 // indirect + github.com/go-viper/mapstructure/v2 v2.2.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/uuid v1.6.0 // indirect - github.com/klauspost/compress v1.17.10 // indirect + github.com/klauspost/compress v1.17.11 // 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,9 +48,9 @@ require ( go.opentelemetry.io/collector/pdata v1.17.0 // indirect go.opentelemetry.io/collector/pipeline v0.111.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.55.0 // indirect - go.opentelemetry.io/otel v1.30.0 // indirect - go.opentelemetry.io/otel/metric v1.30.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect + go.opentelemetry.io/otel v1.31.0 // indirect + go.opentelemetry.io/otel/metric v1.31.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.31.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.30.0 // indirect golang.org/x/sys v0.26.0 // indirect diff --git a/extension/zpagesextension/go.sum b/extension/zpagesextension/go.sum index 1d1a674591f..110e37ba3f2 100644 --- a/extension/zpagesextension/go.sum +++ b/extension/zpagesextension/go.sum @@ -9,8 +9,8 @@ github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-viper/mapstructure/v2 v2.1.0 h1:gHnMa2Y/pIxElCH2GlZZ1lZSsn6XMtufpGyP1XxdC/w= -github.com/go-viper/mapstructure/v2 v2.1.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= @@ -23,8 +23,8 @@ 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.10 h1:oXAz+Vh0PMUvJczoi+flxpnBEPxoER1IaAnU/NMPtT0= -github.com/klauspost/compress v1.17.10/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= +github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= +github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= 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= @@ -59,16 +59,16 @@ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.55.0 h1:ZIg3ZT/ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.55.0/go.mod h1:DQAwmETtZV00skUwgD6+0U89g80NKsJE3DCKeLLPQMI= go.opentelemetry.io/contrib/zpages v0.55.0 h1:F+xj261Ulwl79QC+2O+IO1b3NbwppUDwN+7LbDSdQcY= go.opentelemetry.io/contrib/zpages v0.55.0/go.mod h1:dDqDGDfbXSjt/k9orZk4Huulvz1letX1YWTKts5GQpo= -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/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= -go.opentelemetry.io/otel/sdk v1.30.0/go.mod h1:p14X4Ok8S+sygzblytT1nqG98QG2KYKv++HE0LY/mhg= -go.opentelemetry.io/otel/sdk/metric v1.30.0 h1:QJLT8Pe11jyHBHfSAgYH7kEmT24eX792jZO1bo4BXkM= -go.opentelemetry.io/otel/sdk/metric v1.30.0/go.mod h1:waS6P3YqFNzeP01kuo/MBBYqaoBJl7efRQHOaydhy1Y= -go.opentelemetry.io/otel/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc= -go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o= +go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= +go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= +go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= +go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= +go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= +go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= +go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc= +go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8= +go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= +go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= diff --git a/filter/go.mod b/filter/go.mod index 48ef6213e0c..e40d7bb7388 100644 --- a/filter/go.mod +++ b/filter/go.mod @@ -9,7 +9,7 @@ require ( require ( github.com/davecgh/go-spew v1.1.1 // indirect - github.com/go-viper/mapstructure/v2 v2.1.0 // indirect + github.com/go-viper/mapstructure/v2 v2.2.1 // 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 diff --git a/filter/go.sum b/filter/go.sum index 3a051879bb3..6095cc50622 100644 --- a/filter/go.sum +++ b/filter/go.sum @@ -1,7 +1,7 @@ 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-viper/mapstructure/v2 v2.1.0 h1:gHnMa2Y/pIxElCH2GlZZ1lZSsn6XMtufpGyP1XxdC/w= -github.com/go-viper/mapstructure/v2 v2.1.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= 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= diff --git a/go.mod b/go.mod index 2631b9817c0..efe5cc405de 100644 --- a/go.mod +++ b/go.mod @@ -34,7 +34,7 @@ require ( github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.2.6 // indirect - github.com/go-viper/mapstructure/v2 v2.1.0 // indirect + github.com/go-viper/mapstructure/v2 v2.2.1 // indirect 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 @@ -55,13 +55,13 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.111.0 // indirect go.opentelemetry.io/collector/internal/globalsignal v0.111.0 // indirect go.opentelemetry.io/collector/pipeline v0.111.0 // indirect - go.opentelemetry.io/otel v1.30.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 - go.opentelemetry.io/otel/trace v1.30.0 // indirect + go.opentelemetry.io/otel v1.31.0 // indirect + go.opentelemetry.io/otel/metric v1.31.0 // indirect + go.opentelemetry.io/otel/sdk v1.31.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.31.0 // indirect + go.opentelemetry.io/otel/trace v1.31.0 // indirect golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.25.0 // indirect + golang.org/x/sys v0.26.0 // indirect golang.org/x/text v0.17.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd // indirect google.golang.org/protobuf v1.35.1 // indirect diff --git a/go.sum b/go.sum index 4eb1b14d73d..71f785dea4e 100644 --- a/go.sum +++ b/go.sum @@ -10,8 +10,8 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= -github.com/go-viper/mapstructure/v2 v2.1.0 h1:gHnMa2Y/pIxElCH2GlZZ1lZSsn6XMtufpGyP1XxdC/w= -github.com/go-viper/mapstructure/v2 v2.1.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -65,16 +65,16 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= 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/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= -go.opentelemetry.io/otel/sdk v1.30.0/go.mod h1:p14X4Ok8S+sygzblytT1nqG98QG2KYKv++HE0LY/mhg= -go.opentelemetry.io/otel/sdk/metric v1.30.0 h1:QJLT8Pe11jyHBHfSAgYH7kEmT24eX792jZO1bo4BXkM= -go.opentelemetry.io/otel/sdk/metric v1.30.0/go.mod h1:waS6P3YqFNzeP01kuo/MBBYqaoBJl7efRQHOaydhy1Y= -go.opentelemetry.io/otel/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc= -go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o= +go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= +go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= +go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= +go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= +go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= +go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= +go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc= +go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8= +go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= +go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= @@ -102,8 +102,8 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= -golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= diff --git a/internal/e2e/go.mod b/internal/e2e/go.mod index f6aeb179dd2..c20fe1ab36f 100644 --- a/internal/e2e/go.mod +++ b/internal/e2e/go.mod @@ -42,14 +42,14 @@ require ( github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.2.6 // indirect - github.com/go-viper/mapstructure/v2 v2.1.0 // indirect + github.com/go-viper/mapstructure/v2 v2.2.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/uuid v1.6.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect github.com/hashicorp/go-version v1.7.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.17.10 // indirect + github.com/klauspost/compress v1.17.11 // 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 @@ -73,7 +73,6 @@ require ( github.com/tklauser/numcpus v0.6.1 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect go.opentelemetry.io/collector/client v1.17.0 // indirect - go.opentelemetry.io/collector/component/componentprofiles v0.111.0 // indirect go.opentelemetry.io/collector/config/configauth v0.111.0 // indirect go.opentelemetry.io/collector/config/configcompression v1.17.0 // indirect go.opentelemetry.io/collector/config/confignet v1.17.0 // indirect @@ -85,9 +84,9 @@ require ( go.opentelemetry.io/collector/extension/experimental/storage v0.111.0 // indirect go.opentelemetry.io/collector/extension/extensioncapabilities v0.111.0 // indirect go.opentelemetry.io/collector/featuregate v1.17.0 // indirect - go.opentelemetry.io/collector/internal/globalgates v0.111.0 // indirect go.opentelemetry.io/collector/internal/globalsignal v0.111.0 // indirect go.opentelemetry.io/collector/pdata/pprofile v0.111.0 // indirect + go.opentelemetry.io/collector/pipeline/pipelineprofiles v0.111.0 // indirect go.opentelemetry.io/collector/processor v0.111.0 // indirect go.opentelemetry.io/collector/processor/processorprofiles v0.111.0 // indirect go.opentelemetry.io/collector/receiver/receiverprofiles v0.111.0 // indirect @@ -96,31 +95,31 @@ require ( go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.55.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.55.0 // indirect go.opentelemetry.io/contrib/propagators/b3 v1.30.0 // indirect - go.opentelemetry.io/otel v1.30.0 // indirect + go.opentelemetry.io/otel v1.31.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.6.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.30.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.30.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.31.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.31.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.30.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.30.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.30.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.53.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.6.0 // indirect - go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.30.0 // indirect + go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.31.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.30.0 // indirect go.opentelemetry.io/otel/log v0.6.0 // indirect - go.opentelemetry.io/otel/metric v1.30.0 // indirect - go.opentelemetry.io/otel/sdk v1.30.0 // indirect + go.opentelemetry.io/otel/metric v1.31.0 // indirect + go.opentelemetry.io/otel/sdk v1.31.0 // indirect go.opentelemetry.io/otel/sdk/log v0.6.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect - go.opentelemetry.io/otel/trace v1.30.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.31.0 // indirect + go.opentelemetry.io/otel/trace v1.31.0 // indirect go.opentelemetry.io/proto/otlp v1.3.1 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.30.0 // indirect golang.org/x/sys v0.26.0 // indirect golang.org/x/text v0.19.0 // indirect gonum.org/v1/gonum v0.15.1 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20241007155032-5fefd90f89a9 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9 // indirect google.golang.org/grpc v1.67.1 // indirect google.golang.org/protobuf v1.35.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect @@ -196,10 +195,6 @@ replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extensi replace go.opentelemetry.io/collector/service => ../../service -replace go.opentelemetry.io/collector/component/componentprofiles => ../../component/componentprofiles - -replace go.opentelemetry.io/collector/internal/globalgates => ../globalgates - replace go.opentelemetry.io/collector/extension/extensioncapabilities => ../../extension/extensioncapabilities replace go.opentelemetry.io/collector/receiver/receiverprofiles => ../../receiver/receiverprofiles @@ -213,3 +208,5 @@ replace go.opentelemetry.io/collector/exporter/exporterprofiles => ../../exporte replace go.opentelemetry.io/collector/pipeline => ../../pipeline replace go.opentelemetry.io/collector/internal/globalsignal => ../globalsignal + +replace go.opentelemetry.io/collector/pipeline/pipelineprofiles => ../../pipeline/pipelineprofiles diff --git a/internal/e2e/go.sum b/internal/e2e/go.sum index 631bfb5fb88..9364a47bd81 100644 --- a/internal/e2e/go.sum +++ b/internal/e2e/go.sum @@ -20,8 +20,8 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= -github.com/go-viper/mapstructure/v2 v2.1.0 h1:gHnMa2Y/pIxElCH2GlZZ1lZSsn6XMtufpGyP1XxdC/w= -github.com/go-viper/mapstructure/v2 v2.1.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= @@ -40,8 +40,8 @@ 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.10 h1:oXAz+Vh0PMUvJczoi+flxpnBEPxoER1IaAnU/NMPtT0= -github.com/klauspost/compress v1.17.10/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= +github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= +github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= 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= @@ -83,8 +83,8 @@ github.com/prometheus/common v0.60.0 h1:+V9PAREWNvJMAuJ1x1BaWl9dewMW4YrHZQbx0sJN github.com/prometheus/common v0.60.0/go.mod h1:h0LYf1R1deLSKtD4Vdg8gy4RuOvENW2J/h19V5NADQw= 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/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= +github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/shirou/gopsutil/v4 v4.24.9 h1:KIV+/HaHD5ka5f570RZq+2SaeFsb/pq+fp2DGNWYoOI= @@ -111,40 +111,40 @@ go.opentelemetry.io/contrib/propagators/b3 v1.30.0 h1:vumy4r1KMyaoQRltX7cJ37p3nl go.opentelemetry.io/contrib/propagators/b3 v1.30.0/go.mod h1:fRbvRsaeVZ82LIl3u0rIvusIel2UUf+JcaaIpy5taho= go.opentelemetry.io/contrib/zpages v0.55.0 h1:F+xj261Ulwl79QC+2O+IO1b3NbwppUDwN+7LbDSdQcY= go.opentelemetry.io/contrib/zpages v0.55.0/go.mod h1:dDqDGDfbXSjt/k9orZk4Huulvz1letX1YWTKts5GQpo= -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 v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= +go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.6.0 h1:QSKmLBzbFULSyHzOdO9JsN9lpE4zkrz1byYGmJecdVE= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.6.0/go.mod h1:sTQ/NH8Yrirf0sJ5rWqVu+oT82i4zL9FaF6rWcqnptM= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.30.0 h1:WypxHH02KX2poqqbaadmkMYalGyy/vil4HE4PM4nRJc= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.30.0/go.mod h1:U79SV99vtvGSEBeeHnpgGJfTsnsdkWLpPN/CcHAzBSI= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.30.0 h1:VrMAbeJz4gnVDg2zEzjHG4dEH86j4jO6VYB+NgtGD8s= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.30.0/go.mod h1:qqN/uFdpeitTvm+JDqqnjm517pmQRYxTORbETHq5tOc= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.31.0 h1:FZ6ei8GFW7kyPYdxJaV2rgI6M+4tvZzhYsQ2wgyVC08= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.31.0/go.mod h1:MdEu/mC6j3D+tTEfvI15b5Ci2Fn7NneJ71YMoiS3tpI= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.31.0 h1:ZsXq73BERAiNuuFXYqP4MR5hBrjXfMGSO+Cx7qoOZiM= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.31.0/go.mod h1:hg1zaDMpyZJuUzjFxFsRYBoccE86tM9Uf4IqNMUxvrY= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.30.0 h1:lsInsfvhVIfOI6qHVyysXMNDnjO9Npvl7tlDPJFBVd4= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.30.0/go.mod h1:KQsVNh4OjgjTG0G6EiNi1jVpnaeeKsKMRwbLN+f1+8M= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.30.0 h1:m0yTiGDLUvVYaTFbAvCkVYIYcvwKt3G7OLoN77NUs/8= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.30.0/go.mod h1:wBQbT4UekBfegL2nx0Xk1vBcnzyBPsIVm9hRG4fYcr4= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.30.0 h1:umZgi92IyxfXd/l4kaDhnKgY8rnN/cZcF1LKc6I8OQ8= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.30.0/go.mod h1:4lVs6obhSVRb1EW5FhOuBTyiQhtRtAnnva9vD3yRfq8= -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/exporters/prometheus v0.53.0 h1:QXobPHrwiGLM4ufrY3EOmDPJpo2P90UuFau4CDPJA/I= +go.opentelemetry.io/otel/exporters/prometheus v0.53.0/go.mod h1:WOAXGr3D00CfzmFxtTV1eR0GpoHuPEu+HJT8UWW2SIU= go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.6.0 h1:bZHOb8k/CwwSt0DgvgaoOhBXWNdWqFWaIsGTtg1H3KE= go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.6.0/go.mod h1:XlV163j81kDdIt5b5BXCjdqVfqJFy/LJrHA697SorvQ= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.30.0 h1:IyFlqNsi8VT/nwYlLJfdM0y1gavxGpEvnf6FtVfZ6X4= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.30.0/go.mod h1:bxiX8eUeKoAEQmbq/ecUT8UqZwCjZW52yJrXJUSozsk= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.31.0 h1:HZgBIps9wH0RDrwjrmNa3DVbNRW60HEhdzqZFyAp3fI= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.31.0/go.mod h1:RDRhvt6TDG0eIXmonAx5bd9IcwpqCkziwkOClzWKwAQ= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.30.0 h1:kn1BudCgwtE7PxLqcZkErpD8GKqLZ6BSzeW9QihQJeM= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.30.0/go.mod h1:ljkUDtAMdleoi9tIG1R6dJUpVwDcYjw3J2Q6Q/SuiC0= go.opentelemetry.io/otel/log v0.6.0 h1:nH66tr+dmEgW5y+F9LanGJUBYPrRgP4g2EkmPE3LeK8= go.opentelemetry.io/otel/log v0.6.0/go.mod h1:KdySypjQHhP069JX0z/t26VHwa8vSwzgaKmXtIB3fJM= -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= -go.opentelemetry.io/otel/sdk v1.30.0/go.mod h1:p14X4Ok8S+sygzblytT1nqG98QG2KYKv++HE0LY/mhg= +go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= +go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= +go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= +go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= go.opentelemetry.io/otel/sdk/log v0.6.0 h1:4J8BwXY4EeDE9Mowg+CyhWVBhTSLXVXodiXxS/+PGqI= go.opentelemetry.io/otel/sdk/log v0.6.0/go.mod h1:L1DN8RMAduKkrwRAFDEX3E3TLOq46+XMGSbUfHU/+vE= -go.opentelemetry.io/otel/sdk/metric v1.30.0 h1:QJLT8Pe11jyHBHfSAgYH7kEmT24eX792jZO1bo4BXkM= -go.opentelemetry.io/otel/sdk/metric v1.30.0/go.mod h1:waS6P3YqFNzeP01kuo/MBBYqaoBJl7efRQHOaydhy1Y= -go.opentelemetry.io/otel/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc= -go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o= +go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc= +go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8= +go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= +go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= @@ -192,10 +192,10 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gonum.org/v1/gonum v0.15.1 h1:FNy7N6OUZVUaWG9pTiD+jlhdQ3lMP+/LcTpJ6+a8sQ0= gonum.org/v1/gonum v0.15.1/go.mod h1:eZTZuRFrzu5pcyjN5wJhcIhnUdNijYxX1T2IcrOGY0o= -google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 h1:hjSy6tcFQZ171igDaN5QHOw2n6vx40juYbC/x67CEhc= -google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:qpvKtACPCQhAdu3PyQgV4l3LMXZEtft7y8QcarRsp9I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= +google.golang.org/genproto/googleapis/api v0.0.0-20241007155032-5fefd90f89a9 h1:T6rh4haD3GVYsgEfWExoCZA2o2FmbNyKpTuAxbEFPTg= +google.golang.org/genproto/googleapis/api v0.0.0-20241007155032-5fefd90f89a9/go.mod h1:wp2WsuBYj6j8wUdo3ToZsdxxixbvQNAHqVJrTgi5E5M= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9 h1:QCqS/PdaHTSWGvupk2F/ehwHtGc0/GYkT+3GAcR1CCc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E= google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA= diff --git a/internal/e2e/status_test.go b/internal/e2e/status_test.go index 67dc156804b..55311d99372 100644 --- a/internal/e2e/status_test.go +++ b/internal/e2e/status_test.go @@ -102,11 +102,11 @@ func Test_ComponentStatusReporting_SharedInstance(t *testing.T) { }, }, Pipelines: pipelines.Config{ - pipeline.MustNewID("traces"): { + pipeline.NewID(pipeline.SignalTraces): { Receivers: []component.ID{component.NewID(component.MustNewType("test"))}, Exporters: []component.ID{component.NewID(nopType)}, }, - pipeline.MustNewID("metrics"): { + pipeline.NewID(pipeline.SignalMetrics): { Receivers: []component.ID{component.NewID(component.MustNewType("test"))}, Exporters: []component.ID{component.NewID(nopType)}, }, @@ -239,12 +239,12 @@ func newExtensionFactory() extension.Factory { return extension.NewFactory( component.MustNewType("watcher"), createDefaultExtensionConfig, - createExtension, + create, component.StabilityLevelStable, ) } -func createExtension(_ context.Context, _ extension.Settings, cfg component.Config) (extension.Extension, error) { +func create(_ context.Context, _ extension.Settings, cfg component.Config) (extension.Extension, error) { oCfg := cfg.(*extensionConfig) return &testExtension{ eventsReceived: oCfg.eventsReceived, diff --git a/internal/globalgates/Makefile b/internal/globalgates/Makefile deleted file mode 100644 index ded7a36092d..00000000000 --- a/internal/globalgates/Makefile +++ /dev/null @@ -1 +0,0 @@ -include ../../Makefile.Common diff --git a/internal/globalgates/globalgates.go b/internal/globalgates/globalgates.go deleted file mode 100644 index b7e8a6ce698..00000000000 --- a/internal/globalgates/globalgates.go +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package globalgates // import "go.opentelemetry.io/collector/internal/globalgates" - -import ( - "errors" - - "go.opentelemetry.io/collector/featuregate" -) - -var NoopTracerProvider = featuregate.GlobalRegistry().MustRegister("service.noopTracerProvider", - featuregate.StageAlpha, - featuregate.WithRegisterFromVersion("v0.107.0"), - featuregate.WithRegisterToVersion("v0.109.0"), - featuregate.WithRegisterDescription("Sets a Noop OpenTelemetry TracerProvider to reduce memory allocations. This featuregate is incompatible with the zPages extension.")) - -var _ = mustRegisterOrLoad( - featuregate.GlobalRegistry(), - "component.UseLocalHostAsDefaultHost", - featuregate.StageStable, - featuregate.WithRegisterToVersion("v0.110.0"), - featuregate.WithRegisterDescription("controls whether server-like receivers and extensions such as the OTLP receiver use localhost as the default host for their endpoints"), -) - -// mustRegisterOrLoad tries to register the feature gate and loads it if it already exists. -// It panics on any other error. -func mustRegisterOrLoad(reg *featuregate.Registry, id string, stage featuregate.Stage, opts ...featuregate.RegisterOption) *featuregate.Gate { - gate, err := reg.Register(id, stage, opts...) - - if errors.Is(err, featuregate.ErrAlreadyRegistered) { - // Gate is already registered; find it. - // Only a handful of feature gates are registered, so it's fine to iterate over all of them. - reg.VisitAll(func(g *featuregate.Gate) { - if g.ID() == id { - gate = g - return - } - }) - } else if err != nil { - panic(err) - } - - return gate -} diff --git a/internal/globalgates/go.mod b/internal/globalgates/go.mod deleted file mode 100644 index 6ec6c965015..00000000000 --- a/internal/globalgates/go.mod +++ /dev/null @@ -1,12 +0,0 @@ -module go.opentelemetry.io/collector/internal/globalgates - -go 1.22.0 - -require go.opentelemetry.io/collector/featuregate v1.17.0 - -require ( - github.com/hashicorp/go-version v1.7.0 // indirect - go.uber.org/multierr v1.11.0 // indirect -) - -replace go.opentelemetry.io/collector/featuregate => ../../featuregate diff --git a/internal/globalgates/go.sum b/internal/globalgates/go.sum deleted file mode 100644 index e3ebd41c2e8..00000000000 --- a/internal/globalgates/go.sum +++ /dev/null @@ -1,14 +0,0 @@ -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/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= -github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -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/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= -go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= -go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= -go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/internal/cgroups/cgroup.go b/internal/memorylimiter/cgroups/cgroup.go similarity index 99% rename from internal/cgroups/cgroup.go rename to internal/memorylimiter/cgroups/cgroup.go index 74ef31254d7..9151a3c9cee 100644 --- a/internal/cgroups/cgroup.go +++ b/internal/memorylimiter/cgroups/cgroup.go @@ -25,7 +25,7 @@ //go:build linux -package cgroups // import "go.opentelemetry.io/collector/internal/cgroups" +package cgroups // import "go.opentelemetry.io/collector/internal/memorylimiter/cgroups" import ( "bufio" diff --git a/internal/cgroups/cgroup_test.go b/internal/memorylimiter/cgroups/cgroup_test.go similarity index 100% rename from internal/cgroups/cgroup_test.go rename to internal/memorylimiter/cgroups/cgroup_test.go diff --git a/internal/cgroups/cgroups.go b/internal/memorylimiter/cgroups/cgroups.go similarity index 99% rename from internal/cgroups/cgroups.go rename to internal/memorylimiter/cgroups/cgroups.go index 0b04709c199..f1cd8b9cf70 100644 --- a/internal/cgroups/cgroups.go +++ b/internal/memorylimiter/cgroups/cgroups.go @@ -25,7 +25,7 @@ //go:build linux -package cgroups // import "go.opentelemetry.io/collector/internal/cgroups" +package cgroups // import "go.opentelemetry.io/collector/internal/memorylimiter/cgroups" import ( "bufio" "io" diff --git a/internal/cgroups/cgroups_test.go b/internal/memorylimiter/cgroups/cgroups_test.go similarity index 100% rename from internal/cgroups/cgroups_test.go rename to internal/memorylimiter/cgroups/cgroups_test.go diff --git a/internal/cgroups/doc.go b/internal/memorylimiter/cgroups/doc.go similarity index 98% rename from internal/cgroups/doc.go rename to internal/memorylimiter/cgroups/doc.go index a1dfce8fbc7..f5f936b2cf2 100644 --- a/internal/cgroups/doc.go +++ b/internal/memorylimiter/cgroups/doc.go @@ -26,4 +26,4 @@ // Package cgroups provides utilities to access Linux control group (CGroups) // parameters (total memory, for example) for a given process. // The original implementation is taken from https://github.com/uber-go/automaxprocs -package cgroups // import "go.opentelemetry.io/collector/internal/cgroups" +package cgroups // import "go.opentelemetry.io/collector/internal/memorylimiter/cgroups" diff --git a/internal/cgroups/errors.go b/internal/memorylimiter/cgroups/errors.go similarity index 98% rename from internal/cgroups/errors.go rename to internal/memorylimiter/cgroups/errors.go index 815d01d5704..dd4a085147b 100644 --- a/internal/cgroups/errors.go +++ b/internal/memorylimiter/cgroups/errors.go @@ -25,7 +25,7 @@ //go:build linux -package cgroups // import "go.opentelemetry.io/collector/internal/cgroups" +package cgroups // import "go.opentelemetry.io/collector/internal/memorylimiter/cgroups" import "fmt" diff --git a/internal/cgroups/mountpoint.go b/internal/memorylimiter/cgroups/mountpoint.go similarity index 99% rename from internal/cgroups/mountpoint.go rename to internal/memorylimiter/cgroups/mountpoint.go index 69582b35aa5..28da20fdbcb 100644 --- a/internal/cgroups/mountpoint.go +++ b/internal/memorylimiter/cgroups/mountpoint.go @@ -25,7 +25,7 @@ //go:build linux -package cgroups // import "go.opentelemetry.io/collector/internal/cgroups" +package cgroups // import "go.opentelemetry.io/collector/internal/memorylimiter/cgroups" import ( "bufio" diff --git a/internal/cgroups/mountpoint_test.go b/internal/memorylimiter/cgroups/mountpoint_test.go similarity index 100% rename from internal/cgroups/mountpoint_test.go rename to internal/memorylimiter/cgroups/mountpoint_test.go diff --git a/internal/cgroups/package_test.go b/internal/memorylimiter/cgroups/package_test.go similarity index 100% rename from internal/cgroups/package_test.go rename to internal/memorylimiter/cgroups/package_test.go diff --git a/internal/cgroups/subsys.go b/internal/memorylimiter/cgroups/subsys.go similarity index 99% rename from internal/cgroups/subsys.go rename to internal/memorylimiter/cgroups/subsys.go index dfe60779a31..434ba5dd92a 100644 --- a/internal/cgroups/subsys.go +++ b/internal/memorylimiter/cgroups/subsys.go @@ -25,7 +25,7 @@ //go:build linux -package cgroups // import "go.opentelemetry.io/collector/internal/cgroups" +package cgroups // import "go.opentelemetry.io/collector/internal/memorylimiter/cgroups" import ( "bufio" diff --git a/internal/cgroups/subsys_test.go b/internal/memorylimiter/cgroups/subsys_test.go similarity index 100% rename from internal/cgroups/subsys_test.go rename to internal/memorylimiter/cgroups/subsys_test.go diff --git a/internal/cgroups/testdata/cgroups/cpu/cpu.cfs_period_us b/internal/memorylimiter/cgroups/testdata/cgroups/cpu/cpu.cfs_period_us similarity index 100% rename from internal/cgroups/testdata/cgroups/cpu/cpu.cfs_period_us rename to internal/memorylimiter/cgroups/testdata/cgroups/cpu/cpu.cfs_period_us diff --git a/internal/cgroups/testdata/cgroups/cpu/cpu.cfs_quota_us b/internal/memorylimiter/cgroups/testdata/cgroups/cpu/cpu.cfs_quota_us similarity index 100% rename from internal/cgroups/testdata/cgroups/cpu/cpu.cfs_quota_us rename to internal/memorylimiter/cgroups/testdata/cgroups/cpu/cpu.cfs_quota_us diff --git a/internal/cgroups/testdata/cgroups/empty/cpu.cfs_quota_us b/internal/memorylimiter/cgroups/testdata/cgroups/empty/cpu.cfs_quota_us similarity index 100% rename from internal/cgroups/testdata/cgroups/empty/cpu.cfs_quota_us rename to internal/memorylimiter/cgroups/testdata/cgroups/empty/cpu.cfs_quota_us diff --git a/internal/cgroups/testdata/cgroups/invalid/cpu.cfs_quota_us b/internal/memorylimiter/cgroups/testdata/cgroups/invalid/cpu.cfs_quota_us similarity index 100% rename from internal/cgroups/testdata/cgroups/invalid/cpu.cfs_quota_us rename to internal/memorylimiter/cgroups/testdata/cgroups/invalid/cpu.cfs_quota_us diff --git a/internal/cgroups/testdata/cgroups/memory/memory.limit_in_bytes b/internal/memorylimiter/cgroups/testdata/cgroups/memory/memory.limit_in_bytes similarity index 100% rename from internal/cgroups/testdata/cgroups/memory/memory.limit_in_bytes rename to internal/memorylimiter/cgroups/testdata/cgroups/memory/memory.limit_in_bytes diff --git a/internal/cgroups/testdata/cgroups/undefined-period/cpu.cfs_quota_us b/internal/memorylimiter/cgroups/testdata/cgroups/undefined-period/cpu.cfs_quota_us similarity index 100% rename from internal/cgroups/testdata/cgroups/undefined-period/cpu.cfs_quota_us rename to internal/memorylimiter/cgroups/testdata/cgroups/undefined-period/cpu.cfs_quota_us diff --git a/internal/cgroups/testdata/cgroups/undefined/cpu.cfs_period_us b/internal/memorylimiter/cgroups/testdata/cgroups/undefined/cpu.cfs_period_us similarity index 100% rename from internal/cgroups/testdata/cgroups/undefined/cpu.cfs_period_us rename to internal/memorylimiter/cgroups/testdata/cgroups/undefined/cpu.cfs_period_us diff --git a/internal/cgroups/testdata/cgroups/undefined/cpu.cfs_quota_us b/internal/memorylimiter/cgroups/testdata/cgroups/undefined/cpu.cfs_quota_us similarity index 100% rename from internal/cgroups/testdata/cgroups/undefined/cpu.cfs_quota_us rename to internal/memorylimiter/cgroups/testdata/cgroups/undefined/cpu.cfs_quota_us diff --git a/internal/cgroups/testdata/cgroups/v2/empty/memory.max b/internal/memorylimiter/cgroups/testdata/cgroups/v2/empty/memory.max similarity index 100% rename from internal/cgroups/testdata/cgroups/v2/empty/memory.max rename to internal/memorylimiter/cgroups/testdata/cgroups/v2/empty/memory.max diff --git a/internal/cgroups/testdata/cgroups/v2/invalid/memory.max b/internal/memorylimiter/cgroups/testdata/cgroups/v2/invalid/memory.max similarity index 100% rename from internal/cgroups/testdata/cgroups/v2/invalid/memory.max rename to internal/memorylimiter/cgroups/testdata/cgroups/v2/invalid/memory.max diff --git a/internal/cgroups/testdata/cgroups/v2/memory/memory.max b/internal/memorylimiter/cgroups/testdata/cgroups/v2/memory/memory.max similarity index 100% rename from internal/cgroups/testdata/cgroups/v2/memory/memory.max rename to internal/memorylimiter/cgroups/testdata/cgroups/v2/memory/memory.max diff --git a/internal/cgroups/testdata/cgroups/v2/undefined/memory.max b/internal/memorylimiter/cgroups/testdata/cgroups/v2/undefined/memory.max similarity index 100% rename from internal/cgroups/testdata/cgroups/v2/undefined/memory.max rename to internal/memorylimiter/cgroups/testdata/cgroups/v2/undefined/memory.max diff --git a/internal/cgroups/testdata/proc/cgroups/cgroup b/internal/memorylimiter/cgroups/testdata/proc/cgroups/cgroup similarity index 100% rename from internal/cgroups/testdata/proc/cgroups/cgroup rename to internal/memorylimiter/cgroups/testdata/proc/cgroups/cgroup diff --git a/internal/cgroups/testdata/proc/cgroups/mountinfo b/internal/memorylimiter/cgroups/testdata/proc/cgroups/mountinfo similarity index 100% rename from internal/cgroups/testdata/proc/cgroups/mountinfo rename to internal/memorylimiter/cgroups/testdata/proc/cgroups/mountinfo diff --git a/internal/cgroups/testdata/proc/invalid-cgroup/cgroup b/internal/memorylimiter/cgroups/testdata/proc/invalid-cgroup/cgroup similarity index 100% rename from internal/cgroups/testdata/proc/invalid-cgroup/cgroup rename to internal/memorylimiter/cgroups/testdata/proc/invalid-cgroup/cgroup diff --git a/internal/cgroups/testdata/proc/invalid-mountinfo/mountinfo b/internal/memorylimiter/cgroups/testdata/proc/invalid-mountinfo/mountinfo similarity index 100% rename from internal/cgroups/testdata/proc/invalid-mountinfo/mountinfo rename to internal/memorylimiter/cgroups/testdata/proc/invalid-mountinfo/mountinfo diff --git a/internal/cgroups/testdata/proc/untranslatable/cgroup b/internal/memorylimiter/cgroups/testdata/proc/untranslatable/cgroup similarity index 100% rename from internal/cgroups/testdata/proc/untranslatable/cgroup rename to internal/memorylimiter/cgroups/testdata/proc/untranslatable/cgroup diff --git a/internal/cgroups/testdata/proc/untranslatable/mountinfo b/internal/memorylimiter/cgroups/testdata/proc/untranslatable/mountinfo similarity index 100% rename from internal/cgroups/testdata/proc/untranslatable/mountinfo rename to internal/memorylimiter/cgroups/testdata/proc/untranslatable/mountinfo diff --git a/internal/cgroups/testdata/proc/v2/cgroupv1/mountinfo b/internal/memorylimiter/cgroups/testdata/proc/v2/cgroupv1/mountinfo similarity index 100% rename from internal/cgroups/testdata/proc/v2/cgroupv1/mountinfo rename to internal/memorylimiter/cgroups/testdata/proc/v2/cgroupv1/mountinfo diff --git a/internal/cgroups/testdata/proc/v2/cgroupv1v2/mountinfo b/internal/memorylimiter/cgroups/testdata/proc/v2/cgroupv1v2/mountinfo similarity index 100% rename from internal/cgroups/testdata/proc/v2/cgroupv1v2/mountinfo rename to internal/memorylimiter/cgroups/testdata/proc/v2/cgroupv1v2/mountinfo diff --git a/internal/cgroups/testdata/proc/v2/cgroupv2/mountinfo b/internal/memorylimiter/cgroups/testdata/proc/v2/cgroupv2/mountinfo similarity index 100% rename from internal/cgroups/testdata/proc/v2/cgroupv2/mountinfo rename to internal/memorylimiter/cgroups/testdata/proc/v2/cgroupv2/mountinfo diff --git a/internal/cgroups/util_test.go b/internal/memorylimiter/cgroups/util_test.go similarity index 100% rename from internal/cgroups/util_test.go rename to internal/memorylimiter/cgroups/util_test.go diff --git a/internal/iruntime/mem_info.go b/internal/memorylimiter/iruntime/mem_info.go similarity index 93% rename from internal/iruntime/mem_info.go rename to internal/memorylimiter/iruntime/mem_info.go index 59e53206539..1157cd779d7 100644 --- a/internal/iruntime/mem_info.go +++ b/internal/memorylimiter/iruntime/mem_info.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package iruntime // import "go.opentelemetry.io/collector/internal/iruntime" +package iruntime // import "go.opentelemetry.io/collector/internal/memorylimiter/iruntime" import ( "github.com/shirou/gopsutil/v4/mem" diff --git a/internal/iruntime/mem_info_test.go b/internal/memorylimiter/iruntime/mem_info_test.go similarity index 100% rename from internal/iruntime/mem_info_test.go rename to internal/memorylimiter/iruntime/mem_info_test.go diff --git a/internal/iruntime/package_test.go b/internal/memorylimiter/iruntime/package_test.go similarity index 100% rename from internal/iruntime/package_test.go rename to internal/memorylimiter/iruntime/package_test.go diff --git a/internal/iruntime/total_memory_linux.go b/internal/memorylimiter/iruntime/total_memory_linux.go similarity index 91% rename from internal/iruntime/total_memory_linux.go rename to internal/memorylimiter/iruntime/total_memory_linux.go index 0b53d7a604a..526fefbb191 100644 --- a/internal/iruntime/total_memory_linux.go +++ b/internal/memorylimiter/iruntime/total_memory_linux.go @@ -3,9 +3,9 @@ //go:build linux -package iruntime // import "go.opentelemetry.io/collector/internal/iruntime" +package iruntime // import "go.opentelemetry.io/collector/internal/memorylimiter/iruntime" -import "go.opentelemetry.io/collector/internal/cgroups" +import "go.opentelemetry.io/collector/internal/memorylimiter/cgroups" // unlimitedMemorySize defines the bytes size when memory limit is not set // for the container and process with cgroups @@ -49,5 +49,6 @@ func TotalMemory() (uint64, error) { return totalMem, nil } + // nolint:gosec return uint64(memoryQuota), nil } diff --git a/internal/iruntime/total_memory_linux_test.go b/internal/memorylimiter/iruntime/total_memory_linux_test.go similarity index 100% rename from internal/iruntime/total_memory_linux_test.go rename to internal/memorylimiter/iruntime/total_memory_linux_test.go diff --git a/internal/iruntime/total_memory_other.go b/internal/memorylimiter/iruntime/total_memory_other.go similarity index 91% rename from internal/iruntime/total_memory_other.go rename to internal/memorylimiter/iruntime/total_memory_other.go index 8edb5915d64..6213dc4f06c 100644 --- a/internal/iruntime/total_memory_other.go +++ b/internal/memorylimiter/iruntime/total_memory_other.go @@ -3,7 +3,7 @@ //go:build !linux -package iruntime // import "go.opentelemetry.io/collector/internal/iruntime" +package iruntime // import "go.opentelemetry.io/collector/internal/memorylimiter/iruntime" // TotalMemory returns total available memory for non-linux platforms. func TotalMemory() (uint64, error) { diff --git a/internal/iruntime/total_memory_other_test.go b/internal/memorylimiter/iruntime/total_memory_other_test.go similarity index 100% rename from internal/iruntime/total_memory_other_test.go rename to internal/memorylimiter/iruntime/total_memory_other_test.go diff --git a/internal/memorylimiter/memorylimiter.go b/internal/memorylimiter/memorylimiter.go index db93795127a..53371b8b85c 100644 --- a/internal/memorylimiter/memorylimiter.go +++ b/internal/memorylimiter/memorylimiter.go @@ -15,7 +15,7 @@ import ( "go.uber.org/zap" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/internal/iruntime" + "go.opentelemetry.io/collector/internal/memorylimiter/iruntime" ) const ( diff --git a/internal/memorylimiter/memorylimiter_test.go b/internal/memorylimiter/memorylimiter_test.go index 89924484e79..6096877ccdc 100644 --- a/internal/memorylimiter/memorylimiter_test.go +++ b/internal/memorylimiter/memorylimiter_test.go @@ -12,7 +12,7 @@ import ( "github.com/stretchr/testify/require" "go.uber.org/zap" - "go.opentelemetry.io/collector/internal/iruntime" + "go.opentelemetry.io/collector/internal/memorylimiter/iruntime" ) // TestMemoryPressureResponse manipulates results from querying memory and diff --git a/internal/tools/go.mod b/internal/tools/go.mod index d5268b08dce..6975405ddd8 100644 --- a/internal/tools/go.mod +++ b/internal/tools/go.mod @@ -7,7 +7,7 @@ toolchain go1.22.8 require ( github.com/a8m/envsubst v1.4.2 github.com/client9/misspell v0.3.4 - github.com/golangci/golangci-lint v1.60.1 + github.com/golangci/golangci-lint v1.61.0 github.com/google/addlicense v1.1.1 github.com/jcchavezs/porto v0.6.0 github.com/pavius/impi v0.0.3 @@ -16,7 +16,7 @@ require ( go.opentelemetry.io/build-tools/crosslink v0.14.0 go.opentelemetry.io/build-tools/multimod v0.14.0 go.opentelemetry.io/build-tools/semconvgen v0.14.0 - golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 + golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e golang.org/x/tools v0.26.0 golang.org/x/vuln v1.1.3 ) @@ -26,15 +26,15 @@ require ( 4d63.com/gochecknoglobals v0.2.1 // indirect dario.cat/mergo v1.0.0 // indirect github.com/4meepo/tagalign v1.3.4 // indirect - github.com/Abirdcfly/dupword v0.0.14 // indirect + github.com/Abirdcfly/dupword v0.1.1 // indirect github.com/Antonboom/errname v0.1.13 // indirect github.com/Antonboom/nilnil v0.1.9 // indirect github.com/Antonboom/testifylint v1.4.3 // indirect github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c // indirect - github.com/Crocmagnon/fatcontext v0.4.0 // indirect + github.com/Crocmagnon/fatcontext v0.5.2 // indirect github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.0 // indirect - github.com/Masterminds/semver/v3 v3.2.1 // indirect + github.com/Masterminds/semver/v3 v3.3.0 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/OpenPeeDeeP/depguard/v2 v2.2.0 // indirect github.com/ProtonMail/go-crypto v1.0.0 // indirect @@ -59,11 +59,11 @@ require ( github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/charithe/durationcheck v0.0.10 // indirect github.com/chavacava/garif v0.1.0 // indirect - github.com/ckaznocha/intrange v0.1.2 // indirect + github.com/ckaznocha/intrange v0.2.0 // indirect github.com/cloudflare/circl v1.3.7 // indirect github.com/curioswitch/go-reassign v0.2.0 // indirect github.com/cyphar/filepath-securejoin v0.2.4 // indirect - github.com/daixiang0/gci v0.13.4 // indirect + github.com/daixiang0/gci v0.13.5 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/denis-tingaikin/go-header v0.5.0 // indirect github.com/emirpasic/gods v1.18.1 // indirect @@ -85,13 +85,13 @@ require ( github.com/go-toolsmith/astp v1.1.0 // indirect github.com/go-toolsmith/strparse v1.1.0 // indirect github.com/go-toolsmith/typep v1.1.0 // indirect - github.com/go-viper/mapstructure/v2 v2.0.0 // indirect + github.com/go-viper/mapstructure/v2 v2.1.0 // indirect github.com/go-xmlfmt/xmlfmt v1.1.2 // indirect github.com/gobwas/glob v0.2.3 // indirect github.com/gofrs/flock v0.12.1 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a // indirect - github.com/golangci/gofmt v0.0.0-20231018234816-f50ced29576e // indirect + github.com/golangci/gofmt v0.0.0-20240816233607-d8596aa466a9 // indirect github.com/golangci/misspell v0.6.0 // indirect github.com/golangci/modinfo v0.3.4 // indirect github.com/golangci/plugin-module-register v0.1.1 // indirect @@ -143,7 +143,7 @@ require ( github.com/nishanths/predeclared v0.2.2 // indirect github.com/nunnatsa/ginkgolinter v0.16.2 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect - github.com/pelletier/go-toml/v2 v2.2.2 // indirect + github.com/pelletier/go-toml/v2 v2.2.3 // indirect github.com/pjbgf/sha1cd v0.3.0 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/polyfloyd/go-errorlint v1.6.0 // indirect @@ -151,12 +151,12 @@ require ( github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/common v0.48.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect - github.com/quasilyte/go-ruleguard v0.4.2 // indirect + github.com/quasilyte/go-ruleguard v0.4.3-0.20240823090925-0fe6f58b47b1 // indirect github.com/quasilyte/go-ruleguard/dsl v0.3.22 // indirect github.com/quasilyte/gogrep v0.5.0 // indirect github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 // indirect github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 // indirect - github.com/ryancurrah/gomodguard v1.3.3 // indirect + github.com/ryancurrah/gomodguard v1.3.5 // indirect github.com/ryanrolds/sqlclosecheck v0.5.1 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect @@ -164,7 +164,7 @@ require ( github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect github.com/sashamelentyev/interfacebloat v1.1.0 // indirect github.com/sashamelentyev/usestdlibvars v1.27.0 // indirect - github.com/securego/gosec/v2 v2.20.1-0.20240525090044-5f0084eb01a9 // indirect + github.com/securego/gosec/v2 v2.21.2 // indirect github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c // indirect github.com/sirupsen/logrus v1.9.3 // indirect @@ -185,10 +185,10 @@ require ( github.com/stretchr/testify v1.9.0 // indirect github.com/subosito/gotenv v1.6.0 // indirect github.com/tdakkota/asciicheck v0.2.0 // indirect - github.com/tetafro/godot v1.4.16 // indirect + github.com/tetafro/godot v1.4.17 // indirect github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966 // indirect github.com/timonwong/loggercheck v0.9.4 // indirect - github.com/tomarrell/wrapcheck/v2 v2.8.3 // indirect + github.com/tomarrell/wrapcheck/v2 v2.9.0 // indirect github.com/tommy-muehle/go-mnd/v2 v2.5.1 // indirect github.com/ultraware/funlen v0.1.0 // indirect github.com/ultraware/whitespace v0.1.1 // indirect @@ -213,13 +213,13 @@ require ( golang.org/x/sys v0.26.0 // indirect golang.org/x/telemetry v0.0.0-20240522233618-39ace7a40ae7 // indirect golang.org/x/text v0.19.0 // indirect - google.golang.org/protobuf v1.33.0 // indirect + google.golang.org/protobuf v1.34.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - honnef.co/go/tools v0.5.0 // indirect - mvdan.cc/gofumpt v0.6.0 // indirect + honnef.co/go/tools v0.5.1 // indirect + mvdan.cc/gofumpt v0.7.0 // indirect mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f // indirect ) diff --git a/internal/tools/go.sum b/internal/tools/go.sum index a5452f5f199..cff460b149b 100644 --- a/internal/tools/go.sum +++ b/internal/tools/go.sum @@ -6,8 +6,8 @@ dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= github.com/4meepo/tagalign v1.3.4 h1:P51VcvBnf04YkHzjfclN6BbsopfJR5rxs1n+5zHt+w8= github.com/4meepo/tagalign v1.3.4/go.mod h1:M+pnkHH2vG8+qhE5bVc/zeP7HS/j910Fwa9TUSyZVI0= -github.com/Abirdcfly/dupword v0.0.14 h1:3U4ulkc8EUo+CaT105/GJ1BQwtgyj6+VaBVbAX11Ba8= -github.com/Abirdcfly/dupword v0.0.14/go.mod h1:VKDAbxdY8YbKUByLGg8EETzYSuC4crm9WwI6Y3S0cLI= +github.com/Abirdcfly/dupword v0.1.1 h1:Bsxe0fIw6OwBtXMIncaTxCLHYO5BB+3mcsR5E8VXloY= +github.com/Abirdcfly/dupword v0.1.1/go.mod h1:B49AcJdTYYkpd4HjgAcutNGG9HZ2JWwKunH9Y2BA6sM= github.com/Antonboom/errname v0.1.13 h1:JHICqsewj/fNckzrfVSe+T33svwQxmjC+1ntDsHOVvM= github.com/Antonboom/errname v0.1.13/go.mod h1:uWyefRYRN54lBg6HseYCFhs6Qjcy41Y3Jl/dVhA87Ns= github.com/Antonboom/nilnil v0.1.9 h1:eKFMejSxPSA9eLSensFmjW2XTgTwJMjZ8hUHtV4s/SQ= @@ -16,14 +16,14 @@ github.com/Antonboom/testifylint v1.4.3 h1:ohMt6AHuHgttaQ1xb6SSnxCeK4/rnK7KKzbvs github.com/Antonboom/testifylint v1.4.3/go.mod h1:+8Q9+AOLsz5ZiQiiYujJKs9mNz398+M6UgslP4qgJLA= github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c h1:pxW6RcqyfI9/kWtOwnv/G+AzdKuy2ZrqINhenH4HyNs= github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= -github.com/Crocmagnon/fatcontext v0.4.0 h1:4ykozu23YHA0JB6+thiuEv7iT6xq995qS1vcuWZq0tg= -github.com/Crocmagnon/fatcontext v0.4.0/go.mod h1:ZtWrXkgyfsYPzS6K3O88va6t2GEglG93vnII/F94WC0= +github.com/Crocmagnon/fatcontext v0.5.2 h1:vhSEg8Gqng8awhPju2w7MKHqMlg4/NI+gSDHtR3xgwA= +github.com/Crocmagnon/fatcontext v0.5.2/go.mod h1:87XhRMaInHP44Q7Tlc7jkgKKB7kZAOPiDkFMdKCC+74= github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 h1:sHglBQTwgx+rWPdisA5ynNEsoARbiCBOyGcJM4/OzsM= github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.0 h1:/fTUt5vmbkAcMBt4YQiuC23cV0kEsN1MVMNqeOW43cU= github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.0/go.mod h1:ONJg5sxcbsdQQ4pOW8TGdTidT2TMAUy/2Xhr8mrYaao= -github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0= -github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= +github.com/Masterminds/semver/v3 v3.3.0 h1:B8LGeaivUe71a5qox1ICM/JLl0NqZSW5CHyL+hmvYS0= +github.com/Masterminds/semver/v3 v3.3.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= @@ -82,8 +82,8 @@ github.com/charithe/durationcheck v0.0.10 h1:wgw73BiocdBDQPik+zcEoBG/ob8uyBHf2iy github.com/charithe/durationcheck v0.0.10/go.mod h1:bCWXb7gYRysD1CU3C+u4ceO49LoGOY1C1L6uouGNreQ= github.com/chavacava/garif v0.1.0 h1:2JHa3hbYf5D9dsgseMKAmc/MZ109otzgNFk5s87H9Pc= github.com/chavacava/garif v0.1.0/go.mod h1:XMyYCkEL58DF0oyW4qDjjnPWONs2HBqYKI+UIPD+Gww= -github.com/ckaznocha/intrange v0.1.2 h1:3Y4JAxcMntgb/wABQ6e8Q8leMd26JbX2790lIss9MTI= -github.com/ckaznocha/intrange v0.1.2/go.mod h1:RWffCw/vKBwHeOEwWdCikAtY0q4gGt8VhJZEEA5n+RE= +github.com/ckaznocha/intrange v0.2.0 h1:FykcZuJ8BD7oX93YbO1UY9oZtkRbp+1/kJcDjkefYLs= +github.com/ckaznocha/intrange v0.2.0/go.mod h1:r5I7nUlAAG56xmkOpw4XVr16BXhwYTUdcuRFeevn1oE= github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= @@ -94,8 +94,8 @@ github.com/curioswitch/go-reassign v0.2.0 h1:G9UZyOcpk/d7Gd6mqYgd8XYWFMw/znxwGDU github.com/curioswitch/go-reassign v0.2.0/go.mod h1:x6OpXuWvgfQaMGks2BZybTngWjT84hqJfKoO8Tt/Roc= github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= -github.com/daixiang0/gci v0.13.4 h1:61UGkmpoAcxHM2hhNkZEf5SzwQtWJXTSws7jaPyqwlw= -github.com/daixiang0/gci v0.13.4/go.mod h1:12etP2OniiIdP4q+kjUGrC/rUagga7ODbqsom5Eo5Yk= +github.com/daixiang0/gci v0.13.5 h1:kThgmH1yBmZSBCh1EJVxQ7JsHpm5Oms0AMed/0LaH4c= +github.com/daixiang0/gci v0.13.5/go.mod h1:12etP2OniiIdP4q+kjUGrC/rUagga7ODbqsom5Eo5Yk= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= @@ -134,8 +134,10 @@ github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMj github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII= github.com/go-git/go-git/v5 v5.12.0 h1:7Md+ndsjrzZxbddRDZjF14qK+NN56sy6wkqaVrjZtys= github.com/go-git/go-git/v5 v5.12.0/go.mod h1:FTM9VKtnI2m65hNI/TenDDDnUf2Q9FHnXYjuz9i5OEY= -github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= -github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7eI= +github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/go-toolsmith/astcast v1.1.0 h1:+JN9xZV1A+Re+95pgnMgDboWNVnIMMQXwfBwLRPgSC8= @@ -157,8 +159,8 @@ github.com/go-toolsmith/strparse v1.1.0 h1:GAioeZUK9TGxnLS+qfdqNbA4z0SSm5zVNtCQi github.com/go-toolsmith/strparse v1.1.0/go.mod h1:7ksGy58fsaQkGQlY8WVoBFNyEPMGuJin1rfoPS4lBSQ= github.com/go-toolsmith/typep v1.1.0 h1:fIRYDyF+JywLfqzyhdiHzRop/GQDxxNhLGQ6gFUNHus= github.com/go-toolsmith/typep v1.1.0/go.mod h1:fVIw+7zjdsMxDA3ITWnH1yOiw1rnTQKCsF/sk2H/qig= -github.com/go-viper/mapstructure/v2 v2.0.0 h1:dhn8MZ1gZ0mzeodTG3jt5Vj/o87xZKuNAprG2mQfMfc= -github.com/go-viper/mapstructure/v2 v2.0.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.1.0 h1:gHnMa2Y/pIxElCH2GlZZ1lZSsn6XMtufpGyP1XxdC/w= +github.com/go-viper/mapstructure/v2 v2.1.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/go-xmlfmt/xmlfmt v1.1.2 h1:Nea7b4icn8s57fTx1M5AI4qQT5HEM3rVUO8MuE6g80U= github.com/go-xmlfmt/xmlfmt v1.1.2/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM= github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= @@ -169,10 +171,10 @@ github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a h1:w8hkcTqaFpzKqonE9uMCefW1WDie15eSP/4MssdenaM= github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a/go.mod h1:ryS0uhF+x9jgbj/N71xsEqODy9BN81/GonCZiOzirOk= -github.com/golangci/gofmt v0.0.0-20231018234816-f50ced29576e h1:ULcKCDV1LOZPFxGZaA6TlQbiM3J2GCPnkx/bGF6sX/g= -github.com/golangci/gofmt v0.0.0-20231018234816-f50ced29576e/go.mod h1:Pm5KhLPA8gSnQwrQ6ukebRcapGb/BG9iUkdaiCcGHJM= -github.com/golangci/golangci-lint v1.60.1 h1:DRKNqNTQRLBJZ1il5u4fvgLQCjQc7QFs0DbhksJtVJE= -github.com/golangci/golangci-lint v1.60.1/go.mod h1:jDIPN1rYaIA+ijp9OZcUmUCoQOtZ76pOlFbi15FlLJY= +github.com/golangci/gofmt v0.0.0-20240816233607-d8596aa466a9 h1:/1322Qns6BtQxUZDTAT4SdcoxknUki7IAoK4SAXr8ME= +github.com/golangci/gofmt v0.0.0-20240816233607-d8596aa466a9/go.mod h1:Oesb/0uFAyWoaw1U1qS5zyjCg5NP9C9iwjnI4tIsXEE= +github.com/golangci/golangci-lint v1.61.0 h1:VvbOLaRVWmyxCnUIMTbf1kDsaJbTzH20FAMXTAlQGu8= +github.com/golangci/golangci-lint v1.61.0/go.mod h1:e4lztIrJJgLPhWvFPDkhiMwEFRrWlmFbrZea3FsJyN8= github.com/golangci/misspell v0.6.0 h1:JCle2HUTNWirNlDIAUO44hUsKhOFqGPoC4LZxlaSXDs= github.com/golangci/misspell v0.6.0/go.mod h1:keMNyY6R9isGaSAu+4Q8NMBwMPkh15Gtc8UCVoDtAWo= github.com/golangci/modinfo v0.3.4 h1:oU5huX3fbxqQXdfspamej74DFX0kyGLkw1ppvXoJ8GA= @@ -194,8 +196,8 @@ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 h1:k7nVchz72niMH6YLQNvHSdIE7iqsQxK1P41mySCvssg= -github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw= +github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 h1:5iH8iuqE5apketRbSFBy+X1V0o+l+8NF1avt4HWl7cA= +github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= github.com/google/renameio v0.1.0 h1:GOZbcHa3HfsPKPlmyPyN2KEohoMXOhdMbHrvbpl2QaA= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/gordonklaus/ineffassign v0.1.0 h1:y2Gd/9I7MdY1oEIt+n+rowjBNDcLQq3RsH5hwJd0f9s= @@ -305,10 +307,10 @@ github.com/nunnatsa/ginkgolinter v0.16.2 h1:8iLqHIZvN4fTLDC0Ke9tbSZVcyVHoBs0HIbn github.com/nunnatsa/ginkgolinter v0.16.2/go.mod h1:4tWRinDN1FeJgU+iJANW/kz7xKN5nYRAOfJDQUS9dOQ= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= -github.com/onsi/ginkgo/v2 v2.17.3 h1:oJcvKpIb7/8uLpDDtnQuf18xVnwKp8DTD7DQ6gTd/MU= -github.com/onsi/ginkgo/v2 v2.17.3/go.mod h1:nP2DPOQoNsQmsVyv5rDA8JkXQoCs6goXIvr/PRJ1eCc= -github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk= -github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0= +github.com/onsi/ginkgo/v2 v2.20.2 h1:7NVCeyIWROIAheY21RLS+3j2bb52W0W82tkberYytp4= +github.com/onsi/ginkgo/v2 v2.20.2/go.mod h1:K9gyxPIlb+aIvnZ8bd9Ak+YP18w3APlR+5coaZoE2ag= +github.com/onsi/gomega v1.34.2 h1:pNCwDkzrsv7MS9kpaQvVb1aVLahQXyJ/Tv5oAZMI3i8= +github.com/onsi/gomega v1.34.2/go.mod h1:v1xfxRgk0KIsG+QOdm7p8UosrOzPYRo60fd3B/1Dukc= github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw= github.com/otiai10/copy v1.14.0 h1:dCI/t1iTdYGtkvCuBG2BgR6KZa83PTclw4U5n2wAllU= github.com/otiai10/copy v1.14.0/go.mod h1:ECfuL02W+/FkTWZWgQqXPWZgW9oeKCSQ5qVfSc4qc4w= @@ -318,8 +320,8 @@ github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT9 github.com/otiai10/mint v1.3.1/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= github.com/pavius/impi v0.0.3 h1:DND6MzU+BLABhOZXbELR3FU8b+zDgcq4dOCNLhiTYuI= github.com/pavius/impi v0.0.3/go.mod h1:x/hU0bfdWIhuOT1SKwiJg++yvkk6EuOtJk8WtDZqgr8= -github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= -github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= +github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= +github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -339,8 +341,8 @@ github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSz github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= -github.com/quasilyte/go-ruleguard v0.4.2 h1:htXcXDK6/rO12kiTHKfHuqR4kr3Y4M0J0rOL6CH/BYs= -github.com/quasilyte/go-ruleguard v0.4.2/go.mod h1:GJLgqsLeo4qgavUoL8JeGFNS7qcisx3awV/w9eWTmNI= +github.com/quasilyte/go-ruleguard v0.4.3-0.20240823090925-0fe6f58b47b1 h1:+Wl/0aFp0hpuHM3H//KMft64WQ1yX9LdJY64Qm/gFCo= +github.com/quasilyte/go-ruleguard v0.4.3-0.20240823090925-0fe6f58b47b1/go.mod h1:GJLgqsLeo4qgavUoL8JeGFNS7qcisx3awV/w9eWTmNI= github.com/quasilyte/go-ruleguard/dsl v0.3.22 h1:wd8zkOhSNr+I+8Qeciml08ivDt1pSXe60+5DqOpCjPE= github.com/quasilyte/go-ruleguard/dsl v0.3.22/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= github.com/quasilyte/gogrep v0.5.0 h1:eTKODPXbI8ffJMN+W2aE0+oL0z/nh8/5eNdiO34SOAo= @@ -352,8 +354,8 @@ github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567/go.mod h1:DWNGW8 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/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ryancurrah/gomodguard v1.3.3 h1:eiSQdJVNr9KTNxY2Niij8UReSwR8Xrte3exBrAZfqpg= -github.com/ryancurrah/gomodguard v1.3.3/go.mod h1:rsKQjj4l3LXe8N344Ow7agAy5p9yjsWOtRzUMYmA0QY= +github.com/ryancurrah/gomodguard v1.3.5 h1:cShyguSwUEeC0jS7ylOiG/idnd1TpJ1LfHGpV3oJmPU= +github.com/ryancurrah/gomodguard v1.3.5/go.mod h1:MXlEPQRxgfPQa62O8wzK3Ozbkv9Rkqr+wKjSxTdsNJE= github.com/ryanrolds/sqlclosecheck v0.5.1 h1:dibWW826u0P8jNLsLN+En7+RqWWTYrjCB9fJfSfdyCU= github.com/ryanrolds/sqlclosecheck v0.5.1/go.mod h1:2g3dUjoS6AL4huFdv6wn55WpLIDjY7ZgUR4J8HOO/XQ= github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= @@ -368,8 +370,8 @@ github.com/sashamelentyev/interfacebloat v1.1.0 h1:xdRdJp0irL086OyW1H/RTZTr1h/tM github.com/sashamelentyev/interfacebloat v1.1.0/go.mod h1:+Y9yU5YdTkrNvoX0xHc84dxiN1iBi9+G8zZIhPVoNjQ= github.com/sashamelentyev/usestdlibvars v1.27.0 h1:t/3jZpSXtRPRf2xr0m63i32ZrusyurIGT9E5wAvXQnI= github.com/sashamelentyev/usestdlibvars v1.27.0/go.mod h1:9nl0jgOfHKWNFS43Ojw0i7aRoS4j6EBye3YBhmAIRF8= -github.com/securego/gosec/v2 v2.20.1-0.20240525090044-5f0084eb01a9 h1:rnO6Zp1YMQwv8AyxzuwsVohljJgp4L0ZqiCgtACsPsc= -github.com/securego/gosec/v2 v2.20.1-0.20240525090044-5f0084eb01a9/go.mod h1:dg7lPlu/xK/Ut9SedURCoZbVCR4yC7fM65DtH9/CDHs= +github.com/securego/gosec/v2 v2.21.2 h1:deZp5zmYf3TWwU7A7cR2+SolbTpZ3HQiwFqnzQyEl3M= +github.com/securego/gosec/v2 v2.21.2/go.mod h1:au33kg78rNseF5PwPnTWhuYBFf534bvJRvOrgZ/bFzU= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c h1:W65qqJCIOVP4jpqPQ0YvHYKwcMEMVWIzWC5iNQQfBTU= @@ -429,14 +431,14 @@ github.com/tenntenn/modver v1.0.1 h1:2klLppGhDgzJrScMpkj9Ujy3rXPUspSjAcev9tSEBgA github.com/tenntenn/modver v1.0.1/go.mod h1:bePIyQPb7UeioSRkw3Q0XeMhYZSMx9B8ePqg6SAMGH0= github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3 h1:f+jULpRQGxTSkNYKJ51yaw6ChIqO+Je8UqsTKN/cDag= github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3/go.mod h1:ON8b8w4BN/kE1EOhwT0o+d62W65a6aPw1nouo9LMgyY= -github.com/tetafro/godot v1.4.16 h1:4ChfhveiNLk4NveAZ9Pu2AN8QZ2nkUGFuadM9lrr5D0= -github.com/tetafro/godot v1.4.16/go.mod h1:2oVxTBSftRTh4+MVfUaUXR6bn2GDXCaMcOG4Dk3rfio= +github.com/tetafro/godot v1.4.17 h1:pGzu+Ye7ZUEFx7LHU0dAKmCOXWsPjl7qA6iMGndsjPs= +github.com/tetafro/godot v1.4.17/go.mod h1:2oVxTBSftRTh4+MVfUaUXR6bn2GDXCaMcOG4Dk3rfio= github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966 h1:quvGphlmUVU+nhpFa4gg4yJyTRJ13reZMDHrKwYw53M= github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966/go.mod h1:27bSVNWSBOHm+qRp1T9qzaIpsWEP6TbUnei/43HK+PQ= github.com/timonwong/loggercheck v0.9.4 h1:HKKhqrjcVj8sxL7K77beXh0adEm6DLjV/QOGeMXEVi4= github.com/timonwong/loggercheck v0.9.4/go.mod h1:caz4zlPcgvpEkXgVnAJGowHAMW2NwHaNlpS8xDbVhTg= -github.com/tomarrell/wrapcheck/v2 v2.8.3 h1:5ov+Cbhlgi7s/a42BprYoxsr73CbdMUTzE3bRDFASUs= -github.com/tomarrell/wrapcheck/v2 v2.8.3/go.mod h1:g9vNIyhb5/9TQgumxQyOEqDHsmGYcGsVMOx/xGkqdMo= +github.com/tomarrell/wrapcheck/v2 v2.9.0 h1:801U2YCAjLhdN8zhZ/7tdjB3EnAoRlJHt/s+9hijLQ4= +github.com/tomarrell/wrapcheck/v2 v2.9.0/go.mod h1:g9vNIyhb5/9TQgumxQyOEqDHsmGYcGsVMOx/xGkqdMo= github.com/tommy-muehle/go-mnd/v2 v2.5.1 h1:NowYhSdyE/1zwK9QCLeRb6USWdoif80Ie+v+yU8u1Zw= github.com/tommy-muehle/go-mnd/v2 v2.5.1/go.mod h1:WsUAkMJMYww6l/ufffCD3m+P7LEvr8TnZn9lwVDlgzw= github.com/ultraware/funlen v0.1.0 h1:BuqclbkY6pO+cvxoq7OsktIXZpgBSkYTQtmwhAK81vI= @@ -499,8 +501,8 @@ golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2Uz golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= -golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM= -golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc= +golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e h1:I88y4caeGeuDQxgdoFPUq097j7kNfw6uvuiNxUBfcBk= +golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/exp/typeparams v0.0.0-20230203172020-98cc5a0785f9/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/exp/typeparams v0.0.0-20240314144324-c7f7c6466f7f h1:phY1HzDcf18Aq9A8KkmRtY9WvOFIxN8wgfvy6Zm1DV8= @@ -622,8 +624,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= @@ -638,9 +640,9 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.5.0 h1:29uoiIormS3Z6R+t56STz/oI4v+mB51TSmEOdJPgRnE= -honnef.co/go/tools v0.5.0/go.mod h1:e9irvo83WDG9/irijV44wr3tbhcFeRnfpVlRqVwpzMs= -mvdan.cc/gofumpt v0.6.0 h1:G3QvahNDmpD+Aek/bNOLrFR2XC6ZAdo62dZu65gmwGo= -mvdan.cc/gofumpt v0.6.0/go.mod h1:4L0wf+kgIPZtcCWXynNS2e6bhmj73umwnuXSZarixzA= +honnef.co/go/tools v0.5.1 h1:4bH5o3b5ZULQ4UrBmP+63W9r7qIkqJClEA9ko5YKx+I= +honnef.co/go/tools v0.5.1/go.mod h1:e9irvo83WDG9/irijV44wr3tbhcFeRnfpVlRqVwpzMs= +mvdan.cc/gofumpt v0.7.0 h1:bg91ttqXmi9y2xawvkuMXyvAA/1ZGJqYAEGjXuP0JXU= +mvdan.cc/gofumpt v0.7.0/go.mod h1:txVFJy/Sc/mvaycET54pV8SW8gWxTlUuGHVEcncmNUo= mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f h1:lMpcwN6GxNbWtbpI1+xzFLSW8XzX0u72NttUGVFjO3U= mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f/go.mod h1:RSLa7mKKCNeTTMHBw5Hsy2rfJmd6O2ivt9Dw9ZqCQpQ= diff --git a/otelcol/collector.go b/otelcol/collector.go index 3526861ad83..13ac5986ee5 100644 --- a/otelcol/collector.go +++ b/otelcol/collector.go @@ -95,7 +95,7 @@ type Collector struct { serviceConfig *service.Config service *service.Service - state *atomic.Int32 + state *atomic.Int64 // shutdownChan is used to terminate the collector. shutdownChan chan struct{} @@ -121,8 +121,8 @@ func NewCollector(set CollectorSettings) (*Collector, error) { return nil, err } - state := &atomic.Int32{} - state.Store(int32(StateStarting)) + state := new(atomic.Int64) + state.Store(int64(StateStarting)) return &Collector{ set: set, state: state, @@ -366,5 +366,5 @@ func (col *Collector) shutdown(ctx context.Context) error { // setCollectorState provides current state of the collector func (col *Collector) setCollectorState(state State) { - col.state.Store(int32(state)) + col.state.Store(int64(state)) } diff --git a/otelcol/command_components.go b/otelcol/command_components.go index 94115816d54..bb35465a2be 100644 --- a/otelcol/command_components.go +++ b/otelcol/command_components.go @@ -72,7 +72,7 @@ func newComponentsCommand(set CollectorSettings) *cobra.Command { Name: ext.Type(), Module: factories.ExtensionModules[ext.Type()], Stability: map[string]string{ - "extension": ext.ExtensionStability().String(), + "extension": ext.Stability().String(), }, }) } diff --git a/otelcol/config_test.go b/otelcol/config_test.go index e652d21076b..e0455330bda 100644 --- a/otelcol/config_test.go +++ b/otelcol/config_test.go @@ -100,7 +100,7 @@ func TestConfigValidate(t *testing.T) { name: "invalid-receiver-reference", cfgFn: func() *Config { cfg := generateConfig() - pipe := cfg.Service.Pipelines[pipeline.MustNewID("traces")] + pipe := cfg.Service.Pipelines[pipeline.NewID(pipeline.SignalTraces)] pipe.Receivers = append(pipe.Receivers, component.MustNewIDWithName("nop", "2")) return cfg }, @@ -110,7 +110,7 @@ func TestConfigValidate(t *testing.T) { name: "invalid-processor-reference", cfgFn: func() *Config { cfg := generateConfig() - pipe := cfg.Service.Pipelines[pipeline.MustNewID("traces")] + pipe := cfg.Service.Pipelines[pipeline.NewID(pipeline.SignalTraces)] pipe.Processors = append(pipe.Processors, component.MustNewIDWithName("nop", "2")) return cfg }, @@ -120,7 +120,7 @@ func TestConfigValidate(t *testing.T) { name: "invalid-exporter-reference", cfgFn: func() *Config { cfg := generateConfig() - pipe := cfg.Service.Pipelines[pipeline.MustNewID("traces")] + pipe := cfg.Service.Pipelines[pipeline.NewID(pipeline.SignalTraces)] pipe.Exporters = append(pipe.Exporters, component.MustNewIDWithName("nop", "2")) return cfg }, @@ -187,7 +187,7 @@ func TestConfigValidate(t *testing.T) { cfg := generateConfig() cfg.Receivers[component.MustNewID("nop2")] = &errConfig{} cfg.Connectors[component.MustNewID("nop2")] = &errConfig{} - pipe := cfg.Service.Pipelines[pipeline.MustNewID("traces")] + pipe := cfg.Service.Pipelines[pipeline.NewID(pipeline.SignalTraces)] pipe.Receivers = append(pipe.Receivers, component.MustNewIDWithName("nop", "2")) pipe.Exporters = append(pipe.Exporters, component.MustNewIDWithName("nop", "2")) return cfg @@ -200,7 +200,7 @@ func TestConfigValidate(t *testing.T) { cfg := generateConfig() cfg.Exporters[component.MustNewID("nop2")] = &errConfig{} cfg.Connectors[component.MustNewID("nop2")] = &errConfig{} - pipe := cfg.Service.Pipelines[pipeline.MustNewID("traces")] + pipe := cfg.Service.Pipelines[pipeline.NewID(pipeline.SignalTraces)] pipe.Receivers = append(pipe.Receivers, component.MustNewIDWithName("nop", "2")) pipe.Exporters = append(pipe.Exporters, component.MustNewIDWithName("nop", "2")) return cfg @@ -211,7 +211,7 @@ func TestConfigValidate(t *testing.T) { name: "invalid-connector-reference-as-receiver", cfgFn: func() *Config { cfg := generateConfig() - pipe := cfg.Service.Pipelines[pipeline.MustNewID("traces")] + pipe := cfg.Service.Pipelines[pipeline.NewID(pipeline.SignalTraces)] pipe.Receivers = append(pipe.Receivers, component.MustNewIDWithName("nop", "conn2")) return cfg }, @@ -221,7 +221,7 @@ func TestConfigValidate(t *testing.T) { name: "invalid-connector-reference-as-receiver", cfgFn: func() *Config { cfg := generateConfig() - pipe := cfg.Service.Pipelines[pipeline.MustNewID("traces")] + pipe := cfg.Service.Pipelines[pipeline.NewID(pipeline.SignalTraces)] pipe.Exporters = append(pipe.Exporters, component.MustNewIDWithName("nop", "conn2")) return cfg }, @@ -291,7 +291,7 @@ func generateConfig() *Config { }, Extensions: []component.ID{component.MustNewID("nop")}, Pipelines: pipelines.Config{ - pipeline.MustNewID("traces"): { + pipeline.NewID(pipeline.SignalTraces): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop")}, diff --git a/otelcol/go.mod b/otelcol/go.mod index f5c387ef021..231a38af3c8 100644 --- a/otelcol/go.mod +++ b/otelcol/go.mod @@ -36,14 +36,14 @@ require ( github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.2.6 // indirect - github.com/go-viper/mapstructure/v2 v2.1.0 // indirect + github.com/go-viper/mapstructure/v2 v2.2.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/google/uuid v1.6.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect github.com/hashicorp/go-version v1.7.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.17.10 // indirect + github.com/klauspost/compress v1.17.11 // 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 @@ -65,45 +65,44 @@ require ( github.com/tklauser/numcpus v0.6.1 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect go.opentelemetry.io/collector v0.111.0 // indirect - go.opentelemetry.io/collector/component/componentprofiles v0.111.0 // indirect go.opentelemetry.io/collector/connector/connectorprofiles v0.111.0 // indirect go.opentelemetry.io/collector/consumer v0.111.0 // indirect go.opentelemetry.io/collector/consumer/consumerprofiles v0.111.0 // indirect go.opentelemetry.io/collector/consumer/consumertest v0.111.0 // indirect go.opentelemetry.io/collector/exporter/exporterprofiles v0.111.0 // indirect go.opentelemetry.io/collector/extension/extensioncapabilities v0.111.0 // indirect - go.opentelemetry.io/collector/internal/globalgates v0.111.0 // indirect go.opentelemetry.io/collector/internal/globalsignal v0.111.0 // indirect go.opentelemetry.io/collector/pdata v1.17.0 // indirect go.opentelemetry.io/collector/pdata/pprofile v0.111.0 // indirect go.opentelemetry.io/collector/pdata/testdata v0.111.0 // indirect + go.opentelemetry.io/collector/pipeline/pipelineprofiles v0.111.0 // indirect go.opentelemetry.io/collector/processor/processorprofiles v0.111.0 // indirect go.opentelemetry.io/collector/receiver/receiverprofiles v0.111.0 // indirect go.opentelemetry.io/collector/semconv v0.111.0 // indirect go.opentelemetry.io/contrib/propagators/b3 v1.30.0 // indirect - go.opentelemetry.io/otel v1.30.0 // indirect + go.opentelemetry.io/otel v1.31.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.6.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.30.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.30.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.31.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.31.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.30.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.30.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.30.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.53.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.6.0 // indirect - go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.30.0 // indirect + go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.31.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.30.0 // indirect go.opentelemetry.io/otel/log v0.6.0 // indirect - go.opentelemetry.io/otel/metric v1.30.0 // indirect - go.opentelemetry.io/otel/sdk v1.30.0 // indirect + go.opentelemetry.io/otel/metric v1.31.0 // indirect + go.opentelemetry.io/otel/sdk v1.31.0 // indirect go.opentelemetry.io/otel/sdk/log v0.6.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect - go.opentelemetry.io/otel/trace v1.30.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.31.0 // indirect + go.opentelemetry.io/otel/trace v1.31.0 // indirect go.opentelemetry.io/proto/otlp v1.3.1 // indirect golang.org/x/net v0.30.0 // indirect golang.org/x/text v0.19.0 // indirect gonum.org/v1/gonum v0.15.1 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20241007155032-5fefd90f89a9 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9 // indirect google.golang.org/protobuf v1.35.1 // indirect ) @@ -159,14 +158,10 @@ replace go.opentelemetry.io/collector/config/configtls => ../config/configtls replace go.opentelemetry.io/collector/config/configopaque => ../config/configopaque -replace go.opentelemetry.io/collector/internal/globalgates => ../internal/globalgates - replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../consumer/consumerprofiles replace go.opentelemetry.io/collector/consumer/consumertest => ../consumer/consumertest -replace go.opentelemetry.io/collector/component/componentprofiles => ../component/componentprofiles - replace go.opentelemetry.io/collector/client => ../client replace go.opentelemetry.io/collector/component/componentstatus => ../component/componentstatus @@ -184,3 +179,5 @@ replace go.opentelemetry.io/collector/exporter/exporterprofiles => ../exporter/e replace go.opentelemetry.io/collector/pipeline => ../pipeline replace go.opentelemetry.io/collector/internal/globalsignal => ../internal/globalsignal + +replace go.opentelemetry.io/collector/pipeline/pipelineprofiles => ../pipeline/pipelineprofiles diff --git a/otelcol/go.sum b/otelcol/go.sum index bf879f834b9..3a6c2c8a5c1 100644 --- a/otelcol/go.sum +++ b/otelcol/go.sum @@ -21,8 +21,8 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= -github.com/go-viper/mapstructure/v2 v2.1.0 h1:gHnMa2Y/pIxElCH2GlZZ1lZSsn6XMtufpGyP1XxdC/w= -github.com/go-viper/mapstructure/v2 v2.1.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= @@ -43,8 +43,8 @@ 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.10 h1:oXAz+Vh0PMUvJczoi+flxpnBEPxoER1IaAnU/NMPtT0= -github.com/klauspost/compress v1.17.10/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= +github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= +github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= 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= @@ -84,8 +84,8 @@ github.com/prometheus/common v0.60.0 h1:+V9PAREWNvJMAuJ1x1BaWl9dewMW4YrHZQbx0sJN github.com/prometheus/common v0.60.0/go.mod h1:h0LYf1R1deLSKtD4Vdg8gy4RuOvENW2J/h19V5NADQw= 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/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= +github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -115,40 +115,40 @@ go.opentelemetry.io/contrib/propagators/b3 v1.30.0 h1:vumy4r1KMyaoQRltX7cJ37p3nl go.opentelemetry.io/contrib/propagators/b3 v1.30.0/go.mod h1:fRbvRsaeVZ82LIl3u0rIvusIel2UUf+JcaaIpy5taho= go.opentelemetry.io/contrib/zpages v0.55.0 h1:F+xj261Ulwl79QC+2O+IO1b3NbwppUDwN+7LbDSdQcY= go.opentelemetry.io/contrib/zpages v0.55.0/go.mod h1:dDqDGDfbXSjt/k9orZk4Huulvz1letX1YWTKts5GQpo= -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 v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= +go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.6.0 h1:QSKmLBzbFULSyHzOdO9JsN9lpE4zkrz1byYGmJecdVE= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.6.0/go.mod h1:sTQ/NH8Yrirf0sJ5rWqVu+oT82i4zL9FaF6rWcqnptM= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.30.0 h1:WypxHH02KX2poqqbaadmkMYalGyy/vil4HE4PM4nRJc= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.30.0/go.mod h1:U79SV99vtvGSEBeeHnpgGJfTsnsdkWLpPN/CcHAzBSI= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.30.0 h1:VrMAbeJz4gnVDg2zEzjHG4dEH86j4jO6VYB+NgtGD8s= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.30.0/go.mod h1:qqN/uFdpeitTvm+JDqqnjm517pmQRYxTORbETHq5tOc= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.31.0 h1:FZ6ei8GFW7kyPYdxJaV2rgI6M+4tvZzhYsQ2wgyVC08= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.31.0/go.mod h1:MdEu/mC6j3D+tTEfvI15b5Ci2Fn7NneJ71YMoiS3tpI= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.31.0 h1:ZsXq73BERAiNuuFXYqP4MR5hBrjXfMGSO+Cx7qoOZiM= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.31.0/go.mod h1:hg1zaDMpyZJuUzjFxFsRYBoccE86tM9Uf4IqNMUxvrY= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.30.0 h1:lsInsfvhVIfOI6qHVyysXMNDnjO9Npvl7tlDPJFBVd4= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.30.0/go.mod h1:KQsVNh4OjgjTG0G6EiNi1jVpnaeeKsKMRwbLN+f1+8M= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.30.0 h1:m0yTiGDLUvVYaTFbAvCkVYIYcvwKt3G7OLoN77NUs/8= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.30.0/go.mod h1:wBQbT4UekBfegL2nx0Xk1vBcnzyBPsIVm9hRG4fYcr4= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.30.0 h1:umZgi92IyxfXd/l4kaDhnKgY8rnN/cZcF1LKc6I8OQ8= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.30.0/go.mod h1:4lVs6obhSVRb1EW5FhOuBTyiQhtRtAnnva9vD3yRfq8= -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/exporters/prometheus v0.53.0 h1:QXobPHrwiGLM4ufrY3EOmDPJpo2P90UuFau4CDPJA/I= +go.opentelemetry.io/otel/exporters/prometheus v0.53.0/go.mod h1:WOAXGr3D00CfzmFxtTV1eR0GpoHuPEu+HJT8UWW2SIU= go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.6.0 h1:bZHOb8k/CwwSt0DgvgaoOhBXWNdWqFWaIsGTtg1H3KE= go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.6.0/go.mod h1:XlV163j81kDdIt5b5BXCjdqVfqJFy/LJrHA697SorvQ= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.30.0 h1:IyFlqNsi8VT/nwYlLJfdM0y1gavxGpEvnf6FtVfZ6X4= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.30.0/go.mod h1:bxiX8eUeKoAEQmbq/ecUT8UqZwCjZW52yJrXJUSozsk= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.31.0 h1:HZgBIps9wH0RDrwjrmNa3DVbNRW60HEhdzqZFyAp3fI= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.31.0/go.mod h1:RDRhvt6TDG0eIXmonAx5bd9IcwpqCkziwkOClzWKwAQ= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.30.0 h1:kn1BudCgwtE7PxLqcZkErpD8GKqLZ6BSzeW9QihQJeM= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.30.0/go.mod h1:ljkUDtAMdleoi9tIG1R6dJUpVwDcYjw3J2Q6Q/SuiC0= go.opentelemetry.io/otel/log v0.6.0 h1:nH66tr+dmEgW5y+F9LanGJUBYPrRgP4g2EkmPE3LeK8= go.opentelemetry.io/otel/log v0.6.0/go.mod h1:KdySypjQHhP069JX0z/t26VHwa8vSwzgaKmXtIB3fJM= -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= -go.opentelemetry.io/otel/sdk v1.30.0/go.mod h1:p14X4Ok8S+sygzblytT1nqG98QG2KYKv++HE0LY/mhg= +go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= +go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= +go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= +go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= go.opentelemetry.io/otel/sdk/log v0.6.0 h1:4J8BwXY4EeDE9Mowg+CyhWVBhTSLXVXodiXxS/+PGqI= go.opentelemetry.io/otel/sdk/log v0.6.0/go.mod h1:L1DN8RMAduKkrwRAFDEX3E3TLOq46+XMGSbUfHU/+vE= -go.opentelemetry.io/otel/sdk/metric v1.30.0 h1:QJLT8Pe11jyHBHfSAgYH7kEmT24eX792jZO1bo4BXkM= -go.opentelemetry.io/otel/sdk/metric v1.30.0/go.mod h1:waS6P3YqFNzeP01kuo/MBBYqaoBJl7efRQHOaydhy1Y= -go.opentelemetry.io/otel/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc= -go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o= +go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc= +go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8= +go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= +go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= @@ -196,10 +196,10 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gonum.org/v1/gonum v0.15.1 h1:FNy7N6OUZVUaWG9pTiD+jlhdQ3lMP+/LcTpJ6+a8sQ0= gonum.org/v1/gonum v0.15.1/go.mod h1:eZTZuRFrzu5pcyjN5wJhcIhnUdNijYxX1T2IcrOGY0o= -google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 h1:hjSy6tcFQZ171igDaN5QHOw2n6vx40juYbC/x67CEhc= -google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:qpvKtACPCQhAdu3PyQgV4l3LMXZEtft7y8QcarRsp9I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= +google.golang.org/genproto/googleapis/api v0.0.0-20241007155032-5fefd90f89a9 h1:T6rh4haD3GVYsgEfWExoCZA2o2FmbNyKpTuAxbEFPTg= +google.golang.org/genproto/googleapis/api v0.0.0-20241007155032-5fefd90f89a9/go.mod h1:wp2WsuBYj6j8wUdo3ToZsdxxixbvQNAHqVJrTgi5E5M= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9 h1:QCqS/PdaHTSWGvupk2F/ehwHtGc0/GYkT+3GAcR1CCc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E= google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA= diff --git a/otelcol/otelcoltest/config_test.go b/otelcol/otelcoltest/config_test.go index c8b9ec26e98..fe9f6044498 100644 --- a/otelcol/otelcoltest/config_test.go +++ b/otelcol/otelcoltest/config_test.go @@ -56,7 +56,7 @@ func TestLoadConfig(t *testing.T) { Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop")}, }, - cfg.Service.Pipelines[pipeline.MustNewID("traces")], + cfg.Service.Pipelines[pipeline.NewID(pipeline.SignalTraces)], "Did not load pipeline config correctly") } diff --git a/otelcol/otelcoltest/go.mod b/otelcol/otelcoltest/go.mod index dadd9bd2095..108b4b97553 100644 --- a/otelcol/otelcoltest/go.mod +++ b/otelcol/otelcoltest/go.mod @@ -30,14 +30,14 @@ require ( github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.2.6 // indirect - github.com/go-viper/mapstructure/v2 v2.1.0 // indirect + github.com/go-viper/mapstructure/v2 v2.2.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/google/uuid v1.6.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect github.com/hashicorp/go-version v1.7.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.17.10 // indirect + github.com/klauspost/compress v1.17.11 // 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 @@ -60,7 +60,6 @@ require ( github.com/tklauser/numcpus v0.6.1 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect go.opentelemetry.io/collector v0.111.0 // indirect - go.opentelemetry.io/collector/component/componentprofiles v0.111.0 // indirect go.opentelemetry.io/collector/component/componentstatus v0.111.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.111.0 // indirect go.opentelemetry.io/collector/connector/connectorprofiles v0.111.0 // indirect @@ -70,33 +69,33 @@ require ( go.opentelemetry.io/collector/exporter/exporterprofiles v0.111.0 // indirect go.opentelemetry.io/collector/extension/extensioncapabilities v0.111.0 // indirect go.opentelemetry.io/collector/featuregate v1.17.0 // indirect - go.opentelemetry.io/collector/internal/globalgates v0.111.0 // indirect go.opentelemetry.io/collector/internal/globalsignal v0.111.0 // indirect go.opentelemetry.io/collector/pdata v1.17.0 // indirect go.opentelemetry.io/collector/pdata/pprofile v0.111.0 // indirect go.opentelemetry.io/collector/pdata/testdata v0.111.0 // indirect + go.opentelemetry.io/collector/pipeline/pipelineprofiles v0.111.0 // indirect go.opentelemetry.io/collector/processor/processorprofiles v0.111.0 // indirect go.opentelemetry.io/collector/receiver/receiverprofiles v0.111.0 // indirect go.opentelemetry.io/collector/semconv v0.111.0 // indirect go.opentelemetry.io/contrib/config v0.10.0 // indirect go.opentelemetry.io/contrib/propagators/b3 v1.30.0 // indirect - go.opentelemetry.io/otel v1.30.0 // indirect + go.opentelemetry.io/otel v1.31.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.6.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.30.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.30.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.31.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.31.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.30.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.30.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.30.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.53.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.6.0 // indirect - go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.30.0 // indirect + go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.31.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.30.0 // indirect go.opentelemetry.io/otel/log v0.6.0 // indirect - go.opentelemetry.io/otel/metric v1.30.0 // indirect - go.opentelemetry.io/otel/sdk v1.30.0 // indirect + go.opentelemetry.io/otel/metric v1.31.0 // indirect + go.opentelemetry.io/otel/sdk v1.31.0 // indirect go.opentelemetry.io/otel/sdk/log v0.6.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect - go.opentelemetry.io/otel/trace v1.30.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.31.0 // indirect + go.opentelemetry.io/otel/trace v1.31.0 // indirect go.opentelemetry.io/proto/otlp v1.3.1 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect @@ -105,8 +104,8 @@ require ( golang.org/x/sys v0.26.0 // indirect golang.org/x/text v0.19.0 // indirect gonum.org/v1/gonum v0.15.1 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20241007155032-5fefd90f89a9 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9 // indirect google.golang.org/grpc v1.67.1 // indirect google.golang.org/protobuf v1.35.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect @@ -174,14 +173,10 @@ replace go.opentelemetry.io/collector/extension/auth => ../../extension/auth replace go.opentelemetry.io/collector/extension/experimental/storage => ../../extension/experimental/storage -replace go.opentelemetry.io/collector/internal/globalgates => ../../internal/globalgates - replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../../consumer/consumerprofiles replace go.opentelemetry.io/collector/consumer/consumertest => ../../consumer/consumertest -replace go.opentelemetry.io/collector/component/componentprofiles => ../../component/componentprofiles - replace go.opentelemetry.io/collector/client => ../../client replace go.opentelemetry.io/collector/component/componentstatus => ../../component/componentstatus @@ -199,3 +194,5 @@ replace go.opentelemetry.io/collector/exporter/exporterprofiles => ../../exporte replace go.opentelemetry.io/collector/pipeline => ../../pipeline replace go.opentelemetry.io/collector/internal/globalsignal => ../../internal/globalsignal + +replace go.opentelemetry.io/collector/pipeline/pipelineprofiles => ../../pipeline/pipelineprofiles diff --git a/otelcol/otelcoltest/go.sum b/otelcol/otelcoltest/go.sum index bf879f834b9..3a6c2c8a5c1 100644 --- a/otelcol/otelcoltest/go.sum +++ b/otelcol/otelcoltest/go.sum @@ -21,8 +21,8 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= -github.com/go-viper/mapstructure/v2 v2.1.0 h1:gHnMa2Y/pIxElCH2GlZZ1lZSsn6XMtufpGyP1XxdC/w= -github.com/go-viper/mapstructure/v2 v2.1.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= @@ -43,8 +43,8 @@ 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.10 h1:oXAz+Vh0PMUvJczoi+flxpnBEPxoER1IaAnU/NMPtT0= -github.com/klauspost/compress v1.17.10/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= +github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= +github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= 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= @@ -84,8 +84,8 @@ github.com/prometheus/common v0.60.0 h1:+V9PAREWNvJMAuJ1x1BaWl9dewMW4YrHZQbx0sJN github.com/prometheus/common v0.60.0/go.mod h1:h0LYf1R1deLSKtD4Vdg8gy4RuOvENW2J/h19V5NADQw= 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/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= +github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -115,40 +115,40 @@ go.opentelemetry.io/contrib/propagators/b3 v1.30.0 h1:vumy4r1KMyaoQRltX7cJ37p3nl go.opentelemetry.io/contrib/propagators/b3 v1.30.0/go.mod h1:fRbvRsaeVZ82LIl3u0rIvusIel2UUf+JcaaIpy5taho= go.opentelemetry.io/contrib/zpages v0.55.0 h1:F+xj261Ulwl79QC+2O+IO1b3NbwppUDwN+7LbDSdQcY= go.opentelemetry.io/contrib/zpages v0.55.0/go.mod h1:dDqDGDfbXSjt/k9orZk4Huulvz1letX1YWTKts5GQpo= -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 v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= +go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.6.0 h1:QSKmLBzbFULSyHzOdO9JsN9lpE4zkrz1byYGmJecdVE= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.6.0/go.mod h1:sTQ/NH8Yrirf0sJ5rWqVu+oT82i4zL9FaF6rWcqnptM= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.30.0 h1:WypxHH02KX2poqqbaadmkMYalGyy/vil4HE4PM4nRJc= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.30.0/go.mod h1:U79SV99vtvGSEBeeHnpgGJfTsnsdkWLpPN/CcHAzBSI= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.30.0 h1:VrMAbeJz4gnVDg2zEzjHG4dEH86j4jO6VYB+NgtGD8s= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.30.0/go.mod h1:qqN/uFdpeitTvm+JDqqnjm517pmQRYxTORbETHq5tOc= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.31.0 h1:FZ6ei8GFW7kyPYdxJaV2rgI6M+4tvZzhYsQ2wgyVC08= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.31.0/go.mod h1:MdEu/mC6j3D+tTEfvI15b5Ci2Fn7NneJ71YMoiS3tpI= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.31.0 h1:ZsXq73BERAiNuuFXYqP4MR5hBrjXfMGSO+Cx7qoOZiM= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.31.0/go.mod h1:hg1zaDMpyZJuUzjFxFsRYBoccE86tM9Uf4IqNMUxvrY= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.30.0 h1:lsInsfvhVIfOI6qHVyysXMNDnjO9Npvl7tlDPJFBVd4= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.30.0/go.mod h1:KQsVNh4OjgjTG0G6EiNi1jVpnaeeKsKMRwbLN+f1+8M= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.30.0 h1:m0yTiGDLUvVYaTFbAvCkVYIYcvwKt3G7OLoN77NUs/8= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.30.0/go.mod h1:wBQbT4UekBfegL2nx0Xk1vBcnzyBPsIVm9hRG4fYcr4= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.30.0 h1:umZgi92IyxfXd/l4kaDhnKgY8rnN/cZcF1LKc6I8OQ8= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.30.0/go.mod h1:4lVs6obhSVRb1EW5FhOuBTyiQhtRtAnnva9vD3yRfq8= -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/exporters/prometheus v0.53.0 h1:QXobPHrwiGLM4ufrY3EOmDPJpo2P90UuFau4CDPJA/I= +go.opentelemetry.io/otel/exporters/prometheus v0.53.0/go.mod h1:WOAXGr3D00CfzmFxtTV1eR0GpoHuPEu+HJT8UWW2SIU= go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.6.0 h1:bZHOb8k/CwwSt0DgvgaoOhBXWNdWqFWaIsGTtg1H3KE= go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.6.0/go.mod h1:XlV163j81kDdIt5b5BXCjdqVfqJFy/LJrHA697SorvQ= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.30.0 h1:IyFlqNsi8VT/nwYlLJfdM0y1gavxGpEvnf6FtVfZ6X4= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.30.0/go.mod h1:bxiX8eUeKoAEQmbq/ecUT8UqZwCjZW52yJrXJUSozsk= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.31.0 h1:HZgBIps9wH0RDrwjrmNa3DVbNRW60HEhdzqZFyAp3fI= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.31.0/go.mod h1:RDRhvt6TDG0eIXmonAx5bd9IcwpqCkziwkOClzWKwAQ= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.30.0 h1:kn1BudCgwtE7PxLqcZkErpD8GKqLZ6BSzeW9QihQJeM= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.30.0/go.mod h1:ljkUDtAMdleoi9tIG1R6dJUpVwDcYjw3J2Q6Q/SuiC0= go.opentelemetry.io/otel/log v0.6.0 h1:nH66tr+dmEgW5y+F9LanGJUBYPrRgP4g2EkmPE3LeK8= go.opentelemetry.io/otel/log v0.6.0/go.mod h1:KdySypjQHhP069JX0z/t26VHwa8vSwzgaKmXtIB3fJM= -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= -go.opentelemetry.io/otel/sdk v1.30.0/go.mod h1:p14X4Ok8S+sygzblytT1nqG98QG2KYKv++HE0LY/mhg= +go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= +go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= +go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= +go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= go.opentelemetry.io/otel/sdk/log v0.6.0 h1:4J8BwXY4EeDE9Mowg+CyhWVBhTSLXVXodiXxS/+PGqI= go.opentelemetry.io/otel/sdk/log v0.6.0/go.mod h1:L1DN8RMAduKkrwRAFDEX3E3TLOq46+XMGSbUfHU/+vE= -go.opentelemetry.io/otel/sdk/metric v1.30.0 h1:QJLT8Pe11jyHBHfSAgYH7kEmT24eX792jZO1bo4BXkM= -go.opentelemetry.io/otel/sdk/metric v1.30.0/go.mod h1:waS6P3YqFNzeP01kuo/MBBYqaoBJl7efRQHOaydhy1Y= -go.opentelemetry.io/otel/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc= -go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o= +go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc= +go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8= +go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= +go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= @@ -196,10 +196,10 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gonum.org/v1/gonum v0.15.1 h1:FNy7N6OUZVUaWG9pTiD+jlhdQ3lMP+/LcTpJ6+a8sQ0= gonum.org/v1/gonum v0.15.1/go.mod h1:eZTZuRFrzu5pcyjN5wJhcIhnUdNijYxX1T2IcrOGY0o= -google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 h1:hjSy6tcFQZ171igDaN5QHOw2n6vx40juYbC/x67CEhc= -google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:qpvKtACPCQhAdu3PyQgV4l3LMXZEtft7y8QcarRsp9I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= +google.golang.org/genproto/googleapis/api v0.0.0-20241007155032-5fefd90f89a9 h1:T6rh4haD3GVYsgEfWExoCZA2o2FmbNyKpTuAxbEFPTg= +google.golang.org/genproto/googleapis/api v0.0.0-20241007155032-5fefd90f89a9/go.mod h1:wp2WsuBYj6j8wUdo3ToZsdxxixbvQNAHqVJrTgi5E5M= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9 h1:QCqS/PdaHTSWGvupk2F/ehwHtGc0/GYkT+3GAcR1CCc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E= google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA= diff --git a/pdata/internal/cmd/pdatagen/internal/base_slices.go b/pdata/internal/cmd/pdatagen/internal/base_slices.go index 21646d92bc1..24c648de9f2 100644 --- a/pdata/internal/cmd/pdatagen/internal/base_slices.go +++ b/pdata/internal/cmd/pdatagen/internal/base_slices.go @@ -5,298 +5,8 @@ package internal // import "go.opentelemetry.io/collector/pdata/internal/cmd/pda import ( "bytes" - "text/template" ) -const sliceTemplate = `// {{ .structName }} logically represents a slice of {{ .elementName }}. -// -// This is a reference type. If passed by value and callee modifies it, the -// caller will see the modification. -// -// Must use New{{ .structName }} function to create new instances. -// Important: zero-initialized instance is not valid for use. -type {{ .structName }} struct { - orig *[]{{ .originElementType }} - state *internal.State -} - -func new{{ .structName }}(orig *[]{{ .originElementType }}, state *internal.State) {{ .structName }} { - return {{ .structName }}{orig: orig, state: state} -} - -// New{{ .structName }} creates a {{ .structName }} with 0 elements. -// Can use "EnsureCapacity" to initialize with a given capacity. -func New{{ .structName }}() {{ .structName }} { - orig := []{{ .originElementType }}(nil) - state := internal.StateMutable - return new{{ .structName }}(&orig, &state) -} - -// Len returns the number of elements in the slice. -// -// Returns "0" for a newly instance created with "New{{ .structName }}()". -func (es {{ .structName }}) Len() int { - return len(*es.orig) -} - -// At returns the element at the given index. -// -// This function is used mostly for iterating over all the values in the slice: -// for i := 0; i < es.Len(); i++ { -// e := es.At(i) -// ... // Do something with the element -// } -func (es {{ .structName }}) At(i int) {{ .elementName }} { - return {{ .newElement }} -} - -// EnsureCapacity is an operation that ensures the slice has at least the specified capacity. -// 1. If the newCap <= cap then no change in capacity. -// 2. If the newCap > cap then the slice capacity will be expanded to equal newCap. -// -// Here is how a new {{ .structName }} can be initialized: -// es := New{{ .structName }}() -// es.EnsureCapacity(4) -// for i := 0; i < 4; i++ { -// e := es.AppendEmpty() -// // Here should set all the values for e. -// } -func (es {{ .structName }}) EnsureCapacity(newCap int) { - es.state.AssertMutable() - oldCap := cap(*es.orig) - if newCap <= oldCap { - return - } - - newOrig := make([]{{ .originElementType }}, len(*es.orig), newCap) - copy(newOrig, *es.orig) - *es.orig = newOrig -} - -// AppendEmpty will append to the end of the slice an empty {{ .elementName }}. -// It returns the newly added {{ .elementName }}. -func (es {{ .structName }}) AppendEmpty() {{ .elementName }} { - es.state.AssertMutable() - *es.orig = append(*es.orig, {{ .emptyOriginElement }}) - return es.At(es.Len() - 1) -} - -// MoveAndAppendTo moves all elements from the current slice and appends them to the dest. -// The current slice will be cleared. -func (es {{ .structName }}) MoveAndAppendTo(dest {{ .structName }}) { - es.state.AssertMutable() - dest.state.AssertMutable() - if *dest.orig == nil { - // We can simply move the entire vector and avoid any allocations. - *dest.orig = *es.orig - } else { - *dest.orig = append(*dest.orig, *es.orig...) - } - *es.orig = nil -} - -// RemoveIf calls f sequentially for each element present in the slice. -// If f returns true, the element is removed from the slice. -func (es {{ .structName }}) RemoveIf(f func({{ .elementName }}) bool) { - es.state.AssertMutable() - newLen := 0 - for i := 0; i < len(*es.orig); i++ { - if f(es.At(i)) { - continue - } - if newLen == i { - // Nothing to move, element is at the right place. - newLen++ - continue - } - (*es.orig)[newLen] = (*es.orig)[i] - newLen++ - } - *es.orig = (*es.orig)[:newLen] -} - - -// CopyTo copies all elements from the current slice overriding the destination. -func (es {{ .structName }}) CopyTo(dest {{ .structName }}) { - dest.state.AssertMutable() - srcLen := es.Len() - destCap := cap(*dest.orig) - if srcLen <= destCap { - (*dest.orig) = (*dest.orig)[:srcLen:destCap] - - {{- if eq .type "sliceOfPtrs" }} - for i := range *es.orig { - new{{ .elementName }}((*es.orig)[i], es.state).CopyTo(new{{ .elementName }}((*dest.orig)[i], dest.state)) - } - return - } - origs := make([]{{ .originName }}, srcLen) - wrappers := make([]*{{ .originName }}, srcLen) - for i := range *es.orig { - wrappers[i] = &origs[i] - new{{ .elementName }}((*es.orig)[i], es.state).CopyTo(new{{ .elementName }}(wrappers[i], dest.state)) - } - *dest.orig = wrappers - - {{- else }} - } else { - (*dest.orig) = make([]{{ .originElementType }}, srcLen) - } - for i := range *es.orig { - {{ .newElement }}.CopyTo(new{{ .elementName }}(&(*dest.orig)[i], dest.state)) - } - {{- end }} -} - -{{ if eq .type "sliceOfPtrs" -}} -// Sort sorts the {{ .elementName }} elements within {{ .structName }} given the -// provided less function so that two instances of {{ .structName }} -// can be compared. -func (es {{ .structName }}) Sort(less func(a, b {{ .elementName }}) bool) { - es.state.AssertMutable() - sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) -} -{{- end }}` - -const sliceTestTemplate = `func Test{{ .structName }}(t *testing.T) { - es := New{{ .structName }}() - assert.Equal(t, 0, es.Len()) - state := internal.StateMutable - es = new{{ .structName }}(&[]{{ .originElementType }}{}, &state) - assert.Equal(t, 0, es.Len()) - - emptyVal := New{{ .elementName }}() - testVal := generateTest{{ .elementName }}() - for i := 0; i < 7; i++ { - el := es.AppendEmpty() - assert.Equal(t, emptyVal, es.At(i)) - fillTest{{ .elementName }}(el) - assert.Equal(t, testVal, es.At(i)) - } - assert.Equal(t, 7, es.Len()) -} - -func Test{{ .structName }}ReadOnly(t *testing.T) { - sharedState := internal.StateReadOnly - es := new{{ .structName }}(&[]{{ .originElementType }}{}, &sharedState) - assert.Equal(t, 0, es.Len()) - assert.Panics(t, func() { es.AppendEmpty() }) - assert.Panics(t, func() { es.EnsureCapacity(2) }) - es2 := New{{ .structName }}() - es.CopyTo(es2) - assert.Panics(t, func() { es2.CopyTo(es) }) - assert.Panics(t, func() { es.MoveAndAppendTo(es2) }) - assert.Panics(t, func() { es2.MoveAndAppendTo(es) }) -} - -func Test{{ .structName }}_CopyTo(t *testing.T) { - dest := New{{ .structName }}() - // Test CopyTo to empty - New{{ .structName }}().CopyTo(dest) - assert.Equal(t, New{{ .structName }}(), dest) - - // Test CopyTo larger slice - generateTest{{ .structName }}().CopyTo(dest) - assert.Equal(t, generateTest{{ .structName }}(), dest) - - // Test CopyTo same size slice - generateTest{{ .structName }}().CopyTo(dest) - assert.Equal(t, generateTest{{ .structName }}(), dest) -} - -func Test{{ .structName }}_EnsureCapacity(t *testing.T) { - es := generateTest{{ .structName }}() - - // Test ensure smaller capacity. - const ensureSmallLen = 4 - es.EnsureCapacity(ensureSmallLen) - assert.Less(t, ensureSmallLen, es.Len()) - assert.Equal(t, es.Len(), cap(*es.orig)) - assert.Equal(t, generateTest{{ .structName }}(), es) - - // Test ensure larger capacity - const ensureLargeLen = 9 - es.EnsureCapacity(ensureLargeLen) - assert.Less(t, generateTest{{ .structName }}().Len(), ensureLargeLen) - assert.Equal(t, ensureLargeLen, cap(*es.orig)) - assert.Equal(t, generateTest{{ .structName }}(), es) -} - -func Test{{ .structName }}_MoveAndAppendTo(t *testing.T) { - // Test MoveAndAppendTo to empty - expectedSlice := generateTest{{ .structName }}() - dest := New{{ .structName }}() - src := generateTest{{ .structName }}() - src.MoveAndAppendTo(dest) - assert.Equal(t, generateTest{{ .structName }}(), dest) - assert.Equal(t, 0, src.Len()) - assert.Equal(t, expectedSlice.Len(), dest.Len()) - - // Test MoveAndAppendTo empty slice - src.MoveAndAppendTo(dest) - assert.Equal(t, generateTest{{ .structName }}(), dest) - assert.Equal(t, 0, src.Len()) - assert.Equal(t, expectedSlice.Len(), dest.Len()) - - // Test MoveAndAppendTo not empty slice - generateTest{{ .structName }}().MoveAndAppendTo(dest) - assert.Equal(t, 2*expectedSlice.Len(), dest.Len()) - for i := 0; i < expectedSlice.Len(); i++ { - assert.Equal(t, expectedSlice.At(i), dest.At(i)) - assert.Equal(t, expectedSlice.At(i), dest.At(i+expectedSlice.Len())) - } -} - -func Test{{ .structName }}_RemoveIf(t *testing.T) { - // Test RemoveIf on empty slice - emptySlice := New{{ .structName }}() - emptySlice.RemoveIf(func(el {{ .elementName }}) bool { - t.Fail() - return false - }) - - // Test RemoveIf - filtered := generateTest{{ .structName }}() - pos := 0 - filtered.RemoveIf(func(el {{ .elementName }}) bool { - pos++ - return pos%3 == 0 - }) - assert.Equal(t, 5, filtered.Len()) -} - -{{ if eq .type "sliceOfPtrs" -}} -func Test{{ .structName }}_Sort(t *testing.T) { - es := generateTest{{ .structName }}() - es.Sort(func(a, b {{ .elementName }}) bool { - return uintptr(unsafe.Pointer(a.orig)) < uintptr(unsafe.Pointer(b.orig)) - }) - for i := 1; i < es.Len(); i++ { - assert.Less(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) - } - es.Sort(func(a, b {{ .elementName }}) bool { - return uintptr(unsafe.Pointer(a.orig)) > uintptr(unsafe.Pointer(b.orig)) - }) - for i := 1; i < es.Len(); i++ { - assert.Greater(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) - } -} -{{- end }}` - -const sliceGenerateTest = `func generateTest{{ .structName }}() {{ .structName }} { - es := New{{ .structName }}() - fillTest{{ .structName }}(es) - return es -} - -func fillTest{{ .structName }}(es {{ .structName }}) { - *es.orig = make([]{{ .originElementType }}, 7) - for i := 0; i < 7; i++ { - (*es.orig)[i] = {{ .emptyOriginElement }} - fillTest{{ .elementName }}({{ .newElement }}) - } -}` - type baseSlice interface { getName() string getPackageName() string @@ -317,28 +27,23 @@ func (ss *sliceOfPtrs) getPackageName() string { return ss.packageName } -func (ss *sliceOfPtrs) generateStruct(sb *bytes.Buffer) { - t := template.Must(template.New("sliceTemplate").Parse(sliceTemplate)) - if err := t.Execute(sb, ss.templateFields()); err != nil { - panic(err) - } -} - -func (ss *sliceOfPtrs) generateTests(sb *bytes.Buffer) { - t := template.Must(template.New("sliceTestTemplate").Parse(sliceTestTemplate)) - if err := t.Execute(sb, ss.templateFields()); err != nil { +func (ss *sliceOfPtrs) generate(packageInfo *PackageInfo) []byte { + var sb bytes.Buffer + if err := sliceTemplate.Execute(&sb, ss.templateFields(packageInfo)); err != nil { panic(err) } + return sb.Bytes() } -func (ss *sliceOfPtrs) generateTestValueHelpers(sb *bytes.Buffer) { - t := template.Must(template.New("sliceGenerateTest").Parse(sliceGenerateTest)) - if err := t.Execute(sb, ss.templateFields()); err != nil { +func (ss *sliceOfPtrs) generateTests(packageInfo *PackageInfo) []byte { + var sb bytes.Buffer + if err := sliceTestTemplate.Execute(&sb, ss.templateFields(packageInfo)); err != nil { panic(err) } + return sb.Bytes() } -func (ss *sliceOfPtrs) templateFields() map[string]any { +func (ss *sliceOfPtrs) templateFields(packageInfo *PackageInfo) map[string]any { return map[string]any{ "type": "sliceOfPtrs", "structName": ss.structName, @@ -347,10 +52,15 @@ func (ss *sliceOfPtrs) templateFields() map[string]any { "originElementType": "*" + ss.element.originFullName, "emptyOriginElement": "&" + ss.element.originFullName + "{}", "newElement": "new" + ss.element.structName + "((*es.orig)[i], es.state)", + "packageName": packageInfo.name, + "imports": packageInfo.imports, + "testImports": packageInfo.testImports, } } -func (ss *sliceOfPtrs) generateInternal(*bytes.Buffer) {} +func (ss *sliceOfPtrs) generateInternal(*PackageInfo) []byte { + return nil +} var _ baseStruct = (*sliceOfPtrs)(nil) @@ -369,28 +79,23 @@ func (ss *sliceOfValues) getPackageName() string { return ss.packageName } -func (ss *sliceOfValues) generateStruct(sb *bytes.Buffer) { - t := template.Must(template.New("sliceTemplate").Parse(sliceTemplate)) - if err := t.Execute(sb, ss.templateFields()); err != nil { +func (ss *sliceOfValues) generate(packageInfo *PackageInfo) []byte { + var sb bytes.Buffer + if err := sliceTemplate.Execute(&sb, ss.templateFields(packageInfo)); err != nil { panic(err) } + return sb.Bytes() } -func (ss *sliceOfValues) generateTests(sb *bytes.Buffer) { - t := template.Must(template.New("sliceTestTemplate").Parse(sliceTestTemplate)) - if err := t.Execute(sb, ss.templateFields()); err != nil { +func (ss *sliceOfValues) generateTests(packageInfo *PackageInfo) []byte { + var sb bytes.Buffer + if err := sliceTestTemplate.Execute(&sb, ss.templateFields(packageInfo)); err != nil { panic(err) } + return sb.Bytes() } -func (ss *sliceOfValues) generateTestValueHelpers(sb *bytes.Buffer) { - t := template.Must(template.New("sliceGenerateTest").Parse(sliceGenerateTest)) - if err := t.Execute(sb, ss.templateFields()); err != nil { - panic(err) - } -} - -func (ss *sliceOfValues) templateFields() map[string]any { +func (ss *sliceOfValues) templateFields(packageInfo *PackageInfo) map[string]any { return map[string]any{ "type": "sliceOfValues", "structName": ss.structName, @@ -399,9 +104,14 @@ func (ss *sliceOfValues) templateFields() map[string]any { "originElementType": ss.element.originFullName, "emptyOriginElement": ss.element.originFullName + "{}", "newElement": "new" + ss.element.structName + "(&(*es.orig)[i], es.state)", + "packageName": packageInfo.name, + "imports": packageInfo.imports, + "testImports": packageInfo.testImports, } } -func (ss *sliceOfValues) generateInternal(*bytes.Buffer) {} +func (ss *sliceOfValues) generateInternal(*PackageInfo) []byte { + return nil +} var _ baseStruct = (*sliceOfValues)(nil) diff --git a/pdata/internal/cmd/pdatagen/internal/base_structs.go b/pdata/internal/cmd/pdatagen/internal/base_structs.go index 859bb4d7c05..4cd7832f12d 100644 --- a/pdata/internal/cmd/pdatagen/internal/base_structs.go +++ b/pdata/internal/cmd/pdatagen/internal/base_structs.go @@ -5,142 +5,13 @@ package internal // import "go.opentelemetry.io/collector/pdata/internal/cmd/pda import ( "bytes" - "strings" - "text/template" ) -const messageValueTemplate = `{{ .description }} -// -// This is a reference type, if passed by value and callee modifies it the -// caller will see the modification. -// -// Must use New{{ .structName }} function to create new instances. -// Important: zero-initialized instance is not valid for use. -{{- if .isCommon }} -type {{ .structName }} internal.{{ .structName }} -{{- else }} -type {{ .structName }} struct { - orig *{{ .originName }} - state *internal.State -} -{{- end }} - -func new{{ .structName }}(orig *{{ .originName }}, state *internal.State) {{ .structName }} { - {{- if .isCommon }} - return {{ .structName }}(internal.New{{ .structName }}(orig, state)) - {{- else }} - return {{ .structName }}{orig: orig, state: state} - {{- end }} -} - -// New{{ .structName }} creates a new empty {{ .structName }}. -// -// This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, -// OR directly access the member if this is embedded in another struct. -func New{{ .structName }}() {{ .structName }} { - state := internal.StateMutable - return new{{ .structName }}(&{{ .originName }}{}, &state) -} - -// MoveTo moves all properties from the current struct overriding the destination and -// resetting the current instance to its zero value -func (ms {{ .structName }}) MoveTo(dest {{ .structName }}) { - ms.{{- if .isCommon }}getState(){{ else }}state{{ end }}.AssertMutable() - dest.{{- if .isCommon }}getState(){{ else }}state{{ end }}.AssertMutable() - *dest.{{ .origAccessor }} = *ms.{{ .origAccessor }} - *ms.{{ .origAccessor }} = {{ .originName }}{} -} - -{{ if .isCommon -}} -func (ms {{ .structName }}) getOrig() *{{ .originName }} { - return internal.GetOrig{{ .structName }}(internal.{{ .structName }}(ms)) -} - -func (ms {{ .structName }}) getState() *internal.State { - return internal.Get{{ .structName }}State(internal.{{ .structName }}(ms)) -} -{{- end }} - -{{ range .fields -}} -{{ .GenerateAccessors $.messageStruct }} -{{ end }} - -// CopyTo copies all properties from the current struct overriding the destination. -func (ms {{ .structName }}) CopyTo(dest {{ .structName }}) { - dest.{{- if .isCommon }}getState(){{ else }}state{{ end }}.AssertMutable() - {{- range .fields }} - {{ .GenerateCopyToValue $.messageStruct }} - {{- end }} -}` - -const messageValueTestTemplate = ` -func Test{{ .structName }}_MoveTo(t *testing.T) { - ms := {{ .generateTestData }} - dest := New{{ .structName }}() - ms.MoveTo(dest) - assert.Equal(t, New{{ .structName }}(), ms) - assert.Equal(t, {{ .generateTestData }}, dest) - sharedState := internal.StateReadOnly - assert.Panics(t, func() { ms.MoveTo(new{{ .structName }}(&{{ .originName }}{}, &sharedState)) }) - assert.Panics(t, func() { new{{ .structName }}(&{{ .originName }}{}, &sharedState).MoveTo(dest) }) -} - -func Test{{ .structName }}_CopyTo(t *testing.T) { - ms := New{{ .structName }}() - orig := New{{ .structName }}() - orig.CopyTo(ms) - assert.Equal(t, orig, ms) - orig = {{ .generateTestData }} - orig.CopyTo(ms) - assert.Equal(t, orig, ms) - sharedState := internal.StateReadOnly - assert.Panics(t, func() { ms.CopyTo(new{{ .structName }}(&{{ .originName }}{}, &sharedState)) }) -} - -{{ range .fields }} -{{ .GenerateAccessorsTest $.messageStruct }} -{{ end }}` - -const messageValueGenerateTestTemplate = `func {{ upperIfInternal "g" }}enerateTest{{ .structName }}() {{ .structName }} { - {{- if .isCommon }} - orig := {{ .originName }}{} - state := StateMutable - {{- end }} - tv := New{{ .structName }}({{ if .isCommon }}&orig, &state{{ end }}) - {{ upperIfInternal "f" }}illTest{{ .structName }}(tv) - return tv -} - -func {{ upperIfInternal "f" }}illTest{{ .structName }}(tv {{ .structName }}) { - {{- range .fields }} - {{ .GenerateSetWithTestValue $.messageStruct }} - {{- end }} -}` - -const messageValueAliasTemplate = ` -type {{ .structName }} struct { - orig *{{ .originName }} - state *State -} - -func GetOrig{{ .structName }}(ms {{ .structName }}) *{{ .originName }} { - return ms.orig -} - -func Get{{ .structName }}State(ms {{ .structName }}) *State { - return ms.state -} - -func New{{ .structName }}(orig *{{ .originName }}, state *State) {{ .structName }} { - return {{ .structName }}{orig: orig, state: state} -}` - type baseStruct interface { getName() string - generateStruct(sb *bytes.Buffer) - generateTests(sb *bytes.Buffer) - generateTestValueHelpers(sb *bytes.Buffer) - generateInternal(sb *bytes.Buffer) + generate(packageInfo *PackageInfo) []byte + generateTests(packageInfo *PackageInfo) []byte + generateInternal(packageInfo *PackageInfo) []byte } // messageValueStruct generates a struct for a proto message. The struct can be generated both as a common struct @@ -157,43 +28,31 @@ func (ms *messageValueStruct) getName() string { return ms.structName } -func (ms *messageValueStruct) generateStruct(sb *bytes.Buffer) { - t := template.Must(template.New("messageValueTemplate").Parse(messageValueTemplate)) - if err := t.Execute(sb, ms.templateFields()); err != nil { +func (ms *messageValueStruct) generate(packageInfo *PackageInfo) []byte { + var sb bytes.Buffer + if err := messageTemplate.Execute(&sb, ms.templateFields(packageInfo)); err != nil { panic(err) } + return sb.Bytes() } -func (ms *messageValueStruct) generateTests(sb *bytes.Buffer) { - t := template.Must(template.New("messageValueTestTemplate").Parse(messageValueTestTemplate)) - if err := t.Execute(sb, ms.templateFields()); err != nil { - panic(err) - } -} - -func (ms *messageValueStruct) generateTestValueHelpers(sb *bytes.Buffer) { - funcs := template.FuncMap{ - "upperIfInternal": func(in string) string { - if usedByOtherDataTypes(ms.packageName) { - return strings.ToUpper(in) - } - return in - }, - } - t := template.Must(template.New("messageValueGenerateTestTemplate").Funcs(funcs).Parse(messageValueGenerateTestTemplate)) - if err := t.Execute(sb, ms.templateFields()); err != nil { +func (ms *messageValueStruct) generateTests(packageInfo *PackageInfo) []byte { + var sb bytes.Buffer + if err := messageTestTemplate.Execute(&sb, ms.templateFields(packageInfo)); err != nil { panic(err) } + return sb.Bytes() } -func (ms *messageValueStruct) generateInternal(sb *bytes.Buffer) { - t := template.Must(template.New("messageValueAliasTemplate").Parse(messageValueAliasTemplate)) - if err := t.Execute(sb, ms.templateFields()); err != nil { +func (ms *messageValueStruct) generateInternal(packageInfo *PackageInfo) []byte { + var sb bytes.Buffer + if err := messageInternalTemplate.Execute(&sb, ms.templateFields(packageInfo)); err != nil { panic(err) } + return sb.Bytes() } -func (ms *messageValueStruct) templateFields() map[string]any { +func (ms *messageValueStruct) templateFields(packageInfo *PackageInfo) map[string]any { return map[string]any{ "messageStruct": ms, "fields": ms.fields, @@ -208,6 +67,9 @@ func (ms *messageValueStruct) templateFields() map[string]any { "description": ms.description, "isCommon": usedByOtherDataTypes(ms.packageName), "origAccessor": origAccessor(ms), + "packageName": packageInfo.name, + "imports": packageInfo.imports, + "testImports": packageInfo.testImports, } } diff --git a/pdata/internal/cmd/pdatagen/internal/packages.go b/pdata/internal/cmd/pdatagen/internal/packages.go index 13d98d6703c..47708bc975e 100644 --- a/pdata/internal/cmd/pdatagen/internal/packages.go +++ b/pdata/internal/cmd/pdatagen/internal/packages.go @@ -4,7 +4,6 @@ package internal // import "go.opentelemetry.io/collector/pdata/internal/cmd/pdatagen/internal" import ( - "bytes" "os" "path/filepath" "strings" @@ -31,40 +30,23 @@ var AllPackages = []*Package{ // Package is a struct used to generate files. type Package struct { + info *PackageInfo + // Can be any of sliceOfPtrs, sliceOfValues, messageValueStruct. + structs []baseStruct +} + +type PackageInfo struct { name string path string imports []string testImports []string - // Can be any of sliceOfPtrs, sliceOfValues, messageValueStruct, or messagePtrStruct - structs []baseStruct } -const newLine = "\n" - // GenerateFiles generates files with the configured data structures for this Package. func (p *Package) GenerateFiles() error { for _, s := range p.structs { - var sb bytes.Buffer - generateHeader(&sb, p.name) - - // Add imports - sb.WriteString("import (" + newLine) - for _, imp := range p.imports { - if imp != "" { - sb.WriteString("\t" + imp + newLine) - } else { - sb.WriteString(newLine) - } - } - sb.WriteString(")") - - // Write all structs - sb.WriteString(newLine + newLine) - s.generateStruct(&sb) - sb.WriteString(newLine) - - path := filepath.Join("pdata", p.path, "generated_"+strings.ToLower(s.getName())+".go") - if err := os.WriteFile(path, sb.Bytes(), 0600); err != nil { + path := filepath.Join("pdata", p.info.path, "generated_"+strings.ToLower(s.getName())+".go") + if err := os.WriteFile(path, s.generate(p.info), 0600); err != nil { return err } } @@ -74,30 +56,8 @@ func (p *Package) GenerateFiles() error { // GenerateTestFiles generates files with tests for the configured data structures for this Package. func (p *Package) GenerateTestFiles() error { for _, s := range p.structs { - var sb bytes.Buffer - generateHeader(&sb, p.name) - - // Add imports - sb.WriteString("import (" + newLine) - for _, imp := range p.testImports { - if imp != "" { - sb.WriteString("\t" + imp + newLine) - } else { - sb.WriteString(newLine) - } - } - sb.WriteString(")") - - // Write all tests - sb.WriteString(newLine + newLine) - s.generateTests(&sb) - if !usedByOtherDataTypes(p.name) { - sb.WriteString(newLine + newLine) - s.generateTestValueHelpers(&sb) - } - - path := filepath.Join("pdata", p.path, "generated_"+strings.ToLower(s.getName())+"_test.go") - if err := os.WriteFile(path, sb.Bytes(), 0600); err != nil { + path := filepath.Join("pdata", p.info.path, "generated_"+strings.ToLower(s.getName())+"_test.go") + if err := os.WriteFile(path, s.generateTests(p.info), 0600); err != nil { return err } } @@ -106,52 +66,19 @@ func (p *Package) GenerateTestFiles() error { // GenerateInternalFiles generates files with internal pdata structures for this Package. func (p *Package) GenerateInternalFiles() error { - if !usedByOtherDataTypes(p.name) { + if !usedByOtherDataTypes(p.info.name) { return nil } for _, s := range p.structs { - var sb bytes.Buffer - generateHeader(&sb, "internal") - - // Add imports - sb.WriteString("import (" + newLine) - for _, imp := range p.imports { - if imp == `"go.opentelemetry.io/collector/pdata/internal"` { - continue - } - if imp != "" { - sb.WriteString("\t" + imp + newLine) - } else { - sb.WriteString(newLine) - } - } - sb.WriteString(")") - - // Write all types and funcs - s.generateInternal(&sb) - sb.WriteString(newLine) - - // Write all tests generate value - sb.WriteString(newLine + newLine) - s.generateTestValueHelpers(&sb) - sb.WriteString(newLine) - path := filepath.Join("pdata", "internal", "generated_wrapper_"+strings.ToLower(s.getName())+".go") - if err := os.WriteFile(path, sb.Bytes(), 0600); err != nil { + if err := os.WriteFile(path, s.generateInternal(p.info), 0600); err != nil { return err } } return nil } -func generateHeader(sb *bytes.Buffer, packageName string) { - sb.WriteString(header) - sb.WriteString(newLine + newLine) - sb.WriteString("package " + packageName) - sb.WriteString(newLine + newLine) -} - // usedByOtherDataTypes defines if the package is used by other data types and orig fields of the package's structs // need to be accessible from other pdata packages. func usedByOtherDataTypes(packageName string) bool { diff --git a/pdata/internal/cmd/pdatagen/internal/pcommon_package.go b/pdata/internal/cmd/pdatagen/internal/pcommon_package.go index 6491792b4cf..d6085334f56 100644 --- a/pdata/internal/cmd/pdatagen/internal/pcommon_package.go +++ b/pdata/internal/cmd/pdatagen/internal/pcommon_package.go @@ -4,19 +4,21 @@ package internal // import "go.opentelemetry.io/collector/pdata/internal/cmd/pdatagen/internal" var pcommon = &Package{ - name: "pcommon", - path: "pcommon", - imports: []string{ - `"go.opentelemetry.io/collector/pdata/internal"`, - `otlpcommon "go.opentelemetry.io/collector/pdata/internal/data/protogen/common/v1"`, - `otlpresource "go.opentelemetry.io/collector/pdata/internal/data/protogen/resource/v1"`, - }, - testImports: []string{ - `"testing"`, - ``, - `"github.com/stretchr/testify/assert"`, - ``, - `"go.opentelemetry.io/collector/pdata/internal"`, + info: &PackageInfo{ + name: "pcommon", + path: "pcommon", + imports: []string{ + `"go.opentelemetry.io/collector/pdata/internal"`, + `otlpcommon "go.opentelemetry.io/collector/pdata/internal/data/protogen/common/v1"`, + `otlpresource "go.opentelemetry.io/collector/pdata/internal/data/protogen/resource/v1"`, + }, + testImports: []string{ + `"testing"`, + ``, + `"github.com/stretchr/testify/assert"`, + ``, + `"go.opentelemetry.io/collector/pdata/internal"`, + }, }, structs: []baseStruct{ scope, diff --git a/pdata/internal/cmd/pdatagen/internal/plog_package.go b/pdata/internal/cmd/pdatagen/internal/plog_package.go index d452ea4324e..5e65b6e5fae 100644 --- a/pdata/internal/cmd/pdatagen/internal/plog_package.go +++ b/pdata/internal/cmd/pdatagen/internal/plog_package.go @@ -4,26 +4,28 @@ package internal // import "go.opentelemetry.io/collector/pdata/internal/cmd/pdatagen/internal" var plog = &Package{ - name: "plog", - path: "plog", - imports: []string{ - `"sort"`, - ``, - `"go.opentelemetry.io/collector/pdata/internal"`, - `"go.opentelemetry.io/collector/pdata/internal/data"`, - `otlplogs "go.opentelemetry.io/collector/pdata/internal/data/protogen/logs/v1"`, - `"go.opentelemetry.io/collector/pdata/pcommon"`, - }, - testImports: []string{ - `"testing"`, - `"unsafe"`, - ``, - `"github.com/stretchr/testify/assert"`, - ``, - `"go.opentelemetry.io/collector/pdata/internal"`, - `"go.opentelemetry.io/collector/pdata/internal/data"`, - `otlplogs "go.opentelemetry.io/collector/pdata/internal/data/protogen/logs/v1"`, - `"go.opentelemetry.io/collector/pdata/pcommon"`, + info: &PackageInfo{ + name: "plog", + path: "plog", + imports: []string{ + `"sort"`, + ``, + `"go.opentelemetry.io/collector/pdata/internal"`, + `"go.opentelemetry.io/collector/pdata/internal/data"`, + `otlplogs "go.opentelemetry.io/collector/pdata/internal/data/protogen/logs/v1"`, + `"go.opentelemetry.io/collector/pdata/pcommon"`, + }, + testImports: []string{ + `"testing"`, + `"unsafe"`, + ``, + `"github.com/stretchr/testify/assert"`, + ``, + `"go.opentelemetry.io/collector/pdata/internal"`, + `"go.opentelemetry.io/collector/pdata/internal/data"`, + `otlplogs "go.opentelemetry.io/collector/pdata/internal/data/protogen/logs/v1"`, + `"go.opentelemetry.io/collector/pdata/pcommon"`, + }, }, structs: []baseStruct{ resourceLogsSlice, diff --git a/pdata/internal/cmd/pdatagen/internal/plogotlp_package.go b/pdata/internal/cmd/pdatagen/internal/plogotlp_package.go index 4a91a4c96da..a5d33fb5da5 100644 --- a/pdata/internal/cmd/pdatagen/internal/plogotlp_package.go +++ b/pdata/internal/cmd/pdatagen/internal/plogotlp_package.go @@ -7,15 +7,19 @@ import ( ) var plogotlp = &Package{ - name: "plogotlp", - path: filepath.Join("plog", "plogotlp"), - imports: []string{ - `otlpcollectorlog "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/logs/v1"`, - }, - testImports: []string{ - `"testing"`, - ``, - `"github.com/stretchr/testify/assert"`, + info: &PackageInfo{ + name: "plogotlp", + path: filepath.Join("plog", "plogotlp"), + imports: []string{ + `otlpcollectorlog "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/logs/v1"`, + }, + testImports: []string{ + `"testing"`, + ``, + `"github.com/stretchr/testify/assert"`, + ``, + `"go.opentelemetry.io/collector/pdata/internal"`, + }, }, structs: []baseStruct{ exportLogsPartialSuccess, diff --git a/pdata/internal/cmd/pdatagen/internal/pmetric_package.go b/pdata/internal/cmd/pdatagen/internal/pmetric_package.go index 68aee5219f9..e6e8e3a1901 100644 --- a/pdata/internal/cmd/pdatagen/internal/pmetric_package.go +++ b/pdata/internal/cmd/pdatagen/internal/pmetric_package.go @@ -4,26 +4,28 @@ package internal // import "go.opentelemetry.io/collector/pdata/internal/cmd/pdatagen/internal" var pmetric = &Package{ - name: "pmetric", - path: "pmetric", - imports: []string{ - `"sort"`, - ``, - `"go.opentelemetry.io/collector/pdata/internal"`, - `"go.opentelemetry.io/collector/pdata/internal/data"`, - `otlpmetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1"`, - `"go.opentelemetry.io/collector/pdata/pcommon"`, - }, - testImports: []string{ - `"testing"`, - `"unsafe"`, - ``, - `"github.com/stretchr/testify/assert"`, - ``, - `"go.opentelemetry.io/collector/pdata/internal"`, - `"go.opentelemetry.io/collector/pdata/internal/data"`, - `otlpmetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1"`, - `"go.opentelemetry.io/collector/pdata/pcommon"`, + info: &PackageInfo{ + name: "pmetric", + path: "pmetric", + imports: []string{ + `"sort"`, + ``, + `"go.opentelemetry.io/collector/pdata/internal"`, + `"go.opentelemetry.io/collector/pdata/internal/data"`, + `otlpmetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1"`, + `"go.opentelemetry.io/collector/pdata/pcommon"`, + }, + testImports: []string{ + `"testing"`, + `"unsafe"`, + ``, + `"github.com/stretchr/testify/assert"`, + ``, + `"go.opentelemetry.io/collector/pdata/internal"`, + `"go.opentelemetry.io/collector/pdata/internal/data"`, + `otlpmetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1"`, + `"go.opentelemetry.io/collector/pdata/pcommon"`, + }, }, structs: []baseStruct{ resourceMetricsSlice, diff --git a/pdata/internal/cmd/pdatagen/internal/pmetricotlp_package.go b/pdata/internal/cmd/pdatagen/internal/pmetricotlp_package.go index 33a96aed184..591e9a7ec0d 100644 --- a/pdata/internal/cmd/pdatagen/internal/pmetricotlp_package.go +++ b/pdata/internal/cmd/pdatagen/internal/pmetricotlp_package.go @@ -8,15 +8,19 @@ import ( ) var pmetricotlp = &Package{ - name: "pmetricotlp", - path: filepath.Join("pmetric", "pmetricotlp"), - imports: []string{ - `otlpcollectormetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/metrics/v1"`, - }, - testImports: []string{ - `"testing"`, - ``, - `"github.com/stretchr/testify/assert"`, + info: &PackageInfo{ + name: "pmetricotlp", + path: filepath.Join("pmetric", "pmetricotlp"), + imports: []string{ + `otlpcollectormetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/metrics/v1"`, + }, + testImports: []string{ + `"testing"`, + ``, + `"github.com/stretchr/testify/assert"`, + ``, + `"go.opentelemetry.io/collector/pdata/internal"`, + }, }, structs: []baseStruct{ exportMetricsPartialSuccess, diff --git a/pdata/internal/cmd/pdatagen/internal/pprofile_package.go b/pdata/internal/cmd/pdatagen/internal/pprofile_package.go index 2e740137749..7071021b27d 100644 --- a/pdata/internal/cmd/pdatagen/internal/pprofile_package.go +++ b/pdata/internal/cmd/pdatagen/internal/pprofile_package.go @@ -4,23 +4,25 @@ package internal // import "go.opentelemetry.io/collector/pdata/internal/cmd/pdatagen/internal" var pprofile = &Package{ - name: "pprofile", - path: "pprofile", - imports: []string{ - `"go.opentelemetry.io/collector/pdata/internal"`, - `"go.opentelemetry.io/collector/pdata/internal/data"`, - `otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental"`, - `"go.opentelemetry.io/collector/pdata/pcommon"`, - }, - testImports: []string{ - `"testing"`, - `"unsafe"`, - ``, - `"github.com/stretchr/testify/assert"`, - ``, - `"go.opentelemetry.io/collector/pdata/internal"`, - `otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental"`, - `"go.opentelemetry.io/collector/pdata/pcommon"`, + info: &PackageInfo{ + name: "pprofile", + path: "pprofile", + imports: []string{ + `"go.opentelemetry.io/collector/pdata/internal"`, + `"go.opentelemetry.io/collector/pdata/internal/data"`, + `otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental"`, + `"go.opentelemetry.io/collector/pdata/pcommon"`, + }, + testImports: []string{ + `"testing"`, + `"unsafe"`, + ``, + `"github.com/stretchr/testify/assert"`, + ``, + `"go.opentelemetry.io/collector/pdata/internal"`, + `otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental"`, + `"go.opentelemetry.io/collector/pdata/pcommon"`, + }, }, structs: []baseStruct{ resourceProfilesSlice, diff --git a/pdata/internal/cmd/pdatagen/internal/pprofile_otlp_package.go b/pdata/internal/cmd/pdatagen/internal/pprofileotlp_package.go similarity index 68% rename from pdata/internal/cmd/pdatagen/internal/pprofile_otlp_package.go rename to pdata/internal/cmd/pdatagen/internal/pprofileotlp_package.go index ddd3a5df437..9a94f3945a0 100644 --- a/pdata/internal/cmd/pdatagen/internal/pprofile_otlp_package.go +++ b/pdata/internal/cmd/pdatagen/internal/pprofileotlp_package.go @@ -7,15 +7,19 @@ import ( ) var pprofileotlp = &Package{ - name: "pprofileotlp", - path: filepath.Join("pprofile", "pprofileotlp"), - imports: []string{ - `otlpcollectorprofile "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/profiles/v1experimental"`, - }, - testImports: []string{ - `"testing"`, - ``, - `"github.com/stretchr/testify/assert"`, + info: &PackageInfo{ + name: "pprofileotlp", + path: filepath.Join("pprofile", "pprofileotlp"), + imports: []string{ + `otlpcollectorprofile "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/profiles/v1experimental"`, + }, + testImports: []string{ + `"testing"`, + ``, + `"github.com/stretchr/testify/assert"`, + ``, + `"go.opentelemetry.io/collector/pdata/internal"`, + }, }, structs: []baseStruct{ exportProfilesPartialSuccess, diff --git a/pdata/internal/cmd/pdatagen/internal/primitive_slice_structs.go b/pdata/internal/cmd/pdatagen/internal/primitive_slice_structs.go index 11ddf6d7c12..0e3c45d6b91 100644 --- a/pdata/internal/cmd/pdatagen/internal/primitive_slice_structs.go +++ b/pdata/internal/cmd/pdatagen/internal/primitive_slice_structs.go @@ -6,234 +6,8 @@ package internal // import "go.opentelemetry.io/collector/pdata/internal/cmd/pda import ( "bytes" "strings" - "text/template" ) -const primitiveSliceTemplate = `// {{ .structName }} represents a []{{ .itemType }} slice. -// The instance of {{ .structName }} can be assigned to multiple objects since it's immutable. -// -// Must use New{{ .structName }} function to create new instances. -// Important: zero-initialized instance is not valid for use. -type {{ .structName }} internal.{{ .structName }} - -func (ms {{ .structName }}) getOrig() *[]{{ .itemType }} { - return internal.GetOrig{{ .structName }}(internal.{{ .structName }}(ms)) -} - -func (ms {{ .structName }}) getState() *internal.State { - return internal.Get{{ .structName }}State(internal.{{ .structName }}(ms)) -} - -// New{{ .structName }} creates a new empty {{ .structName }}. -func New{{ .structName }}() {{ .structName }} { - orig := []{{ .itemType }}(nil) - state := internal.StateMutable - return {{ .structName }}(internal.New{{ .structName }}(&orig, &state)) -} - -// AsRaw returns a copy of the []{{ .itemType }} slice. -func (ms {{ .structName }}) AsRaw() []{{ .itemType }} { - return copy{{ .structName }}(nil, *ms.getOrig()) -} - -// FromRaw copies raw []{{ .itemType }} into the slice {{ .structName }}. -func (ms {{ .structName }}) FromRaw(val []{{ .itemType }}) { - ms.getState().AssertMutable() - *ms.getOrig() = copy{{ .structName }}(*ms.getOrig(), val) -} - -// Len returns length of the []{{ .itemType }} slice value. -// Equivalent of len({{ .lowerStructName }}). -func (ms {{ .structName }}) Len() int { - return len(*ms.getOrig()) -} - -// At returns an item from particular index. -// Equivalent of {{ .lowerStructName }}[i]. -func (ms {{ .structName }}) At(i int) {{ .itemType }} { - return (*ms.getOrig())[i] -} - -// SetAt sets {{ .itemType }} item at particular index. -// Equivalent of {{ .lowerStructName }}[i] = val -func (ms {{ .structName }}) SetAt(i int, val {{ .itemType }}) { - ms.getState().AssertMutable() - (*ms.getOrig())[i] = val -} - -// EnsureCapacity ensures {{ .structName }} has at least the specified capacity. -// 1. If the newCap <= cap, then is no change in capacity. -// 2. If the newCap > cap, then the slice capacity will be expanded to the provided value which will be equivalent of: -// buf := make([]{{ .itemType }}, len({{ .lowerStructName }}), newCap) -// copy(buf, {{ .lowerStructName }}) -// {{ .lowerStructName }} = buf -func (ms {{ .structName }}) EnsureCapacity(newCap int) { - ms.getState().AssertMutable() - oldCap := cap(*ms.getOrig()) - if newCap <= oldCap { - return - } - - newOrig := make([]{{ .itemType }}, len(*ms.getOrig()), newCap) - copy(newOrig, *ms.getOrig()) - *ms.getOrig() = newOrig -} - -// Append appends extra elements to {{ .structName }}. -// Equivalent of {{ .lowerStructName }} = append({{ .lowerStructName }}, elms...) -func (ms {{ .structName }}) Append(elms ...{{ .itemType }}) { - ms.getState().AssertMutable() - *ms.getOrig() = append(*ms.getOrig(), elms...) -} - -// MoveTo moves all elements from the current slice overriding the destination and -// resetting the current instance to its zero value. -func (ms {{ .structName }}) MoveTo(dest {{ .structName }}) { - ms.getState().AssertMutable() - dest.getState().AssertMutable() - *dest.getOrig() = *ms.getOrig() - *ms.getOrig() = nil -} - -// CopyTo copies all elements from the current slice overriding the destination. -func (ms {{ .structName }}) CopyTo(dest {{ .structName }}) { - dest.getState().AssertMutable() - *dest.getOrig() = copy{{ .structName }}(*dest.getOrig(), *ms.getOrig()) -} - -func copy{{ .structName }}(dst, src []{{ .itemType }}) []{{ .itemType }} { - dst = dst[:0] - return append(dst, src...) -}` - -const immutableSliceTestTemplate = `func TestNew{{ .structName }}(t *testing.T) { - ms := New{{ .structName }}() - assert.Equal(t, 0, ms.Len()) - ms.FromRaw([]{{ .itemType }}{ {{ .testOrigVal }} }) - assert.Equal(t, 3, ms.Len()) - assert.Equal(t, []{{ .itemType }}{ {{ .testOrigVal }} }, ms.AsRaw()) - ms.SetAt(1, {{ .itemType }}( {{ .testSetVal }} )) - assert.Equal(t, []{{ .itemType }}{ {{ .testNewVal }} }, ms.AsRaw()) - ms.FromRaw([]{{ .itemType }}{ {{ index .testInterfaceOrigVal 2 }} }) - assert.Equal(t, 1, ms.Len()) - {{- if eq .itemType "float64" }} - assert.InDelta(t, {{ .itemType }}({{ index .testInterfaceOrigVal 2 }}), ms.At(0), 0.01) - {{- else }} - assert.Equal(t, {{ .itemType }}({{ index .testInterfaceOrigVal 2 }}), ms.At(0)) - {{- end }} - - cp := New{{ .structName }}() - ms.CopyTo(cp) - ms.SetAt(0, {{ .itemType }}( {{ index .testInterfaceOrigVal 1 }} )) - {{- if eq .itemType "float64" }} - assert.InDelta(t, {{ .itemType }}({{ index .testInterfaceOrigVal 1 }}), ms.At(0), 0.01) - {{- else }} - assert.Equal(t, {{ .itemType }}({{ index .testInterfaceOrigVal 1 }}), ms.At(0)) - {{- end }} - {{- if eq .itemType "float64" }} - assert.InDelta(t, {{ .itemType }}({{ index .testInterfaceOrigVal 2 }}), cp.At(0), 0.01) - {{- else }} - assert.Equal(t, {{ .itemType }}({{ index .testInterfaceOrigVal 2 }}), cp.At(0)) - {{- end }} - ms.CopyTo(cp) - {{- if eq .itemType "float64" }} - assert.InDelta(t, {{ .itemType }}({{ index .testInterfaceOrigVal 1 }}), cp.At(0), 0.01) - {{- else }} - assert.Equal(t, {{ .itemType }}({{ index .testInterfaceOrigVal 1 }}), cp.At(0)) - {{- end }} - - mv := New{{ .structName }}() - ms.MoveTo(mv) - assert.Equal(t, 0, ms.Len()) - assert.Equal(t, 1, mv.Len()) - {{- if eq .itemType "float64" }} - assert.InDelta(t, {{ .itemType }}({{index .testInterfaceOrigVal 1 }}), mv.At(0), 0.01) - {{- else }} - assert.Equal(t, {{ .itemType }}({{index .testInterfaceOrigVal 1 }}), mv.At(0)) - {{- end }} - ms.FromRaw([]{{ .itemType }}{ {{ .testOrigVal }} }) - ms.MoveTo(mv) - assert.Equal(t, 3, mv.Len()) - {{- if eq .itemType "float64" }} - assert.InDelta(t, {{ .itemType }}({{index .testInterfaceOrigVal 0 }}), mv.At(0), 0.01) - {{- else }} - assert.Equal(t, {{ .itemType }}({{index .testInterfaceOrigVal 0 }}), mv.At(0)) - {{- end }} -} - -func Test{{ .structName }}ReadOnly(t *testing.T) { - raw := []{{ .itemType }}{ {{ .testOrigVal }}} - state := internal.StateReadOnly - ms := {{ .structName }}(internal.New{{ .structName }}(&raw, &state)) - - assert.Equal(t, 3, ms.Len()) - {{- if eq .itemType "float64" }} - assert.InDelta(t, {{ .itemType }}( {{index .testInterfaceOrigVal 0 }} ), ms.At(0), 0.01) - {{- else }} - assert.Equal(t, {{ .itemType }}({{ index .testInterfaceOrigVal 0 }}), ms.At(0)) - {{- end }} - assert.Panics(t, func() { ms.Append({{ index .testInterfaceOrigVal 0 }}) }) - assert.Panics(t, func() { ms.EnsureCapacity(2) }) - assert.Equal(t, raw, ms.AsRaw()) - assert.Panics(t, func() { ms.FromRaw(raw) }) - - ms2 := New{{ .structName }}() - ms.CopyTo(ms2) - assert.Equal(t, ms.AsRaw(), ms2.AsRaw()) - assert.Panics(t, func() { ms2.CopyTo(ms) }) - - assert.Panics(t, func() { ms.MoveTo(ms2) }) - assert.Panics(t, func() { ms2.MoveTo(ms) }) -} - -func Test{{ .structName }}Append(t *testing.T) { - ms := New{{ .structName }}() - ms.FromRaw([]{{ .itemType }}{ {{ .testOrigVal }} }) - ms.Append({{ .testSetVal }}, {{ .testSetVal }}) - assert.Equal(t, 5, ms.Len()) - {{- if eq .itemType "float64" }} - assert.InDelta(t, {{ .itemType }}({{ .testSetVal }} ), ms.At(4), 0.01) - {{- else }} - assert.Equal(t, {{ .itemType }}({{ .testSetVal }}), ms.At(4)) - {{- end }} -} - -func Test{{ .structName }}EnsureCapacity(t *testing.T) { - ms := New{{ .structName }}() - ms.EnsureCapacity(4) - assert.Equal(t, 4, cap(*ms.getOrig())) - ms.EnsureCapacity(2) - assert.Equal(t, 4, cap(*ms.getOrig())) -}` - -const primitiveSliceInternalTemplate = ` -type {{ .structName }} struct { - orig *[]{{ .itemType }} - state *State -} - -func GetOrig{{ .structName }}(ms {{ .structName }}) *[]{{ .itemType }} { - return ms.orig -} - -func Get{{ .structName }}State(ms {{ .structName }}) *State { - return ms.state -} - -func New{{ .structName }}(orig *[]{{ .itemType }}, state *State) {{ .structName }} { - return {{ .structName }}{orig: orig, state: state} -} - -func FillTest{{ .structName }}(tv {{ .structName}}) { -} - -func GenerateTest{{ .structName }}() {{ .structName }} { - state := StateMutable - var orig []{{ .itemType }} = nil - - return {{ .structName }}{&orig, &state} -}` - // primitiveSliceStruct generates a struct for a slice of primitive value elements. The structs are always generated // in a way that they can be used as fields in structs from other packages (using the internal package). type primitiveSliceStruct struct { @@ -255,30 +29,31 @@ func (iss *primitiveSliceStruct) getPackageName() string { return iss.packageName } -func (iss *primitiveSliceStruct) generateStruct(sb *bytes.Buffer) { - t := template.Must(template.New("primitiveSliceTemplate").Parse(primitiveSliceTemplate)) - if err := t.Execute(sb, iss.templateFields()); err != nil { +func (iss *primitiveSliceStruct) generate(packageInfo *PackageInfo) []byte { + var sb bytes.Buffer + if err := primitiveSliceTemplate.Execute(&sb, iss.templateFields(packageInfo)); err != nil { panic(err) } + return sb.Bytes() } -func (iss *primitiveSliceStruct) generateTests(sb *bytes.Buffer) { - t := template.Must(template.New("immutableSliceTestTemplate").Parse(immutableSliceTestTemplate)) - if err := t.Execute(sb, iss.templateFields()); err != nil { +func (iss *primitiveSliceStruct) generateTests(packageInfo *PackageInfo) []byte { + var sb bytes.Buffer + if err := primitiveSliceTestTemplate.Execute(&sb, iss.templateFields(packageInfo)); err != nil { panic(err) } + return sb.Bytes() } -func (iss *primitiveSliceStruct) generateTestValueHelpers(*bytes.Buffer) {} - -func (iss *primitiveSliceStruct) generateInternal(sb *bytes.Buffer) { - t := template.Must(template.New("primitiveSliceInternalTemplate").Parse(primitiveSliceInternalTemplate)) - if err := t.Execute(sb, iss.templateFields()); err != nil { +func (iss *primitiveSliceStruct) generateInternal(packageInfo *PackageInfo) []byte { + var sb bytes.Buffer + if err := primitiveSliceInternalTemplate.Execute(&sb, iss.templateFields(packageInfo)); err != nil { panic(err) } + return sb.Bytes() } -func (iss *primitiveSliceStruct) templateFields() map[string]any { +func (iss *primitiveSliceStruct) templateFields(packageInfo *PackageInfo) map[string]any { return map[string]any{ "structName": iss.structName, "itemType": iss.itemType, @@ -287,5 +62,8 @@ func (iss *primitiveSliceStruct) templateFields() map[string]any { "testInterfaceOrigVal": iss.testInterfaceOrigVal, "testSetVal": iss.testSetVal, "testNewVal": iss.testNewVal, + "packageName": packageInfo.name, + "imports": packageInfo.imports, + "testImports": packageInfo.testImports, } } diff --git a/pdata/internal/cmd/pdatagen/internal/ptrace_package.go b/pdata/internal/cmd/pdatagen/internal/ptrace_package.go index bb4345294d9..d04192b7455 100644 --- a/pdata/internal/cmd/pdatagen/internal/ptrace_package.go +++ b/pdata/internal/cmd/pdatagen/internal/ptrace_package.go @@ -4,26 +4,28 @@ package internal // import "go.opentelemetry.io/collector/pdata/internal/cmd/pdatagen/internal" var ptrace = &Package{ - name: "ptrace", - path: "ptrace", - imports: []string{ - `"sort"`, - ``, - `"go.opentelemetry.io/collector/pdata/internal"`, - `"go.opentelemetry.io/collector/pdata/internal/data"`, - `otlptrace "go.opentelemetry.io/collector/pdata/internal/data/protogen/trace/v1"`, - `"go.opentelemetry.io/collector/pdata/pcommon"`, - }, - testImports: []string{ - `"testing"`, - `"unsafe"`, - ``, - `"github.com/stretchr/testify/assert"`, - ``, - `"go.opentelemetry.io/collector/pdata/internal"`, - `"go.opentelemetry.io/collector/pdata/internal/data"`, - `otlptrace "go.opentelemetry.io/collector/pdata/internal/data/protogen/trace/v1"`, - `"go.opentelemetry.io/collector/pdata/pcommon"`, + info: &PackageInfo{ + name: "ptrace", + path: "ptrace", + imports: []string{ + `"sort"`, + ``, + `"go.opentelemetry.io/collector/pdata/internal"`, + `"go.opentelemetry.io/collector/pdata/internal/data"`, + `otlptrace "go.opentelemetry.io/collector/pdata/internal/data/protogen/trace/v1"`, + `"go.opentelemetry.io/collector/pdata/pcommon"`, + }, + testImports: []string{ + `"testing"`, + `"unsafe"`, + ``, + `"github.com/stretchr/testify/assert"`, + ``, + `"go.opentelemetry.io/collector/pdata/internal"`, + `"go.opentelemetry.io/collector/pdata/internal/data"`, + `otlptrace "go.opentelemetry.io/collector/pdata/internal/data/protogen/trace/v1"`, + `"go.opentelemetry.io/collector/pdata/pcommon"`, + }, }, structs: []baseStruct{ resourceSpansSlice, diff --git a/pdata/internal/cmd/pdatagen/internal/ptraceotlp_package.go b/pdata/internal/cmd/pdatagen/internal/ptraceotlp_package.go index 621f42bf2a7..ca574f1b4d7 100644 --- a/pdata/internal/cmd/pdatagen/internal/ptraceotlp_package.go +++ b/pdata/internal/cmd/pdatagen/internal/ptraceotlp_package.go @@ -8,15 +8,19 @@ import ( ) var ptraceotlp = &Package{ - name: "ptraceotlp", - path: filepath.Join("ptrace", "ptraceotlp"), - imports: []string{ - `otlpcollectortrace "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/trace/v1"`, - }, - testImports: []string{ - `"testing"`, - ``, - `"github.com/stretchr/testify/assert"`, + info: &PackageInfo{ + name: "ptraceotlp", + path: filepath.Join("ptrace", "ptraceotlp"), + imports: []string{ + `otlpcollectortrace "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/trace/v1"`, + }, + testImports: []string{ + `"testing"`, + ``, + `"github.com/stretchr/testify/assert"`, + ``, + `"go.opentelemetry.io/collector/pdata/internal"`, + }, }, structs: []baseStruct{ exportTracePartialSuccess, diff --git a/pdata/internal/cmd/pdatagen/internal/templates.go b/pdata/internal/cmd/pdatagen/internal/templates.go new file mode 100644 index 00000000000..e7218752979 --- /dev/null +++ b/pdata/internal/cmd/pdatagen/internal/templates.go @@ -0,0 +1,47 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package internal // import "go.opentelemetry.io/collector/pdata/internal/cmd/pdatagen/internal" + +import ( + _ "embed" + "text/template" +) + +var ( + //go:embed templates/message.go.tmpl + messageTemplateBytes []byte + messageTemplate = parseTemplate("message.go", messageTemplateBytes) + + //go:embed templates/message_internal.go.tmpl + messageInternalTemplateBytes []byte + messageInternalTemplate = parseTemplate("message_internal.go", messageInternalTemplateBytes) + + //go:embed templates/message_test.go.tmpl + messageTestTemplateBytes []byte + messageTestTemplate = parseTemplate("message_test.go", messageTestTemplateBytes) + + //go:embed templates/primitive_slice.go.tmpl + primitiveSliceTemplateBytes []byte + primitiveSliceTemplate = parseTemplate("primitive_slice.go", primitiveSliceTemplateBytes) + + //go:embed templates/primitive_slice_internal.go.tmpl + primitiveSliceInternalTemplateBytes []byte + primitiveSliceInternalTemplate = parseTemplate("primitive_slice_internal.go", primitiveSliceInternalTemplateBytes) + + //go:embed templates/primitive_slice_test.go.tmpl + primitiveSliceTestTemplateBytes []byte + primitiveSliceTestTemplate = parseTemplate("primitive_slice_test.go", primitiveSliceTestTemplateBytes) + + //go:embed templates/slice.go.tmpl + sliceTemplateBytes []byte + sliceTemplate = parseTemplate("slice.go", sliceTemplateBytes) + + //go:embed templates/slice_test.go.tmpl + sliceTestTemplateBytes []byte + sliceTestTemplate = parseTemplate("slice_test.go", sliceTestTemplateBytes) +) + +func parseTemplate(name string, bytes []byte) *template.Template { + return template.Must(template.New(name).Parse(string(bytes))) +} diff --git a/pdata/internal/cmd/pdatagen/internal/templates/message.go.tmpl b/pdata/internal/cmd/pdatagen/internal/templates/message.go.tmpl new file mode 100644 index 00000000000..d7e93b9f31d --- /dev/null +++ b/pdata/internal/cmd/pdatagen/internal/templates/message.go.tmpl @@ -0,0 +1,77 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// To regenerate this file run "make genpdata". + +package {{ .packageName }} + +import ( +{{ range $index, $element := .imports -}} +{{ $element }} +{{ end }} +) + +{{ .description }} +// +// This is a reference type, if passed by value and callee modifies it the +// caller will see the modification. +// +// Must use New{{ .structName }} function to create new instances. +// Important: zero-initialized instance is not valid for use. +{{- if .isCommon }} +type {{ .structName }} internal.{{ .structName }} +{{- else }} +type {{ .structName }} struct { + orig *{{ .originName }} + state *internal.State +} +{{- end }} + +func new{{ .structName }}(orig *{{ .originName }}, state *internal.State) {{ .structName }} { + {{- if .isCommon }} + return {{ .structName }}(internal.New{{ .structName }}(orig, state)) + {{- else }} + return {{ .structName }}{orig: orig, state: state} + {{- end }} +} + +// New{{ .structName }} creates a new empty {{ .structName }}. +// +// This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, +// OR directly access the member if this is embedded in another struct. +func New{{ .structName }}() {{ .structName }} { + state := internal.StateMutable + return new{{ .structName }}(&{{ .originName }}{}, &state) +} + +// MoveTo moves all properties from the current struct overriding the destination and +// resetting the current instance to its zero value +func (ms {{ .structName }}) MoveTo(dest {{ .structName }}) { + ms.{{- if .isCommon }}getState(){{ else }}state{{ end }}.AssertMutable() + dest.{{- if .isCommon }}getState(){{ else }}state{{ end }}.AssertMutable() + *dest.{{ .origAccessor }} = *ms.{{ .origAccessor }} + *ms.{{ .origAccessor }} = {{ .originName }}{} +} + +{{ if .isCommon -}} +func (ms {{ .structName }}) getOrig() *{{ .originName }} { + return internal.GetOrig{{ .structName }}(internal.{{ .structName }}(ms)) +} + +func (ms {{ .structName }}) getState() *internal.State { + return internal.Get{{ .structName }}State(internal.{{ .structName }}(ms)) +} +{{- end }} + +{{ range .fields -}} +{{ .GenerateAccessors $.messageStruct }} +{{ end }} + +// CopyTo copies all properties from the current struct overriding the destination. +func (ms {{ .structName }}) CopyTo(dest {{ .structName }}) { + dest.{{- if .isCommon }}getState(){{ else }}state{{ end }}.AssertMutable() + {{- range .fields }} + {{ .GenerateCopyToValue $.messageStruct }} + {{- end }} +} diff --git a/pdata/internal/cmd/pdatagen/internal/templates/message_internal.go.tmpl b/pdata/internal/cmd/pdatagen/internal/templates/message_internal.go.tmpl new file mode 100644 index 00000000000..6f1c0b41979 --- /dev/null +++ b/pdata/internal/cmd/pdatagen/internal/templates/message_internal.go.tmpl @@ -0,0 +1,46 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// To regenerate this file run "make genpdata". + +package internal + +import ( +{{ range $index, $element := .imports -}} +{{ if ne $element "go.opentelemetry.io/collector/pdata/internal" }} +{{ $element }} +{{ end }} +{{ end }} +) + +type {{ .structName }} struct { + orig *{{ .originName }} + state *State +} + +func GetOrig{{ .structName }}(ms {{ .structName }}) *{{ .originName }} { + return ms.orig +} + +func Get{{ .structName }}State(ms {{ .structName }}) *State { + return ms.state +} + +func New{{ .structName }}(orig *{{ .originName }}, state *State) {{ .structName }} { + return {{ .structName }}{orig: orig, state: state} +} + +func GenerateTest{{ .structName }}() {{ .structName }} { + orig := {{ .originName }}{} + state := StateMutable + tv := New{{ .structName }}(&orig, &state) + FillTest{{ .structName }}(tv) + return tv +} + +func FillTest{{ .structName }}(tv {{ .structName }}) { + {{- range .fields }} + {{ .GenerateSetWithTestValue $.messageStruct }} + {{- end }} +} diff --git a/pdata/internal/cmd/pdatagen/internal/templates/message_test.go.tmpl b/pdata/internal/cmd/pdatagen/internal/templates/message_test.go.tmpl new file mode 100644 index 00000000000..ff96aa71718 --- /dev/null +++ b/pdata/internal/cmd/pdatagen/internal/templates/message_test.go.tmpl @@ -0,0 +1,54 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// To regenerate this file run "make genpdata". + +package {{ .packageName }} + +import ( +{{ range $index, $element := .testImports -}} +{{ $element }} +{{ end }} +) + +func Test{{ .structName }}_MoveTo(t *testing.T) { + ms := {{ .generateTestData }} + dest := New{{ .structName }}() + ms.MoveTo(dest) + assert.Equal(t, New{{ .structName }}(), ms) + assert.Equal(t, {{ .generateTestData }}, dest) + sharedState := internal.StateReadOnly + assert.Panics(t, func() { ms.MoveTo(new{{ .structName }}(&{{ .originName }}{}, &sharedState)) }) + assert.Panics(t, func() { new{{ .structName }}(&{{ .originName }}{}, &sharedState).MoveTo(dest) }) +} + +func Test{{ .structName }}_CopyTo(t *testing.T) { + ms := New{{ .structName }}() + orig := New{{ .structName }}() + orig.CopyTo(ms) + assert.Equal(t, orig, ms) + orig = {{ .generateTestData }} + orig.CopyTo(ms) + assert.Equal(t, orig, ms) + sharedState := internal.StateReadOnly + assert.Panics(t, func() { ms.CopyTo(new{{ .structName }}(&{{ .originName }}{}, &sharedState)) }) +} + +{{ range .fields }} +{{ .GenerateAccessorsTest $.messageStruct }} +{{ end }} + +{{- if not .isCommon }} +func generateTest{{ .structName }}() {{ .structName }} { + tv := New{{ .structName }}() + fillTest{{ .structName }}(tv) + return tv +} + +func fillTest{{ .structName }}(tv {{ .structName }}) { + {{- range .fields }} + {{ .GenerateSetWithTestValue $.messageStruct }} + {{- end }} +} +{{ end }} diff --git a/pdata/internal/cmd/pdatagen/internal/templates/primitive_slice.go.tmpl b/pdata/internal/cmd/pdatagen/internal/templates/primitive_slice.go.tmpl new file mode 100644 index 00000000000..c8b848a81f4 --- /dev/null +++ b/pdata/internal/cmd/pdatagen/internal/templates/primitive_slice.go.tmpl @@ -0,0 +1,110 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// To regenerate this file run "make genpdata". + +package {{ .packageName }} + +import ( +{{ range $index, $element := .imports -}} +{{ $element }} +{{ end }} +) + +// {{ .structName }} represents a []{{ .itemType }} slice. +// The instance of {{ .structName }} can be assigned to multiple objects since it's immutable. +// +// Must use New{{ .structName }} function to create new instances. +// Important: zero-initialized instance is not valid for use. +type {{ .structName }} internal.{{ .structName }} + +func (ms {{ .structName }}) getOrig() *[]{{ .itemType }} { + return internal.GetOrig{{ .structName }}(internal.{{ .structName }}(ms)) +} + +func (ms {{ .structName }}) getState() *internal.State { + return internal.Get{{ .structName }}State(internal.{{ .structName }}(ms)) +} + +// New{{ .structName }} creates a new empty {{ .structName }}. +func New{{ .structName }}() {{ .structName }} { + orig := []{{ .itemType }}(nil) + state := internal.StateMutable + return {{ .structName }}(internal.New{{ .structName }}(&orig, &state)) +} + +// AsRaw returns a copy of the []{{ .itemType }} slice. +func (ms {{ .structName }}) AsRaw() []{{ .itemType }} { + return copy{{ .structName }}(nil, *ms.getOrig()) +} + +// FromRaw copies raw []{{ .itemType }} into the slice {{ .structName }}. +func (ms {{ .structName }}) FromRaw(val []{{ .itemType }}) { + ms.getState().AssertMutable() + *ms.getOrig() = copy{{ .structName }}(*ms.getOrig(), val) +} + +// Len returns length of the []{{ .itemType }} slice value. +// Equivalent of len({{ .lowerStructName }}). +func (ms {{ .structName }}) Len() int { + return len(*ms.getOrig()) +} + +// At returns an item from particular index. +// Equivalent of {{ .lowerStructName }}[i]. +func (ms {{ .structName }}) At(i int) {{ .itemType }} { + return (*ms.getOrig())[i] +} + +// SetAt sets {{ .itemType }} item at particular index. +// Equivalent of {{ .lowerStructName }}[i] = val +func (ms {{ .structName }}) SetAt(i int, val {{ .itemType }}) { + ms.getState().AssertMutable() + (*ms.getOrig())[i] = val +} + +// EnsureCapacity ensures {{ .structName }} has at least the specified capacity. +// 1. If the newCap <= cap, then is no change in capacity. +// 2. If the newCap > cap, then the slice capacity will be expanded to the provided value which will be equivalent of: +// buf := make([]{{ .itemType }}, len({{ .lowerStructName }}), newCap) +// copy(buf, {{ .lowerStructName }}) +// {{ .lowerStructName }} = buf +func (ms {{ .structName }}) EnsureCapacity(newCap int) { + ms.getState().AssertMutable() + oldCap := cap(*ms.getOrig()) + if newCap <= oldCap { + return + } + + newOrig := make([]{{ .itemType }}, len(*ms.getOrig()), newCap) + copy(newOrig, *ms.getOrig()) + *ms.getOrig() = newOrig +} + +// Append appends extra elements to {{ .structName }}. +// Equivalent of {{ .lowerStructName }} = append({{ .lowerStructName }}, elms...) +func (ms {{ .structName }}) Append(elms ...{{ .itemType }}) { + ms.getState().AssertMutable() + *ms.getOrig() = append(*ms.getOrig(), elms...) +} + +// MoveTo moves all elements from the current slice overriding the destination and +// resetting the current instance to its zero value. +func (ms {{ .structName }}) MoveTo(dest {{ .structName }}) { + ms.getState().AssertMutable() + dest.getState().AssertMutable() + *dest.getOrig() = *ms.getOrig() + *ms.getOrig() = nil +} + +// CopyTo copies all elements from the current slice overriding the destination. +func (ms {{ .structName }}) CopyTo(dest {{ .structName }}) { + dest.getState().AssertMutable() + *dest.getOrig() = copy{{ .structName }}(*dest.getOrig(), *ms.getOrig()) +} + +func copy{{ .structName }}(dst, src []{{ .itemType }}) []{{ .itemType }} { + dst = dst[:0] + return append(dst, src...) +} diff --git a/pdata/internal/cmd/pdatagen/internal/templates/primitive_slice_internal.go.tmpl b/pdata/internal/cmd/pdatagen/internal/templates/primitive_slice_internal.go.tmpl new file mode 100644 index 00000000000..db8b2001546 --- /dev/null +++ b/pdata/internal/cmd/pdatagen/internal/templates/primitive_slice_internal.go.tmpl @@ -0,0 +1,42 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// To regenerate this file run "make genpdata". + +package internal + +import ( +{{ range $index, $element := .imports -}} +{{ if ne $element "go.opentelemetry.io/collector/pdata/internal" }} +{{ $element }} +{{ end }} +{{ end }} +) + +type {{ .structName }} struct { + orig *[]{{ .itemType }} + state *State +} + +func GetOrig{{ .structName }}(ms {{ .structName }}) *[]{{ .itemType }} { + return ms.orig +} + +func Get{{ .structName }}State(ms {{ .structName }}) *State { + return ms.state +} + +func New{{ .structName }}(orig *[]{{ .itemType }}, state *State) {{ .structName }} { + return {{ .structName }}{orig: orig, state: state} +} + +func FillTest{{ .structName }}(tv {{ .structName}}) { +} + +func GenerateTest{{ .structName }}() {{ .structName }} { + state := StateMutable + var orig []{{ .itemType }} = nil + + return {{ .structName }}{&orig, &state} +} diff --git a/pdata/internal/cmd/pdatagen/internal/templates/primitive_slice_test.go.tmpl b/pdata/internal/cmd/pdatagen/internal/templates/primitive_slice_test.go.tmpl new file mode 100644 index 00000000000..26f6038ba7c --- /dev/null +++ b/pdata/internal/cmd/pdatagen/internal/templates/primitive_slice_test.go.tmpl @@ -0,0 +1,113 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// To regenerate this file run "make genpdata". + +package {{ .packageName }} + +import ( +{{ range $index, $element := .testImports -}} +{{ $element }} +{{ end }} +) + +func TestNew{{ .structName }}(t *testing.T) { + ms := New{{ .structName }}() + assert.Equal(t, 0, ms.Len()) + ms.FromRaw([]{{ .itemType }}{ {{ .testOrigVal }} }) + assert.Equal(t, 3, ms.Len()) + assert.Equal(t, []{{ .itemType }}{ {{ .testOrigVal }} }, ms.AsRaw()) + ms.SetAt(1, {{ .itemType }}( {{ .testSetVal }} )) + assert.Equal(t, []{{ .itemType }}{ {{ .testNewVal }} }, ms.AsRaw()) + ms.FromRaw([]{{ .itemType }}{ {{ index .testInterfaceOrigVal 2 }} }) + assert.Equal(t, 1, ms.Len()) + {{- if eq .itemType "float64" }} + assert.InDelta(t, {{ .itemType }}({{ index .testInterfaceOrigVal 2 }}), ms.At(0), 0.01) + {{- else }} + assert.Equal(t, {{ .itemType }}({{ index .testInterfaceOrigVal 2 }}), ms.At(0)) + {{- end }} + + cp := New{{ .structName }}() + ms.CopyTo(cp) + ms.SetAt(0, {{ .itemType }}( {{ index .testInterfaceOrigVal 1 }} )) + {{- if eq .itemType "float64" }} + assert.InDelta(t, {{ .itemType }}({{ index .testInterfaceOrigVal 1 }}), ms.At(0), 0.01) + {{- else }} + assert.Equal(t, {{ .itemType }}({{ index .testInterfaceOrigVal 1 }}), ms.At(0)) + {{- end }} + {{- if eq .itemType "float64" }} + assert.InDelta(t, {{ .itemType }}({{ index .testInterfaceOrigVal 2 }}), cp.At(0), 0.01) + {{- else }} + assert.Equal(t, {{ .itemType }}({{ index .testInterfaceOrigVal 2 }}), cp.At(0)) + {{- end }} + ms.CopyTo(cp) + {{- if eq .itemType "float64" }} + assert.InDelta(t, {{ .itemType }}({{ index .testInterfaceOrigVal 1 }}), cp.At(0), 0.01) + {{- else }} + assert.Equal(t, {{ .itemType }}({{ index .testInterfaceOrigVal 1 }}), cp.At(0)) + {{- end }} + + mv := New{{ .structName }}() + ms.MoveTo(mv) + assert.Equal(t, 0, ms.Len()) + assert.Equal(t, 1, mv.Len()) + {{- if eq .itemType "float64" }} + assert.InDelta(t, {{ .itemType }}({{index .testInterfaceOrigVal 1 }}), mv.At(0), 0.01) + {{- else }} + assert.Equal(t, {{ .itemType }}({{index .testInterfaceOrigVal 1 }}), mv.At(0)) + {{- end }} + ms.FromRaw([]{{ .itemType }}{ {{ .testOrigVal }} }) + ms.MoveTo(mv) + assert.Equal(t, 3, mv.Len()) + {{- if eq .itemType "float64" }} + assert.InDelta(t, {{ .itemType }}({{index .testInterfaceOrigVal 0 }}), mv.At(0), 0.01) + {{- else }} + assert.Equal(t, {{ .itemType }}({{index .testInterfaceOrigVal 0 }}), mv.At(0)) + {{- end }} +} + +func Test{{ .structName }}ReadOnly(t *testing.T) { + raw := []{{ .itemType }}{ {{ .testOrigVal }}} + state := internal.StateReadOnly + ms := {{ .structName }}(internal.New{{ .structName }}(&raw, &state)) + + assert.Equal(t, 3, ms.Len()) + {{- if eq .itemType "float64" }} + assert.InDelta(t, {{ .itemType }}( {{index .testInterfaceOrigVal 0 }} ), ms.At(0), 0.01) + {{- else }} + assert.Equal(t, {{ .itemType }}({{ index .testInterfaceOrigVal 0 }}), ms.At(0)) + {{- end }} + assert.Panics(t, func() { ms.Append({{ index .testInterfaceOrigVal 0 }}) }) + assert.Panics(t, func() { ms.EnsureCapacity(2) }) + assert.Equal(t, raw, ms.AsRaw()) + assert.Panics(t, func() { ms.FromRaw(raw) }) + + ms2 := New{{ .structName }}() + ms.CopyTo(ms2) + assert.Equal(t, ms.AsRaw(), ms2.AsRaw()) + assert.Panics(t, func() { ms2.CopyTo(ms) }) + + assert.Panics(t, func() { ms.MoveTo(ms2) }) + assert.Panics(t, func() { ms2.MoveTo(ms) }) +} + +func Test{{ .structName }}Append(t *testing.T) { + ms := New{{ .structName }}() + ms.FromRaw([]{{ .itemType }}{ {{ .testOrigVal }} }) + ms.Append({{ .testSetVal }}, {{ .testSetVal }}) + assert.Equal(t, 5, ms.Len()) + {{- if eq .itemType "float64" }} + assert.InDelta(t, {{ .itemType }}({{ .testSetVal }} ), ms.At(4), 0.01) + {{- else }} + assert.Equal(t, {{ .itemType }}({{ .testSetVal }}), ms.At(4)) + {{- end }} +} + +func Test{{ .structName }}EnsureCapacity(t *testing.T) { + ms := New{{ .structName }}() + ms.EnsureCapacity(4) + assert.Equal(t, 4, cap(*ms.getOrig())) + ms.EnsureCapacity(2) + assert.Equal(t, 4, cap(*ms.getOrig())) +} diff --git a/pdata/internal/cmd/pdatagen/internal/templates/slice.go.tmpl b/pdata/internal/cmd/pdatagen/internal/templates/slice.go.tmpl new file mode 100644 index 00000000000..082c6c18cce --- /dev/null +++ b/pdata/internal/cmd/pdatagen/internal/templates/slice.go.tmpl @@ -0,0 +1,163 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// To regenerate this file run "make genpdata". + +package {{ .packageName }} + +import ( +{{ range $index, $element := .imports -}} +{{ $element }} +{{ end }} +) + +// {{ .structName }} logically represents a slice of {{ .elementName }}. +// +// This is a reference type. If passed by value and callee modifies it, the +// caller will see the modification. +// +// Must use New{{ .structName }} function to create new instances. +// Important: zero-initialized instance is not valid for use. +type {{ .structName }} struct { + orig *[]{{ .originElementType }} + state *internal.State +} + +func new{{ .structName }}(orig *[]{{ .originElementType }}, state *internal.State) {{ .structName }} { + return {{ .structName }}{orig: orig, state: state} +} + +// New{{ .structName }} creates a {{ .structName }} with 0 elements. +// Can use "EnsureCapacity" to initialize with a given capacity. +func New{{ .structName }}() {{ .structName }} { + orig := []{{ .originElementType }}(nil) + state := internal.StateMutable + return new{{ .structName }}(&orig, &state) +} + +// Len returns the number of elements in the slice. +// +// Returns "0" for a newly instance created with "New{{ .structName }}()". +func (es {{ .structName }}) Len() int { + return len(*es.orig) +} + +// At returns the element at the given index. +// +// This function is used mostly for iterating over all the values in the slice: +// for i := 0; i < es.Len(); i++ { +// e := es.At(i) +// ... // Do something with the element +// } +func (es {{ .structName }}) At(i int) {{ .elementName }} { + return {{ .newElement }} +} + +// EnsureCapacity is an operation that ensures the slice has at least the specified capacity. +// 1. If the newCap <= cap then no change in capacity. +// 2. If the newCap > cap then the slice capacity will be expanded to equal newCap. +// +// Here is how a new {{ .structName }} can be initialized: +// es := New{{ .structName }}() +// es.EnsureCapacity(4) +// for i := 0; i < 4; i++ { +// e := es.AppendEmpty() +// // Here should set all the values for e. +// } +func (es {{ .structName }}) EnsureCapacity(newCap int) { + es.state.AssertMutable() + oldCap := cap(*es.orig) + if newCap <= oldCap { + return + } + + newOrig := make([]{{ .originElementType }}, len(*es.orig), newCap) + copy(newOrig, *es.orig) + *es.orig = newOrig +} + +// AppendEmpty will append to the end of the slice an empty {{ .elementName }}. +// It returns the newly added {{ .elementName }}. +func (es {{ .structName }}) AppendEmpty() {{ .elementName }} { + es.state.AssertMutable() + *es.orig = append(*es.orig, {{ .emptyOriginElement }}) + return es.At(es.Len() - 1) +} + +// MoveAndAppendTo moves all elements from the current slice and appends them to the dest. +// The current slice will be cleared. +func (es {{ .structName }}) MoveAndAppendTo(dest {{ .structName }}) { + es.state.AssertMutable() + dest.state.AssertMutable() + if *dest.orig == nil { + // We can simply move the entire vector and avoid any allocations. + *dest.orig = *es.orig + } else { + *dest.orig = append(*dest.orig, *es.orig...) + } + *es.orig = nil +} + +// RemoveIf calls f sequentially for each element present in the slice. +// If f returns true, the element is removed from the slice. +func (es {{ .structName }}) RemoveIf(f func({{ .elementName }}) bool) { + es.state.AssertMutable() + newLen := 0 + for i := 0; i < len(*es.orig); i++ { + if f(es.At(i)) { + continue + } + if newLen == i { + // Nothing to move, element is at the right place. + newLen++ + continue + } + (*es.orig)[newLen] = (*es.orig)[i] + newLen++ + } + *es.orig = (*es.orig)[:newLen] +} + + +// CopyTo copies all elements from the current slice overriding the destination. +func (es {{ .structName }}) CopyTo(dest {{ .structName }}) { + dest.state.AssertMutable() + srcLen := es.Len() + destCap := cap(*dest.orig) + if srcLen <= destCap { + (*dest.orig) = (*dest.orig)[:srcLen:destCap] + + {{- if eq .type "sliceOfPtrs" }} + for i := range *es.orig { + new{{ .elementName }}((*es.orig)[i], es.state).CopyTo(new{{ .elementName }}((*dest.orig)[i], dest.state)) + } + return + } + origs := make([]{{ .originName }}, srcLen) + wrappers := make([]*{{ .originName }}, srcLen) + for i := range *es.orig { + wrappers[i] = &origs[i] + new{{ .elementName }}((*es.orig)[i], es.state).CopyTo(new{{ .elementName }}(wrappers[i], dest.state)) + } + *dest.orig = wrappers + + {{- else }} + } else { + (*dest.orig) = make([]{{ .originElementType }}, srcLen) + } + for i := range *es.orig { + {{ .newElement }}.CopyTo(new{{ .elementName }}(&(*dest.orig)[i], dest.state)) + } + {{- end }} +} + +{{ if eq .type "sliceOfPtrs" -}} +// Sort sorts the {{ .elementName }} elements within {{ .structName }} given the +// provided less function so that two instances of {{ .structName }} +// can be compared. +func (es {{ .structName }}) Sort(less func(a, b {{ .elementName }}) bool) { + es.state.AssertMutable() + sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) +} +{{ end }} diff --git a/pdata/internal/cmd/pdatagen/internal/templates/slice_test.go.tmpl b/pdata/internal/cmd/pdatagen/internal/templates/slice_test.go.tmpl new file mode 100644 index 00000000000..8b947a5ac8b --- /dev/null +++ b/pdata/internal/cmd/pdatagen/internal/templates/slice_test.go.tmpl @@ -0,0 +1,152 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// To regenerate this file run "make genpdata". + +package {{ .packageName }} + +import ( +{{ range $index, $element := .testImports -}} +{{ $element }} +{{ end }} +) + +func Test{{ .structName }}(t *testing.T) { + es := New{{ .structName }}() + assert.Equal(t, 0, es.Len()) + state := internal.StateMutable + es = new{{ .structName }}(&[]{{ .originElementType }}{}, &state) + assert.Equal(t, 0, es.Len()) + + emptyVal := New{{ .elementName }}() + testVal := generateTest{{ .elementName }}() + for i := 0; i < 7; i++ { + el := es.AppendEmpty() + assert.Equal(t, emptyVal, es.At(i)) + fillTest{{ .elementName }}(el) + assert.Equal(t, testVal, es.At(i)) + } + assert.Equal(t, 7, es.Len()) +} + +func Test{{ .structName }}ReadOnly(t *testing.T) { + sharedState := internal.StateReadOnly + es := new{{ .structName }}(&[]{{ .originElementType }}{}, &sharedState) + assert.Equal(t, 0, es.Len()) + assert.Panics(t, func() { es.AppendEmpty() }) + assert.Panics(t, func() { es.EnsureCapacity(2) }) + es2 := New{{ .structName }}() + es.CopyTo(es2) + assert.Panics(t, func() { es2.CopyTo(es) }) + assert.Panics(t, func() { es.MoveAndAppendTo(es2) }) + assert.Panics(t, func() { es2.MoveAndAppendTo(es) }) +} + +func Test{{ .structName }}_CopyTo(t *testing.T) { + dest := New{{ .structName }}() + // Test CopyTo to empty + New{{ .structName }}().CopyTo(dest) + assert.Equal(t, New{{ .structName }}(), dest) + + // Test CopyTo larger slice + generateTest{{ .structName }}().CopyTo(dest) + assert.Equal(t, generateTest{{ .structName }}(), dest) + + // Test CopyTo same size slice + generateTest{{ .structName }}().CopyTo(dest) + assert.Equal(t, generateTest{{ .structName }}(), dest) +} + +func Test{{ .structName }}_EnsureCapacity(t *testing.T) { + es := generateTest{{ .structName }}() + + // Test ensure smaller capacity. + const ensureSmallLen = 4 + es.EnsureCapacity(ensureSmallLen) + assert.Less(t, ensureSmallLen, es.Len()) + assert.Equal(t, es.Len(), cap(*es.orig)) + assert.Equal(t, generateTest{{ .structName }}(), es) + + // Test ensure larger capacity + const ensureLargeLen = 9 + es.EnsureCapacity(ensureLargeLen) + assert.Less(t, generateTest{{ .structName }}().Len(), ensureLargeLen) + assert.Equal(t, ensureLargeLen, cap(*es.orig)) + assert.Equal(t, generateTest{{ .structName }}(), es) +} + +func Test{{ .structName }}_MoveAndAppendTo(t *testing.T) { + // Test MoveAndAppendTo to empty + expectedSlice := generateTest{{ .structName }}() + dest := New{{ .structName }}() + src := generateTest{{ .structName }}() + src.MoveAndAppendTo(dest) + assert.Equal(t, generateTest{{ .structName }}(), dest) + assert.Equal(t, 0, src.Len()) + assert.Equal(t, expectedSlice.Len(), dest.Len()) + + // Test MoveAndAppendTo empty slice + src.MoveAndAppendTo(dest) + assert.Equal(t, generateTest{{ .structName }}(), dest) + assert.Equal(t, 0, src.Len()) + assert.Equal(t, expectedSlice.Len(), dest.Len()) + + // Test MoveAndAppendTo not empty slice + generateTest{{ .structName }}().MoveAndAppendTo(dest) + assert.Equal(t, 2*expectedSlice.Len(), dest.Len()) + for i := 0; i < expectedSlice.Len(); i++ { + assert.Equal(t, expectedSlice.At(i), dest.At(i)) + assert.Equal(t, expectedSlice.At(i), dest.At(i+expectedSlice.Len())) + } +} + +func Test{{ .structName }}_RemoveIf(t *testing.T) { + // Test RemoveIf on empty slice + emptySlice := New{{ .structName }}() + emptySlice.RemoveIf(func(el {{ .elementName }}) bool { + t.Fail() + return false + }) + + // Test RemoveIf + filtered := generateTest{{ .structName }}() + pos := 0 + filtered.RemoveIf(func(el {{ .elementName }}) bool { + pos++ + return pos%3 == 0 + }) + assert.Equal(t, 5, filtered.Len()) +} + +{{ if eq .type "sliceOfPtrs" -}} +func Test{{ .structName }}_Sort(t *testing.T) { + es := generateTest{{ .structName }}() + es.Sort(func(a, b {{ .elementName }}) bool { + return uintptr(unsafe.Pointer(a.orig)) < uintptr(unsafe.Pointer(b.orig)) + }) + for i := 1; i < es.Len(); i++ { + assert.Less(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) + } + es.Sort(func(a, b {{ .elementName }}) bool { + return uintptr(unsafe.Pointer(a.orig)) > uintptr(unsafe.Pointer(b.orig)) + }) + for i := 1; i < es.Len(); i++ { + assert.Greater(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) + } +} +{{- end }} + +func generateTest{{ .structName }}() {{ .structName }} { + es := New{{ .structName }}() + fillTest{{ .structName }}(es) + return es +} + +func fillTest{{ .structName }}(es {{ .structName }}) { + *es.orig = make([]{{ .originElementType }}, 7) + for i := 0; i < 7; i++ { + (*es.orig)[i] = {{ .emptyOriginElement }} + fillTest{{ .elementName }}({{ .newElement }}) + } +} diff --git a/pdata/pcommon/timestamp.go b/pdata/pcommon/timestamp.go index 5fd1758b1be..666f86f43f6 100644 --- a/pdata/pcommon/timestamp.go +++ b/pdata/pcommon/timestamp.go @@ -13,11 +13,13 @@ type Timestamp uint64 // NewTimestampFromTime constructs a new Timestamp from the provided time.Time. func NewTimestampFromTime(t time.Time) Timestamp { + // nolint:gosec return Timestamp(uint64(t.UnixNano())) } // AsTime converts this to a time.Time. func (ts Timestamp) AsTime() time.Time { + // nolint:gosec return time.Unix(0, int64(ts)).UTC() } diff --git a/pdata/pcommon/timestamp_test.go b/pdata/pcommon/timestamp_test.go index 35986663d10..edd94596ec6 100644 --- a/pdata/pcommon/timestamp_test.go +++ b/pdata/pcommon/timestamp_test.go @@ -12,6 +12,7 @@ import ( func TestUnixNanosConverters(t *testing.T) { t1 := time.Date(2020, 03, 24, 1, 13, 23, 789, time.UTC) + // nolint:gosec tun := Timestamp(t1.UnixNano()) assert.EqualValues(t, uint64(1585012403000000789), tun) diff --git a/pdata/pcommon/value.go b/pdata/pcommon/value.go index 77a84e51758..286b9c928e3 100644 --- a/pdata/pcommon/value.go +++ b/pdata/pcommon/value.go @@ -148,6 +148,7 @@ func (v Value) FromRaw(iv any) error { case int64: v.SetInt(tv) case uint: + // nolint:gosec v.SetInt(int64(tv)) case uint8: v.SetInt(int64(tv)) @@ -156,6 +157,7 @@ func (v Value) FromRaw(iv any) error { case uint32: v.SetInt(int64(tv)) case uint64: + // nolint:gosec v.SetInt(int64(tv)) case float32: v.SetDouble(float64(tv)) diff --git a/component/componentprofiles/Makefile b/pipeline/pipelineprofiles/Makefile similarity index 100% rename from component/componentprofiles/Makefile rename to pipeline/pipelineprofiles/Makefile diff --git a/component/componentprofiles/config.go b/pipeline/pipelineprofiles/config.go similarity index 68% rename from component/componentprofiles/config.go rename to pipeline/pipelineprofiles/config.go index 39106b9888d..8aa00dd61a1 100644 --- a/component/componentprofiles/config.go +++ b/pipeline/pipelineprofiles/config.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package componentprofiles // import "go.opentelemetry.io/collector/component/componentprofiles" +package pipelineprofiles // import "go.opentelemetry.io/collector/pipeline/pipelineprofiles" import ( "go.opentelemetry.io/collector/internal/globalsignal" diff --git a/component/componentprofiles/go.mod b/pipeline/pipelineprofiles/go.mod similarity index 61% rename from component/componentprofiles/go.mod rename to pipeline/pipelineprofiles/go.mod index 2f7410b0dc8..8170d7826b5 100644 --- a/component/componentprofiles/go.mod +++ b/pipeline/pipelineprofiles/go.mod @@ -1,7 +1,7 @@ -module go.opentelemetry.io/collector/component/componentprofiles +module go.opentelemetry.io/collector/pipeline/pipelineprofiles go 1.22.0 require go.opentelemetry.io/collector/internal/globalsignal v0.111.0 -replace go.opentelemetry.io/collector/internal/globalsignal => ../../internal/globalsignal +replace go.opentelemetry.io/collector/internal/globalsignal => ./../../internal/globalsignal diff --git a/component/componentprofiles/go.sum b/pipeline/pipelineprofiles/go.sum similarity index 100% rename from component/componentprofiles/go.sum rename to pipeline/pipelineprofiles/go.sum diff --git a/processor/batchprocessor/batch_processor_test.go b/processor/batchprocessor/batch_processor_test.go index 8ab9aca8565..3d2e6571406 100644 --- a/processor/batchprocessor/batch_processor_test.go +++ b/processor/batchprocessor/batch_processor_test.go @@ -167,12 +167,19 @@ func TestBatchProcessorSpansDeliveredEnforceBatchSize(t *testing.T) { } func TestBatchProcessorSentBySize(t *testing.T) { + const ( + sendBatchSize = 20 + requestCount = 100 + spansPerRequest = 5 + expectedBatchesNum = requestCount * spansPerRequest / sendBatchSize + expectedBatchingFactor = sendBatchSize / spansPerRequest + ) + tel := setupTestTelemetry() sizer := &ptrace.ProtoMarshaler{} sink := new(consumertest.TracesSink) cfg := createDefaultConfig().(*Config) - sendBatchSize := 20 - cfg.SendBatchSize = uint32(sendBatchSize) + cfg.SendBatchSize = sendBatchSize cfg.Timeout = 500 * time.Millisecond creationSet := tel.NewSettings() creationSet.MetricsLevel = configtelemetry.LevelDetailed @@ -180,9 +187,6 @@ func TestBatchProcessorSentBySize(t *testing.T) { require.NoError(t, err) require.NoError(t, batcher.Start(context.Background(), componenttest.NewNopHost())) - requestCount := 100 - spansPerRequest := 5 - start := time.Now() sizeSum := 0 for requestNum := 0; requestNum < requestCount; requestNum++ { @@ -196,9 +200,6 @@ func TestBatchProcessorSentBySize(t *testing.T) { elapsed := time.Since(start) require.LessOrEqual(t, elapsed.Nanoseconds(), cfg.Timeout.Nanoseconds()) - expectedBatchesNum := requestCount * spansPerRequest / sendBatchSize - expectedBatchingFactor := sendBatchSize / spansPerRequest - require.Equal(t, requestCount*spansPerRequest, sink.SpanCount()) receivedTraces := sink.AllTraces() require.Len(t, receivedTraces, expectedBatchesNum) @@ -286,12 +287,18 @@ func TestBatchProcessorSentBySize(t *testing.T) { } func TestBatchProcessorSentBySizeWithMaxSize(t *testing.T) { + const ( + sendBatchSize = 20 + sendBatchMaxSize = 37 + requestCount = 1 + spansPerRequest = 500 + totalSpans = requestCount * spansPerRequest + ) + tel := setupTestTelemetry() sizer := &ptrace.ProtoMarshaler{} sink := new(consumertest.TracesSink) cfg := createDefaultConfig().(*Config) - sendBatchSize := 20 - sendBatchMaxSize := 37 cfg.SendBatchSize = uint32(sendBatchSize) cfg.SendBatchMaxSize = uint32(sendBatchMaxSize) cfg.Timeout = 500 * time.Millisecond @@ -301,10 +308,6 @@ func TestBatchProcessorSentBySizeWithMaxSize(t *testing.T) { require.NoError(t, err) require.NoError(t, batcher.Start(context.Background(), componenttest.NewNopHost())) - requestCount := 1 - spansPerRequest := 500 - totalSpans := requestCount * spansPerRequest - start := time.Now() sizeSum := 0 @@ -319,11 +322,11 @@ func TestBatchProcessorSentBySizeWithMaxSize(t *testing.T) { require.LessOrEqual(t, elapsed.Nanoseconds(), cfg.Timeout.Nanoseconds()) // The max batch size is not a divisor of the total number of spans - expectedBatchesNum := int(math.Ceil(float64(totalSpans) / float64(sendBatchMaxSize))) + expectedBatchesNum := math.Ceil(float64(totalSpans) / float64(sendBatchMaxSize)) require.Equal(t, totalSpans, sink.SpanCount()) receivedTraces := sink.AllTraces() - require.Len(t, receivedTraces, expectedBatchesNum) + require.Len(t, receivedTraces, int(expectedBatchesNum)) // we have to count the size after it was processed since splitTraces will cause some // repeated ResourceSpan data to be sent through the processor var min, max int @@ -563,10 +566,12 @@ func TestBatchMetricProcessorBatchSize(t *testing.T) { SendBatchSize: 50, } - requestCount := 100 - metricsPerRequest := 5 - dataPointsPerMetric := 2 // Since the int counter uses two datapoints. - dataPointsPerRequest := metricsPerRequest * dataPointsPerMetric + const ( + requestCount = 100 + metricsPerRequest = 5 + dataPointsPerMetric = 2 // Since the int counter uses two datapoints. + dataPointsPerRequest = metricsPerRequest * dataPointsPerMetric + ) sink := new(consumertest.MetricsSink) creationSet := tel.NewSettings() @@ -587,12 +592,12 @@ func TestBatchMetricProcessorBatchSize(t *testing.T) { elapsed := time.Since(start) require.LessOrEqual(t, elapsed.Nanoseconds(), cfg.Timeout.Nanoseconds()) - expectedBatchesNum := requestCount * dataPointsPerRequest / int(cfg.SendBatchSize) + expectedBatchesNum := requestCount * dataPointsPerRequest / cfg.SendBatchSize expectedBatchingFactor := int(cfg.SendBatchSize) / dataPointsPerRequest require.Equal(t, requestCount*2*metricsPerRequest, sink.DataPointCount()) receivedMds := sink.AllMetrics() - require.Len(t, receivedMds, expectedBatchesNum) + require.Len(t, receivedMds, int(expectedBatchesNum)) for _, md := range receivedMds { require.Equal(t, expectedBatchingFactor, md.ResourceMetrics().Len()) for i := 0; i < expectedBatchingFactor; i++ { @@ -616,8 +621,8 @@ func TestBatchMetricProcessorBatchSize(t *testing.T) { 1000_000, 2000_000, 3000_000, 4000_000, 5000_000, 6000_000, 7000_000, 8000_000, 9000_000}, BucketCounts: []uint64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, uint64(expectedBatchesNum), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, Sum: int64(size), - Min: metricdata.NewExtrema(int64(size / expectedBatchesNum)), - Max: metricdata.NewExtrema(int64(size / expectedBatchesNum)), + Min: metricdata.NewExtrema(int64(size / int(expectedBatchesNum))), + Max: metricdata.NewExtrema(int64(size / int(expectedBatchesNum))), }, }, }, @@ -946,8 +951,10 @@ func TestBatchLogProcessor_BatchSize(t *testing.T) { SendBatchSize: 50, } - requestCount := 100 - logsPerRequest := 5 + const ( + requestCount = 100 + logsPerRequest = 5 + ) sink := new(consumertest.LogsSink) creationSet := tel.NewSettings() @@ -968,12 +975,12 @@ func TestBatchLogProcessor_BatchSize(t *testing.T) { elapsed := time.Since(start) require.LessOrEqual(t, elapsed.Nanoseconds(), cfg.Timeout.Nanoseconds()) - expectedBatchesNum := requestCount * logsPerRequest / int(cfg.SendBatchSize) + expectedBatchesNum := requestCount * logsPerRequest / cfg.SendBatchSize expectedBatchingFactor := int(cfg.SendBatchSize) / logsPerRequest require.Equal(t, requestCount*logsPerRequest, sink.LogRecordCount()) receivedMds := sink.AllLogs() - require.Len(t, receivedMds, expectedBatchesNum) + require.Len(t, receivedMds, int(expectedBatchesNum)) for _, ld := range receivedMds { require.Equal(t, expectedBatchingFactor, ld.ResourceLogs().Len()) for i := 0; i < expectedBatchingFactor; i++ { @@ -997,8 +1004,8 @@ func TestBatchLogProcessor_BatchSize(t *testing.T) { 1000_000, 2000_000, 3000_000, 4000_000, 5000_000, 6000_000, 7000_000, 8000_000, 9000_000}, BucketCounts: []uint64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, uint64(expectedBatchesNum), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, Sum: int64(size), - Min: metricdata.NewExtrema(int64(size / expectedBatchesNum)), - Max: metricdata.NewExtrema(int64(size / expectedBatchesNum)), + Min: metricdata.NewExtrema(int64(size / int(expectedBatchesNum))), + Max: metricdata.NewExtrema(int64(size / int(expectedBatchesNum))), }, }, }, diff --git a/processor/batchprocessor/go.mod b/processor/batchprocessor/go.mod index 70ffed20315..82c50d82558 100644 --- a/processor/batchprocessor/go.mod +++ b/processor/batchprocessor/go.mod @@ -13,10 +13,10 @@ require ( go.opentelemetry.io/collector/pdata v1.17.0 go.opentelemetry.io/collector/pdata/testdata v0.111.0 go.opentelemetry.io/collector/processor v0.111.0 - go.opentelemetry.io/otel v1.30.0 - go.opentelemetry.io/otel/metric v1.30.0 - go.opentelemetry.io/otel/sdk/metric v1.30.0 - go.opentelemetry.io/otel/trace v1.30.0 + go.opentelemetry.io/otel v1.31.0 + go.opentelemetry.io/otel/metric v1.31.0 + go.opentelemetry.io/otel/sdk/metric v1.31.0 + go.opentelemetry.io/otel/trace v1.31.0 go.uber.org/goleak v1.3.0 go.uber.org/zap v1.27.0 ) @@ -25,7 +25,7 @@ require ( 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/go-viper/mapstructure/v2 v2.1.0 // indirect + github.com/go-viper/mapstructure/v2 v2.2.1 // indirect 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 @@ -43,10 +43,10 @@ require ( go.opentelemetry.io/collector/pdata/pprofile v0.111.0 // indirect go.opentelemetry.io/collector/pipeline v0.111.0 // indirect go.opentelemetry.io/collector/processor/processorprofiles v0.111.0 // indirect - go.opentelemetry.io/otel/sdk v1.30.0 // indirect + go.opentelemetry.io/otel/sdk v1.31.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.25.0 // indirect + golang.org/x/sys v0.26.0 // indirect golang.org/x/text v0.17.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd // indirect google.golang.org/grpc v1.67.1 // indirect diff --git a/processor/batchprocessor/go.sum b/processor/batchprocessor/go.sum index 48ac1381c0b..c3877e6fcd1 100644 --- a/processor/batchprocessor/go.sum +++ b/processor/batchprocessor/go.sum @@ -6,8 +6,8 @@ github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-viper/mapstructure/v2 v2.1.0 h1:gHnMa2Y/pIxElCH2GlZZ1lZSsn6XMtufpGyP1XxdC/w= -github.com/go-viper/mapstructure/v2 v2.1.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= @@ -48,16 +48,16 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 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/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= -go.opentelemetry.io/otel/sdk v1.30.0/go.mod h1:p14X4Ok8S+sygzblytT1nqG98QG2KYKv++HE0LY/mhg= -go.opentelemetry.io/otel/sdk/metric v1.30.0 h1:QJLT8Pe11jyHBHfSAgYH7kEmT24eX792jZO1bo4BXkM= -go.opentelemetry.io/otel/sdk/metric v1.30.0/go.mod h1:waS6P3YqFNzeP01kuo/MBBYqaoBJl7efRQHOaydhy1Y= -go.opentelemetry.io/otel/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc= -go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o= +go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= +go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= +go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= +go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= +go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= +go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= +go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc= +go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8= +go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= +go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= @@ -81,8 +81,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= -golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= diff --git a/processor/go.mod b/processor/go.mod index d984ba0d0b0..4e8e3152b40 100644 --- a/processor/go.mod +++ b/processor/go.mod @@ -16,10 +16,10 @@ require ( go.opentelemetry.io/collector/pdata/testdata v0.111.0 go.opentelemetry.io/collector/pipeline v0.111.0 go.opentelemetry.io/collector/processor/processorprofiles v0.111.0 - go.opentelemetry.io/otel v1.30.0 - go.opentelemetry.io/otel/metric v1.30.0 - go.opentelemetry.io/otel/sdk/metric v1.30.0 - go.opentelemetry.io/otel/trace v1.30.0 + go.opentelemetry.io/otel v1.31.0 + go.opentelemetry.io/otel/metric v1.31.0 + go.opentelemetry.io/otel/sdk/metric v1.31.0 + go.opentelemetry.io/otel/trace v1.31.0 go.uber.org/goleak v1.3.0 ) @@ -33,11 +33,11 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect go.opentelemetry.io/collector/internal/globalsignal v0.111.0 // indirect - go.opentelemetry.io/otel/sdk v1.30.0 // indirect + go.opentelemetry.io/otel/sdk v1.31.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.25.0 // indirect + golang.org/x/sys v0.26.0 // indirect golang.org/x/text v0.17.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd // indirect google.golang.org/grpc v1.67.1 // indirect diff --git a/processor/go.sum b/processor/go.sum index 6b6c9df2321..ac86a8a0265 100644 --- a/processor/go.sum +++ b/processor/go.sum @@ -36,16 +36,16 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 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/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= -go.opentelemetry.io/otel/sdk v1.30.0/go.mod h1:p14X4Ok8S+sygzblytT1nqG98QG2KYKv++HE0LY/mhg= -go.opentelemetry.io/otel/sdk/metric v1.30.0 h1:QJLT8Pe11jyHBHfSAgYH7kEmT24eX792jZO1bo4BXkM= -go.opentelemetry.io/otel/sdk/metric v1.30.0/go.mod h1:waS6P3YqFNzeP01kuo/MBBYqaoBJl7efRQHOaydhy1Y= -go.opentelemetry.io/otel/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc= -go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o= +go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= +go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= +go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= +go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= +go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= +go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= +go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc= +go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8= +go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= +go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= @@ -69,8 +69,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= -golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= diff --git a/processor/memorylimiterprocessor/go.mod b/processor/memorylimiterprocessor/go.mod index 4f44f842fb7..3f7afc8d42f 100644 --- a/processor/memorylimiterprocessor/go.mod +++ b/processor/memorylimiterprocessor/go.mod @@ -13,10 +13,10 @@ require ( go.opentelemetry.io/collector/pdata v1.17.0 go.opentelemetry.io/collector/pipeline v0.111.0 go.opentelemetry.io/collector/processor v0.111.0 - go.opentelemetry.io/otel v1.30.0 - go.opentelemetry.io/otel/metric v1.30.0 - go.opentelemetry.io/otel/sdk/metric v1.30.0 - go.opentelemetry.io/otel/trace v1.30.0 + go.opentelemetry.io/otel v1.31.0 + go.opentelemetry.io/otel/metric v1.31.0 + go.opentelemetry.io/otel/sdk/metric v1.31.0 + go.opentelemetry.io/otel/trace v1.31.0 go.uber.org/goleak v1.3.0 ) @@ -26,7 +26,7 @@ require ( github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.2.6 // indirect - github.com/go-viper/mapstructure/v2 v2.1.0 // indirect + github.com/go-viper/mapstructure/v2 v2.2.1 // indirect 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 @@ -50,11 +50,11 @@ require ( go.opentelemetry.io/collector/pdata/pprofile v0.111.0 // indirect go.opentelemetry.io/collector/pdata/testdata v0.111.0 // indirect go.opentelemetry.io/collector/processor/processorprofiles v0.111.0 // indirect - go.opentelemetry.io/otel/sdk v1.30.0 // indirect + go.opentelemetry.io/otel/sdk v1.31.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.25.0 // indirect + golang.org/x/sys v0.26.0 // indirect golang.org/x/text v0.17.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd // indirect google.golang.org/grpc v1.67.1 // indirect diff --git a/processor/memorylimiterprocessor/go.sum b/processor/memorylimiterprocessor/go.sum index 4eb1b14d73d..71f785dea4e 100644 --- a/processor/memorylimiterprocessor/go.sum +++ b/processor/memorylimiterprocessor/go.sum @@ -10,8 +10,8 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= -github.com/go-viper/mapstructure/v2 v2.1.0 h1:gHnMa2Y/pIxElCH2GlZZ1lZSsn6XMtufpGyP1XxdC/w= -github.com/go-viper/mapstructure/v2 v2.1.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -65,16 +65,16 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= 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/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= -go.opentelemetry.io/otel/sdk v1.30.0/go.mod h1:p14X4Ok8S+sygzblytT1nqG98QG2KYKv++HE0LY/mhg= -go.opentelemetry.io/otel/sdk/metric v1.30.0 h1:QJLT8Pe11jyHBHfSAgYH7kEmT24eX792jZO1bo4BXkM= -go.opentelemetry.io/otel/sdk/metric v1.30.0/go.mod h1:waS6P3YqFNzeP01kuo/MBBYqaoBJl7efRQHOaydhy1Y= -go.opentelemetry.io/otel/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc= -go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o= +go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= +go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= +go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= +go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= +go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= +go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= +go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc= +go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8= +go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= +go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= @@ -102,8 +102,8 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= -golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= diff --git a/processor/memorylimiterprocessor/memorylimiter_test.go b/processor/memorylimiterprocessor/memorylimiter_test.go index b01703b12e5..73fcfdd4d9d 100644 --- a/processor/memorylimiterprocessor/memorylimiter_test.go +++ b/processor/memorylimiterprocessor/memorylimiter_test.go @@ -15,8 +15,8 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/consumer/consumertest" - "go.opentelemetry.io/collector/internal/iruntime" "go.opentelemetry.io/collector/internal/memorylimiter" + "go.opentelemetry.io/collector/internal/memorylimiter/iruntime" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" "go.opentelemetry.io/collector/pdata/ptrace" @@ -48,6 +48,7 @@ func TestNoDataLoss(t *testing.T) { runtime.ReadMemStats(&ms) // Set the limit to current usage plus expected increase. This means initially we will not be limited. + // nolint:gosec cfg.MemoryLimitMiB = uint32(ms.Alloc/(1024*1024) + expectedMemoryIncreaseMiB) cfg.MemorySpikeLimitMiB = 1 diff --git a/processor/processorprofiles/go.mod b/processor/processorprofiles/go.mod index ab83ff5267e..639304261c9 100644 --- a/processor/processorprofiles/go.mod +++ b/processor/processorprofiles/go.mod @@ -23,13 +23,13 @@ require ( go.opentelemetry.io/collector/internal/globalsignal v0.111.0 // indirect go.opentelemetry.io/collector/pdata v1.17.0 // indirect go.opentelemetry.io/collector/pdata/pprofile v0.111.0 // indirect - go.opentelemetry.io/otel v1.30.0 // indirect - go.opentelemetry.io/otel/metric v1.30.0 // indirect - go.opentelemetry.io/otel/trace v1.30.0 // indirect + go.opentelemetry.io/otel v1.31.0 // indirect + go.opentelemetry.io/otel/metric v1.31.0 // indirect + go.opentelemetry.io/otel/trace v1.31.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.25.0 // indirect + golang.org/x/sys v0.26.0 // indirect golang.org/x/text v0.17.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd // indirect google.golang.org/grpc v1.67.1 // indirect diff --git a/processor/processorprofiles/go.sum b/processor/processorprofiles/go.sum index 93d2a7991b6..a151885f5c4 100644 --- a/processor/processorprofiles/go.sum +++ b/processor/processorprofiles/go.sum @@ -33,12 +33,12 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 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/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/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc= -go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o= +go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= +go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= +go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= +go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= +go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= +go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= @@ -62,8 +62,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= -golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= diff --git a/receiver/go.mod b/receiver/go.mod index 75b383d2cdd..f22d1ce0003 100644 --- a/receiver/go.mod +++ b/receiver/go.mod @@ -13,11 +13,11 @@ require ( go.opentelemetry.io/collector/pdata v1.17.0 go.opentelemetry.io/collector/pipeline v0.111.0 go.opentelemetry.io/collector/receiver/receiverprofiles v0.111.0 - go.opentelemetry.io/otel v1.30.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 - go.opentelemetry.io/otel/trace v1.30.0 + go.opentelemetry.io/otel v1.31.0 + go.opentelemetry.io/otel/metric v1.31.0 + go.opentelemetry.io/otel/sdk v1.31.0 + go.opentelemetry.io/otel/sdk/metric v1.31.0 + go.opentelemetry.io/otel/trace v1.31.0 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.27.0 @@ -35,7 +35,7 @@ require ( go.opentelemetry.io/collector/internal/globalsignal v0.111.0 // indirect go.opentelemetry.io/collector/pdata/pprofile v0.111.0 // indirect golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.25.0 // indirect + golang.org/x/sys v0.26.0 // indirect golang.org/x/text v0.17.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd // indirect google.golang.org/grpc v1.67.1 // indirect diff --git a/receiver/go.sum b/receiver/go.sum index 6b6c9df2321..ac86a8a0265 100644 --- a/receiver/go.sum +++ b/receiver/go.sum @@ -36,16 +36,16 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 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/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= -go.opentelemetry.io/otel/sdk v1.30.0/go.mod h1:p14X4Ok8S+sygzblytT1nqG98QG2KYKv++HE0LY/mhg= -go.opentelemetry.io/otel/sdk/metric v1.30.0 h1:QJLT8Pe11jyHBHfSAgYH7kEmT24eX792jZO1bo4BXkM= -go.opentelemetry.io/otel/sdk/metric v1.30.0/go.mod h1:waS6P3YqFNzeP01kuo/MBBYqaoBJl7efRQHOaydhy1Y= -go.opentelemetry.io/otel/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc= -go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o= +go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= +go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= +go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= +go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= +go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= +go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= +go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc= +go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8= +go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= +go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= @@ -69,8 +69,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= -golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= diff --git a/receiver/nopreceiver/go.mod b/receiver/nopreceiver/go.mod index 94b52680290..35005191258 100644 --- a/receiver/nopreceiver/go.mod +++ b/receiver/nopreceiver/go.mod @@ -16,7 +16,7 @@ require ( 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/go-viper/mapstructure/v2 v2.1.0 // indirect + github.com/go-viper/mapstructure/v2 v2.2.1 // indirect 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 @@ -35,15 +35,15 @@ require ( go.opentelemetry.io/collector/pdata/pprofile v0.111.0 // indirect go.opentelemetry.io/collector/pipeline v0.111.0 // indirect go.opentelemetry.io/collector/receiver/receiverprofiles v0.111.0 // indirect - go.opentelemetry.io/otel v1.30.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 - go.opentelemetry.io/otel/trace v1.30.0 // indirect + go.opentelemetry.io/otel v1.31.0 // indirect + go.opentelemetry.io/otel/metric v1.31.0 // indirect + go.opentelemetry.io/otel/sdk v1.31.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.31.0 // indirect + go.opentelemetry.io/otel/trace v1.31.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.25.0 // indirect + golang.org/x/sys v0.26.0 // indirect golang.org/x/text v0.17.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd // indirect google.golang.org/grpc v1.67.1 // indirect diff --git a/receiver/nopreceiver/go.sum b/receiver/nopreceiver/go.sum index 48ac1381c0b..c3877e6fcd1 100644 --- a/receiver/nopreceiver/go.sum +++ b/receiver/nopreceiver/go.sum @@ -6,8 +6,8 @@ github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-viper/mapstructure/v2 v2.1.0 h1:gHnMa2Y/pIxElCH2GlZZ1lZSsn6XMtufpGyP1XxdC/w= -github.com/go-viper/mapstructure/v2 v2.1.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= @@ -48,16 +48,16 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 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/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= -go.opentelemetry.io/otel/sdk v1.30.0/go.mod h1:p14X4Ok8S+sygzblytT1nqG98QG2KYKv++HE0LY/mhg= -go.opentelemetry.io/otel/sdk/metric v1.30.0 h1:QJLT8Pe11jyHBHfSAgYH7kEmT24eX792jZO1bo4BXkM= -go.opentelemetry.io/otel/sdk/metric v1.30.0/go.mod h1:waS6P3YqFNzeP01kuo/MBBYqaoBJl7efRQHOaydhy1Y= -go.opentelemetry.io/otel/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc= -go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o= +go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= +go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= +go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= +go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= +go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= +go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= +go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc= +go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8= +go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= +go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= @@ -81,8 +81,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= -golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= diff --git a/receiver/otlpreceiver/go.mod b/receiver/otlpreceiver/go.mod index de83743ebcc..c666b2da0af 100644 --- a/receiver/otlpreceiver/go.mod +++ b/receiver/otlpreceiver/go.mod @@ -4,7 +4,7 @@ go 1.22.0 require ( github.com/gogo/protobuf v1.3.2 - github.com/klauspost/compress v1.17.10 + github.com/klauspost/compress v1.17.11 github.com/stretchr/testify v1.9.0 go.opentelemetry.io/collector v0.111.0 go.opentelemetry.io/collector/component v0.111.0 @@ -36,7 +36,7 @@ require ( github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/go-viper/mapstructure/v2 v2.1.0 // indirect + github.com/go-viper/mapstructure/v2 v2.2.1 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/uuid v1.6.0 // indirect github.com/json-iterator/go v1.1.12 // indirect @@ -62,11 +62,11 @@ require ( go.opentelemetry.io/collector/pipeline v0.111.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.55.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.55.0 // indirect - go.opentelemetry.io/otel v1.30.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 - go.opentelemetry.io/otel/trace v1.30.0 // indirect + go.opentelemetry.io/otel v1.31.0 // indirect + go.opentelemetry.io/otel/metric v1.31.0 // indirect + go.opentelemetry.io/otel/sdk v1.31.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.31.0 // indirect + go.opentelemetry.io/otel/trace v1.31.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.30.0 // indirect golang.org/x/sys v0.26.0 // indirect diff --git a/receiver/otlpreceiver/go.sum b/receiver/otlpreceiver/go.sum index 257e93e92cd..a962c4aeb77 100644 --- a/receiver/otlpreceiver/go.sum +++ b/receiver/otlpreceiver/go.sum @@ -10,8 +10,8 @@ github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-viper/mapstructure/v2 v2.1.0 h1:gHnMa2Y/pIxElCH2GlZZ1lZSsn6XMtufpGyP1XxdC/w= -github.com/go-viper/mapstructure/v2 v2.1.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= @@ -25,8 +25,8 @@ 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.10 h1:oXAz+Vh0PMUvJczoi+flxpnBEPxoER1IaAnU/NMPtT0= -github.com/klauspost/compress v1.17.10/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= +github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= +github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= 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= @@ -66,16 +66,16 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.5 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.55.0/go.mod h1:LqaApwGx/oUmzsbqxkzuBvyoPpkxk3JQWnqfVrJ3wCA= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.55.0 h1:ZIg3ZT/aQ7AfKqdwp7ECpOK6vHqquXXuyTjIO8ZdmPs= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.55.0/go.mod h1:DQAwmETtZV00skUwgD6+0U89g80NKsJE3DCKeLLPQMI= -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/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= -go.opentelemetry.io/otel/sdk v1.30.0/go.mod h1:p14X4Ok8S+sygzblytT1nqG98QG2KYKv++HE0LY/mhg= -go.opentelemetry.io/otel/sdk/metric v1.30.0 h1:QJLT8Pe11jyHBHfSAgYH7kEmT24eX792jZO1bo4BXkM= -go.opentelemetry.io/otel/sdk/metric v1.30.0/go.mod h1:waS6P3YqFNzeP01kuo/MBBYqaoBJl7efRQHOaydhy1Y= -go.opentelemetry.io/otel/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc= -go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o= +go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= +go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= +go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= +go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= +go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= +go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= +go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc= +go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8= +go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= +go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= diff --git a/receiver/otlpreceiver/otlp_test.go b/receiver/otlpreceiver/otlp_test.go index 1f174319767..23e2115a983 100644 --- a/receiver/otlpreceiver/otlp_test.go +++ b/receiver/otlpreceiver/otlp_test.go @@ -674,6 +674,7 @@ func TestOTLPReceiverHTTPTracesIngestTest(t *testing.T) { errStatus := &spb.Status{} require.NoError(t, proto.Unmarshal(respBytes, errStatus)) assert.Equal(t, ingestionState.expectedStatusCode, resp.StatusCode) + // nolint:gosec assert.Equal(t, ingestionState.expectedCode, codes.Code(errStatus.Code)) } } diff --git a/receiver/receiverprofiles/go.mod b/receiver/receiverprofiles/go.mod index c882e6bf73c..d5d5e94fffc 100644 --- a/receiver/receiverprofiles/go.mod +++ b/receiver/receiverprofiles/go.mod @@ -23,13 +23,13 @@ require ( go.opentelemetry.io/collector/internal/globalsignal v0.111.0 // indirect go.opentelemetry.io/collector/pdata v1.17.0 // indirect go.opentelemetry.io/collector/pdata/pprofile v0.111.0 // indirect - go.opentelemetry.io/otel v1.30.0 // indirect - go.opentelemetry.io/otel/metric v1.30.0 // indirect - go.opentelemetry.io/otel/trace v1.30.0 // indirect + go.opentelemetry.io/otel v1.31.0 // indirect + go.opentelemetry.io/otel/metric v1.31.0 // indirect + go.opentelemetry.io/otel/trace v1.31.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.25.0 // indirect + golang.org/x/sys v0.26.0 // indirect golang.org/x/text v0.17.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd // indirect google.golang.org/grpc v1.67.1 // indirect diff --git a/receiver/receiverprofiles/go.sum b/receiver/receiverprofiles/go.sum index 93d2a7991b6..a151885f5c4 100644 --- a/receiver/receiverprofiles/go.sum +++ b/receiver/receiverprofiles/go.sum @@ -33,12 +33,12 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 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/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/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc= -go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o= +go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= +go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= +go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= +go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= +go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= +go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= @@ -62,8 +62,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= -golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= diff --git a/receiver/scraperhelper/config_test.go b/receiver/scraperhelper/config_test.go index 1da08e78006..c82b95ddfda 100644 --- a/receiver/scraperhelper/config_test.go +++ b/receiver/scraperhelper/config_test.go @@ -37,7 +37,6 @@ func TestScrapeControllerSettings(t *testing.T) { errVal: `"timeout": requires positive value`, }, } { - tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel() diff --git a/service/config_test.go b/service/config_test.go index 36781fb10ed..09567436cfa 100644 --- a/service/config_test.go +++ b/service/config_test.go @@ -44,7 +44,7 @@ func TestConfigValidate(t *testing.T) { name: "duplicate-processor-reference", cfgFn: func() *Config { cfg := generateConfig() - pipe := cfg.Pipelines[pipeline.MustNewID("traces")] + pipe := cfg.Pipelines[pipeline.NewID(pipeline.SignalTraces)] pipe.Processors = append(pipe.Processors, pipe.Processors...) return cfg }, @@ -108,7 +108,7 @@ func generateConfig() *Config { }, Extensions: extensions.Config{component.MustNewID("nop")}, Pipelines: pipelines.Config{ - pipeline.MustNewID("traces"): { + pipeline.NewID(pipeline.SignalTraces): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop")}, diff --git a/service/go.mod b/service/go.mod index b7e897f08bb..62083742a71 100644 --- a/service/go.mod +++ b/service/go.mod @@ -11,7 +11,6 @@ require ( github.com/stretchr/testify v1.9.0 go.opentelemetry.io/collector v0.111.0 go.opentelemetry.io/collector/component v0.111.0 - go.opentelemetry.io/collector/component/componentprofiles v0.111.0 go.opentelemetry.io/collector/component/componentstatus v0.111.0 go.opentelemetry.io/collector/config/confighttp v0.111.0 go.opentelemetry.io/collector/config/configtelemetry v0.111.0 @@ -27,11 +26,11 @@ require ( go.opentelemetry.io/collector/extension/extensioncapabilities v0.111.0 go.opentelemetry.io/collector/extension/zpagesextension v0.111.0 go.opentelemetry.io/collector/featuregate v1.17.0 - go.opentelemetry.io/collector/internal/globalgates v0.111.0 go.opentelemetry.io/collector/pdata v1.17.0 go.opentelemetry.io/collector/pdata/pprofile v0.111.0 go.opentelemetry.io/collector/pdata/testdata v0.111.0 go.opentelemetry.io/collector/pipeline v0.111.0 + go.opentelemetry.io/collector/pipeline/pipelineprofiles v0.111.0 go.opentelemetry.io/collector/processor v0.111.0 go.opentelemetry.io/collector/processor/processorprofiles v0.111.0 go.opentelemetry.io/collector/receiver v0.111.0 @@ -39,15 +38,15 @@ require ( go.opentelemetry.io/collector/semconv v0.111.0 go.opentelemetry.io/contrib/config v0.10.0 go.opentelemetry.io/contrib/propagators/b3 v1.30.0 - go.opentelemetry.io/otel v1.30.0 - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.30.0 - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.30.0 - go.opentelemetry.io/otel/exporters/prometheus v0.52.0 - go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.30.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 - go.opentelemetry.io/otel/trace v1.30.0 + go.opentelemetry.io/otel v1.31.0 + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.31.0 + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.31.0 + go.opentelemetry.io/otel/exporters/prometheus v0.53.0 + go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.31.0 + go.opentelemetry.io/otel/metric v1.31.0 + go.opentelemetry.io/otel/sdk v1.31.0 + go.opentelemetry.io/otel/sdk/metric v1.31.0 + go.opentelemetry.io/otel/trace v1.31.0 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.27.0 @@ -65,13 +64,13 @@ require ( github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.2.6 // indirect - github.com/go-viper/mapstructure/v2 v2.1.0 // indirect + github.com/go-viper/mapstructure/v2 v2.2.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect github.com/hashicorp/go-version v1.7.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.17.10 // indirect + github.com/klauspost/compress v1.17.11 // 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 @@ -111,8 +110,8 @@ require ( golang.org/x/net v0.30.0 // indirect golang.org/x/sys v0.26.0 // indirect golang.org/x/text v0.19.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20241007155032-5fefd90f89a9 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9 // indirect google.golang.org/grpc v1.67.1 // indirect google.golang.org/protobuf v1.35.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect @@ -178,12 +177,8 @@ replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../consumer/c replace go.opentelemetry.io/collector/consumer/consumertest => ../consumer/consumertest -replace go.opentelemetry.io/collector/component/componentprofiles => ../component/componentprofiles - replace go.opentelemetry.io/collector/client => ../client -replace go.opentelemetry.io/collector/internal/globalgates => ../internal/globalgates - replace go.opentelemetry.io/collector/receiver/receiverprofiles => ../receiver/receiverprofiles replace go.opentelemetry.io/collector/processor/processorprofiles => ../processor/processorprofiles @@ -193,3 +188,5 @@ replace go.opentelemetry.io/collector/connector/connectorprofiles => ../connecto replace go.opentelemetry.io/collector/exporter/exporterprofiles => ../exporter/exporterprofiles replace go.opentelemetry.io/collector/internal/globalsignal => ../internal/globalsignal + +replace go.opentelemetry.io/collector/pipeline/pipelineprofiles => ../pipeline/pipelineprofiles diff --git a/service/go.sum b/service/go.sum index 77e920a5dd7..e3b378175f0 100644 --- a/service/go.sum +++ b/service/go.sum @@ -20,8 +20,8 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= -github.com/go-viper/mapstructure/v2 v2.1.0 h1:gHnMa2Y/pIxElCH2GlZZ1lZSsn6XMtufpGyP1XxdC/w= -github.com/go-viper/mapstructure/v2 v2.1.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= @@ -40,8 +40,8 @@ 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.10 h1:oXAz+Vh0PMUvJczoi+flxpnBEPxoER1IaAnU/NMPtT0= -github.com/klauspost/compress v1.17.10/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= +github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= +github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= 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= @@ -81,8 +81,8 @@ github.com/prometheus/common v0.60.0 h1:+V9PAREWNvJMAuJ1x1BaWl9dewMW4YrHZQbx0sJN github.com/prometheus/common v0.60.0/go.mod h1:h0LYf1R1deLSKtD4Vdg8gy4RuOvENW2J/h19V5NADQw= 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/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= +github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/shirou/gopsutil/v4 v4.24.9 h1:KIV+/HaHD5ka5f570RZq+2SaeFsb/pq+fp2DGNWYoOI= @@ -107,40 +107,40 @@ go.opentelemetry.io/contrib/propagators/b3 v1.30.0 h1:vumy4r1KMyaoQRltX7cJ37p3nl go.opentelemetry.io/contrib/propagators/b3 v1.30.0/go.mod h1:fRbvRsaeVZ82LIl3u0rIvusIel2UUf+JcaaIpy5taho= go.opentelemetry.io/contrib/zpages v0.55.0 h1:F+xj261Ulwl79QC+2O+IO1b3NbwppUDwN+7LbDSdQcY= go.opentelemetry.io/contrib/zpages v0.55.0/go.mod h1:dDqDGDfbXSjt/k9orZk4Huulvz1letX1YWTKts5GQpo= -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 v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= +go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.6.0 h1:QSKmLBzbFULSyHzOdO9JsN9lpE4zkrz1byYGmJecdVE= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.6.0/go.mod h1:sTQ/NH8Yrirf0sJ5rWqVu+oT82i4zL9FaF6rWcqnptM= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.30.0 h1:WypxHH02KX2poqqbaadmkMYalGyy/vil4HE4PM4nRJc= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.30.0/go.mod h1:U79SV99vtvGSEBeeHnpgGJfTsnsdkWLpPN/CcHAzBSI= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.30.0 h1:VrMAbeJz4gnVDg2zEzjHG4dEH86j4jO6VYB+NgtGD8s= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.30.0/go.mod h1:qqN/uFdpeitTvm+JDqqnjm517pmQRYxTORbETHq5tOc= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.31.0 h1:FZ6ei8GFW7kyPYdxJaV2rgI6M+4tvZzhYsQ2wgyVC08= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.31.0/go.mod h1:MdEu/mC6j3D+tTEfvI15b5Ci2Fn7NneJ71YMoiS3tpI= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.31.0 h1:ZsXq73BERAiNuuFXYqP4MR5hBrjXfMGSO+Cx7qoOZiM= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.31.0/go.mod h1:hg1zaDMpyZJuUzjFxFsRYBoccE86tM9Uf4IqNMUxvrY= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.30.0 h1:lsInsfvhVIfOI6qHVyysXMNDnjO9Npvl7tlDPJFBVd4= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.30.0/go.mod h1:KQsVNh4OjgjTG0G6EiNi1jVpnaeeKsKMRwbLN+f1+8M= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.30.0 h1:m0yTiGDLUvVYaTFbAvCkVYIYcvwKt3G7OLoN77NUs/8= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.30.0/go.mod h1:wBQbT4UekBfegL2nx0Xk1vBcnzyBPsIVm9hRG4fYcr4= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.30.0 h1:umZgi92IyxfXd/l4kaDhnKgY8rnN/cZcF1LKc6I8OQ8= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.30.0/go.mod h1:4lVs6obhSVRb1EW5FhOuBTyiQhtRtAnnva9vD3yRfq8= -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/exporters/prometheus v0.53.0 h1:QXobPHrwiGLM4ufrY3EOmDPJpo2P90UuFau4CDPJA/I= +go.opentelemetry.io/otel/exporters/prometheus v0.53.0/go.mod h1:WOAXGr3D00CfzmFxtTV1eR0GpoHuPEu+HJT8UWW2SIU= go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.6.0 h1:bZHOb8k/CwwSt0DgvgaoOhBXWNdWqFWaIsGTtg1H3KE= go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.6.0/go.mod h1:XlV163j81kDdIt5b5BXCjdqVfqJFy/LJrHA697SorvQ= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.30.0 h1:IyFlqNsi8VT/nwYlLJfdM0y1gavxGpEvnf6FtVfZ6X4= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.30.0/go.mod h1:bxiX8eUeKoAEQmbq/ecUT8UqZwCjZW52yJrXJUSozsk= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.31.0 h1:HZgBIps9wH0RDrwjrmNa3DVbNRW60HEhdzqZFyAp3fI= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.31.0/go.mod h1:RDRhvt6TDG0eIXmonAx5bd9IcwpqCkziwkOClzWKwAQ= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.30.0 h1:kn1BudCgwtE7PxLqcZkErpD8GKqLZ6BSzeW9QihQJeM= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.30.0/go.mod h1:ljkUDtAMdleoi9tIG1R6dJUpVwDcYjw3J2Q6Q/SuiC0= go.opentelemetry.io/otel/log v0.6.0 h1:nH66tr+dmEgW5y+F9LanGJUBYPrRgP4g2EkmPE3LeK8= go.opentelemetry.io/otel/log v0.6.0/go.mod h1:KdySypjQHhP069JX0z/t26VHwa8vSwzgaKmXtIB3fJM= -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= -go.opentelemetry.io/otel/sdk v1.30.0/go.mod h1:p14X4Ok8S+sygzblytT1nqG98QG2KYKv++HE0LY/mhg= +go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= +go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= +go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= +go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= go.opentelemetry.io/otel/sdk/log v0.6.0 h1:4J8BwXY4EeDE9Mowg+CyhWVBhTSLXVXodiXxS/+PGqI= go.opentelemetry.io/otel/sdk/log v0.6.0/go.mod h1:L1DN8RMAduKkrwRAFDEX3E3TLOq46+XMGSbUfHU/+vE= -go.opentelemetry.io/otel/sdk/metric v1.30.0 h1:QJLT8Pe11jyHBHfSAgYH7kEmT24eX792jZO1bo4BXkM= -go.opentelemetry.io/otel/sdk/metric v1.30.0/go.mod h1:waS6P3YqFNzeP01kuo/MBBYqaoBJl7efRQHOaydhy1Y= -go.opentelemetry.io/otel/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc= -go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o= +go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc= +go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8= +go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= +go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= @@ -188,10 +188,10 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gonum.org/v1/gonum v0.15.1 h1:FNy7N6OUZVUaWG9pTiD+jlhdQ3lMP+/LcTpJ6+a8sQ0= gonum.org/v1/gonum v0.15.1/go.mod h1:eZTZuRFrzu5pcyjN5wJhcIhnUdNijYxX1T2IcrOGY0o= -google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 h1:hjSy6tcFQZ171igDaN5QHOw2n6vx40juYbC/x67CEhc= -google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:qpvKtACPCQhAdu3PyQgV4l3LMXZEtft7y8QcarRsp9I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= +google.golang.org/genproto/googleapis/api v0.0.0-20241007155032-5fefd90f89a9 h1:T6rh4haD3GVYsgEfWExoCZA2o2FmbNyKpTuAxbEFPTg= +google.golang.org/genproto/googleapis/api v0.0.0-20241007155032-5fefd90f89a9/go.mod h1:wp2WsuBYj6j8wUdo3ToZsdxxixbvQNAHqVJrTgi5E5M= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9 h1:QCqS/PdaHTSWGvupk2F/ehwHtGc0/GYkT+3GAcR1CCc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E= google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA= diff --git a/service/internal/builders/connector.go b/service/internal/builders/connector.go index f5c94dc26d9..d93a7345f81 100644 --- a/service/internal/builders/connector.go +++ b/service/internal/builders/connector.go @@ -8,13 +8,13 @@ import ( "fmt" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componentprofiles" "go.opentelemetry.io/collector/connector" "go.opentelemetry.io/collector/connector/connectorprofiles" "go.opentelemetry.io/collector/connector/connectortest" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/consumer/consumerprofiles" "go.opentelemetry.io/collector/pipeline" + "go.opentelemetry.io/collector/pipeline/pipelineprofiles" ) func errDataTypes(id component.ID, from, to pipeline.Signal) error { @@ -106,7 +106,7 @@ func (b *ConnectorBuilder) CreateTracesToProfiles(ctx context.Context, set conne f, ok := connFact.(connectorprofiles.Factory) if !ok { - return nil, errDataTypes(set.ID, pipeline.SignalTraces, componentprofiles.SignalProfiles) + return nil, errDataTypes(set.ID, pipeline.SignalTraces, pipelineprofiles.SignalProfiles) } logStabilityLevel(set.Logger, f.TracesToProfilesStability()) @@ -187,7 +187,7 @@ func (b *ConnectorBuilder) CreateMetricsToProfiles(ctx context.Context, set conn f, ok := connFact.(connectorprofiles.Factory) if !ok { - return nil, errDataTypes(set.ID, pipeline.SignalMetrics, componentprofiles.SignalProfiles) + return nil, errDataTypes(set.ID, pipeline.SignalMetrics, pipelineprofiles.SignalProfiles) } logStabilityLevel(set.Logger, f.MetricsToProfilesStability()) @@ -268,7 +268,7 @@ func (b *ConnectorBuilder) CreateLogsToProfiles(ctx context.Context, set connect f, ok := connFact.(connectorprofiles.Factory) if !ok { - return nil, errDataTypes(set.ID, pipeline.SignalLogs, componentprofiles.SignalProfiles) + return nil, errDataTypes(set.ID, pipeline.SignalLogs, pipelineprofiles.SignalProfiles) } logStabilityLevel(set.Logger, f.LogsToProfilesStability()) @@ -292,7 +292,7 @@ func (b *ConnectorBuilder) CreateProfilesToTraces(ctx context.Context, set conne f, ok := connFact.(connectorprofiles.Factory) if !ok { - return nil, errDataTypes(set.ID, componentprofiles.SignalProfiles, pipeline.SignalTraces) + return nil, errDataTypes(set.ID, pipelineprofiles.SignalProfiles, pipeline.SignalTraces) } logStabilityLevel(set.Logger, f.ProfilesToTracesStability()) @@ -316,7 +316,7 @@ func (b *ConnectorBuilder) CreateProfilesToMetrics(ctx context.Context, set conn f, ok := connFact.(connectorprofiles.Factory) if !ok { - return nil, errDataTypes(set.ID, componentprofiles.SignalProfiles, pipeline.SignalMetrics) + return nil, errDataTypes(set.ID, pipelineprofiles.SignalProfiles, pipeline.SignalMetrics) } logStabilityLevel(set.Logger, f.ProfilesToMetricsStability()) @@ -340,7 +340,7 @@ func (b *ConnectorBuilder) CreateProfilesToLogs(ctx context.Context, set connect f, ok := connFact.(connectorprofiles.Factory) if !ok { - return nil, errDataTypes(set.ID, componentprofiles.SignalProfiles, pipeline.SignalLogs) + return nil, errDataTypes(set.ID, pipelineprofiles.SignalProfiles, pipeline.SignalLogs) } logStabilityLevel(set.Logger, f.ProfilesToLogsStability()) @@ -364,7 +364,7 @@ func (b *ConnectorBuilder) CreateProfilesToProfiles(ctx context.Context, set con f, ok := connFact.(connectorprofiles.Factory) if !ok { - return nil, errDataTypes(set.ID, componentprofiles.SignalProfiles, componentprofiles.SignalProfiles) + return nil, errDataTypes(set.ID, pipelineprofiles.SignalProfiles, pipelineprofiles.SignalProfiles) } logStabilityLevel(set.Logger, f.ProfilesToProfilesStability()) diff --git a/service/internal/builders/connector_test.go b/service/internal/builders/connector_test.go index abd145a14fa..d02f304d930 100644 --- a/service/internal/builders/connector_test.go +++ b/service/internal/builders/connector_test.go @@ -12,7 +12,6 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componentprofiles" "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/connector" "go.opentelemetry.io/collector/connector/connectorprofiles" @@ -21,6 +20,7 @@ import ( "go.opentelemetry.io/collector/consumer/consumerprofiles" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/pipeline" + "go.opentelemetry.io/collector/pipeline/pipelineprofiles" ) func TestConnectorBuilder(t *testing.T) { @@ -146,7 +146,7 @@ func TestConnectorBuilder(t *testing.T) { assert.Equal(t, nopConnectorInstance, t2l) } t2p, err := b.CreateTracesToProfiles(context.Background(), createConnectorSettings(tt.id), tt.nextProfiles) - if expectedErr := tt.err(pipeline.SignalTraces, componentprofiles.SignalProfiles); expectedErr != "" { + if expectedErr := tt.err(pipeline.SignalTraces, pipelineprofiles.SignalProfiles); expectedErr != "" { assert.EqualError(t, err, expectedErr) assert.Nil(t, t2p) } else { @@ -181,7 +181,7 @@ func TestConnectorBuilder(t *testing.T) { assert.Equal(t, nopConnectorInstance, m2l) } m2p, err := b.CreateMetricsToProfiles(context.Background(), createConnectorSettings(tt.id), tt.nextProfiles) - if expectedErr := tt.err(pipeline.SignalMetrics, componentprofiles.SignalProfiles); expectedErr != "" { + if expectedErr := tt.err(pipeline.SignalMetrics, pipelineprofiles.SignalProfiles); expectedErr != "" { assert.EqualError(t, err, expectedErr) assert.Nil(t, m2p) } else { @@ -216,7 +216,7 @@ func TestConnectorBuilder(t *testing.T) { assert.Equal(t, nopConnectorInstance, l2l) } l2p, err := b.CreateLogsToProfiles(context.Background(), createConnectorSettings(tt.id), tt.nextProfiles) - if expectedErr := tt.err(pipeline.SignalLogs, componentprofiles.SignalProfiles); expectedErr != "" { + if expectedErr := tt.err(pipeline.SignalLogs, pipelineprofiles.SignalProfiles); expectedErr != "" { assert.EqualError(t, err, expectedErr) assert.Nil(t, l2p) } else { @@ -225,7 +225,7 @@ func TestConnectorBuilder(t *testing.T) { } p2t, err := b.CreateProfilesToTraces(context.Background(), createConnectorSettings(tt.id), tt.nextTraces) - if expectedErr := tt.err(componentprofiles.SignalProfiles, pipeline.SignalTraces); expectedErr != "" { + if expectedErr := tt.err(pipelineprofiles.SignalProfiles, pipeline.SignalTraces); expectedErr != "" { assert.EqualError(t, err, expectedErr) assert.Nil(t, p2t) } else { @@ -233,7 +233,7 @@ func TestConnectorBuilder(t *testing.T) { assert.Equal(t, nopConnectorInstance, p2t) } p2m, err := b.CreateProfilesToMetrics(context.Background(), createConnectorSettings(tt.id), tt.nextMetrics) - if expectedErr := tt.err(componentprofiles.SignalProfiles, pipeline.SignalMetrics); expectedErr != "" { + if expectedErr := tt.err(pipelineprofiles.SignalProfiles, pipeline.SignalMetrics); expectedErr != "" { assert.EqualError(t, err, expectedErr) assert.Nil(t, p2m) } else { @@ -241,7 +241,7 @@ func TestConnectorBuilder(t *testing.T) { assert.Equal(t, nopConnectorInstance, p2m) } p2l, err := b.CreateProfilesToLogs(context.Background(), createConnectorSettings(tt.id), tt.nextLogs) - if expectedErr := tt.err(componentprofiles.SignalProfiles, pipeline.SignalLogs); expectedErr != "" { + if expectedErr := tt.err(pipelineprofiles.SignalProfiles, pipeline.SignalLogs); expectedErr != "" { assert.EqualError(t, err, expectedErr) assert.Nil(t, p2l) } else { @@ -249,7 +249,7 @@ func TestConnectorBuilder(t *testing.T) { assert.Equal(t, nopConnectorInstance, p2l) } p2p, err := b.CreateProfilesToProfiles(context.Background(), createConnectorSettings(tt.id), tt.nextProfiles) - if expectedErr := tt.err(componentprofiles.SignalProfiles, componentprofiles.SignalProfiles); expectedErr != "" { + if expectedErr := tt.err(pipelineprofiles.SignalProfiles, pipelineprofiles.SignalProfiles); expectedErr != "" { assert.EqualError(t, err, expectedErr) assert.Nil(t, p2p) } else { diff --git a/service/internal/builders/extension.go b/service/internal/builders/extension.go index 9e4eb912dd5..6ac32fe5698 100644 --- a/service/internal/builders/extension.go +++ b/service/internal/builders/extension.go @@ -43,20 +43,20 @@ func (b *ExtensionBuilder) Create(ctx context.Context, set extension.Settings) ( return nil, fmt.Errorf("extension factory not available for: %q", set.ID) } - sl := f.ExtensionStability() + sl := f.Stability() if sl >= component.StabilityLevelAlpha { set.Logger.Debug(sl.LogMessage()) } else { set.Logger.Info(sl.LogMessage()) } - return f.CreateExtension(ctx, set, cfg) + return f.Create(ctx, set, cfg) } func (b *ExtensionBuilder) Factory(componentType component.Type) component.Factory { return b.factories[componentType] } -// NewNopProcessorConfigsAndFactories returns a configuration and factories that allows building a new nop processor. +// NewNopExtensionConfigsAndFactories returns a configuration and factories that allows building a new nop processor. func NewNopExtensionConfigsAndFactories() (map[component.ID]component.Config, map[component.Type]extension.Factory) { nopFactory := extensiontest.NewNopFactory() configs := map[component.ID]component.Config{ diff --git a/service/internal/builders/extension_test.go b/service/internal/builders/extension_test.go index 798b11c33ea..13c19d62aca 100644 --- a/service/internal/builders/extension_test.go +++ b/service/internal/builders/extension_test.go @@ -75,7 +75,7 @@ func TestNewNopExtensionConfigsAndFactories(t *testing.T) { set := extensiontest.NewNopSettings() set.ID = component.NewID(nopType) - ext, err := factory.CreateExtension(context.Background(), set, cfg) + ext, err := factory.Create(context.Background(), set, cfg) require.NoError(t, err) bExt, err := builder.Create(context.Background(), set) require.NoError(t, err) diff --git a/service/internal/graph/connector.go b/service/internal/graph/connector.go index 6b949c3f25d..76e69df77d1 100644 --- a/service/internal/graph/connector.go +++ b/service/internal/graph/connector.go @@ -7,12 +7,12 @@ import ( "context" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componentprofiles" "go.opentelemetry.io/collector/connector" "go.opentelemetry.io/collector/connector/connectorprofiles" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/consumer/consumerprofiles" "go.opentelemetry.io/collector/pipeline" + "go.opentelemetry.io/collector/pipeline/pipelineprofiles" "go.opentelemetry.io/collector/service/internal/builders" "go.opentelemetry.io/collector/service/internal/capabilityconsumer" "go.opentelemetry.io/collector/service/internal/components" @@ -61,7 +61,7 @@ func (n *connectorNode) buildComponent( return n.buildMetrics(ctx, set, builder, nexts) case pipeline.SignalLogs: return n.buildLogs(ctx, set, builder, nexts) - case componentprofiles.SignalProfiles: + case pipelineprofiles.SignalProfiles: return n.buildProfiles(ctx, set, builder, nexts) } return nil @@ -96,7 +96,7 @@ func (n *connectorNode) buildTraces( n.Component, err = builder.CreateMetricsToTraces(ctx, set, next) case pipeline.SignalLogs: n.Component, err = builder.CreateLogsToTraces(ctx, set, next) - case componentprofiles.SignalProfiles: + case pipelineprofiles.SignalProfiles: n.Component, err = builder.CreateProfilesToTraces(ctx, set, next) } return err @@ -131,7 +131,7 @@ func (n *connectorNode) buildMetrics( n.Component, err = builder.CreateTracesToMetrics(ctx, set, next) case pipeline.SignalLogs: n.Component, err = builder.CreateLogsToMetrics(ctx, set, next) - case componentprofiles.SignalProfiles: + case pipelineprofiles.SignalProfiles: n.Component, err = builder.CreateProfilesToMetrics(ctx, set, next) } return err @@ -166,7 +166,7 @@ func (n *connectorNode) buildLogs( n.Component, err = builder.CreateTracesToLogs(ctx, set, next) case pipeline.SignalMetrics: n.Component, err = builder.CreateMetricsToLogs(ctx, set, next) - case componentprofiles.SignalProfiles: + case pipelineprofiles.SignalProfiles: n.Component, err = builder.CreateProfilesToLogs(ctx, set, next) } return err @@ -186,7 +186,7 @@ func (n *connectorNode) buildProfiles( var err error switch n.exprPipelineType { - case componentprofiles.SignalProfiles: + case pipelineprofiles.SignalProfiles: var conn connectorprofiles.Profiles conn, err = builder.CreateProfilesToProfiles(ctx, set, next) if err != nil { diff --git a/service/internal/graph/exporter.go b/service/internal/graph/exporter.go index 04532a81992..948da2f759a 100644 --- a/service/internal/graph/exporter.go +++ b/service/internal/graph/exporter.go @@ -8,9 +8,9 @@ import ( "fmt" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componentprofiles" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/pipeline" + "go.opentelemetry.io/collector/pipeline/pipelineprofiles" "go.opentelemetry.io/collector/service/internal/builders" "go.opentelemetry.io/collector/service/internal/components" ) @@ -56,7 +56,7 @@ func (n *exporterNode) buildComponent( n.Component, err = builder.CreateMetrics(ctx, set) case pipeline.SignalLogs: n.Component, err = builder.CreateLogs(ctx, set) - case componentprofiles.SignalProfiles: + case pipelineprofiles.SignalProfiles: n.Component, err = builder.CreateProfiles(ctx, set) default: return fmt.Errorf("error creating exporter %q for data type %q is not supported", set.ID, n.pipelineType) diff --git a/service/internal/graph/graph.go b/service/internal/graph/graph.go index 3e0c1e5d057..26754e8fc34 100644 --- a/service/internal/graph/graph.go +++ b/service/internal/graph/graph.go @@ -25,7 +25,6 @@ import ( "gonum.org/v1/gonum/graph/topo" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componentprofiles" "go.opentelemetry.io/collector/component/componentstatus" "go.opentelemetry.io/collector/connector" "go.opentelemetry.io/collector/connector/connectorprofiles" @@ -33,6 +32,7 @@ import ( "go.opentelemetry.io/collector/consumer/consumerprofiles" "go.opentelemetry.io/collector/internal/fanoutconsumer" "go.opentelemetry.io/collector/pipeline" + "go.opentelemetry.io/collector/pipeline/pipelineprofiles" "go.opentelemetry.io/collector/service/internal/builders" "go.opentelemetry.io/collector/service/internal/capabilityconsumer" "go.opentelemetry.io/collector/service/internal/status" @@ -318,7 +318,7 @@ func (g *Graph) buildComponents(ctx context.Context, set Settings) error { cc := capabilityconsumer.NewLogs(next.(consumer.Logs), capability) n.baseConsumer = cc n.ConsumeLogsFunc = cc.ConsumeLogs - case componentprofiles.SignalProfiles: + case pipelineprofiles.SignalProfiles: cc := capabilityconsumer.NewProfiles(next.(consumerprofiles.Profiles), capability) n.baseConsumer = cc n.ConsumeProfilesFunc = cc.ConsumeProfiles @@ -344,7 +344,7 @@ func (g *Graph) buildComponents(ctx context.Context, set Settings) error { consumers = append(consumers, next.(consumer.Logs)) } n.baseConsumer = fanoutconsumer.NewLogs(consumers) - case componentprofiles.SignalProfiles: + case pipelineprofiles.SignalProfiles: consumers := make([]consumerprofiles.Profiles, 0, len(nexts)) for _, next := range nexts { consumers = append(consumers, next.(consumerprofiles.Profiles)) @@ -484,7 +484,7 @@ func (g *Graph) GetExporters() map[pipeline.Signal]map[component.ID]component.Co exportersMap[pipeline.SignalTraces] = make(map[component.ID]component.Component) exportersMap[pipeline.SignalMetrics] = make(map[component.ID]component.Component) exportersMap[pipeline.SignalLogs] = make(map[component.ID]component.Component) - exportersMap[componentprofiles.SignalProfiles] = make(map[component.ID]component.Component) + exportersMap[pipelineprofiles.SignalProfiles] = make(map[component.ID]component.Component) for _, pg := range g.pipelines { for _, expNode := range pg.exporters { @@ -547,7 +547,7 @@ func connectorStability(f connector.Factory, expType, recType pipeline.Signal) c return f.TracesToMetricsStability() case pipeline.SignalLogs: return f.TracesToLogsStability() - case componentprofiles.SignalProfiles: + case pipelineprofiles.SignalProfiles: fprof, ok := f.(connectorprofiles.Factory) if !ok { return component.StabilityLevelUndefined @@ -562,7 +562,7 @@ func connectorStability(f connector.Factory, expType, recType pipeline.Signal) c return f.MetricsToMetricsStability() case pipeline.SignalLogs: return f.MetricsToLogsStability() - case componentprofiles.SignalProfiles: + case pipelineprofiles.SignalProfiles: fprof, ok := f.(connectorprofiles.Factory) if !ok { return component.StabilityLevelUndefined @@ -577,14 +577,14 @@ func connectorStability(f connector.Factory, expType, recType pipeline.Signal) c return f.LogsToMetricsStability() case pipeline.SignalLogs: return f.LogsToLogsStability() - case componentprofiles.SignalProfiles: + case pipelineprofiles.SignalProfiles: fprof, ok := f.(connectorprofiles.Factory) if !ok { return component.StabilityLevelUndefined } return fprof.LogsToProfilesStability() } - case componentprofiles.SignalProfiles: + case pipelineprofiles.SignalProfiles: fprof, ok := f.(connectorprofiles.Factory) if !ok { return component.StabilityLevelUndefined @@ -596,7 +596,7 @@ func connectorStability(f connector.Factory, expType, recType pipeline.Signal) c return fprof.ProfilesToMetricsStability() case pipeline.SignalLogs: return fprof.ProfilesToLogsStability() - case componentprofiles.SignalProfiles: + case pipelineprofiles.SignalProfiles: return fprof.ProfilesToProfilesStability() } } diff --git a/service/internal/graph/graph_test.go b/service/internal/graph/graph_test.go index 809825c0d58..50c274f053a 100644 --- a/service/internal/graph/graph_test.go +++ b/service/internal/graph/graph_test.go @@ -13,7 +13,6 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componentprofiles" "go.opentelemetry.io/collector/component/componentstatus" "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/connector" @@ -22,6 +21,7 @@ import ( "go.opentelemetry.io/collector/exporter/exportertest" "go.opentelemetry.io/collector/pdata/testdata" "go.opentelemetry.io/collector/pipeline" + "go.opentelemetry.io/collector/pipeline/pipelineprofiles" "go.opentelemetry.io/collector/processor" "go.opentelemetry.io/collector/processor/processortest" "go.opentelemetry.io/collector/receiver" @@ -42,22 +42,22 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_simple.yaml", pipelineConfigs: pipelines.Config{ - pipeline.MustNewID("traces"): { + pipeline.NewID(pipeline.SignalTraces): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.MustNewID("metrics"): { + pipeline.NewID(pipeline.SignalMetrics): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.MustNewID("logs"): { + pipeline.NewID(pipeline.SignalLogs): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.MustNewID("profiles"): { + pipeline.NewID(pipelineprofiles.SignalProfiles): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -68,22 +68,22 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_simple_mutate.yaml", pipelineConfigs: pipelines.Config{ - pipeline.MustNewID("traces"): { + pipeline.NewID(pipeline.SignalTraces): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.MustNewID("metrics"): { + pipeline.NewID(pipeline.SignalMetrics): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.MustNewID("logs"): { + pipeline.NewID(pipeline.SignalLogs): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.MustNewID("profiles"): { + pipeline.NewID(pipelineprofiles.SignalProfiles): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -94,22 +94,22 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_simple_multi_proc.yaml", pipelineConfigs: pipelines.Config{ - pipeline.MustNewID("traces"): { + pipeline.NewID(pipeline.SignalTraces): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor"), component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.MustNewID("metrics"): { + pipeline.NewID(pipeline.SignalMetrics): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor"), component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.MustNewID("logs"): { + pipeline.NewID(pipeline.SignalLogs): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor"), component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.MustNewID("profiles"): { + pipeline.NewID(pipelineprofiles.SignalProfiles): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor"), component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -120,19 +120,19 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_simple_no_proc.yaml", pipelineConfigs: pipelines.Config{ - pipeline.MustNewID("traces"): { + pipeline.NewID(pipeline.SignalTraces): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.MustNewID("metrics"): { + pipeline.NewID(pipeline.SignalMetrics): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.MustNewID("logs"): { + pipeline.NewID(pipeline.SignalLogs): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.MustNewID("profiles"): { + pipeline.NewID(pipelineprofiles.SignalProfiles): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, @@ -142,22 +142,22 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_multi.yaml", pipelineConfigs: pipelines.Config{ - pipeline.MustNewID("traces"): { + pipeline.NewID(pipeline.SignalTraces): { Receivers: []component.ID{component.MustNewID("examplereceiver"), component.MustNewIDWithName("examplereceiver", "1")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate"), component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter"), component.MustNewIDWithName("exampleexporter", "1")}, }, - pipeline.MustNewID("metrics"): { + pipeline.NewID(pipeline.SignalMetrics): { Receivers: []component.ID{component.MustNewID("examplereceiver"), component.MustNewIDWithName("examplereceiver", "1")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate"), component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter"), component.MustNewIDWithName("exampleexporter", "1")}, }, - pipeline.MustNewID("logs"): { + pipeline.NewID(pipeline.SignalLogs): { Receivers: []component.ID{component.MustNewID("examplereceiver"), component.MustNewIDWithName("examplereceiver", "1")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate"), component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter"), component.MustNewIDWithName("exampleexporter", "1")}, }, - pipeline.MustNewID("profiles"): { + pipeline.NewID(pipelineprofiles.SignalProfiles): { Receivers: []component.ID{component.MustNewID("examplereceiver"), component.MustNewIDWithName("examplereceiver", "1")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate"), component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter"), component.MustNewIDWithName("exampleexporter", "1")}, @@ -168,19 +168,19 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_multi_no_proc.yaml", pipelineConfigs: pipelines.Config{ - pipeline.MustNewID("traces"): { + pipeline.NewID(pipeline.SignalTraces): { Receivers: []component.ID{component.MustNewID("examplereceiver"), component.MustNewIDWithName("examplereceiver", "1")}, Exporters: []component.ID{component.MustNewID("exampleexporter"), component.MustNewIDWithName("exampleexporter", "1")}, }, - pipeline.MustNewID("metrics"): { + pipeline.NewID(pipeline.SignalMetrics): { Receivers: []component.ID{component.MustNewID("examplereceiver"), component.MustNewIDWithName("examplereceiver", "1")}, Exporters: []component.ID{component.MustNewID("exampleexporter"), component.MustNewIDWithName("exampleexporter", "1")}, }, - pipeline.MustNewID("logs"): { + pipeline.NewID(pipeline.SignalLogs): { Receivers: []component.ID{component.MustNewID("examplereceiver"), component.MustNewIDWithName("examplereceiver", "1")}, Exporters: []component.ID{component.MustNewID("exampleexporter"), component.MustNewIDWithName("exampleexporter", "1")}, }, - pipeline.MustNewID("profiles"): { + pipeline.NewID(pipelineprofiles.SignalProfiles): { Receivers: []component.ID{component.MustNewID("examplereceiver"), component.MustNewIDWithName("examplereceiver", "1")}, Exporters: []component.ID{component.MustNewID("exampleexporter"), component.MustNewIDWithName("exampleexporter", "1")}, }, @@ -190,39 +190,39 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "multi_pipeline_receivers_and_exporters.yaml", pipelineConfigs: pipelines.Config{ - pipeline.MustNewID("traces"): { + pipeline.NewID(pipeline.SignalTraces): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.MustNewIDWithName("traces", "1"): { + pipeline.NewIDWithName(pipeline.SignalTraces, "1"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.MustNewID("metrics"): { + pipeline.NewID(pipeline.SignalMetrics): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.MustNewIDWithName("metrics", "1"): { + pipeline.NewIDWithName(pipeline.SignalMetrics, "1"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.MustNewID("logs"): { + pipeline.NewID(pipeline.SignalLogs): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.MustNewIDWithName("logs", "1"): { + pipeline.NewIDWithName(pipeline.SignalLogs, "1"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.MustNewID("profiles"): { + pipeline.NewID(pipelineprofiles.SignalProfiles): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.MustNewIDWithName("profiles", "1"): { + pipeline.NewIDWithName(pipelineprofiles.SignalProfiles, "1"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, @@ -232,12 +232,12 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_simple_traces.yaml", pipelineConfigs: pipelines.Config{ - pipeline.MustNewIDWithName("traces", "in"): { + pipeline.NewIDWithName(pipeline.SignalTraces, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - pipeline.MustNewIDWithName("traces", "out"): { + pipeline.NewIDWithName(pipeline.SignalTraces, "out"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, // mutate propagates upstream to connector Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -248,12 +248,12 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_simple_metrics.yaml", pipelineConfigs: pipelines.Config{ - pipeline.MustNewIDWithName("metrics", "in"): { + pipeline.NewIDWithName(pipeline.SignalMetrics, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - pipeline.MustNewIDWithName("metrics", "out"): { + pipeline.NewIDWithName(pipeline.SignalMetrics, "out"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, // mutate propagates upstream to connector Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -264,12 +264,12 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_simple_logs.yaml", pipelineConfigs: pipelines.Config{ - pipeline.MustNewIDWithName("logs", "in"): { + pipeline.NewIDWithName(pipeline.SignalLogs, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - pipeline.MustNewIDWithName("logs", "out"): { + pipeline.NewIDWithName(pipeline.SignalLogs, "out"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, // mutate propagates upstream to connector Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -280,12 +280,12 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_simple_profiles.yaml", pipelineConfigs: pipelines.Config{ - pipeline.MustNewIDWithName("profiles", "in"): { + pipeline.NewIDWithName(pipelineprofiles.SignalProfiles, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - pipeline.MustNewIDWithName("profiles", "out"): { + pipeline.NewIDWithName(pipelineprofiles.SignalProfiles, "out"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, // mutate propagates upstream to connector Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -296,22 +296,22 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_fork_merge_traces.yaml", pipelineConfigs: pipelines.Config{ - pipeline.MustNewIDWithName("traces", "in"): { + pipeline.NewIDWithName(pipeline.SignalTraces, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - pipeline.MustNewIDWithName("traces", "type0"): { + pipeline.NewIDWithName(pipeline.SignalTraces, "type0"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "merge")}, }, - pipeline.MustNewIDWithName("traces", "type1"): { + pipeline.NewIDWithName(pipeline.SignalTraces, "type1"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, // mutate propagates upstream to connector Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "merge")}, }, - pipeline.MustNewIDWithName("traces", "out"): { + pipeline.NewIDWithName(pipeline.SignalTraces, "out"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "merge")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -322,22 +322,22 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_fork_merge_metrics.yaml", pipelineConfigs: pipelines.Config{ - pipeline.MustNewIDWithName("metrics", "in"): { + pipeline.NewIDWithName(pipeline.SignalMetrics, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - pipeline.MustNewIDWithName("metrics", "type0"): { + pipeline.NewIDWithName(pipeline.SignalMetrics, "type0"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "merge")}, }, - pipeline.MustNewIDWithName("metrics", "type1"): { + pipeline.NewIDWithName(pipeline.SignalMetrics, "type1"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, // mutate propagates upstream to connector Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "merge")}, }, - pipeline.MustNewIDWithName("metrics", "out"): { + pipeline.NewIDWithName(pipeline.SignalMetrics, "out"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "merge")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -348,22 +348,22 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_fork_merge_logs.yaml", pipelineConfigs: pipelines.Config{ - pipeline.MustNewIDWithName("logs", "in"): { + pipeline.NewIDWithName(pipeline.SignalLogs, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - pipeline.MustNewIDWithName("logs", "type0"): { + pipeline.NewIDWithName(pipeline.SignalLogs, "type0"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "merge")}, }, - pipeline.MustNewIDWithName("logs", "type1"): { + pipeline.NewIDWithName(pipeline.SignalLogs, "type1"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, // mutate propagates upstream to connector Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "merge")}, }, - pipeline.MustNewIDWithName("logs", "out"): { + pipeline.NewIDWithName(pipeline.SignalLogs, "out"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "merge")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -374,22 +374,22 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_fork_merge_profiles.yaml", pipelineConfigs: pipelines.Config{ - pipeline.MustNewIDWithName("profiles", "in"): { + pipeline.NewIDWithName(pipelineprofiles.SignalProfiles, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - pipeline.MustNewIDWithName("profiles", "type0"): { + pipeline.NewIDWithName(pipelineprofiles.SignalProfiles, "type0"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "merge")}, }, - pipeline.MustNewIDWithName("profiles", "type1"): { + pipeline.NewIDWithName(pipelineprofiles.SignalProfiles, "type1"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, // mutate propagates upstream to connector Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "merge")}, }, - pipeline.MustNewIDWithName("profiles", "out"): { + pipeline.NewIDWithName(pipelineprofiles.SignalProfiles, "out"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "merge")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -400,22 +400,22 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_translate_from_traces.yaml", pipelineConfigs: pipelines.Config{ - pipeline.MustNewID("traces"): { + pipeline.NewID(pipeline.SignalTraces): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleconnector")}, }, - pipeline.MustNewID("metrics"): { + pipeline.NewID(pipeline.SignalMetrics): { Receivers: []component.ID{component.MustNewID("exampleconnector")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.MustNewID("logs"): { + pipeline.NewID(pipeline.SignalLogs): { Receivers: []component.ID{component.MustNewID("exampleconnector")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.MustNewID("profiles"): { + pipeline.NewID(pipelineprofiles.SignalProfiles): { Receivers: []component.ID{component.MustNewID("exampleconnector")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -426,22 +426,22 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_translate_from_metrics.yaml", pipelineConfigs: pipelines.Config{ - pipeline.MustNewID("metrics"): { + pipeline.NewID(pipeline.SignalMetrics): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleconnector")}, }, - pipeline.MustNewID("traces"): { + pipeline.NewID(pipeline.SignalTraces): { Receivers: []component.ID{component.MustNewID("exampleconnector")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.MustNewID("logs"): { + pipeline.NewID(pipeline.SignalLogs): { Receivers: []component.ID{component.MustNewID("exampleconnector")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.MustNewID("profiles"): { + pipeline.NewID(pipelineprofiles.SignalProfiles): { Receivers: []component.ID{component.MustNewID("exampleconnector")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -452,22 +452,22 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_translate_from_logs.yaml", pipelineConfigs: pipelines.Config{ - pipeline.MustNewID("logs"): { + pipeline.NewID(pipeline.SignalLogs): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleconnector")}, }, - pipeline.MustNewID("traces"): { + pipeline.NewID(pipeline.SignalTraces): { Receivers: []component.ID{component.MustNewID("exampleconnector")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.MustNewID("metrics"): { + pipeline.NewID(pipeline.SignalMetrics): { Receivers: []component.ID{component.MustNewID("exampleconnector")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.MustNewID("profiles"): { + pipeline.NewID(pipelineprofiles.SignalProfiles): { Receivers: []component.ID{component.MustNewID("exampleconnector")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -478,22 +478,22 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_translate_from_profiles.yaml", pipelineConfigs: pipelines.Config{ - pipeline.MustNewID("traces"): { + pipeline.NewID(pipeline.SignalTraces): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleconnector")}, }, - pipeline.MustNewID("metrics"): { + pipeline.NewID(pipeline.SignalMetrics): { Receivers: []component.ID{component.MustNewID("exampleconnector")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.MustNewID("logs"): { + pipeline.NewID(pipeline.SignalLogs): { Receivers: []component.ID{component.MustNewID("exampleconnector")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.MustNewID("profiles"): { + pipeline.NewID(pipelineprofiles.SignalProfiles): { Receivers: []component.ID{component.MustNewID("exampleconnector")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -504,42 +504,42 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_matrix_immutable.yaml", pipelineConfigs: pipelines.Config{ - pipeline.MustNewIDWithName("traces", "in"): { + pipeline.NewIDWithName(pipeline.SignalTraces, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleconnector")}, }, - pipeline.MustNewIDWithName("metrics", "in"): { + pipeline.NewIDWithName(pipeline.SignalMetrics, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleconnector")}, }, - pipeline.MustNewIDWithName("logs", "in"): { + pipeline.NewIDWithName(pipeline.SignalLogs, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleconnector")}, }, - pipeline.MustNewIDWithName("profiles", "in"): { + pipeline.NewIDWithName(pipelineprofiles.SignalProfiles, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleconnector")}, }, - pipeline.MustNewIDWithName("traces", "out"): { + pipeline.NewIDWithName(pipeline.SignalTraces, "out"): { Receivers: []component.ID{component.MustNewID("exampleconnector")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.MustNewIDWithName("metrics", "out"): { + pipeline.NewIDWithName(pipeline.SignalMetrics, "out"): { Receivers: []component.ID{component.MustNewID("exampleconnector")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.MustNewIDWithName("logs", "out"): { + pipeline.NewIDWithName(pipeline.SignalLogs, "out"): { Receivers: []component.ID{component.MustNewID("exampleconnector")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.MustNewIDWithName("profiles", "out"): { + pipeline.NewIDWithName(pipelineprofiles.SignalProfiles, "out"): { Receivers: []component.ID{component.MustNewID("exampleconnector")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -550,42 +550,42 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_matrix_mutable.yaml", pipelineConfigs: pipelines.Config{ - pipeline.MustNewIDWithName("traces", "in"): { + pipeline.NewIDWithName(pipeline.SignalTraces, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - pipeline.MustNewIDWithName("metrics", "in"): { + pipeline.NewIDWithName(pipeline.SignalMetrics, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - pipeline.MustNewIDWithName("logs", "in"): { + pipeline.NewIDWithName(pipeline.SignalLogs, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - pipeline.MustNewIDWithName("profiles", "in"): { + pipeline.NewIDWithName(pipelineprofiles.SignalProfiles, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - pipeline.MustNewIDWithName("traces", "out"): { + pipeline.NewIDWithName(pipeline.SignalTraces, "out"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, // mutate propagates upstream to connector Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.MustNewIDWithName("metrics", "out"): { + pipeline.NewIDWithName(pipeline.SignalMetrics, "out"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, // mutate propagates upstream to connector Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.MustNewIDWithName("logs", "out"): { + pipeline.NewIDWithName(pipeline.SignalLogs, "out"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, // mutate propagates upstream to connector Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.MustNewIDWithName("profiles", "out"): { + pipeline.NewIDWithName(pipelineprofiles.SignalProfiles, "out"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, // mutate propagates upstream to connector Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -596,35 +596,35 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_lanes.yaml", pipelineConfigs: pipelines.Config{ - pipeline.MustNewIDWithName("traces", "in"): { + pipeline.NewIDWithName(pipeline.SignalTraces, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Exporters: []component.ID{component.MustNewID("mockforward")}, }, - pipeline.MustNewIDWithName("traces", "out"): { + pipeline.NewIDWithName(pipeline.SignalTraces, "out"): { Receivers: []component.ID{component.MustNewID("mockforward")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.MustNewIDWithName("metrics", "in"): { + pipeline.NewIDWithName(pipeline.SignalMetrics, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Exporters: []component.ID{component.MustNewID("mockforward")}, }, - pipeline.MustNewIDWithName("metrics", "out"): { + pipeline.NewIDWithName(pipeline.SignalMetrics, "out"): { Receivers: []component.ID{component.MustNewID("mockforward")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.MustNewIDWithName("logs", "in"): { + pipeline.NewIDWithName(pipeline.SignalLogs, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Exporters: []component.ID{component.MustNewID("mockforward")}, }, - pipeline.MustNewIDWithName("logs", "out"): { + pipeline.NewIDWithName(pipeline.SignalLogs, "out"): { Receivers: []component.ID{component.MustNewID("mockforward")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.MustNewIDWithName("profiles", "in"): { + pipeline.NewIDWithName(pipelineprofiles.SignalProfiles, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Exporters: []component.ID{component.MustNewID("mockforward")}, }, - pipeline.MustNewIDWithName("profiles", "out"): { + pipeline.NewIDWithName(pipelineprofiles.SignalProfiles, "out"): { Receivers: []component.ID{component.MustNewID("mockforward")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, @@ -634,22 +634,22 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_mutate_traces.yaml", pipelineConfigs: pipelines.Config{ - pipeline.MustNewIDWithName("traces", "in"): { + pipeline.NewIDWithName(pipeline.SignalTraces, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - pipeline.MustNewIDWithName("traces", "out0"): { + pipeline.NewIDWithName(pipeline.SignalTraces, "out0"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.MustNewIDWithName("traces", "middle"): { + pipeline.NewIDWithName(pipeline.SignalTraces, "middle"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "mutate")}, }, - pipeline.MustNewIDWithName("traces", "out1"): { + pipeline.NewIDWithName(pipeline.SignalTraces, "out1"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -660,22 +660,22 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_mutate_metrics.yaml", pipelineConfigs: pipelines.Config{ - pipeline.MustNewIDWithName("metrics", "in"): { + pipeline.NewIDWithName(pipeline.SignalMetrics, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - pipeline.MustNewIDWithName("metrics", "out0"): { + pipeline.NewIDWithName(pipeline.SignalMetrics, "out0"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.MustNewIDWithName("metrics", "middle"): { + pipeline.NewIDWithName(pipeline.SignalMetrics, "middle"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "mutate")}, }, - pipeline.MustNewIDWithName("metrics", "out1"): { + pipeline.NewIDWithName(pipeline.SignalMetrics, "out1"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -686,22 +686,22 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_mutate_logs.yaml", pipelineConfigs: pipelines.Config{ - pipeline.MustNewIDWithName("logs", "in"): { + pipeline.NewIDWithName(pipeline.SignalLogs, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - pipeline.MustNewIDWithName("logs", "out0"): { + pipeline.NewIDWithName(pipeline.SignalLogs, "out0"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.MustNewIDWithName("logs", "middle"): { + pipeline.NewIDWithName(pipeline.SignalLogs, "middle"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "mutate")}, }, - pipeline.MustNewIDWithName("logs", "out1"): { + pipeline.NewIDWithName(pipeline.SignalLogs, "out1"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -712,22 +712,22 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_mutate_profiles.yaml", pipelineConfigs: pipelines.Config{ - pipeline.MustNewIDWithName("profiles", "in"): { + pipeline.NewIDWithName(pipelineprofiles.SignalProfiles, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - pipeline.MustNewIDWithName("profiles", "out0"): { + pipeline.NewIDWithName(pipelineprofiles.SignalProfiles, "out0"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.MustNewIDWithName("profiles", "middle"): { + pipeline.NewIDWithName(pipelineprofiles.SignalProfiles, "middle"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "mutate")}, }, - pipeline.MustNewIDWithName("profiles", "out1"): { + pipeline.NewIDWithName(pipelineprofiles.SignalProfiles, "out1"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -902,7 +902,7 @@ func TestConnectorPipelinesGraph(t *testing.T) { logsReceiver := c.(*testcomponents.ExampleReceiver) require.NoError(t, logsReceiver.ConsumeLogs(context.Background(), testdata.GenerateLogs(1))) } - for _, c := range allReceivers[componentprofiles.SignalProfiles] { + for _, c := range allReceivers[pipelineprofiles.SignalProfiles] { profilesReceiver := c.(*testcomponents.ExampleReceiver) require.NoError(t, profilesReceiver.ConsumeProfiles(context.Background(), testdata.GenerateProfiles(1))) } @@ -992,7 +992,7 @@ func TestConnectorPipelinesGraph(t *testing.T) { } } } - for _, e := range allExporters[componentprofiles.SignalProfiles] { + for _, e := range allExporters[pipelineprofiles.SignalProfiles] { profilesExporter := e.(*testcomponents.ExampleExporter) assert.Len(t, profilesExporter.Profiles, tt.expectedPerExporter) expectedMutable := testdata.GenerateProfiles(1) @@ -1019,21 +1019,21 @@ func TestConnectorRouter(t *testing.T) { expRightID := component.MustNewIDWithName("exampleexporter", "right") expLeftID := component.MustNewIDWithName("exampleexporter", "left") - tracesInID := pipeline.MustNewIDWithName("traces", "in") - tracesRightID := pipeline.MustNewIDWithName("traces", "right") - tracesLeftID := pipeline.MustNewIDWithName("traces", "left") + tracesInID := pipeline.NewIDWithName(pipeline.SignalTraces, "in") + tracesRightID := pipeline.NewIDWithName(pipeline.SignalTraces, "right") + tracesLeftID := pipeline.NewIDWithName(pipeline.SignalTraces, "left") - metricsInID := pipeline.MustNewIDWithName("metrics", "in") - metricsRightID := pipeline.MustNewIDWithName("metrics", "right") - metricsLeftID := pipeline.MustNewIDWithName("metrics", "left") + metricsInID := pipeline.NewIDWithName(pipeline.SignalMetrics, "in") + metricsRightID := pipeline.NewIDWithName(pipeline.SignalMetrics, "right") + metricsLeftID := pipeline.NewIDWithName(pipeline.SignalMetrics, "left") - logsInID := pipeline.MustNewIDWithName("logs", "in") - logsRightID := pipeline.MustNewIDWithName("logs", "right") - logsLeftID := pipeline.MustNewIDWithName("logs", "left") + logsInID := pipeline.NewIDWithName(pipeline.SignalLogs, "in") + logsRightID := pipeline.NewIDWithName(pipeline.SignalLogs, "right") + logsLeftID := pipeline.NewIDWithName(pipeline.SignalLogs, "left") - profilesInID := pipeline.MustNewIDWithName("profiles", "in") - profilesRightID := pipeline.MustNewIDWithName("profiles", "right") - profilesLeftID := pipeline.MustNewIDWithName("profiles", "left") + profilesInID := pipeline.NewIDWithName(pipelineprofiles.SignalProfiles, "in") + profilesRightID := pipeline.NewIDWithName(pipelineprofiles.SignalProfiles, "right") + profilesLeftID := pipeline.NewIDWithName(pipelineprofiles.SignalProfiles, "left") ctx := context.Background() set := Settings{ @@ -1214,9 +1214,9 @@ func TestConnectorRouter(t *testing.T) { assert.Len(t, logsLeft.Logs, 2) // Get a handle for the profiles receiver and both Exporters - profilesReceiver := allReceivers[componentprofiles.SignalProfiles][rcvrID].(*testcomponents.ExampleReceiver) - profilesRight := allExporters[componentprofiles.SignalProfiles][expRightID].(*testcomponents.ExampleExporter) - profilesLeft := allExporters[componentprofiles.SignalProfiles][expLeftID].(*testcomponents.ExampleExporter) + profilesReceiver := allReceivers[pipelineprofiles.SignalProfiles][rcvrID].(*testcomponents.ExampleReceiver) + profilesRight := allExporters[pipelineprofiles.SignalProfiles][expRightID].(*testcomponents.ExampleExporter) + profilesLeft := allExporters[pipelineprofiles.SignalProfiles][expLeftID].(*testcomponents.ExampleExporter) // Consume 1, validate it went right require.NoError(t, profilesReceiver.ConsumeProfiles(ctx, testdata.GenerateProfiles(1))) @@ -1266,7 +1266,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): badExporterFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewID("logs"): { + pipeline.NewID(pipeline.SignalLogs): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, @@ -1282,7 +1282,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): badExporterFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewID("metrics"): { + pipeline.NewID(pipeline.SignalMetrics): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, @@ -1298,7 +1298,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): badExporterFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewID("traces"): { + pipeline.NewID(pipeline.SignalTraces): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, @@ -1314,7 +1314,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): badExporterFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewID("profiles"): { + pipeline.NewID(pipelineprofiles.SignalProfiles): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, @@ -1333,7 +1333,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewID("logs"): { + pipeline.NewID(pipeline.SignalLogs): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -1353,7 +1353,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewID("metrics"): { + pipeline.NewID(pipeline.SignalMetrics): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -1373,7 +1373,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewID("traces"): { + pipeline.NewID(pipeline.SignalTraces): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -1393,7 +1393,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewID("profiles"): { + pipeline.NewID(pipelineprofiles.SignalProfiles): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -1410,7 +1410,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewID("logs"): { + pipeline.NewID(pipeline.SignalLogs): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1426,7 +1426,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewID("metrics"): { + pipeline.NewID(pipeline.SignalMetrics): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1442,7 +1442,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewID("traces"): { + pipeline.NewID(pipeline.SignalTraces): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1458,7 +1458,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewID("profiles"): { + pipeline.NewID(pipelineprofiles.SignalProfiles): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1477,11 +1477,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewIDWithName("traces", "in"): { + pipeline.NewIDWithName(pipeline.SignalTraces, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, - pipeline.MustNewIDWithName("traces", "out"): { + pipeline.NewIDWithName(pipeline.SignalTraces, "out"): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1500,11 +1500,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewIDWithName("traces", "in"): { + pipeline.NewIDWithName(pipeline.SignalTraces, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, - pipeline.MustNewIDWithName("metrics", "out"): { + pipeline.NewIDWithName(pipeline.SignalMetrics, "out"): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1523,11 +1523,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewIDWithName("traces", "in"): { + pipeline.NewIDWithName(pipeline.SignalTraces, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, - pipeline.MustNewIDWithName("logs", "out"): { + pipeline.NewIDWithName(pipeline.SignalLogs, "out"): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1546,11 +1546,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewIDWithName("traces", "in"): { + pipeline.NewIDWithName(pipeline.SignalTraces, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, - pipeline.MustNewIDWithName("profiles", "out"): { + pipeline.NewIDWithName(pipelineprofiles.SignalProfiles, "out"): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1569,11 +1569,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewIDWithName("metrics", "in"): { + pipeline.NewIDWithName(pipeline.SignalMetrics, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, - pipeline.MustNewIDWithName("traces", "out"): { + pipeline.NewIDWithName(pipeline.SignalTraces, "out"): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1592,11 +1592,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewIDWithName("metrics", "in"): { + pipeline.NewIDWithName(pipeline.SignalMetrics, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, - pipeline.MustNewIDWithName("metrics", "out"): { + pipeline.NewIDWithName(pipeline.SignalMetrics, "out"): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1615,11 +1615,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewIDWithName("metrics", "in"): { + pipeline.NewIDWithName(pipeline.SignalMetrics, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, - pipeline.MustNewIDWithName("logs", "out"): { + pipeline.NewIDWithName(pipeline.SignalLogs, "out"): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1638,11 +1638,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewIDWithName("metrics", "in"): { + pipeline.NewIDWithName(pipeline.SignalMetrics, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, - pipeline.MustNewIDWithName("profiles", "out"): { + pipeline.NewIDWithName(pipelineprofiles.SignalProfiles, "out"): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1661,11 +1661,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewIDWithName("logs", "in"): { + pipeline.NewIDWithName(pipeline.SignalLogs, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, - pipeline.MustNewIDWithName("traces", "out"): { + pipeline.NewIDWithName(pipeline.SignalTraces, "out"): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1684,11 +1684,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewIDWithName("logs", "in"): { + pipeline.NewIDWithName(pipeline.SignalLogs, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, - pipeline.MustNewIDWithName("metrics", "out"): { + pipeline.NewIDWithName(pipeline.SignalMetrics, "out"): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1707,11 +1707,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewIDWithName("logs", "in"): { + pipeline.NewIDWithName(pipeline.SignalLogs, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, - pipeline.MustNewIDWithName("logs", "out"): { + pipeline.NewIDWithName(pipeline.SignalLogs, "out"): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1730,11 +1730,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewIDWithName("logs", "in"): { + pipeline.NewIDWithName(pipeline.SignalLogs, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, - pipeline.MustNewIDWithName("profiles", "out"): { + pipeline.NewIDWithName(pipelineprofiles.SignalProfiles, "out"): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1753,11 +1753,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewIDWithName("profiles", "in"): { + pipeline.NewIDWithName(pipelineprofiles.SignalProfiles, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, - pipeline.MustNewIDWithName("traces", "out"): { + pipeline.NewIDWithName(pipeline.SignalTraces, "out"): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1776,11 +1776,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewIDWithName("profiles", "in"): { + pipeline.NewIDWithName(pipelineprofiles.SignalProfiles, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, - pipeline.MustNewIDWithName("metrics", "out"): { + pipeline.NewIDWithName(pipeline.SignalMetrics, "out"): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1799,11 +1799,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewIDWithName("profiles", "in"): { + pipeline.NewIDWithName(pipelineprofiles.SignalProfiles, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, - pipeline.MustNewIDWithName("logs", "out"): { + pipeline.NewIDWithName(pipeline.SignalLogs, "out"): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1822,11 +1822,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewIDWithName("profiles", "in"): { + pipeline.NewIDWithName(pipelineprofiles.SignalProfiles, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, - pipeline.MustNewIDWithName("profiles", "out"): { + pipeline.NewIDWithName(pipelineprofiles.SignalProfiles, "out"): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1845,7 +1845,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewIDWithName("nop", "conn"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewIDWithName("metrics", "in"): { + pipeline.NewIDWithName(pipeline.SignalMetrics, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn")}, }, @@ -1864,7 +1864,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewIDWithName("nop", "conn"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewIDWithName("traces", "out"): { + pipeline.NewIDWithName(pipeline.SignalTraces, "out"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1883,15 +1883,15 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("mockforward"): mfConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewIDWithName("traces", "in"): { + pipeline.NewIDWithName(pipeline.SignalTraces, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("mockforward")}, }, - pipeline.MustNewIDWithName("traces", "out"): { + pipeline.NewIDWithName(pipeline.SignalTraces, "out"): { Receivers: []component.ID{component.MustNewID("mockforward")}, Exporters: []component.ID{component.MustNewID("nop")}, }, - pipeline.MustNewIDWithName("metrics", "in"): { + pipeline.NewIDWithName(pipeline.SignalMetrics, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("mockforward")}, }, @@ -1910,15 +1910,15 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("mockforward"): mfConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewIDWithName("metrics", "in"): { + pipeline.NewIDWithName(pipeline.SignalMetrics, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("mockforward")}, }, - pipeline.MustNewIDWithName("metrics", "out"): { + pipeline.NewIDWithName(pipeline.SignalMetrics, "out"): { Receivers: []component.ID{component.MustNewID("mockforward")}, Exporters: []component.ID{component.MustNewID("nop")}, }, - pipeline.MustNewIDWithName("traces", "out"): { + pipeline.NewIDWithName(pipeline.SignalTraces, "out"): { Receivers: []component.ID{component.MustNewID("mockforward")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1940,7 +1940,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewIDWithName("nop", "conn"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewID("traces"): { + pipeline.NewID(pipeline.SignalTraces): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn")}, @@ -1966,7 +1966,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewIDWithName("nop", "conn"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewID("metrics"): { + pipeline.NewID(pipeline.SignalMetrics): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn")}, @@ -1992,7 +1992,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewIDWithName("nop", "conn"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewID("logs"): { + pipeline.NewID(pipeline.SignalLogs): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn")}, @@ -2018,7 +2018,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewIDWithName("nop", "conn"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewID("profiles"): { + pipeline.NewID(pipelineprofiles.SignalProfiles): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn")}, @@ -2046,22 +2046,22 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewIDWithName("nop", "conn2"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewIDWithName("traces", "in"): { + pipeline.NewIDWithName(pipeline.SignalTraces, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn")}, }, - pipeline.MustNewIDWithName("traces", "1"): { + pipeline.NewIDWithName(pipeline.SignalTraces, "1"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn1")}, }, - pipeline.MustNewIDWithName("traces", "2"): { + pipeline.NewIDWithName(pipeline.SignalTraces, "2"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn1")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn2"), component.MustNewIDWithName("nop", "conn")}, }, - pipeline.MustNewIDWithName("traces", "out"): { + pipeline.NewIDWithName(pipeline.SignalTraces, "out"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn2")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -2091,22 +2091,22 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewIDWithName("nop", "conn2"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewIDWithName("metrics", "in"): { + pipeline.NewIDWithName(pipeline.SignalMetrics, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn")}, }, - pipeline.MustNewIDWithName("metrics", "1"): { + pipeline.NewIDWithName(pipeline.SignalMetrics, "1"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn1")}, }, - pipeline.MustNewIDWithName("metrics", "2"): { + pipeline.NewIDWithName(pipeline.SignalMetrics, "2"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn1")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn2"), component.MustNewIDWithName("nop", "conn")}, }, - pipeline.MustNewIDWithName("metrics", "out"): { + pipeline.NewIDWithName(pipeline.SignalMetrics, "out"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn2")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -2136,22 +2136,22 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewIDWithName("nop", "conn2"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewIDWithName("logs", "in"): { + pipeline.NewIDWithName(pipeline.SignalLogs, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn")}, }, - pipeline.MustNewIDWithName("logs", "1"): { + pipeline.NewIDWithName(pipeline.SignalLogs, "1"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn1")}, }, - pipeline.MustNewIDWithName("logs", "2"): { + pipeline.NewIDWithName(pipeline.SignalLogs, "2"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn1")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn2"), component.MustNewIDWithName("nop", "conn")}, }, - pipeline.MustNewIDWithName("logs", "out"): { + pipeline.NewIDWithName(pipeline.SignalLogs, "out"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn2")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -2181,22 +2181,22 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewIDWithName("nop", "conn2"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewIDWithName("profiles", "in"): { + pipeline.NewIDWithName(pipelineprofiles.SignalProfiles, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn")}, }, - pipeline.MustNewIDWithName("profiles", "1"): { + pipeline.NewIDWithName(pipelineprofiles.SignalProfiles, "1"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn1")}, }, - pipeline.MustNewIDWithName("profiles", "2"): { + pipeline.NewIDWithName(pipelineprofiles.SignalProfiles, "2"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn1")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn2"), component.MustNewIDWithName("nop", "conn")}, }, - pipeline.MustNewIDWithName("profiles", "out"): { + pipeline.NewIDWithName(pipelineprofiles.SignalProfiles, "out"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn2")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -2227,37 +2227,37 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewIDWithName("nop", "rawlog"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewIDWithName("traces", "in"): { + pipeline.NewIDWithName(pipeline.SignalTraces, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "fork")}, }, - pipeline.MustNewIDWithName("traces", "copy1"): { + pipeline.NewIDWithName(pipeline.SignalTraces, "copy1"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "fork")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "count")}, }, - pipeline.MustNewIDWithName("traces", "copy2"): { + pipeline.NewIDWithName(pipeline.SignalTraces, "copy2"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "fork")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "forkagain")}, }, - pipeline.MustNewIDWithName("traces", "copy2a"): { + pipeline.NewIDWithName(pipeline.SignalTraces, "copy2a"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "forkagain")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "count")}, }, - pipeline.MustNewIDWithName("traces", "copy2b"): { + pipeline.NewIDWithName(pipeline.SignalTraces, "copy2b"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "forkagain")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "rawlog")}, }, - pipeline.MustNewIDWithName("metrics", "count"): { + pipeline.NewIDWithName(pipeline.SignalMetrics, "count"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "count")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop")}, }, - pipeline.MustNewIDWithName("logs", "raw"): { + pipeline.NewIDWithName(pipeline.SignalLogs, "raw"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "rawlog")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "fork")}, // cannot loop back to "nop/fork" @@ -2281,7 +2281,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewID("traces"): { + pipeline.NewID(pipeline.SignalTraces): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop"), component.MustNewIDWithName("nop", "1")}, }, @@ -2297,7 +2297,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("unknown"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewID("traces"): { + pipeline.NewID(pipeline.SignalTraces): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("unknown")}, }, @@ -2316,7 +2316,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewID("metrics"): { + pipeline.NewID(pipeline.SignalMetrics): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop"), component.MustNewIDWithName("nop", "1")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -2336,7 +2336,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewID("metrics"): { + pipeline.NewID(pipeline.SignalMetrics): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("unknown")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -2353,7 +2353,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewID("logs"): { + pipeline.NewID(pipeline.SignalLogs): { Receivers: []component.ID{component.MustNewID("nop"), component.MustNewIDWithName("nop", "1")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -2369,7 +2369,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewID("logs"): { + pipeline.NewID(pipeline.SignalLogs): { Receivers: []component.ID{component.MustNewID("unknown")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -2388,11 +2388,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("unknown"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.MustNewIDWithName("traces", "in"): { + pipeline.NewIDWithName(pipeline.SignalTraces, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("unknown")}, }, - pipeline.MustNewIDWithName("traces", "out"): { + pipeline.NewIDWithName(pipeline.SignalTraces, "out"): { Receivers: []component.ID{component.MustNewID("unknown")}, Exporters: []component.ID{component.MustNewID("nop")}, }, diff --git a/service/internal/graph/node.go b/service/internal/graph/node.go index 0e17bb74bf5..0d1c329c68e 100644 --- a/service/internal/graph/node.go +++ b/service/internal/graph/node.go @@ -17,5 +17,6 @@ func (n nodeID) ID() int64 { func newNodeID(parts ...string) nodeID { h := fnv.New64a() h.Write([]byte(strings.Join(parts, "|"))) + // nolint:gosec return nodeID(h.Sum64()) } diff --git a/service/internal/graph/processor.go b/service/internal/graph/processor.go index a20e8e8dfd8..9167152011c 100644 --- a/service/internal/graph/processor.go +++ b/service/internal/graph/processor.go @@ -8,10 +8,10 @@ import ( "fmt" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componentprofiles" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/consumer/consumerprofiles" "go.opentelemetry.io/collector/pipeline" + "go.opentelemetry.io/collector/pipeline/pipelineprofiles" "go.opentelemetry.io/collector/processor" "go.opentelemetry.io/collector/service/internal/builders" "go.opentelemetry.io/collector/service/internal/components" @@ -58,7 +58,7 @@ func (n *processorNode) buildComponent(ctx context.Context, n.Component, err = builder.CreateMetrics(ctx, set, next.(consumer.Metrics)) case pipeline.SignalLogs: n.Component, err = builder.CreateLogs(ctx, set, next.(consumer.Logs)) - case componentprofiles.SignalProfiles: + case pipelineprofiles.SignalProfiles: n.Component, err = builder.CreateProfiles(ctx, set, next.(consumerprofiles.Profiles)) default: return fmt.Errorf("error creating processor %q in pipeline %q, data type %q is not supported", set.ID, n.pipelineID.String(), n.pipelineID.Signal()) diff --git a/service/internal/graph/receiver.go b/service/internal/graph/receiver.go index e462671bfc7..d5de95ca3b2 100644 --- a/service/internal/graph/receiver.go +++ b/service/internal/graph/receiver.go @@ -8,11 +8,11 @@ import ( "fmt" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componentprofiles" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/consumer/consumerprofiles" "go.opentelemetry.io/collector/internal/fanoutconsumer" "go.opentelemetry.io/collector/pipeline" + "go.opentelemetry.io/collector/pipeline/pipelineprofiles" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/service/internal/builders" "go.opentelemetry.io/collector/service/internal/components" @@ -65,7 +65,7 @@ func (n *receiverNode) buildComponent(ctx context.Context, consumers = append(consumers, next.(consumer.Logs)) } n.Component, err = builder.CreateLogs(ctx, set, fanoutconsumer.NewLogs(consumers)) - case componentprofiles.SignalProfiles: + case pipelineprofiles.SignalProfiles: var consumers []consumerprofiles.Profiles for _, next := range nexts { consumers = append(consumers, next.(consumerprofiles.Profiles)) diff --git a/service/internal/graph/util_test.go b/service/internal/graph/util_test.go index 0a9165622c4..dc788bca56a 100644 --- a/service/internal/graph/util_test.go +++ b/service/internal/graph/util_test.go @@ -9,7 +9,6 @@ import ( "sync" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componentprofiles" "go.opentelemetry.io/collector/connector" "go.opentelemetry.io/collector/connector/connectorprofiles" "go.opentelemetry.io/collector/consumer" @@ -18,6 +17,7 @@ import ( "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exporterprofiles" "go.opentelemetry.io/collector/pipeline" + "go.opentelemetry.io/collector/pipeline/pipelineprofiles" "go.opentelemetry.io/collector/processor" "go.opentelemetry.io/collector/processor/processorprofiles" "go.opentelemetry.io/collector/receiver" @@ -79,7 +79,7 @@ func (g *Graph) getReceivers() map[pipeline.Signal]map[component.ID]component.Co receiversMap[pipeline.SignalTraces] = make(map[component.ID]component.Component) receiversMap[pipeline.SignalMetrics] = make(map[component.ID]component.Component) receiversMap[pipeline.SignalLogs] = make(map[component.ID]component.Component) - receiversMap[componentprofiles.SignalProfiles] = make(map[component.ID]component.Component) + receiversMap[pipelineprofiles.SignalProfiles] = make(map[component.ID]component.Component) for _, pg := range g.pipelines { for _, rcvrNode := range pg.receivers { diff --git a/service/internal/proctelemetry/process_telemetry.go b/service/internal/proctelemetry/process_telemetry.go index 0fe58d5d694..de60d4518ed 100644 --- a/service/internal/proctelemetry/process_telemetry.go +++ b/service/internal/proctelemetry/process_telemetry.go @@ -68,6 +68,7 @@ func RegisterProcessMetrics(cfg component.TelemetrySettings, opts ...RegisterOpt ctx = context.WithValue(ctx, common.EnvKey, common.EnvMap{common.HostProcEnvKey: set.hostProc}) } pm.context = ctx + // nolint:gosec pm.proc, err = process.NewProcessWithContext(pm.context, int32(os.Getpid())) if err != nil { return err @@ -93,6 +94,7 @@ func (pm *processMetrics) updateAllocMem() int64 { pm.mu.Lock() defer pm.mu.Unlock() pm.readMemStatsIfNeeded() + // nolint:gosec return int64(pm.ms.Alloc) } @@ -100,6 +102,7 @@ func (pm *processMetrics) updateTotalAllocMem() int64 { pm.mu.Lock() defer pm.mu.Unlock() pm.readMemStatsIfNeeded() + // nolint:gosec return int64(pm.ms.TotalAlloc) } @@ -107,6 +110,7 @@ func (pm *processMetrics) updateSysMem() int64 { pm.mu.Lock() defer pm.mu.Unlock() pm.readMemStatsIfNeeded() + // nolint:gosec return int64(pm.ms.Sys) } @@ -125,6 +129,7 @@ func (pm *processMetrics) updateRSSMemory() int64 { if err != nil { return 0 } + // nolint:gosec return int64(mem.RSS) } diff --git a/service/internal/status/status_test.go b/service/internal/status/status_test.go index 18a5fa3553f..8c9498bd1e3 100644 --- a/service/internal/status/status_test.go +++ b/service/internal/status/status_test.go @@ -241,7 +241,6 @@ func TestStatusFuncsConcurrent(t *testing.T) { wg.Add(len(ids)) for _, id := range ids { - id := id go func() { compFn := NewReportStatusFunc(id, rep.ReportStatus) compFn(componentstatus.NewEvent(componentstatus.StatusStarting)) diff --git a/service/internal/testcomponents/example_router_test.go b/service/internal/testcomponents/example_router_test.go index f8c69e40f8a..11cdac35a3c 100644 --- a/service/internal/testcomponents/example_router_test.go +++ b/service/internal/testcomponents/example_router_test.go @@ -34,8 +34,8 @@ func TestExampleRouter(t *testing.T) { } func TestTracesRouter(t *testing.T) { - leftID := pipeline.MustNewIDWithName("sink", "left") - rightID := pipeline.MustNewIDWithName("sink", "right") + leftID := pipeline.NewIDWithName(pipeline.SignalTraces, "sink_left") + rightID := pipeline.NewIDWithName(pipeline.SignalTraces, "sink_right") sinkLeft := new(consumertest.TracesSink) sinkRight := new(consumertest.TracesSink) @@ -73,8 +73,8 @@ func TestTracesRouter(t *testing.T) { } func TestMetricsRouter(t *testing.T) { - leftID := pipeline.MustNewIDWithName("sink", "left") - rightID := pipeline.MustNewIDWithName("sink", "right") + leftID := pipeline.NewIDWithName(pipeline.SignalTraces, "sink_left") + rightID := pipeline.NewIDWithName(pipeline.SignalTraces, "sink_right") sinkLeft := new(consumertest.MetricsSink) sinkRight := new(consumertest.MetricsSink) @@ -112,8 +112,8 @@ func TestMetricsRouter(t *testing.T) { } func TestLogsRouter(t *testing.T) { - leftID := pipeline.MustNewIDWithName("sink", "left") - rightID := pipeline.MustNewIDWithName("sink", "right") + leftID := pipeline.NewIDWithName(pipeline.SignalTraces, "sink_left") + rightID := pipeline.NewIDWithName(pipeline.SignalTraces, "sink_right") sinkLeft := new(consumertest.LogsSink) sinkRight := new(consumertest.LogsSink) @@ -151,8 +151,8 @@ func TestLogsRouter(t *testing.T) { } func TestProfilesRouter(t *testing.T) { - leftID := pipeline.MustNewIDWithName("sink", "left") - rightID := pipeline.MustNewIDWithName("sink", "right") + leftID := pipeline.NewIDWithName(pipeline.SignalTraces, "sink_left") + rightID := pipeline.NewIDWithName(pipeline.SignalTraces, "sink_right") sinkLeft := new(consumertest.ProfilesSink) sinkRight := new(consumertest.ProfilesSink) diff --git a/service/pipelines/config.go b/service/pipelines/config.go index ff898aafacb..30db3e820db 100644 --- a/service/pipelines/config.go +++ b/service/pipelines/config.go @@ -8,8 +8,8 @@ import ( "fmt" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componentprofiles" "go.opentelemetry.io/collector/pipeline" + "go.opentelemetry.io/collector/pipeline/pipelineprofiles" ) var ( @@ -31,7 +31,7 @@ func (cfg Config) Validate() error { // only configured components. for pipelineID, p := range cfg { switch pipelineID.Signal() { - case pipeline.SignalTraces, pipeline.SignalMetrics, pipeline.SignalLogs, componentprofiles.SignalProfiles: + case pipeline.SignalTraces, pipeline.SignalMetrics, pipeline.SignalLogs, pipelineprofiles.SignalProfiles: // Continue default: return fmt.Errorf("pipeline %q: unknown signal %q", pipelineID.String(), pipelineID.Signal()) diff --git a/service/pipelines/config_test.go b/service/pipelines/config_test.go index 33a836f5395..520085ee79c 100644 --- a/service/pipelines/config_test.go +++ b/service/pipelines/config_test.go @@ -29,7 +29,7 @@ func TestConfigValidate(t *testing.T) { name: "duplicate-processor-reference", cfgFn: func() Config { cfg := generateConfig() - pipe := cfg[pipeline.MustNewID("traces")] + pipe := cfg[pipeline.NewID(pipeline.SignalTraces)] pipe.Processors = append(pipe.Processors, pipe.Processors...) return cfg }, @@ -39,7 +39,7 @@ func TestConfigValidate(t *testing.T) { name: "missing-pipeline-receivers", cfgFn: func() Config { cfg := generateConfig() - cfg[pipeline.MustNewID("traces")].Receivers = nil + cfg[pipeline.NewID(pipeline.SignalTraces)].Receivers = nil return cfg }, expected: fmt.Errorf(`pipeline "traces": %w`, errMissingServicePipelineReceivers), @@ -48,7 +48,7 @@ func TestConfigValidate(t *testing.T) { name: "missing-pipeline-exporters", cfgFn: func() Config { cfg := generateConfig() - cfg[pipeline.MustNewID("traces")].Exporters = nil + cfg[pipeline.NewID(pipeline.SignalTraces)].Exporters = nil return cfg }, expected: fmt.Errorf(`pipeline "traces": %w`, errMissingServicePipelineExporters), @@ -85,7 +85,7 @@ func TestConfigValidate(t *testing.T) { func generateConfig() Config { return map[pipeline.ID]*PipelineConfig{ - pipeline.MustNewID("traces"): { + pipeline.NewID(pipeline.SignalTraces): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop")}, diff --git a/service/service_test.go b/service/service_test.go index 5548a681092..09aa0b7a4ab 100644 --- a/service/service_test.go +++ b/service/service_test.go @@ -22,7 +22,6 @@ import ( "go.uber.org/zap/zapcore" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componentprofiles" "go.opentelemetry.io/collector/component/componentstatus" "go.opentelemetry.io/collector/config/confighttp" "go.opentelemetry.io/collector/config/configtelemetry" @@ -32,6 +31,7 @@ import ( "go.opentelemetry.io/collector/internal/testutil" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pipeline" + "go.opentelemetry.io/collector/pipeline/pipelineprofiles" "go.opentelemetry.io/collector/service/extensions" "go.opentelemetry.io/collector/service/internal/builders" "go.opentelemetry.io/collector/service/internal/promtest" @@ -242,8 +242,8 @@ func TestServiceGetExporters(t *testing.T) { assert.Contains(t, expMap[pipeline.SignalMetrics], component.NewID(nopType)) assert.Len(t, expMap[pipeline.SignalLogs], 1) assert.Contains(t, expMap[pipeline.SignalLogs], component.NewID(nopType)) - assert.Len(t, expMap[componentprofiles.SignalProfiles], 1) - assert.Contains(t, expMap[componentprofiles.SignalProfiles], component.NewID(nopType)) + assert.Len(t, expMap[pipelineprofiles.SignalProfiles], 1) + assert.Contains(t, expMap[pipelineprofiles.SignalProfiles], component.NewID(nopType)) } func TestServiceGetExportersWithSignal(t *testing.T) { @@ -269,15 +269,15 @@ func TestServiceGetExportersWithSignal(t *testing.T) { assert.Contains(t, expMap[pipeline.SignalMetrics], component.NewID(nopType)) assert.Len(t, expMap[pipeline.SignalLogs], 1) assert.Contains(t, expMap[pipeline.SignalLogs], component.NewID(nopType)) - assert.Len(t, expMap[componentprofiles.SignalProfiles], 1) - assert.Contains(t, expMap[componentprofiles.SignalProfiles], component.NewID(nopType)) + assert.Len(t, expMap[pipelineprofiles.SignalProfiles], 1) + assert.Contains(t, expMap[pipelineprofiles.SignalProfiles], component.NewID(nopType)) } // TestServiceTelemetryCleanupOnError tests that if newService errors due to an invalid config telemetry is cleaned up // and another service with a valid config can be started right after. func TestServiceTelemetryCleanupOnError(t *testing.T) { invalidCfg := newNopConfig() - invalidCfg.Pipelines[pipeline.MustNewID("traces")].Processors[0] = component.MustNewID("invalid") + invalidCfg.Pipelines[pipeline.NewID(pipeline.SignalTraces)].Processors[0] = component.MustNewID("invalid") // Create a service with an invalid config and expect an error _, err := New(context.Background(), newNopSettings(), invalidCfg) require.Error(t, err) @@ -624,22 +624,22 @@ func newNopSettings() Settings { func newNopConfig() Config { return newNopConfigPipelineConfigs(pipelines.Config{ - pipeline.MustNewID("traces"): { + pipeline.NewID(pipeline.SignalTraces): { Receivers: []component.ID{component.NewID(nopType)}, Processors: []component.ID{component.NewID(nopType)}, Exporters: []component.ID{component.NewID(nopType)}, }, - pipeline.MustNewID("metrics"): { + pipeline.NewID(pipeline.SignalMetrics): { Receivers: []component.ID{component.NewID(nopType)}, Processors: []component.ID{component.NewID(nopType)}, Exporters: []component.ID{component.NewID(nopType)}, }, - pipeline.MustNewID("logs"): { + pipeline.NewID(pipeline.SignalLogs): { Receivers: []component.ID{component.NewID(nopType)}, Processors: []component.ID{component.NewID(nopType)}, Exporters: []component.ID{component.NewID(nopType)}, }, - pipeline.MustNewID("profiles"): { + pipeline.NewID(pipelineprofiles.SignalProfiles): { Receivers: []component.ID{component.NewID(nopType)}, Processors: []component.ID{component.NewID(nopType)}, Exporters: []component.ID{component.NewID(nopType)}, diff --git a/service/telemetry/tracer.go b/service/telemetry/tracer.go index ff17f296865..ca4ee8c54b0 100644 --- a/service/telemetry/tracer.go +++ b/service/telemetry/tracer.go @@ -17,9 +17,15 @@ import ( "go.opentelemetry.io/otel/trace/noop" "go.opentelemetry.io/collector/config/configtelemetry" - "go.opentelemetry.io/collector/internal/globalgates" + "go.opentelemetry.io/collector/featuregate" ) +var noopTracerProvider = featuregate.GlobalRegistry().MustRegister("service.noopTracerProvider", + featuregate.StageAlpha, + featuregate.WithRegisterFromVersion("v0.107.0"), + featuregate.WithRegisterToVersion("v0.109.0"), + featuregate.WithRegisterDescription("Sets a Noop OpenTelemetry TracerProvider to reduce memory allocations. This featuregate is incompatible with the zPages extension.")) + const ( // supported trace propagators traceContextPropagator = "tracecontext" @@ -50,7 +56,7 @@ func (n *noopNoContextTracerProvider) Tracer(_ string, _ ...trace.TracerOption) // New creates a new Telemetry from Config. func newTracerProvider(ctx context.Context, set Settings, cfg Config) (trace.TracerProvider, error) { - if globalgates.NoopTracerProvider.IsEnabled() || cfg.Traces.Level == configtelemetry.LevelNone { + if noopTracerProvider.IsEnabled() || cfg.Traces.Level == configtelemetry.LevelNone { return &noopNoContextTracerProvider{}, nil } diff --git a/service/telemetry/tracer_test.go b/service/telemetry/tracer_test.go index f2ed37c1b50..62b022af597 100644 --- a/service/telemetry/tracer_test.go +++ b/service/telemetry/tracer_test.go @@ -12,7 +12,6 @@ import ( "go.opentelemetry.io/collector/config/configtelemetry" "go.opentelemetry.io/collector/featuregate" - "go.opentelemetry.io/collector/internal/globalgates" ) func TestNewTracerProvider(t *testing.T) { @@ -44,11 +43,11 @@ func TestNewTracerProvider(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - previousValue := globalgates.NoopTracerProvider.IsEnabled() + previousValue := noopTracerProvider.IsEnabled() // expect error due to deprecated flag - require.NoError(t, featuregate.GlobalRegistry().Set(globalgates.NoopTracerProvider.ID(), tt.noopTracerGate)) + require.NoError(t, featuregate.GlobalRegistry().Set(noopTracerProvider.ID(), tt.noopTracerGate)) defer func() { - require.NoError(t, featuregate.GlobalRegistry().Set(globalgates.NoopTracerProvider.ID(), previousValue)) + require.NoError(t, featuregate.GlobalRegistry().Set(noopTracerProvider.ID(), previousValue)) }() provider, err := newTracerProvider(context.TODO(), Settings{}, tt.cfg) require.NoError(t, err) diff --git a/versions.yaml b/versions.yaml index 8aff45feede..4ed1b6de37f 100644 --- a/versions.yaml +++ b/versions.yaml @@ -23,13 +23,11 @@ module-sets: version: v0.111.0 modules: - go.opentelemetry.io/collector - - go.opentelemetry.io/collector/internal/globalgates - go.opentelemetry.io/collector/internal/globalsignal - go.opentelemetry.io/collector/cmd/builder - go.opentelemetry.io/collector/cmd/mdatagen - go.opentelemetry.io/collector/component - go.opentelemetry.io/collector/component/componentstatus - - go.opentelemetry.io/collector/component/componentprofiles - go.opentelemetry.io/collector/confmap/converter/expandconverter - go.opentelemetry.io/collector/config/configauth - go.opentelemetry.io/collector/config/configgrpc @@ -61,6 +59,7 @@ module-sets: - go.opentelemetry.io/collector/pdata/pprofile - go.opentelemetry.io/collector/pdata/testdata - go.opentelemetry.io/collector/pipeline + - go.opentelemetry.io/collector/pipeline/pipelineprofiles - go.opentelemetry.io/collector/processor - go.opentelemetry.io/collector/processor/batchprocessor - go.opentelemetry.io/collector/processor/memorylimiterprocessor