diff --git a/.chloggen/remove-deprecated-receiver-builder.yaml b/.chloggen/6767-exporterhelper-rename-config.yaml similarity index 67% rename from .chloggen/remove-deprecated-receiver-builder.yaml rename to .chloggen/6767-exporterhelper-rename-config.yaml index cdb91e66fa2..f81f1b28223 100644 --- a/.chloggen/remove-deprecated-receiver-builder.yaml +++ b/.chloggen/6767-exporterhelper-rename-config.yaml @@ -1,21 +1,16 @@ # Use this changelog template to create an entry for release notes. # One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' -change_type: breaking +change_type: 'deprecation' # The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) -component: receiver +component: exporterhelper # A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). -note: Remove deprecated receiver builder +note: "Deprecate TimeoutSettings/QueueSettings in favor of TimeoutConfig/QueueConfig." # One or more tracking issues or pull requests related to the change -issues: [11019] - -# (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: +issues: [6767] # Optional: The change log or logs in which this entry should be included. # e.g. '[user]' or '[user, api]' diff --git a/.chloggen/remove-deprecated-connector-builder.yaml b/.chloggen/avoid-internal.yaml similarity index 67% rename from .chloggen/remove-deprecated-connector-builder.yaml rename to .chloggen/avoid-internal.yaml index 854077b93ef..70bd015768b 100644 --- a/.chloggen/remove-deprecated-connector-builder.yaml +++ b/.chloggen/avoid-internal.yaml @@ -1,21 +1,16 @@ # Use this changelog template to create an entry for release notes. # One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' -change_type: breaking +change_type: 'enhancement' # The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) -component: connector +component: mdatagen # A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). -note: Remove deprecated connector builder +note: Avoid using private types in public APIs and also protect options to be implemented outside this module. # One or more tracking issues or pull requests related to the change -issues: [11019] - -# (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: +issues: [11040] # Optional: The change log or logs in which this entry should be included. # e.g. '[user]' or '[user, api]' diff --git a/.chloggen/codeboten_consolidate-inout-items.yaml b/.chloggen/codeboten_consolidate-inout-items.yaml new file mode 100644 index 00000000000..067327f9e79 --- /dev/null +++ b/.chloggen/codeboten_consolidate-inout-items.yaml @@ -0,0 +1,36 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: breaking + +# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) +component: processorhelper + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: "Update incoming/outgoing metrics to a single metric with a `otel.signal` attributes." + +# One or more tracking issues or pull requests related to the change +issues: [11144] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: | + The following metrics were added in the previous version + - otelcol_processor_incoming_spans + - otelcol_processor_outgoing_spans + - otelcol_processor_incoming_metric_points + - otelcol_processor_outgoing_metric_points + - otelcol_processor_incoming_log_records + - otelcol_processor_outgoing_log_records + + They are being replaced with the following to more closely align with OTEP 259: + - otelcol_processor_incoming_items + - otelcol_processor_outgoing_items + +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Include 'api' if there is a change to a library API. +# Default: '[user]' +change_logs: [] diff --git a/.chloggen/codeboten_int64-int.yaml b/.chloggen/codeboten_fix-bug.yaml similarity index 84% rename from .chloggen/codeboten_int64-int.yaml rename to .chloggen/codeboten_fix-bug.yaml index 049c2e78583..3faac735c42 100644 --- a/.chloggen/codeboten_int64-int.yaml +++ b/.chloggen/codeboten_fix-bug.yaml @@ -4,13 +4,13 @@ change_type: bug_fix # The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) -component: configgrpc +component: service # A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). -note: Change the value of max_recv_msg_size_mib from uint64 to int to avoid a case where misconfiguration caused an integer overflow. +note: Ensure process telemetry is registered when internal telemetry is configured with readers instead of an address. # One or more tracking issues or pull requests related to the change -issues: [10948] +issues: [11093] # (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. diff --git a/.chloggen/codeboten_level-internal-telemetry.yaml b/.chloggen/codeboten_level-internal-telemetry.yaml deleted file mode 100644 index 0d8561d9af3..00000000000 --- a/.chloggen/codeboten_level-internal-telemetry.yaml +++ /dev/null @@ -1,25 +0,0 @@ -# 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: configtelemetry - -# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). -note: "Deprecating `TelemetrySettings.MeterProvider` in favour of `TelemetrySettings.LeveledMeterProvider`" - -# One or more tracking issues or pull requests related to the change -issues: [10912] - -# (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/mx-psi_configtelemetry-1.0.yaml b/.chloggen/confignet-mark-stable.yaml similarity index 92% rename from .chloggen/mx-psi_configtelemetry-1.0.yaml rename to .chloggen/confignet-mark-stable.yaml index d5cee6b3fcb..9181b2d4010 100644 --- a/.chloggen/mx-psi_configtelemetry-1.0.yaml +++ b/.chloggen/confignet-mark-stable.yaml @@ -4,13 +4,13 @@ change_type: enhancement # The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) -component: configtelemetry +component: confignet # A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). -note: Mark module as stable +note: Mark module as Stable. # One or more tracking issues or pull requests related to the change -issues: [10277] +issues: [9801] # (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. diff --git a/.chloggen/connectorprofiles-router.yaml b/.chloggen/envprovider-default-value.yaml similarity index 86% rename from .chloggen/connectorprofiles-router.yaml rename to .chloggen/envprovider-default-value.yaml index 0e3df7db51c..9528a2a41d0 100644 --- a/.chloggen/connectorprofiles-router.yaml +++ b/.chloggen/envprovider-default-value.yaml @@ -4,13 +4,13 @@ change_type: enhancement # The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) -component: connectorprofiles +component: confmap/provider/envprovider # A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). -note: Add ProfilesRouterAndConsumer interface, and NewProfilesRouter method. +note: Support default values when env var is empty # One or more tracking issues or pull requests related to the change -issues: [11023] +issues: [5228] # (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. @@ -22,4 +22,4 @@ subtext: # 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] +change_logs: ['user'] diff --git a/.chloggen/add_guidelines_telemetry.yaml b/.chloggen/fix-metadatagen-validate.yaml similarity index 88% rename from .chloggen/add_guidelines_telemetry.yaml rename to .chloggen/fix-metadatagen-validate.yaml index c74de0c4708..37d5122793f 100644 --- a/.chloggen/add_guidelines_telemetry.yaml +++ b/.chloggen/fix-metadatagen-validate.yaml @@ -4,13 +4,13 @@ change_type: enhancement # The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) -component: configtelemetry +component: mdatagen # A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). -note: Add guidelines for each level of component telemetry +note: mdatagen `validateMetrics()` support validate metrics in `telemetry.metric` # One or more tracking issues or pull requests related to the change -issues: [10286] +issues: [10925] # (Optional) One or more lines of additional information to render under the primary note. # These lines will be padded with 2 spaces and then inserted directly into the document. diff --git a/.chloggen/confmap-remove-unify-feature-gate.yaml b/.chloggen/fix_windows_service_event_log_core.yaml similarity index 85% rename from .chloggen/confmap-remove-unify-feature-gate.yaml rename to .chloggen/fix_windows_service_event_log_core.yaml index a398c864b8c..7b33776084e 100644 --- a/.chloggen/confmap-remove-unify-feature-gate.yaml +++ b/.chloggen/fix_windows_service_event_log_core.yaml @@ -1,16 +1,16 @@ # Use this changelog template to create an entry for release notes. # One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' -change_type: breaking +change_type: bug_fix # The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) -component: confmap +component: otelcol # A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). -note: Removes stable `confmap.unifyEnvVarExpansion` feature gate. +note: Fix the Windows Event Log configuration when running the Collector as a Windows service. # One or more tracking issues or pull requests related to the change -issues: [11007] +issues: [5297, 11051] # (Optional) One or more lines of additional information to render under the primary note. # These lines will be padded with 2 spaces and then inserted directly into the document. diff --git a/.chloggen/fixdefaultcfg.yaml b/.chloggen/fixdefaultcfg.yaml new file mode 100644 index 00000000000..29c328367d2 --- /dev/null +++ b/.chloggen/fixdefaultcfg.yaml @@ -0,0 +1,20 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: 'bug_fix' + +# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) +component: builder + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Fix version for providers in the default config + +# One or more tracking issues or pull requests related to the change +issues: [11123] + +# 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/remove-opencensus-bridge-gate.yaml b/.chloggen/main.yaml similarity index 89% rename from .chloggen/remove-opencensus-bridge-gate.yaml rename to .chloggen/main.yaml index e7cc22319bf..506af46bb8c 100644 --- a/.chloggen/remove-opencensus-bridge-gate.yaml +++ b/.chloggen/main.yaml @@ -4,13 +4,13 @@ change_type: breaking # The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) -component: service +component: processorhelper # A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). -note: Removes stable `service.disableOpenCensusBridge` feature gate +note: "Remove deprecated `[Traces|Metrics|Logs]`Inserted funcs" # One or more tracking issues or pull requests related to the change -issues: [11009] +issues: [11151] # (Optional) One or more lines of additional information to render under the primary note. # These lines will be padded with 2 spaces and then inserted directly into the document. diff --git a/.chloggen/mx-psi_disable-strict-versioning.yaml b/.chloggen/mx-psi_disable-strict-versioning.yaml new file mode 100644 index 00000000000..677225ad0dc --- /dev/null +++ b/.chloggen/mx-psi_disable-strict-versioning.yaml @@ -0,0 +1,26 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: bug_fix + +# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) +component: cmd/builder + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Temporarily disable strict versioning checks + +# One or more tracking issues or pull requests related to the change +issues: [11129, 11152] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: | + The strict versioning check may be enabled by default in a future version once all configuration providers are stabilized. + +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Include 'api' if there is a change to a library API. +# Default: '[user]' +change_logs: [] diff --git a/.chloggen/mx-psi_experimental-storage-module.yaml b/.chloggen/mx-psi_experimental-storage-module.yaml deleted file mode 100644 index e432f8715e7..00000000000 --- a/.chloggen/mx-psi_experimental-storage-module.yaml +++ /dev/null @@ -1,25 +0,0 @@ -# Use this changelog template to create an entry for release notes. - -# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' -change_type: new_component - -# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) -component: extension/experimental/storage - -# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). -note: Move `extension/experimental/storage` into a separate module - -# One or more tracking issues or pull requests related to the change -issues: [11022] - -# (Optional) One or more lines of additional information to render under the primary note. -# These lines will be padded with 2 spaces and then inserted directly into the document. -# Use pipe (|) for multiline entries. -subtext: - -# Optional: The change log or logs in which this entry should be included. -# e.g. '[user]' or '[user, api]' -# Include 'user' if the change is relevant to end users. -# Include 'api' if there is a change to a library API. -# Default: '[user]' -change_logs: [] diff --git a/.chloggen/confmap-remove-strictlytyped-feature-gate.yaml b/.chloggen/mx-psi_fix-sub-config.yaml similarity index 78% rename from .chloggen/confmap-remove-strictlytyped-feature-gate.yaml rename to .chloggen/mx-psi_fix-sub-config.yaml index 8974de25d2f..af4c99bca09 100644 --- a/.chloggen/confmap-remove-strictlytyped-feature-gate.yaml +++ b/.chloggen/mx-psi_fix-sub-config.yaml @@ -1,21 +1,22 @@ # Use this changelog template to create an entry for release notes. # One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' -change_type: breaking +change_type: bug_fix # The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) component: confmap # A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). -note: Remove stable `confmap.strictlyTypedInput` gate +note: Fix loading config of a component from a different source. # One or more tracking issues or pull requests related to the change -issues: [11008] +issues: [11154] # (Optional) One or more lines of additional information to render under the primary note. # These lines will be padded with 2 spaces and then inserted directly into the document. # Use pipe (|) for multiline entries. -subtext: +subtext: | + This issue only affected loading the whole component config, loading parts of a component config from a different source was working correctly. # Optional: The change log or logs in which this entry should be included. # e.g. '[user]' or '[user, api]' diff --git a/.chloggen/remove-deprecated-exporter-builder.yaml b/.chloggen/mx-psi_remove-deprecated-interfaces.yaml similarity index 85% rename from .chloggen/remove-deprecated-exporter-builder.yaml rename to .chloggen/mx-psi_remove-deprecated-interfaces.yaml index 832a3907700..95dc6020454 100644 --- a/.chloggen/remove-deprecated-exporter-builder.yaml +++ b/.chloggen/mx-psi_remove-deprecated-interfaces.yaml @@ -4,18 +4,19 @@ change_type: breaking # The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) -component: exporter +component: extension # A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). -note: Remove deprecated exporter builder +note: Remove deprecated extension interfaces. # One or more tracking issues or pull requests related to the change -issues: [11019] +issues: [11043] # (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: +subtext: | + They are now available in the `extensioncapabilities` module. # Optional: The change log or logs in which this entry should be included. # e.g. '[user]' or '[user, api]' diff --git a/.chloggen/remove-deprecated-processor-builder.yaml b/.chloggen/remove-deprecated-processor-builder.yaml deleted file mode 100644 index 766f8cde0e7..00000000000 --- a/.chloggen/remove-deprecated-processor-builder.yaml +++ /dev/null @@ -1,25 +0,0 @@ -# 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: processor - -# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). -note: Remove deprecated processor builder - -# One or more tracking issues or pull requests related to the change -issues: [11019] - -# (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/remove-deprecated-extension-builder.yaml b/.chloggen/replace-new-scraper.yaml similarity index 87% rename from .chloggen/remove-deprecated-extension-builder.yaml rename to .chloggen/replace-new-scraper.yaml index 203cbf2e5ee..676d41a9b20 100644 --- a/.chloggen/remove-deprecated-extension-builder.yaml +++ b/.chloggen/replace-new-scraper.yaml @@ -1,16 +1,16 @@ # Use this changelog template to create an entry for release notes. # One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' -change_type: breaking +change_type: deprecation # The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) -component: extension +component: scraperhelper # A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). -note: Remove deprecated extension builder +note: Deprecate NewScraperWithComponentType, should use NewScraper # One or more tracking issues or pull requests related to the change -issues: [11019] +issues: [11159] # (Optional) One or more lines of additional information to render under the primary note. # These lines will be padded with 2 spaces and then inserted directly into the document. diff --git a/.github/ISSUE_TEMPLATE/release.md b/.github/ISSUE_TEMPLATE/release.md deleted file mode 100644 index 7ac68b668d3..00000000000 --- a/.github/ISSUE_TEMPLATE/release.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -name: Release -about: Create an issue for releasing new versions -title: 'Release stable vY.Y.Y and beta vX.X.X' -labels: release -assignees: '' - ---- - -Like #9601, but for vX.X.X - -**Performed by collector release manager** - -- [ ] Prepare stable core release vY.Y.Y -- [ ] Tag and release stable core vY.Y.Y -- [ ] Prepare beta core release vX.X.X -- [ ] Tag and release beta core vX.X.X -- [ ] Prepare contrib release vX.X.X -- [ ] Tag and release contrib vX.X.X -- [ ] Prepare otelcol-releases vX.X.X -- [ ] Release binaries and container images vX.X.X -- [ ] Update the release schedule in docs/RELEASE.md - -**Performed by operator maintainers** - -- [ ] Release the operator vX.X.X - -**Performed by helm chart maintainers** - -- [ ] Update the opentelemetry-collector helm chart to use vX.X.X docker image diff --git a/.github/workflows/api-compatibility.yml b/.github/workflows/api-compatibility.yml index 92dbb6e3686..c2c3c7d7095 100644 --- a/.github/workflows/api-compatibility.yml +++ b/.github/workflows/api-compatibility.yml @@ -34,7 +34,7 @@ jobs: - name: Setup Go uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: - go-version: ~1.22.6 + go-version: ~1.22.7 # Generate apidiff states of Main - name: Generate-States diff --git a/.github/workflows/build-and-test-arm.yml b/.github/workflows/build-and-test-arm.yml index 4e6ecf9dccf..dd6950be32c 100644 --- a/.github/workflows/build-and-test-arm.yml +++ b/.github/workflows/build-and-test-arm.yml @@ -31,7 +31,7 @@ jobs: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: - go-version: "~1.22.6" + go-version: "~1.22.7" cache: false - name: Cache Go id: go-cache diff --git a/.github/workflows/build-and-test-windows.yaml b/.github/workflows/build-and-test-windows.yaml index d89ca657143..8c0d9d43467 100644 --- a/.github/workflows/build-and-test-windows.yaml +++ b/.github/workflows/build-and-test-windows.yaml @@ -22,7 +22,7 @@ jobs: - name: Setup Go uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: - go-version: ~1.22.6 + go-version: ~1.22.7 cache: false - name: Cache Go uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 @@ -47,7 +47,7 @@ jobs: - name: Setup Go uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: - go-version: ~1.22.6 + go-version: ~1.22.7 cache: false - name: Cache Go uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 6916b9bea36..13f12092cb3 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -22,7 +22,7 @@ jobs: - name: Setup Go uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: - go-version: ~1.22.6 + go-version: ~1.22.7 cache: false - name: Cache Go id: go-cache @@ -45,7 +45,7 @@ jobs: - name: Setup Go uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: - go-version: ~1.22.6 + go-version: ~1.22.7 cache: false - name: Cache Go id: go-cache @@ -69,7 +69,7 @@ jobs: - name: Setup Go uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: - go-version: ~1.22.6 + go-version: ~1.22.7 cache: false - name: Cache Go id: go-cache @@ -94,7 +94,7 @@ jobs: - name: Setup Go uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: - go-version: ~1.22.6 + go-version: ~1.22.7 cache: false - name: Cache Go id: go-cache @@ -194,7 +194,7 @@ jobs: - name: Setup Go uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: - go-version: ~1.22.6 + go-version: ~1.22.7 cache: false - name: Cache Go id: go-cache @@ -256,7 +256,7 @@ jobs: - name: Setup Go uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: - go-version: ~1.22.6 + go-version: ~1.22.7 cache: false - name: Cache Go id: go-cache diff --git a/.github/workflows/builder-integration-test.yaml b/.github/workflows/builder-integration-test.yaml index c0712ec95d4..d6f539ec83e 100644 --- a/.github/workflows/builder-integration-test.yaml +++ b/.github/workflows/builder-integration-test.yaml @@ -33,6 +33,6 @@ jobs: - name: Setup Go uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: - go-version: ~1.22.6 + go-version: ~1.22.7 - name: Test run: make builder-integration-test diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 78e15c0e140..46bbdf135c9 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -32,7 +32,7 @@ jobs: - name: Setup Go uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: - go-version: ~1.22.6 + go-version: ~1.22.7 - name: Cache Go id: go-cache uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 24ab6e74f69..8681098314c 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -26,16 +26,16 @@ jobs: - name: Setup Go uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: - go-version: ~1.22.6 + go-version: ~1.22.7 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@2c779ab0d087cd7fe7b826087247c2c81f27bfa6 # v3.26.5 + uses: github/codeql-action/init@4dd16135b69a43b6c8efb853346f8437d92d3c93 # v3.26.6 with: languages: go - name: Autobuild - uses: github/codeql-action/autobuild@2c779ab0d087cd7fe7b826087247c2c81f27bfa6 # v3.26.5 + uses: github/codeql-action/autobuild@4dd16135b69a43b6c8efb853346f8437d92d3c93 # v3.26.6 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@2c779ab0d087cd7fe7b826087247c2c81f27bfa6 # v3.26.5 + uses: github/codeql-action/analyze@4dd16135b69a43b6c8efb853346f8437d92d3c93 # v3.26.6 diff --git a/.github/workflows/contrib-tests.yml b/.github/workflows/contrib-tests.yml index 6f5226a20c7..e994bf35363 100644 --- a/.github/workflows/contrib-tests.yml +++ b/.github/workflows/contrib-tests.yml @@ -43,7 +43,7 @@ jobs: - name: Setup Go uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: - go-version: ~1.22.6 + go-version: ~1.22.7 cache: false - name: Run Contrib Tests run: | diff --git a/.github/workflows/perf.yml b/.github/workflows/perf.yml index 12fd41b4eac..ce7ddb6dc61 100644 --- a/.github/workflows/perf.yml +++ b/.github/workflows/perf.yml @@ -16,7 +16,7 @@ jobs: - name: Setup Go uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: - go-version: ~1.22.6 + go-version: ~1.22.7 - name: Run benchmark run: make gobenchmark diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml index 8c35088c778..1fb0257c162 100644 --- a/.github/workflows/prepare-release.yml +++ b/.github/workflows/prepare-release.yml @@ -94,7 +94,7 @@ jobs: - name: Setup Go uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: - go-version: ~1.22.6 + go-version: ~1.22.7 # Prepare Core for release. # - Update CHANGELOG.md file, this is done via chloggen # - Run make prepare-release PREVIOUS_VERSION=1.0.0 RELEASE_CANDIDATE=1.1.0 MODSET=stable diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 4dc72f13de4..4e6ff3ae421 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@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6 + uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 with: name: SARIF file path: results.sarif @@ -64,6 +64,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@2c779ab0d087cd7fe7b826087247c2c81f27bfa6 # v3.26.5 + uses: github/codeql-action/upload-sarif@4dd16135b69a43b6c8efb853346f8437d92d3c93 # v3.26.6 with: sarif_file: results.sarif diff --git a/.github/workflows/tidy-dependencies.yml b/.github/workflows/tidy-dependencies.yml index f0ed338285d..f3588e317ed 100644 --- a/.github/workflows/tidy-dependencies.yml +++ b/.github/workflows/tidy-dependencies.yml @@ -21,7 +21,7 @@ jobs: ref: ${{ github.head_ref }} - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: - go-version: ~1.22.6 + go-version: ~1.22.7 cache: false - name: Cache Go id: go-cache diff --git a/.golangci.yml b/.golangci.yml index da99b135fd7..a0a56fd5fc1 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -124,17 +124,9 @@ linters-settings: testifylint: # TODO: enable all rules disable: - - compares - - empty - - error-is-as - - error-nil - - expected-actual - float-compare - formatter - go-require - - len - - negative-positive - - nil-compare - require-error enable-all: true diff --git a/CHANGELOG-API.md b/CHANGELOG-API.md index 5e3af930b04..ce3069291e2 100644 --- a/CHANGELOG-API.md +++ b/CHANGELOG-API.md @@ -7,6 +7,36 @@ If you are looking for user-facing changes, check out [CHANGELOG.md](./CHANGELOG +## v1.15.0/v0.109.0 + +### 🛑 Breaking changes 🛑 + +- `Remove `extensiontest` StatusWatcher helpers`: They were unused. They may be added back on a different module or after `componentstatus` is marked 1.0 + (#11044) +- `pprofile`: Change Profile ID field from a byte array to a custom data type (#11048) +- `connector`: Remove deprecated connector builder (#11019) +- `exporter`: Remove deprecated exporter builder (#11019) +- `extension`: Remove deprecated extension builder (#11019) +- `processor`: Remove deprecated processor builder (#11019) +- `receiver`: Remove deprecated receiver builder (#11019) + +### 🚩 Deprecations 🚩 + +- `configtelemetry`: Deprecating `TelemetrySettings.MeterProvider` in favour of `TelemetrySettings.LeveledMeterProvider` (#10912) +- `extension`: Deprecate `extension.ConfigWatcher`, `extension.PipelineWatcher` and `extension.Dependent` in favor of equivalents in the `extensioncapabilities` module. (#11000) +- `scraperhelper`: deprecate NewScraper, should use NewScraperWithComponentType (#11082) + +### 🚀 New components 🚀 + +- `extensioncapabilities`: Create a new module for optional extension capabilities. (#11000) + +### 💡 Enhancements 💡 + +- `connectorprofiles`: Add ProfilesRouterAndConsumer interface, and NewProfilesRouter method. (#11023) +- `pprofileotlp`: Introduce grpc service implementation of pprofileotlp (#11048) +- `pprofile`: Introduce marshalling and unmarshalling of pprofile data (#11048) +- `service`: Support profiles in the service package (#11024) + ## v1.14.1/v0.108.1 ## v1.14.0/v0.108.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b06b63722a..67e004eb6df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,51 @@ If you are looking for developer-facing changes, check out [CHANGELOG-API.md](./ +## v1.15.0/v0.109.0 + +### 🛑 Breaking changes 🛑 + +- `scraperhelper`: Remove deprecated `ObsReport`, `ObsReportSettings`, `NewObsReport` types/funcs (#11086) +- `confmap`: Remove stable `confmap.strictlyTypedInput` gate (#11008) +- `confmap`: Removes stable `confmap.unifyEnvVarExpansion` feature gate. (#11007) +- `ballastextension`: Removes the deprecated ballastextension (#10671) +- `service`: Removes stable `service.disableOpenCensusBridge` feature gate (#11009) + +### 🚩 Deprecations 🚩 + +- `processorhelper`: These funcs are not used anywhere, marking them deprecated. (#11083) + +### 🚀 New components 🚀 + +- `extension/experimental/storage`: Move `extension/experimental/storage` into a separate module (#11022) + +### 💡 Enhancements 💡 + +- `configtelemetry`: Add guidelines for each level of component telemetry (#10286) +- `service`: move `useOtelWithSDKConfigurationForInternalTelemetry` gate to beta (#11091) +- `service`: implement a no-op tracer provider that doesn't propagate the context (#11026) + The no-op tracer provider supported by the SDK incurs a memory cost of propagating the context no matter + what. This is not needed if tracing is not enabled in the Collector. This implementation of the no-op tracer + provider removes the need to allocate memory when tracing is disabled. + +- `envprovider`: Mark module as stable (#10982) +- `fileprovider`: Mark module as stable (#10983) +- `processor`: Add incoming and outgoing counts for processors using processorhelper. (#10910) + Any processor using the processorhelper package (this is most processors) will automatically report + incoming and outgoing item counts. The new metrics are: + - otelcol_processor_incoming_spans + - otelcol_processor_outgoing_spans + - otelcol_processor_incoming_metric_points + - otelcol_processor_outgoing_metric_points + - otelcol_processor_incoming_log_records + - otelcol_processor_outgoing_log_records + + +### 🧰 Bug fixes 🧰 + +- `configgrpc`: Change the value of max_recv_msg_size_mib from uint64 to int to avoid a case where misconfiguration caused an integer overflow. (#10948) +- `exporterqueue`: Fix a bug in persistent queue that Offer can becomes deadlocked when queue is almost full (#11015) + ## v1.14.1/v0.108.1 ### 🧰 Bug fixes 🧰 @@ -235,7 +280,7 @@ This release includes 2 very important breaking changes. - Stop doing most kinds of implicit type casting when resolving configuration values - Use the original string representation of configuration values if the ${} syntax is used in inline position -- `confighttp`: Use `confighttp.ServerConfig` as part of zpagesextension. See [https://github.com/open-telemetry/opentelemetry-collector/blob/main/config/confighttp/README.md#server-configuration](server configuration) options. (#9368) +- `confighttp`: Use `confighttp.ServerConfig` as part of zpagesextension. See [server configuration](https://github.com/open-telemetry/opentelemetry-collector/blob/main/config/confighttp/README.md#server-configuration) options. (#9368) ### 🧰 Bug fixes 🧰 @@ -2160,9 +2205,9 @@ There isn't a valid core binary for this release. Use v0.57.2 instead. - Deprecate global flag in `featuregates` (#5060) - Deprecate last funcs/structs in componenthelper (#5069) - Change structs in otlpgrpc to follow standard go encoding interfaces (#5062) - - Deprecate UnmarshalJSON[Traces|Metrics|Logs][Reques|Response] in favor of `UnmarshalJSON`. - - Deprecate [Traces|Metrics|Logs][Reques|Response].Marshal in favor of `MarshalProto`. - - Deprecate UnmarshalJSON[Traces|Metrics|Logs][Reques|Response] in favor of `UnmarshalProto`. + - Deprecate `UnmarshalJSON[Traces|Metrics|Logs][Reques|Response]` in favor of `UnmarshalJSON`. + - Deprecate `[Traces|Metrics|Logs][Reques|Response].Marshal` in favor of `MarshalProto`. + - Deprecate `UnmarshalJSON[Traces|Metrics|Logs][Reques|Response]` in favor of `UnmarshalProto`. - Deprecating following pdata methods/types following OTLP v0.15.0 upgrade (#5076): - InstrumentationLibrary is now InstrumentationScope - NewInstrumentationLibrary is now NewInstrumentationScope @@ -2662,7 +2707,7 @@ This release is marked as "bad" since the metrics pipelines will produce bad dat - Remove Resize() from pdata slice APIs (#3675) - Remove the ballast allocation when `mem-ballast-size-mib` is set in command line (#3626) - - Use [`ballast extension`](./extension/ballastextension/README.md) to set memory ballast instead. + - Use `ballast extension` to set memory ballast instead. - Rename `DoubleDataPoint` to `NumberDataPoint` (#3633) - Remove `IntHistogram` (#3676) diff --git a/Makefile b/Makefile index b05559316c2..d27740260b1 100644 --- a/Makefile +++ b/Makefile @@ -56,6 +56,10 @@ gotest-with-cover: @$(MAKE) for-all-target TARGET="test-with-cover" $(GOCMD) tool covdata textfmt -i=./coverage/unit -o ./coverage.txt +.PHONY: gotestifylint-fix +gotestifylint-fix: + $(MAKE) for-all-target TARGET="testifylint-fix" + .PHONY: goporto goporto: $(PORTO) $(PORTO) -w --include-internal --skip-dirs "^cmd/mdatagen/third_party$$" ./ @@ -286,6 +290,7 @@ check-contrib: -replace go.opentelemetry.io/collector/consumer/consumertest=$(CURDIR)/consumer/consumertest \ -replace go.opentelemetry.io/collector/exporter=$(CURDIR)/exporter \ -replace go.opentelemetry.io/collector/exporter/debugexporter=$(CURDIR)/exporter/debugexporter \ + -replace go.opentelemetry.io/collector/exporter/exporterprofiles=$(CURDIR)/exporter/exporterprofiles \ -replace go.opentelemetry.io/collector/exporter/loggingexporter=$(CURDIR)/exporter/loggingexporter \ -replace go.opentelemetry.io/collector/exporter/nopexporter=$(CURDIR)/exporter/nopexporter \ -replace go.opentelemetry.io/collector/exporter/otlpexporter=$(CURDIR)/exporter/otlpexporter \ @@ -293,7 +298,7 @@ check-contrib: -replace go.opentelemetry.io/collector/extension=$(CURDIR)/extension \ -replace go.opentelemetry.io/collector/extension/auth=$(CURDIR)/extension/auth \ -replace go.opentelemetry.io/collector/extension/experimental/storage=$(CURDIR)/extension/experimental/storage \ - -replace go.opentelemetry.io/collector/extension/ballastextension=$(CURDIR)/extension/ballastextension \ + -replace go.opentelemetry.io/collector/extension/extensioncapabilities=$(CURDIR)/extension/extensioncapabilities \ -replace go.opentelemetry.io/collector/extension/memorylimiterextension=$(CURDIR)/extension/memorylimiterextension \ -replace go.opentelemetry.io/collector/extension/zpagesextension=$(CURDIR)/extension/zpagesextension \ -replace go.opentelemetry.io/collector/featuregate=$(CURDIR)/featuregate \ @@ -306,9 +311,11 @@ check-contrib: -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 \ + -replace go.opentelemetry.io/collector/processor/processorprofiles=$(CURDIR)/processor/processorprofiles \ -replace go.opentelemetry.io/collector/receiver=$(CURDIR)/receiver \ -replace go.opentelemetry.io/collector/receiver/nopreceiver=$(CURDIR)/receiver/nopreceiver \ -replace go.opentelemetry.io/collector/receiver/otlpreceiver=$(CURDIR)/receiver/otlpreceiver \ + -replace go.opentelemetry.io/collector/receiver/receiverprofiles=$(CURDIR)/receiver/receiverprofiles \ -replace go.opentelemetry.io/collector/semconv=$(CURDIR)/semconv \ -replace go.opentelemetry.io/collector/service=$(CURDIR)/service" @$(MAKE) -C $(CONTRIB_PATH) gotidy @@ -358,7 +365,6 @@ restore-contrib: -dropreplace go.opentelemetry.io/collector/exporter/otlphttpexporter \ -dropreplace go.opentelemetry.io/collector/extension \ -dropreplace go.opentelemetry.io/collector/extension/auth \ - -dropreplace go.opentelemetry.io/collector/extension/ballastextension \ -dropreplace go.opentelemetry.io/collector/extension/memorylimiterextension \ -dropreplace go.opentelemetry.io/collector/extension/zpagesextension \ -dropreplace go.opentelemetry.io/collector/featuregate \ diff --git a/Makefile.Common b/Makefile.Common index 15c1407d446..d0e8a2615f4 100644 --- a/Makefile.Common +++ b/Makefile.Common @@ -36,6 +36,9 @@ MULTIMOD := $(TOOLS_BIN_DIR)/multimod PORTO := $(TOOLS_BIN_DIR)/porto SEMCONVGEN := $(TOOLS_BIN_DIR)/semconvgen SEMCONVKIT := $(TOOLS_BIN_DIR)/semconvkit +TESTIFYLINT := $(TOOLS_BIN_DIR)/testifylint + +TESTIFYLINT_OPT?= --enable-all --disable=float-compare,formatter,go-require,require-error .PHONY: install-tools install-tools: $(TOOLS_BIN_NAMES) @@ -88,3 +91,9 @@ impi: $(IMPI) .PHONY: moddownload moddownload: $(GOCMD) mod download + +.PHONY: testifylint-fix +testifylint-fix:$(TESTIFYLINT) + @echo "running $(TESTIFYLINT)" + @$(TESTIFYLINT) $(TESTIFYLINT_OPT) -fix ./... + diff --git a/client/client_test.go b/client/client_test.go index ddec6bd89dd..37f300de496 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -71,7 +71,7 @@ func TestFromContext(t *testing.T) { } for _, tC := range testCases { t.Run(tC.desc, func(t *testing.T) { - assert.Equal(t, FromContext(tC.input), tC.expected) + assert.Equal(t, tC.expected, FromContext(tC.input)) }) } } diff --git a/client/go.mod b/client/go.mod index 7b759acbca9..4a63147c416 100644 --- a/client/go.mod +++ b/client/go.mod @@ -4,8 +4,8 @@ go 1.22.0 require ( github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector/consumer v0.108.1 - go.opentelemetry.io/collector/pdata v1.14.1 + go.opentelemetry.io/collector/consumer v0.109.0 + go.opentelemetry.io/collector/pdata v1.15.0 go.uber.org/goleak v1.3.0 ) @@ -18,11 +18,11 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/net v0.25.0 // indirect - golang.org/x/sys v0.20.0 // indirect - golang.org/x/text v0.15.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect - google.golang.org/grpc v1.65.0 // indirect + golang.org/x/net v0.26.0 // indirect + golang.org/x/sys v0.21.0 // indirect + golang.org/x/text v0.16.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect + google.golang.org/grpc v1.66.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/client/go.sum b/client/go.sum index 2d7de4069f1..a0d13c568ed 100644 --- a/client/go.sum +++ b/client/go.sum @@ -43,20 +43,20 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= -golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= +golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.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.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= -golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -65,10 +65,10 @@ 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/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 h1:Zy9XzmMEflZ/MAaA7vNcoebnRAld7FsPW1EeBB7V0m8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 h1:1GBuWVLM/KMVUv1t1En5Gs+gFZCNd360GGb4sSxtrhU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= 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= diff --git a/cmd/builder/go.mod b/cmd/builder/go.mod index e724b8c175d..7665cae3f4e 100644 --- a/cmd/builder/go.mod +++ b/cmd/builder/go.mod @@ -18,7 +18,7 @@ require ( go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.27.0 - golang.org/x/mod v0.20.0 + golang.org/x/mod v0.21.0 ) require ( diff --git a/cmd/builder/go.sum b/cmd/builder/go.sum index dfdbd91a46b..f4327961190 100644 --- a/cmd/builder/go.sum +++ b/cmd/builder/go.sum @@ -52,8 +52,8 @@ go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= -golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= -golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= +golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/cmd/builder/internal/builder/config.go b/cmd/builder/internal/builder/config.go index a7949b303e8..8de7ed3d82c 100644 --- a/cmd/builder/internal/builder/config.go +++ b/cmd/builder/internal/builder/config.go @@ -17,7 +17,7 @@ import ( "go.uber.org/zap" ) -const defaultOtelColVersion = "0.108.1" +const defaultOtelColVersion = "0.109.0" // ErrMissingGoMod indicates an empty gomod field var ErrMissingGoMod = errors.New("missing gomod specification for module") diff --git a/cmd/builder/internal/builder/config_test.go b/cmd/builder/internal/builder/config_test.go index 9daf158cb8e..60e1b426ee2 100644 --- a/cmd/builder/internal/builder/config_test.go +++ b/cmd/builder/internal/builder/config_test.go @@ -4,7 +4,6 @@ package builder import ( - "errors" "os" "strings" "testing" @@ -143,7 +142,7 @@ func TestMissingModule(t *testing.T) { } for _, test := range configurations { - assert.True(t, errors.Is(test.cfg.Validate(), test.err)) + assert.ErrorIs(t, test.cfg.Validate(), test.err) } } @@ -171,10 +170,10 @@ func TestNewBuiltinConfig(t *testing.T) { // Unlike the config initialized in NewDefaultConfig(), we expect // the builtin default to be practically useful, so there must be // a set of modules present. - assert.NotZero(t, len(cfg.Receivers)) - assert.NotZero(t, len(cfg.Exporters)) - assert.NotZero(t, len(cfg.Extensions)) - assert.NotZero(t, len(cfg.Processors)) + assert.NotEmpty(t, cfg.Receivers) + assert.NotEmpty(t, cfg.Exporters) + assert.NotEmpty(t, cfg.Extensions) + assert.NotEmpty(t, cfg.Processors) } func TestSkipGoValidation(t *testing.T) { diff --git a/cmd/builder/internal/builder/main_test.go b/cmd/builder/internal/builder/main_test.go index beb86c9117c..400740610cf 100644 --- a/cmd/builder/internal/builder/main_test.go +++ b/cmd/builder/internal/builder/main_test.go @@ -74,6 +74,7 @@ var ( "/extension", "/extension/auth", "/extension/experimental/storage", + "/extension/extensioncapabilities", "/extension/zpagesextension", "/featuregate", "/internal/globalgates", diff --git a/cmd/builder/internal/command.go b/cmd/builder/internal/command.go index a738fb1c1f1..3af77178727 100644 --- a/cmd/builder/internal/command.go +++ b/cmd/builder/internal/command.go @@ -84,7 +84,7 @@ configuration is provided, ocb will generate a default Collector. cmd.Flags().BoolVar(&cfg.SkipGenerate, skipGenerateFlag, false, "Whether builder should skip generating go code (default false)") cmd.Flags().BoolVar(&cfg.SkipCompilation, skipCompilationFlag, false, "Whether builder should only generate go code with no compile of the collector (default false)") cmd.Flags().BoolVar(&cfg.SkipGetModules, skipGetModulesFlag, false, "Whether builder should skip updating go.mod and retrieve Go module list (default false)") - cmd.Flags().BoolVar(&cfg.SkipStrictVersioning, skipStrictVersioningFlag, false, "Whether builder should skip strictly checking the calculated versions following dependency resolution") + cmd.Flags().BoolVar(&cfg.SkipStrictVersioning, skipStrictVersioningFlag, true, "Whether builder should skip strictly checking the calculated versions following dependency resolution") cmd.Flags().BoolVar(&cfg.Verbose, verboseFlag, false, "Whether builder should print verbose output (default false)") cmd.Flags().StringVar(&cfg.LDFlags, ldflagsFlag, "", `ldflags to include in the "go build" command`) cmd.Flags().StringVar(&cfg.Distribution.Name, distributionNameFlag, "otelcol-custom", "The executable name for the OpenTelemetry Collector distribution") diff --git a/cmd/builder/internal/command_test.go b/cmd/builder/internal/command_test.go index d071efb312d..2f2a68f69ef 100644 --- a/cmd/builder/internal/command_test.go +++ b/cmd/builder/internal/command_test.go @@ -257,7 +257,7 @@ func Test_applyCfgFromFile(t *testing.T) { assert.Equal(t, tt.want.SkipGenerate, cfg.SkipGenerate) assert.Equal(t, tt.want.SkipCompilation, cfg.SkipCompilation) assert.Equal(t, tt.want.SkipGetModules, cfg.SkipGetModules) - assert.Equal(t, tt.want.SkipStrictVersioning, cfg.SkipStrictVersioning) + assert.True(t, cfg.SkipStrictVersioning) assert.Equal(t, tt.want.Excludes, cfg.Excludes) assert.Equal(t, tt.want.Exporters, cfg.Exporters) assert.Equal(t, tt.want.Receivers, cfg.Receivers) diff --git a/cmd/builder/internal/config/default.yaml b/cmd/builder/internal/config/default.yaml index 4d28b5b3b63..07c8a820a64 100644 --- a/cmd/builder/internal/config/default.yaml +++ b/cmd/builder/internal/config/default.yaml @@ -10,32 +10,30 @@ dist: module: go.opentelemetry.io/collector/cmd/otelcorecol name: otelcorecol description: Local OpenTelemetry Collector binary, testing only. - version: 0.108.1-dev - otelcol_version: 0.108.1 + version: 0.109.0-dev + otelcol_version: 0.109.0 receivers: - - gomod: go.opentelemetry.io/collector/receiver/nopreceiver v0.108.1 - - gomod: go.opentelemetry.io/collector/receiver/otlpreceiver v0.108.1 + - gomod: go.opentelemetry.io/collector/receiver/nopreceiver v0.109.0 + - gomod: go.opentelemetry.io/collector/receiver/otlpreceiver v0.109.0 exporters: - - gomod: go.opentelemetry.io/collector/exporter/debugexporter v0.108.1 - - gomod: go.opentelemetry.io/collector/exporter/loggingexporter v0.108.1 - - gomod: go.opentelemetry.io/collector/exporter/nopexporter v0.108.1 - - gomod: go.opentelemetry.io/collector/exporter/otlpexporter v0.108.1 - - gomod: go.opentelemetry.io/collector/exporter/otlphttpexporter v0.108.1 + - gomod: go.opentelemetry.io/collector/exporter/debugexporter v0.109.0 + - gomod: go.opentelemetry.io/collector/exporter/loggingexporter v0.109.0 + - gomod: go.opentelemetry.io/collector/exporter/nopexporter v0.109.0 + - gomod: go.opentelemetry.io/collector/exporter/otlpexporter v0.109.0 + - gomod: go.opentelemetry.io/collector/exporter/otlphttpexporter v0.109.0 extensions: - - gomod: go.opentelemetry.io/collector/extension/ballastextension v0.108.1 - - gomod: go.opentelemetry.io/collector/extension/memorylimiterextension v0.108.1 - - gomod: go.opentelemetry.io/collector/extension/zpagesextension v0.108.1 + - gomod: go.opentelemetry.io/collector/extension/memorylimiterextension v0.109.0 + - gomod: go.opentelemetry.io/collector/extension/zpagesextension v0.109.0 processors: - - gomod: go.opentelemetry.io/collector/processor/batchprocessor v0.108.1 - - gomod: go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.108.1 + - gomod: go.opentelemetry.io/collector/processor/batchprocessor v0.109.0 + - gomod: go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.109.0 connectors: - - gomod: go.opentelemetry.io/collector/connector/forwardconnector v0.108.1 + - gomod: go.opentelemetry.io/collector/connector/forwardconnector v0.109.0 providers: - - gomod: go.opentelemetry.io/collector/confmap/provider/envprovider v0.108.1 - - gomod: go.opentelemetry.io/collector/confmap/provider/fileprovider v0.108.1 - - gomod: go.opentelemetry.io/collector/confmap/provider/httpprovider v0.108.1 - - gomod: go.opentelemetry.io/collector/confmap/provider/httpsprovider v0.108.1 - - gomod: go.opentelemetry.io/collector/confmap/provider/yamlprovider v0.108.1 - + - gomod: go.opentelemetry.io/collector/confmap/provider/envprovider v1.15.0 + - gomod: go.opentelemetry.io/collector/confmap/provider/fileprovider v1.15.0 + - gomod: go.opentelemetry.io/collector/confmap/provider/httpprovider v0.109.0 + - gomod: go.opentelemetry.io/collector/confmap/provider/httpsprovider v0.109.0 + - gomod: go.opentelemetry.io/collector/confmap/provider/yamlprovider v0.109.0 diff --git a/cmd/builder/test/core.builder.yaml b/cmd/builder/test/core.builder.yaml index 2ea0f8b3590..866a625a91b 100644 --- a/cmd/builder/test/core.builder.yaml +++ b/cmd/builder/test/core.builder.yaml @@ -1,21 +1,15 @@ dist: module: go.opentelemetry.io/collector/builder/test/core - otelcol_version: 0.108.1 + otelcol_version: 0.109.0 extensions: - - import: go.opentelemetry.io/collector/extension/zpagesextension - gomod: go.opentelemetry.io/collector v0.108.1 - path: ${WORKSPACE_DIR} + - gomod: go.opentelemetry.io/collector/extension/zpagesextension v0.109.0 receivers: - - import: go.opentelemetry.io/collector/receiver/otlpreceiver - gomod: go.opentelemetry.io/collector v0.108.1 - path: ${WORKSPACE_DIR} + - gomod: go.opentelemetry.io/collector/receiver/otlpreceiver v0.109.0 exporters: - - import: go.opentelemetry.io/collector/exporter/debugexporter - gomod: go.opentelemetry.io/collector v0.108.1 - path: ${WORKSPACE_DIR} + - gomod: go.opentelemetry.io/collector/exporter/debugexporter v0.109.0 replaces: - go.opentelemetry.io/collector => ${WORKSPACE_DIR} @@ -47,9 +41,11 @@ replaces: - go.opentelemetry.io/collector/exporter => ${WORKSPACE_DIR}/exporter - go.opentelemetry.io/collector/exporter/debugexporter => ${WORKSPACE_DIR}/exporter/debugexporter - go.opentelemetry.io/collector/exporter/loggingexporter => ${WORKSPACE_DIR}/exporter/loggingexporter + - go.opentelemetry.io/collector/exporter/exporterprofiles => ${WORKSPACE_DIR}/exporter/exporterprofiles - go.opentelemetry.io/collector/extension => ${WORKSPACE_DIR}/extension - go.opentelemetry.io/collector/extension/auth => ${WORKSPACE_DIR}/extension/auth - go.opentelemetry.io/collector/extension/experimental/storage => ${WORKSPACE_DIR}/extension/experimental/storage + - 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 @@ -59,7 +55,9 @@ 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/processor => ${WORKSPACE_DIR}/processor + - go.opentelemetry.io/collector/processor/processorprofiles => ${WORKSPACE_DIR}/processor/processorprofiles - go.opentelemetry.io/collector/receiver => ${WORKSPACE_DIR}/receiver - go.opentelemetry.io/collector/receiver/otlpreceiver => ${WORKSPACE_DIR}/receiver/otlpreceiver + - go.opentelemetry.io/collector/receiver/receiverprofiles => ${WORKSPACE_DIR}/receiver/receiverprofiles - go.opentelemetry.io/collector/semconv => ${WORKSPACE_DIR}/semconv - go.opentelemetry.io/collector/service => ${WORKSPACE_DIR}/service diff --git a/cmd/mdatagen/go.mod b/cmd/mdatagen/go.mod index 6f7dcb8f366..5e4d0d93e12 100644 --- a/cmd/mdatagen/go.mod +++ b/cmd/mdatagen/go.mod @@ -5,22 +5,22 @@ go 1.22.0 require ( github.com/google/go-cmp v0.6.0 github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector/component v0.108.1 - go.opentelemetry.io/collector/config/configtelemetry v0.108.1 - go.opentelemetry.io/collector/confmap v1.14.1 - go.opentelemetry.io/collector/confmap/provider/fileprovider v0.108.1 - go.opentelemetry.io/collector/consumer v0.108.1 - go.opentelemetry.io/collector/consumer/consumertest v0.108.1 - go.opentelemetry.io/collector/filter v0.108.1 - go.opentelemetry.io/collector/pdata v1.14.1 - go.opentelemetry.io/collector/receiver v0.108.1 - go.opentelemetry.io/collector/semconv v0.108.1 - go.opentelemetry.io/otel/metric v1.29.0 - go.opentelemetry.io/otel/sdk/metric v1.29.0 - go.opentelemetry.io/otel/trace v1.29.0 + go.opentelemetry.io/collector/component v0.109.0 + go.opentelemetry.io/collector/config/configtelemetry v0.109.0 + go.opentelemetry.io/collector/confmap v1.15.0 + go.opentelemetry.io/collector/confmap/provider/fileprovider v1.15.0 + go.opentelemetry.io/collector/consumer v0.109.0 + go.opentelemetry.io/collector/consumer/consumertest v0.109.0 + go.opentelemetry.io/collector/filter v0.109.0 + go.opentelemetry.io/collector/pdata v1.15.0 + go.opentelemetry.io/collector/receiver v0.109.0 + go.opentelemetry.io/collector/semconv v0.109.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.uber.org/goleak v1.3.0 go.uber.org/zap v1.27.0 - golang.org/x/text v0.17.0 + golang.org/x/text v0.18.0 ) require ( @@ -43,21 +43,21 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.20.2 // indirect + github.com/prometheus/client_golang v1.20.3 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.56.0 // indirect + github.com/prometheus/common v0.59.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect - go.opentelemetry.io/collector/consumer/consumerprofiles v0.108.1 // indirect - go.opentelemetry.io/collector/pdata/pprofile v0.108.1 // indirect - go.opentelemetry.io/collector/receiver/receiverprofiles v0.108.1 // indirect - go.opentelemetry.io/otel v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.51.0 // indirect - go.opentelemetry.io/otel/sdk v1.29.0 // indirect + go.opentelemetry.io/collector/consumer/consumerprofiles v0.109.0 // indirect + go.opentelemetry.io/collector/pdata/pprofile v0.109.0 // indirect + go.opentelemetry.io/collector/receiver/receiverprofiles v0.109.0 // indirect + go.opentelemetry.io/otel v1.30.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect + go.opentelemetry.io/otel/sdk v1.30.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.24.0 // indirect + golang.org/x/sys v0.25.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd // indirect - google.golang.org/grpc v1.65.0 // indirect + google.golang.org/grpc v1.66.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) @@ -78,12 +78,8 @@ replace go.opentelemetry.io/collector/receiver => ../../receiver replace go.opentelemetry.io/collector/semconv => ../../semconv -replace go.opentelemetry.io/collector/featuregate => ../../featuregate - replace go.opentelemetry.io/collector/consumer => ../../consumer -replace go.opentelemetry.io/collector => ../.. - replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/configtelemetry retract ( @@ -98,6 +94,4 @@ replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../../consume replace go.opentelemetry.io/collector/consumer/consumertest => ../../consumer/consumertest -replace go.opentelemetry.io/collector/component/componentstatus => ../../component/componentstatus - replace go.opentelemetry.io/collector/receiver/receiverprofiles => ../../receiver/receiverprofiles diff --git a/cmd/mdatagen/go.sum b/cmd/mdatagen/go.sum index 916c7ef13dd..1dd1a3915b5 100644 --- a/cmd/mdatagen/go.sum +++ b/cmd/mdatagen/go.sum @@ -50,12 +50,12 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg= -github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= +github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.56.0 h1:UffReloqkBtvtQEYDg2s+uDPGRrJyC6vZWPGXf6OhPY= -github.com/prometheus/common v0.56.0/go.mod h1:7uRPFSUTbfZWsJ7MHY56sqt7hLQu3bxXHDnNhl8E9qI= +github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= +github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= @@ -66,18 +66,18 @@ 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.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= -go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0 h1:G7uexXb/K3T+T9fNLCCKncweEtNEBMTO+46hKX5EdKw= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0/go.mod h1:v0mFe5Kk7woIh938mrZBJBmENYquyA0IICrlYm4Y0t4= -go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= -go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= -go.opentelemetry.io/otel/sdk v1.29.0 h1:vkqKjk7gwhS8VaWb0POZKmIEDimRCMsopNYnriHyryo= -go.opentelemetry.io/otel/sdk v1.29.0/go.mod h1:pM8Dx5WKnvxLCb+8lG1PRNIDxu9g9b9g59Qr7hfAAok= -go.opentelemetry.io/otel/sdk/metric v1.29.0 h1:K2CfmJohnRgvZ9UAj2/FhIf/okdWcNdBwe1m8xFXiSY= -go.opentelemetry.io/otel/sdk/metric v1.29.0/go.mod h1:6zZLdCl2fkauYoZIOn/soQIDSWFmNSRcICarHfuhNJQ= -go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= -go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= +go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= +go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= +go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= +go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= +go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= +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.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= @@ -101,12 +101,12 @@ 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.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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= -golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -117,8 +117,8 @@ 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= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd h1:6TEm2ZxXoQmFWFlt1vNxvVOa1Q0dXFQD1m/rYjXmS0E= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= 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= diff --git a/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_metrics.go b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_metrics.go index b05bf39206d..1e345a799b7 100644 --- a/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_metrics.go +++ b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_metrics.go @@ -331,17 +331,25 @@ type MetricsBuilder struct { metricOptionalMetricEmptyUnit metricOptionalMetricEmptyUnit } -// metricBuilderOption applies changes to default metrics builder. -type metricBuilderOption func(*MetricsBuilder) +// MetricBuilderOption applies changes to default metrics builder. +type MetricBuilderOption interface { + apply(*MetricsBuilder) +} + +type metricBuilderOptionFunc func(mb *MetricsBuilder) + +func (mbof metricBuilderOptionFunc) apply(mb *MetricsBuilder) { + mbof(mb) +} // WithStartTime sets startTime on the metrics builder. -func WithStartTime(startTime pcommon.Timestamp) metricBuilderOption { - return func(mb *MetricsBuilder) { +func WithStartTime(startTime pcommon.Timestamp) MetricBuilderOption { + return metricBuilderOptionFunc(func(mb *MetricsBuilder) { mb.startTime = startTime - } + }) } -func NewMetricsBuilder(mbc MetricsBuilderConfig, settings receiver.Settings, options ...metricBuilderOption) *MetricsBuilder { +func NewMetricsBuilder(mbc MetricsBuilderConfig, settings receiver.Settings, options ...MetricBuilderOption) *MetricsBuilder { if !mbc.Metrics.DefaultMetric.enabledSetByUser { settings.Logger.Warn("[WARNING] Please set `enabled` field explicitly for `default.metric`: This metric will be disabled by default soon.") } @@ -426,7 +434,7 @@ func NewMetricsBuilder(mbc MetricsBuilderConfig, settings receiver.Settings, opt } for _, op := range options { - op(mb) + op.apply(mb) } return mb } @@ -444,20 +452,28 @@ func (mb *MetricsBuilder) updateCapacity(rm pmetric.ResourceMetrics) { } // ResourceMetricsOption applies changes to provided resource metrics. -type ResourceMetricsOption func(pmetric.ResourceMetrics) +type ResourceMetricsOption interface { + apply(pmetric.ResourceMetrics) +} + +type resourceMetricsOptionFunc func(pmetric.ResourceMetrics) + +func (rmof resourceMetricsOptionFunc) apply(rm pmetric.ResourceMetrics) { + rmof(rm) +} // WithResource sets the provided resource on the emitted ResourceMetrics. // It's recommended to use ResourceBuilder to create the resource. func WithResource(res pcommon.Resource) ResourceMetricsOption { - return func(rm pmetric.ResourceMetrics) { + return resourceMetricsOptionFunc(func(rm pmetric.ResourceMetrics) { res.CopyTo(rm.Resource()) - } + }) } // WithStartTimeOverride overrides start time for all the resource metrics data points. // This option should be only used if different start time has to be set on metrics coming from different resources. func WithStartTimeOverride(start pcommon.Timestamp) ResourceMetricsOption { - return func(rm pmetric.ResourceMetrics) { + return resourceMetricsOptionFunc(func(rm pmetric.ResourceMetrics) { var dps pmetric.NumberDataPointSlice metrics := rm.ScopeMetrics().At(0).Metrics() for i := 0; i < metrics.Len(); i++ { @@ -471,7 +487,7 @@ func WithStartTimeOverride(start pcommon.Timestamp) ResourceMetricsOption { dps.At(j).SetStartTimestamp(start) } } - } + }) } // EmitForResource saves all the generated metrics under a new resource and updates the internal state to be ready for @@ -479,7 +495,7 @@ func WithStartTimeOverride(start pcommon.Timestamp) ResourceMetricsOption { // needs to emit metrics from several resources. Otherwise calling this function is not required, // just `Emit` function can be called instead. // Resource attributes should be provided as ResourceMetricsOption arguments. -func (mb *MetricsBuilder) EmitForResource(rmo ...ResourceMetricsOption) { +func (mb *MetricsBuilder) EmitForResource(options ...ResourceMetricsOption) { rm := pmetric.NewResourceMetrics() rm.SetSchemaUrl(conventions.SchemaURL) ils := rm.ScopeMetrics().AppendEmpty() @@ -492,8 +508,8 @@ func (mb *MetricsBuilder) EmitForResource(rmo ...ResourceMetricsOption) { mb.metricOptionalMetric.emit(ils.Metrics()) mb.metricOptionalMetricEmptyUnit.emit(ils.Metrics()) - for _, op := range rmo { - op(rm) + for _, op := range options { + op.apply(rm) } for attr, filter := range mb.resourceAttributeIncludeFilter { if val, ok := rm.Resource().Attributes().Get(attr); ok && !filter.Matches(val.AsString()) { @@ -515,8 +531,8 @@ func (mb *MetricsBuilder) EmitForResource(rmo ...ResourceMetricsOption) { // Emit returns all the metrics accumulated by the metrics builder and updates the internal state to be ready for // recording another set of metrics. This function will be responsible for applying all the transformations required to // produce metric representation defined in metadata and user config, e.g. delta or cumulative. -func (mb *MetricsBuilder) Emit(rmo ...ResourceMetricsOption) pmetric.Metrics { - mb.EmitForResource(rmo...) +func (mb *MetricsBuilder) Emit(options ...ResourceMetricsOption) pmetric.Metrics { + mb.EmitForResource(options...) metrics := mb.metricsBuffer mb.metricsBuffer = pmetric.NewMetrics() return metrics @@ -554,9 +570,9 @@ func (mb *MetricsBuilder) RecordOptionalMetricEmptyUnitDataPoint(ts pcommon.Time // Reset resets metrics builder to its initial state. It should be used when external metrics source is restarted, // and metrics builder should update its startTime and reset it's internal state accordingly. -func (mb *MetricsBuilder) Reset(options ...metricBuilderOption) { +func (mb *MetricsBuilder) Reset(options ...MetricBuilderOption) { mb.startTime = pcommon.NewTimestampFromTime(time.Now()) for _, op := range options { - op(mb) + op.apply(mb) } } diff --git a/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_metrics_test.go b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_metrics_test.go index 657e400408b..f4100521330 100644 --- a/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_metrics_test.go +++ b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_metrics_test.go @@ -153,7 +153,7 @@ func TestMetricsBuilder(t *testing.T) { assert.Equal(t, 1, ms.At(i).Sum().DataPoints().Len()) assert.Equal(t, "Monotonic cumulative sum int metric enabled by default.", ms.At(i).Description()) assert.Equal(t, "s", ms.At(i).Unit()) - assert.Equal(t, true, ms.At(i).Sum().IsMonotonic()) + assert.True(t, ms.At(i).Sum().IsMonotonic()) assert.Equal(t, pmetric.AggregationTemporalityCumulative, ms.At(i).Sum().AggregationTemporality()) dp := ms.At(i).Sum().DataPoints().At(0) assert.Equal(t, start, dp.StartTimestamp()) @@ -182,7 +182,7 @@ func TestMetricsBuilder(t *testing.T) { assert.Equal(t, 1, ms.At(i).Sum().DataPoints().Len()) assert.Equal(t, "[DEPRECATED] Non-monotonic delta sum double metric enabled by default.", ms.At(i).Description()) assert.Equal(t, "s", ms.At(i).Unit()) - assert.Equal(t, false, ms.At(i).Sum().IsMonotonic()) + assert.False(t, ms.At(i).Sum().IsMonotonic()) assert.Equal(t, pmetric.AggregationTemporalityDelta, ms.At(i).Sum().AggregationTemporality()) dp := ms.At(i).Sum().DataPoints().At(0) assert.Equal(t, start, dp.StartTimestamp()) @@ -196,7 +196,7 @@ func TestMetricsBuilder(t *testing.T) { assert.Equal(t, 1, ms.At(i).Sum().DataPoints().Len()) assert.Equal(t, "Monotonic cumulative sum int metric with string input_type enabled by default.", ms.At(i).Description()) assert.Equal(t, "s", ms.At(i).Unit()) - assert.Equal(t, true, ms.At(i).Sum().IsMonotonic()) + assert.True(t, ms.At(i).Sum().IsMonotonic()) assert.Equal(t, pmetric.AggregationTemporalityCumulative, ms.At(i).Sum().AggregationTemporality()) dp := ms.At(i).Sum().DataPoints().At(0) assert.Equal(t, start, dp.StartTimestamp()) @@ -235,7 +235,7 @@ func TestMetricsBuilder(t *testing.T) { assert.EqualValues(t, "string_attr-val", attrVal.Str()) attrVal, ok = dp.Attributes().Get("boolean_attr") assert.True(t, ok) - assert.EqualValues(t, true, attrVal.Bool()) + assert.True(t, attrVal.Bool()) case "optional.metric.empty_unit": assert.False(t, validatedMetrics["optional.metric.empty_unit"], "Found a duplicate in the metrics slice: optional.metric.empty_unit") validatedMetrics["optional.metric.empty_unit"] = true @@ -253,7 +253,7 @@ func TestMetricsBuilder(t *testing.T) { assert.EqualValues(t, "string_attr-val", attrVal.Str()) attrVal, ok = dp.Attributes().Get("boolean_attr") assert.True(t, ok) - assert.EqualValues(t, true, attrVal.Bool()) + assert.True(t, attrVal.Bool()) } } }) diff --git a/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_telemetry.go b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_telemetry.go index 43104bedead..17685ad210d 100644 --- a/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_telemetry.go +++ b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_telemetry.go @@ -38,17 +38,25 @@ type TelemetryBuilder struct { meters map[configtelemetry.Level]metric.Meter } -// telemetryBuilderOption applies changes to default builder. -type telemetryBuilderOption func(*TelemetryBuilder) +// TelemetryBuilderOption applies changes to default builder. +type TelemetryBuilderOption interface { + apply(*TelemetryBuilder) +} + +type telemetryBuilderOptionFunc func(mb *TelemetryBuilder) + +func (tbof telemetryBuilderOptionFunc) apply(mb *TelemetryBuilder) { + tbof(mb) +} // WithProcessRuntimeTotalAllocBytesCallback sets callback for observable ProcessRuntimeTotalAllocBytes metric. -func WithProcessRuntimeTotalAllocBytesCallback(cb func() int64, opts ...metric.ObserveOption) telemetryBuilderOption { - return func(builder *TelemetryBuilder) { +func WithProcessRuntimeTotalAllocBytesCallback(cb func() int64, opts ...metric.ObserveOption) TelemetryBuilderOption { + return telemetryBuilderOptionFunc(func(builder *TelemetryBuilder) { builder.observeProcessRuntimeTotalAllocBytes = func(_ context.Context, o metric.Observer) error { o.ObserveInt64(builder.ProcessRuntimeTotalAllocBytes, cb(), opts...) return nil } - } + }) } // InitQueueLength configures the QueueLength metric. @@ -71,10 +79,10 @@ func (builder *TelemetryBuilder) InitQueueLength(cb func() int64, opts ...metric // NewTelemetryBuilder provides a struct with methods to update all internal telemetry // for a component -func NewTelemetryBuilder(settings component.TelemetrySettings, options ...telemetryBuilderOption) (*TelemetryBuilder, error) { +func NewTelemetryBuilder(settings component.TelemetrySettings, options ...TelemetryBuilderOption) (*TelemetryBuilder, error) { builder := TelemetryBuilder{meters: map[configtelemetry.Level]metric.Meter{}} for _, op := range options { - op(&builder) + op.apply(&builder) } builder.meters[configtelemetry.LevelBasic] = LeveledMeter(settings, configtelemetry.LevelBasic) var err, errs error diff --git a/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_telemetry_test.go b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_telemetry_test.go index 2d6767665ff..d34a3f5f639 100644 --- a/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_telemetry_test.go +++ b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_telemetry_test.go @@ -75,9 +75,9 @@ func TestNewTelemetryBuilder(t *testing.T) { TracerProvider: mockTracerProvider{}, } applied := false - _, err := NewTelemetryBuilder(set, func(b *TelemetryBuilder) { + _, err := NewTelemetryBuilder(set, telemetryBuilderOptionFunc(func(b *TelemetryBuilder) { applied = true - }) + })) require.NoError(t, err) require.True(t, applied) } diff --git a/cmd/mdatagen/loader.go b/cmd/mdatagen/loader.go index 9353aae405b..451bc0c5b4d 100644 --- a/cmd/mdatagen/loader.go +++ b/cmd/mdatagen/loader.go @@ -122,7 +122,7 @@ type metric struct { Sum *sum `mapstructure:"sum,omitempty"` // Gauge stores metadata for gauge metric type Gauge *gauge `mapstructure:"gauge,omitempty"` - // Gauge stores metadata for gauge metric type + // Histogram stores metadata for histogram metric type Histogram *histogram `mapstructure:"histogram,omitempty"` // Attributes is the list of attributes that the metric emits. diff --git a/cmd/mdatagen/metadata-schema.yaml b/cmd/mdatagen/metadata-schema.yaml index f746de078fd..eb15a9775cf 100644 --- a/cmd/mdatagen/metadata-schema.yaml +++ b/cmd/mdatagen/metadata-schema.yaml @@ -168,4 +168,5 @@ telemetry: # Bucket boundaries are only available to set for histogram metrics. bucket_boundaries: [double] # Optional: array of attributes that were defined in the attributes section that are emitted by this metric. + # Note: Only the following attribute types are supported: attributes: [string] diff --git a/cmd/mdatagen/templates/metrics.go.tmpl b/cmd/mdatagen/templates/metrics.go.tmpl index a084d847ee8..1a7075d3de4 100644 --- a/cmd/mdatagen/templates/metrics.go.tmpl +++ b/cmd/mdatagen/templates/metrics.go.tmpl @@ -144,17 +144,25 @@ type MetricsBuilder struct { {{- end }} } -// metricBuilderOption applies changes to default metrics builder. -type metricBuilderOption func(*MetricsBuilder) +// MetricBuilderOption applies changes to default metrics builder. +type MetricBuilderOption interface { + apply(*MetricsBuilder) +} + +type metricBuilderOptionFunc func(mb *MetricsBuilder) + +func (mbof metricBuilderOptionFunc) apply(mb *MetricsBuilder) { + mbof(mb) +} // WithStartTime sets startTime on the metrics builder. -func WithStartTime(startTime pcommon.Timestamp) metricBuilderOption { - return func(mb *MetricsBuilder) { +func WithStartTime(startTime pcommon.Timestamp) MetricBuilderOption { + return metricBuilderOptionFunc(func(mb *MetricsBuilder) { mb.startTime = startTime - } + }) } -func NewMetricsBuilder(mbc MetricsBuilderConfig, settings receiver.Settings, options ...metricBuilderOption) *MetricsBuilder { +func NewMetricsBuilder(mbc MetricsBuilderConfig, settings receiver.Settings, options ...MetricBuilderOption) *MetricsBuilder { {{- range $name, $metric := .Metrics }} {{- if $metric.Warnings.IfEnabled }} if mbc.Metrics.{{ $name.Render }}.Enabled { @@ -212,7 +220,7 @@ func NewMetricsBuilder(mbc MetricsBuilderConfig, settings receiver.Settings, opt {{- end }} for _, op := range options { - op(mb) + op.apply(mb) } return mb } @@ -232,20 +240,28 @@ func (mb *MetricsBuilder) updateCapacity(rm pmetric.ResourceMetrics) { } // ResourceMetricsOption applies changes to provided resource metrics. -type ResourceMetricsOption func(pmetric.ResourceMetrics) +type ResourceMetricsOption interface { + apply(pmetric.ResourceMetrics) +} + +type resourceMetricsOptionFunc func(pmetric.ResourceMetrics) + +func (rmof resourceMetricsOptionFunc) apply(rm pmetric.ResourceMetrics) { + rmof(rm) +} // WithResource sets the provided resource on the emitted ResourceMetrics. // It's recommended to use ResourceBuilder to create the resource. func WithResource(res pcommon.Resource) ResourceMetricsOption { - return func(rm pmetric.ResourceMetrics) { + return resourceMetricsOptionFunc(func(rm pmetric.ResourceMetrics) { res.CopyTo(rm.Resource()) - } + }) } // WithStartTimeOverride overrides start time for all the resource metrics data points. // This option should be only used if different start time has to be set on metrics coming from different resources. func WithStartTimeOverride(start pcommon.Timestamp) ResourceMetricsOption { - return func(rm pmetric.ResourceMetrics) { + return resourceMetricsOptionFunc(func(rm pmetric.ResourceMetrics) { var dps pmetric.NumberDataPointSlice metrics := rm.ScopeMetrics().At(0).Metrics() for i := 0; i < metrics.Len(); i++ { @@ -259,7 +275,7 @@ func WithStartTimeOverride(start pcommon.Timestamp) ResourceMetricsOption { dps.At(j).SetStartTimestamp(start) } } - } + }) } // EmitForResource saves all the generated metrics under a new resource and updates the internal state to be ready for @@ -267,7 +283,7 @@ func WithStartTimeOverride(start pcommon.Timestamp) ResourceMetricsOption { // needs to emit metrics from several resources. Otherwise calling this function is not required, // just `Emit` function can be called instead. // Resource attributes should be provided as ResourceMetricsOption arguments. -func (mb *MetricsBuilder) EmitForResource(rmo ...ResourceMetricsOption) { +func (mb *MetricsBuilder) EmitForResource(options ...ResourceMetricsOption) { rm := pmetric.NewResourceMetrics() {{- if .SemConvVersion }} rm.SetSchemaUrl(conventions.SchemaURL) @@ -280,8 +296,8 @@ func (mb *MetricsBuilder) EmitForResource(rmo ...ResourceMetricsOption) { mb.metric{{- $name.Render }}.emit(ils.Metrics()) {{- end }} - for _, op := range rmo { - op(rm) + for _, op := range options { + op.apply(rm) } {{ if .ResourceAttributes -}} for attr, filter := range mb.resourceAttributeIncludeFilter { @@ -305,8 +321,8 @@ func (mb *MetricsBuilder) EmitForResource(rmo ...ResourceMetricsOption) { // Emit returns all the metrics accumulated by the metrics builder and updates the internal state to be ready for // recording another set of metrics. This function will be responsible for applying all the transformations required to // produce metric representation defined in metadata and user config, e.g. delta or cumulative. -func (mb *MetricsBuilder) Emit(rmo ...ResourceMetricsOption) pmetric.Metrics { - mb.EmitForResource(rmo...) +func (mb *MetricsBuilder) Emit(options ...ResourceMetricsOption) pmetric.Metrics { + mb.EmitForResource(options...) metrics := mb.metricsBuffer mb.metricsBuffer = pmetric.NewMetrics() return metrics @@ -344,9 +360,9 @@ func (mb *MetricsBuilder) Record{{ $name.Render }}DataPoint(ts pcommon.Timestamp // Reset resets metrics builder to its initial state. It should be used when external metrics source is restarted, // and metrics builder should update its startTime and reset it's internal state accordingly. -func (mb *MetricsBuilder) Reset(options ...metricBuilderOption) { +func (mb *MetricsBuilder) Reset(options ...MetricBuilderOption) { mb.startTime = pcommon.NewTimestampFromTime(time.Now()) for _, op := range options { - op(mb) + op.apply(mb) } } diff --git a/cmd/mdatagen/templates/metrics_test.go.tmpl b/cmd/mdatagen/templates/metrics_test.go.tmpl index f97e8ef8110..ecb7008960e 100644 --- a/cmd/mdatagen/templates/metrics_test.go.tmpl +++ b/cmd/mdatagen/templates/metrics_test.go.tmpl @@ -164,7 +164,7 @@ func TestMetricsBuilder(t *testing.T) { assert.Equal(t, "{{ $metric.Description }}", ms.At(i).Description()) assert.Equal(t, "{{ $metric.Unit }}", ms.At(i).Unit()) {{- if $metric.Data.HasMonotonic }} - assert.Equal(t, {{ $metric.Data.Monotonic }}, ms.At(i).{{ $metric.Data.Type }}().IsMonotonic()) + assert.{{- if $metric.Data.Monotonic }}True{{ else }}False{{ end }}(t, ms.At(i).{{ $metric.Data.Type }}().IsMonotonic()) {{- end }} {{- if $metric.Data.HasAggregated }} assert.Equal(t, pmetric.AggregationTemporality{{ $metric.Data.AggregationTemporality }}, ms.At(i).{{ $metric.Data.Type }}().AggregationTemporality()) @@ -178,7 +178,11 @@ func TestMetricsBuilder(t *testing.T) { {{- range $i, $attr := $metric.Attributes }} attrVal, ok {{ if eq $i 0 }}:{{ end }}= dp.Attributes().Get("{{ (attributeInfo $attr).Name }}") assert.True(t, ok) + {{- if eq (attributeInfo $attr).Type.String "Bool"}} + assert.{{- if (attributeInfo $attr).TestValue }}True{{ else }}False{{- end }}(t, attrVal.{{ (attributeInfo $attr).Type }}() + {{- else }} assert.EqualValues(t, {{ (attributeInfo $attr).TestValue }}, attrVal.{{ (attributeInfo $attr).Type }}() + {{- end }} {{- if or (eq (attributeInfo $attr).Type.String "Slice") (eq (attributeInfo $attr).Type.String "Map")}}.AsRaw(){{ end }}) {{- end }} {{- end }} diff --git a/cmd/mdatagen/templates/telemetry.go.tmpl b/cmd/mdatagen/templates/telemetry.go.tmpl index a4b98c3359b..7460f5958c1 100644 --- a/cmd/mdatagen/templates/telemetry.go.tmpl +++ b/cmd/mdatagen/templates/telemetry.go.tmpl @@ -48,8 +48,17 @@ type TelemetryBuilder struct { meters map[configtelemetry.Level]metric.Meter } -// telemetryBuilderOption applies changes to default builder. -type telemetryBuilderOption func(*TelemetryBuilder) +// TelemetryBuilderOption applies changes to default builder. +type TelemetryBuilderOption interface { + apply(*TelemetryBuilder) +} + +type telemetryBuilderOptionFunc func(mb *TelemetryBuilder) + +func (tbof telemetryBuilderOptionFunc) apply(mb *TelemetryBuilder) { + tbof(mb) +} + {{- range $name, $metric := .Telemetry.Metrics }} {{- if $metric.Optional }} @@ -79,13 +88,13 @@ func (builder *TelemetryBuilder) Init{{ $name.Render }}({{ if $metric.Data.Async {{- else }} {{ if $metric.Data.Async -}} // With{{ $name.Render }}Callback sets callback for observable {{ $name.Render }} metric. -func With{{ $name.Render }}Callback(cb func() {{ $metric.Data.BasicType }}, opts ...metric.ObserveOption) telemetryBuilderOption { - return func(builder *TelemetryBuilder) { +func With{{ $name.Render }}Callback(cb func() {{ $metric.Data.BasicType }}, opts ...metric.ObserveOption) TelemetryBuilderOption { + return telemetryBuilderOptionFunc(func(builder *TelemetryBuilder) { builder.observe{{ $name.Render }} = func(_ context.Context, o metric.Observer) error { o.Observe{{ casesTitle $metric.Data.BasicType }}(builder.{{ $name.Render }}, cb(), opts...) return nil } - } + }) } {{- end }} {{- end }} @@ -94,10 +103,10 @@ func With{{ $name.Render }}Callback(cb func() {{ $metric.Data.BasicType }}, opts // NewTelemetryBuilder provides a struct with methods to update all internal telemetry // for a component -func NewTelemetryBuilder(settings component.TelemetrySettings, options ...telemetryBuilderOption) (*TelemetryBuilder, error) { +func NewTelemetryBuilder(settings component.TelemetrySettings, options ...TelemetryBuilderOption) (*TelemetryBuilder, error) { builder := TelemetryBuilder{meters: map[configtelemetry.Level]metric.Meter{}} for _, op := range options { - op(&builder) + op.apply(&builder) } {{- range $level, $val := .Telemetry.Levels }} builder.meters[configtelemetry.Level{{ casesTitle $level }}] = LeveledMeter(settings, configtelemetry.Level{{ casesTitle $level }}) diff --git a/cmd/mdatagen/templates/telemetry_test.go.tmpl b/cmd/mdatagen/templates/telemetry_test.go.tmpl index 600fe5d42d8..87cd7c2688a 100644 --- a/cmd/mdatagen/templates/telemetry_test.go.tmpl +++ b/cmd/mdatagen/templates/telemetry_test.go.tmpl @@ -76,9 +76,9 @@ func TestNewTelemetryBuilder(t *testing.T) { TracerProvider: mockTracerProvider{}, } applied := false - _, err := NewTelemetryBuilder(set, func(b *TelemetryBuilder) { + _, err := NewTelemetryBuilder(set, telemetryBuilderOptionFunc(func(b *TelemetryBuilder) { applied = true - }) + })) require.NoError(t, err) require.True(t, applied) } diff --git a/cmd/mdatagen/testdata/unused_attribute.yaml b/cmd/mdatagen/testdata/unused_attribute.yaml index d71586a7714..a3348712f8b 100644 --- a/cmd/mdatagen/testdata/unused_attribute.yaml +++ b/cmd/mdatagen/testdata/unused_attribute.yaml @@ -10,7 +10,10 @@ status: stable: [metrics] attributes: - used_attr: + used_attr_in_metrics_section: + description: Used attribute. + type: string + used_attr_in_telemetry_section: description: Used attribute. type: string @@ -26,4 +29,14 @@ metrics: unit: "1" gauge: value_type: double - attributes: [used_attr] + attributes: [used_attr_in_metrics_section] + +telemetry: + metrics: + metric: + enabled: true + description: Metric. + unit: "1" + gauge: + value_type: double + attributes: [used_attr_in_telemetry_section] \ No newline at end of file diff --git a/cmd/mdatagen/validate.go b/cmd/mdatagen/validate.go index 63108f29470..4685b1e2b1c 100644 --- a/cmd/mdatagen/validate.go +++ b/cmd/mdatagen/validate.go @@ -129,34 +129,9 @@ func (md *metadata) validateResourceAttributes() error { func (md *metadata) validateMetrics() error { var errs error usedAttrs := map[attributeName]bool{} - for mn, m := range md.Metrics { - if m.Sum == nil && m.Gauge == nil { - errs = errors.Join(errs, fmt.Errorf("metric %v doesn't have a metric type key, "+ - "one of the following has to be specified: sum, gauge", mn)) - continue - } - if m.Sum != nil && m.Gauge != nil { - errs = errors.Join(errs, fmt.Errorf("metric %v has more than one metric type keys, "+ - "only one of the following has to be specified: sum, gauge", mn)) - continue - } - if err := m.validate(); err != nil { - errs = errors.Join(errs, fmt.Errorf(`metric "%v": %w`, mn, err)) - continue - } - unknownAttrs := make([]attributeName, 0, len(m.Attributes)) - for _, attr := range m.Attributes { - if _, ok := md.Attributes[attr]; ok { - usedAttrs[attr] = true - } else { - unknownAttrs = append(unknownAttrs, attr) - } - } - if len(unknownAttrs) > 0 { - errs = errors.Join(errs, fmt.Errorf(`metric "%v" refers to undefined attributes: %v`, mn, unknownAttrs)) - } - } - errs = errors.Join(errs, md.validateAttributes(usedAttrs)) + errs = errors.Join(errs, validateMetrics(md.Metrics, md.Attributes, usedAttrs), + validateMetrics(md.Telemetry.Metrics, md.Attributes, usedAttrs), + md.validateAttributes(usedAttrs)) return errs } @@ -204,3 +179,35 @@ func (md *metadata) validateAttributes(usedAttrs map[attributeName]bool) error { } return errs } + +func validateMetrics(metrics map[metricName]metric, attributes map[attributeName]attribute, usedAttrs map[attributeName]bool) error { + var errs error + for mn, m := range metrics { + if m.Sum == nil && m.Gauge == nil && m.Histogram == nil { + errs = errors.Join(errs, fmt.Errorf("metric %v doesn't have a metric type key, "+ + "one of the following has to be specified: sum, gauge, histogram", mn)) + continue + } + if (m.Sum != nil && m.Gauge != nil) || (m.Sum != nil && m.Histogram != nil) || (m.Gauge != nil && m.Histogram != nil) { + errs = errors.Join(errs, fmt.Errorf("metric %v has more than one metric type keys, "+ + "only one of the following has to be specified: sum, gauge, histogram", mn)) + continue + } + if err := m.validate(); err != nil { + errs = errors.Join(errs, fmt.Errorf(`metric "%v": %w`, mn, err)) + continue + } + unknownAttrs := make([]attributeName, 0, len(m.Attributes)) + for _, attr := range m.Attributes { + if _, ok := attributes[attr]; ok { + usedAttrs[attr] = true + } else { + unknownAttrs = append(unknownAttrs, attr) + } + } + if len(unknownAttrs) > 0 { + errs = errors.Join(errs, fmt.Errorf(`metric "%v" refers to undefined attributes: %v`, mn, unknownAttrs)) + } + } + return errs +} diff --git a/cmd/mdatagen/validate_test.go b/cmd/mdatagen/validate_test.go index 497b726bca8..fcc62428648 100644 --- a/cmd/mdatagen/validate_test.go +++ b/cmd/mdatagen/validate_test.go @@ -69,12 +69,12 @@ func TestValidate(t *testing.T) { { name: "testdata/no_metric_type.yaml", wantErr: "metric system.cpu.time doesn't have a metric type key, " + - "one of the following has to be specified: sum, gauge", + "one of the following has to be specified: sum, gauge, histogram", }, { name: "testdata/two_metric_types.yaml", wantErr: "metric system.cpu.time has more than one metric type keys, " + - "only one of the following has to be specified: sum, gauge", + "only one of the following has to be specified: sum, gauge, histogram", }, { name: "testdata/invalid_input_type.yaml", diff --git a/cmd/otelcorecol/builder-config.yaml b/cmd/otelcorecol/builder-config.yaml index 1db20c35c62..b5a726e374b 100644 --- a/cmd/otelcorecol/builder-config.yaml +++ b/cmd/otelcorecol/builder-config.yaml @@ -10,34 +10,33 @@ dist: module: go.opentelemetry.io/collector/cmd/otelcorecol name: otelcorecol description: Local OpenTelemetry Collector binary, testing only. - version: 0.108.1-dev - otelcol_version: 0.108.1 + version: 0.109.0-dev + otelcol_version: 0.109.0 receivers: - - gomod: go.opentelemetry.io/collector/receiver/nopreceiver v0.108.1 - - gomod: go.opentelemetry.io/collector/receiver/otlpreceiver v0.108.1 + - gomod: go.opentelemetry.io/collector/receiver/nopreceiver v0.109.0 + - gomod: go.opentelemetry.io/collector/receiver/otlpreceiver v0.109.0 exporters: - - gomod: go.opentelemetry.io/collector/exporter/debugexporter v0.108.1 - - gomod: go.opentelemetry.io/collector/exporter/loggingexporter v0.108.1 - - gomod: go.opentelemetry.io/collector/exporter/nopexporter v0.108.1 - - gomod: go.opentelemetry.io/collector/exporter/otlpexporter v0.108.1 - - gomod: go.opentelemetry.io/collector/exporter/otlphttpexporter v0.108.1 + - gomod: go.opentelemetry.io/collector/exporter/debugexporter v0.109.0 + - gomod: go.opentelemetry.io/collector/exporter/loggingexporter v0.109.0 + - gomod: go.opentelemetry.io/collector/exporter/nopexporter v0.109.0 + - gomod: go.opentelemetry.io/collector/exporter/otlpexporter v0.109.0 + - gomod: go.opentelemetry.io/collector/exporter/otlphttpexporter v0.109.0 extensions: - - gomod: go.opentelemetry.io/collector/extension/ballastextension v0.108.1 - - gomod: go.opentelemetry.io/collector/extension/memorylimiterextension v0.108.1 - - gomod: go.opentelemetry.io/collector/extension/zpagesextension v0.108.1 + - gomod: go.opentelemetry.io/collector/extension/memorylimiterextension v0.109.0 + - gomod: go.opentelemetry.io/collector/extension/zpagesextension v0.109.0 processors: - - gomod: go.opentelemetry.io/collector/processor/batchprocessor v0.108.1 - - gomod: go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.108.1 + - gomod: go.opentelemetry.io/collector/processor/batchprocessor v0.109.0 + - gomod: go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.109.0 connectors: - - gomod: go.opentelemetry.io/collector/connector/forwardconnector v0.108.1 + - gomod: go.opentelemetry.io/collector/connector/forwardconnector v0.109.0 providers: - - gomod: go.opentelemetry.io/collector/confmap/provider/envprovider v0.108.1 - - gomod: go.opentelemetry.io/collector/confmap/provider/fileprovider v0.108.1 - - gomod: go.opentelemetry.io/collector/confmap/provider/httpprovider v0.108.1 - - gomod: go.opentelemetry.io/collector/confmap/provider/httpsprovider v0.108.1 - - gomod: go.opentelemetry.io/collector/confmap/provider/yamlprovider v0.108.1 + - gomod: go.opentelemetry.io/collector/confmap/provider/envprovider v1.15.0 + - gomod: go.opentelemetry.io/collector/confmap/provider/fileprovider v1.15.0 + - gomod: go.opentelemetry.io/collector/confmap/provider/httpprovider v0.109.0 + - gomod: go.opentelemetry.io/collector/confmap/provider/httpsprovider v0.109.0 + - gomod: go.opentelemetry.io/collector/confmap/provider/yamlprovider v0.109.0 replaces: - go.opentelemetry.io/collector => ../../ @@ -79,7 +78,7 @@ replaces: - go.opentelemetry.io/collector/extension => ../../extension - go.opentelemetry.io/collector/extension/auth => ../../extension/auth - go.opentelemetry.io/collector/extension/experimental/storage => ../../extension/experimental/storage - - go.opentelemetry.io/collector/extension/ballastextension => ../../extension/ballastextension + - go.opentelemetry.io/collector/extension/extensioncapabilities => ../../extension/extensioncapabilities - go.opentelemetry.io/collector/extension/memorylimiterextension => ../../extension/memorylimiterextension - go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension - go.opentelemetry.io/collector/featuregate => ../../featuregate diff --git a/cmd/otelcorecol/components.go b/cmd/otelcorecol/components.go index 94115c0ebe6..0340fe55519 100644 --- a/cmd/otelcorecol/components.go +++ b/cmd/otelcorecol/components.go @@ -13,7 +13,6 @@ import ( otlpexporter "go.opentelemetry.io/collector/exporter/otlpexporter" otlphttpexporter "go.opentelemetry.io/collector/exporter/otlphttpexporter" "go.opentelemetry.io/collector/extension" - ballastextension "go.opentelemetry.io/collector/extension/ballastextension" memorylimiterextension "go.opentelemetry.io/collector/extension/memorylimiterextension" zpagesextension "go.opentelemetry.io/collector/extension/zpagesextension" "go.opentelemetry.io/collector/otelcol" @@ -30,7 +29,6 @@ func components() (otelcol.Factories, error) { factories := otelcol.Factories{} factories.Extensions, err = extension.MakeFactoryMap( - ballastextension.NewFactory(), memorylimiterextension.NewFactory(), zpagesextension.NewFactory(), ) @@ -38,9 +36,8 @@ func components() (otelcol.Factories, error) { return otelcol.Factories{}, err } factories.ExtensionModules = make(map[component.Type]string, len(factories.Extensions)) - factories.ExtensionModules[ballastextension.NewFactory().Type()] = "go.opentelemetry.io/collector/extension/ballastextension v0.108.1" - factories.ExtensionModules[memorylimiterextension.NewFactory().Type()] = "go.opentelemetry.io/collector/extension/memorylimiterextension v0.108.1" - factories.ExtensionModules[zpagesextension.NewFactory().Type()] = "go.opentelemetry.io/collector/extension/zpagesextension v0.108.1" + factories.ExtensionModules[memorylimiterextension.NewFactory().Type()] = "go.opentelemetry.io/collector/extension/memorylimiterextension v0.109.0" + factories.ExtensionModules[zpagesextension.NewFactory().Type()] = "go.opentelemetry.io/collector/extension/zpagesextension v0.109.0" factories.Receivers, err = receiver.MakeFactoryMap( nopreceiver.NewFactory(), @@ -50,8 +47,8 @@ func components() (otelcol.Factories, error) { return otelcol.Factories{}, err } factories.ReceiverModules = make(map[component.Type]string, len(factories.Receivers)) - factories.ReceiverModules[nopreceiver.NewFactory().Type()] = "go.opentelemetry.io/collector/receiver/nopreceiver v0.108.1" - factories.ReceiverModules[otlpreceiver.NewFactory().Type()] = "go.opentelemetry.io/collector/receiver/otlpreceiver v0.108.1" + factories.ReceiverModules[nopreceiver.NewFactory().Type()] = "go.opentelemetry.io/collector/receiver/nopreceiver v0.109.0" + factories.ReceiverModules[otlpreceiver.NewFactory().Type()] = "go.opentelemetry.io/collector/receiver/otlpreceiver v0.109.0" factories.Exporters, err = exporter.MakeFactoryMap( debugexporter.NewFactory(), @@ -64,11 +61,11 @@ func components() (otelcol.Factories, error) { return otelcol.Factories{}, err } factories.ExporterModules = make(map[component.Type]string, len(factories.Exporters)) - factories.ExporterModules[debugexporter.NewFactory().Type()] = "go.opentelemetry.io/collector/exporter/debugexporter v0.108.1" - factories.ExporterModules[loggingexporter.NewFactory().Type()] = "go.opentelemetry.io/collector/exporter/loggingexporter v0.108.1" - factories.ExporterModules[nopexporter.NewFactory().Type()] = "go.opentelemetry.io/collector/exporter/nopexporter v0.108.1" - factories.ExporterModules[otlpexporter.NewFactory().Type()] = "go.opentelemetry.io/collector/exporter/otlpexporter v0.108.1" - factories.ExporterModules[otlphttpexporter.NewFactory().Type()] = "go.opentelemetry.io/collector/exporter/otlphttpexporter v0.108.1" + factories.ExporterModules[debugexporter.NewFactory().Type()] = "go.opentelemetry.io/collector/exporter/debugexporter v0.109.0" + factories.ExporterModules[loggingexporter.NewFactory().Type()] = "go.opentelemetry.io/collector/exporter/loggingexporter v0.109.0" + factories.ExporterModules[nopexporter.NewFactory().Type()] = "go.opentelemetry.io/collector/exporter/nopexporter v0.109.0" + factories.ExporterModules[otlpexporter.NewFactory().Type()] = "go.opentelemetry.io/collector/exporter/otlpexporter v0.109.0" + factories.ExporterModules[otlphttpexporter.NewFactory().Type()] = "go.opentelemetry.io/collector/exporter/otlphttpexporter v0.109.0" factories.Processors, err = processor.MakeFactoryMap( batchprocessor.NewFactory(), @@ -78,8 +75,8 @@ func components() (otelcol.Factories, error) { return otelcol.Factories{}, err } factories.ProcessorModules = make(map[component.Type]string, len(factories.Processors)) - factories.ProcessorModules[batchprocessor.NewFactory().Type()] = "go.opentelemetry.io/collector/processor/batchprocessor v0.108.1" - factories.ProcessorModules[memorylimiterprocessor.NewFactory().Type()] = "go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.108.1" + factories.ProcessorModules[batchprocessor.NewFactory().Type()] = "go.opentelemetry.io/collector/processor/batchprocessor v0.109.0" + factories.ProcessorModules[memorylimiterprocessor.NewFactory().Type()] = "go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.109.0" factories.Connectors, err = connector.MakeFactoryMap( forwardconnector.NewFactory(), @@ -88,7 +85,7 @@ func components() (otelcol.Factories, error) { return otelcol.Factories{}, err } factories.ConnectorModules = make(map[component.Type]string, len(factories.Connectors)) - factories.ConnectorModules[forwardconnector.NewFactory().Type()] = "go.opentelemetry.io/collector/connector/forwardconnector v0.108.1" + factories.ConnectorModules[forwardconnector.NewFactory().Type()] = "go.opentelemetry.io/collector/connector/forwardconnector v0.109.0" return factories, nil } diff --git a/cmd/otelcorecol/go.mod b/cmd/otelcorecol/go.mod index a1cb791b7fe..5de90ac84fd 100644 --- a/cmd/otelcorecol/go.mod +++ b/cmd/otelcorecol/go.mod @@ -4,36 +4,35 @@ module go.opentelemetry.io/collector/cmd/otelcorecol go 1.22.0 -toolchain go1.22.6 +toolchain go1.22.7 require ( - go.opentelemetry.io/collector/component v0.108.1 - go.opentelemetry.io/collector/confmap v1.14.1 - go.opentelemetry.io/collector/confmap/provider/envprovider v0.108.1 - go.opentelemetry.io/collector/confmap/provider/fileprovider v0.108.1 - go.opentelemetry.io/collector/confmap/provider/httpprovider v0.108.1 - go.opentelemetry.io/collector/confmap/provider/httpsprovider v0.108.1 - go.opentelemetry.io/collector/confmap/provider/yamlprovider v0.108.1 - go.opentelemetry.io/collector/connector v0.108.1 - go.opentelemetry.io/collector/connector/forwardconnector v0.108.1 - go.opentelemetry.io/collector/exporter v0.108.1 - go.opentelemetry.io/collector/exporter/debugexporter v0.108.1 - go.opentelemetry.io/collector/exporter/loggingexporter v0.108.1 - go.opentelemetry.io/collector/exporter/nopexporter v0.108.1 - go.opentelemetry.io/collector/exporter/otlpexporter v0.108.1 - go.opentelemetry.io/collector/exporter/otlphttpexporter v0.108.1 - go.opentelemetry.io/collector/extension v0.108.1 - go.opentelemetry.io/collector/extension/ballastextension v0.108.1 - go.opentelemetry.io/collector/extension/memorylimiterextension v0.108.1 - go.opentelemetry.io/collector/extension/zpagesextension v0.108.1 - go.opentelemetry.io/collector/otelcol v0.108.1 - go.opentelemetry.io/collector/processor v0.108.1 - go.opentelemetry.io/collector/processor/batchprocessor v0.108.1 - go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.108.1 - go.opentelemetry.io/collector/receiver v0.108.1 - go.opentelemetry.io/collector/receiver/nopreceiver v0.108.1 - go.opentelemetry.io/collector/receiver/otlpreceiver v0.108.1 - golang.org/x/sys v0.24.0 + go.opentelemetry.io/collector/component v0.109.0 + go.opentelemetry.io/collector/confmap v1.15.0 + go.opentelemetry.io/collector/confmap/provider/envprovider v1.15.0 + go.opentelemetry.io/collector/confmap/provider/fileprovider v1.15.0 + go.opentelemetry.io/collector/confmap/provider/httpprovider v0.109.0 + go.opentelemetry.io/collector/confmap/provider/httpsprovider v0.109.0 + go.opentelemetry.io/collector/confmap/provider/yamlprovider v0.109.0 + go.opentelemetry.io/collector/connector v0.109.0 + go.opentelemetry.io/collector/connector/forwardconnector v0.109.0 + go.opentelemetry.io/collector/exporter v0.109.0 + go.opentelemetry.io/collector/exporter/debugexporter v0.109.0 + go.opentelemetry.io/collector/exporter/loggingexporter v0.109.0 + go.opentelemetry.io/collector/exporter/nopexporter v0.109.0 + go.opentelemetry.io/collector/exporter/otlpexporter v0.109.0 + go.opentelemetry.io/collector/exporter/otlphttpexporter v0.109.0 + go.opentelemetry.io/collector/extension v0.109.0 + go.opentelemetry.io/collector/extension/memorylimiterextension v0.109.0 + go.opentelemetry.io/collector/extension/zpagesextension v0.109.0 + go.opentelemetry.io/collector/otelcol v0.109.0 + go.opentelemetry.io/collector/processor v0.109.0 + go.opentelemetry.io/collector/processor/batchprocessor v0.109.0 + go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.109.0 + go.opentelemetry.io/collector/receiver v0.109.0 + go.opentelemetry.io/collector/receiver/nopreceiver v0.109.0 + go.opentelemetry.io/collector/receiver/otlpreceiver v0.109.0 + golang.org/x/sys v0.25.0 ) require ( @@ -67,12 +66,12 @@ require ( github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect - github.com/prometheus/client_golang v1.20.2 // indirect + github.com/prometheus/client_golang v1.20.3 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.56.0 // indirect + github.com/prometheus/common v0.59.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect - github.com/rs/cors v1.11.0 // indirect - github.com/shirou/gopsutil/v4 v4.24.7 // indirect + github.com/rs/cors v1.11.1 // indirect + github.com/shirou/gopsutil/v4 v4.24.8 // indirect github.com/shoenig/go-m1cpu v0.1.6 // indirect github.com/spf13/cobra v1.8.1 // indirect github.com/spf13/pflag v1.0.5 // indirect @@ -80,68 +79,69 @@ require ( github.com/tklauser/go-sysconf v0.3.12 // indirect github.com/tklauser/numcpus v0.6.1 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect - go.opentelemetry.io/collector v0.108.1 // indirect - go.opentelemetry.io/collector/client v1.14.1 // indirect - go.opentelemetry.io/collector/component/componentprofiles v0.108.1 // indirect - go.opentelemetry.io/collector/component/componentstatus v0.108.1 // indirect - go.opentelemetry.io/collector/config/configauth v0.108.1 // indirect - go.opentelemetry.io/collector/config/configcompression v1.14.1 // indirect - go.opentelemetry.io/collector/config/configgrpc v0.108.1 // indirect - go.opentelemetry.io/collector/config/confighttp v0.108.1 // indirect - go.opentelemetry.io/collector/config/confignet v0.108.1 // indirect - go.opentelemetry.io/collector/config/configopaque v1.14.1 // indirect - go.opentelemetry.io/collector/config/configretry v1.14.1 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.108.1 // indirect - go.opentelemetry.io/collector/config/configtls v1.14.1 // indirect - go.opentelemetry.io/collector/config/internal v0.108.1 // indirect - go.opentelemetry.io/collector/connector/connectorprofiles v0.108.1 // indirect - go.opentelemetry.io/collector/consumer v0.108.1 // indirect - go.opentelemetry.io/collector/consumer/consumerprofiles v0.108.1 // indirect - go.opentelemetry.io/collector/consumer/consumertest v0.108.1 // indirect - go.opentelemetry.io/collector/exporter/exporterprofiles v0.108.1 // indirect - go.opentelemetry.io/collector/extension/auth v0.108.1 // indirect - go.opentelemetry.io/collector/extension/experimental/storage v0.0.0-20240902085631-cd1f7623fe67 // indirect - go.opentelemetry.io/collector/featuregate v1.14.1 // indirect - go.opentelemetry.io/collector/internal/globalgates v0.108.1 // indirect - go.opentelemetry.io/collector/pdata v1.14.1 // indirect - go.opentelemetry.io/collector/pdata/pprofile v0.108.1 // indirect - go.opentelemetry.io/collector/pdata/testdata v0.108.1 // indirect - go.opentelemetry.io/collector/processor/processorprofiles v0.108.1 // indirect - go.opentelemetry.io/collector/receiver/receiverprofiles v0.108.1 // indirect - go.opentelemetry.io/collector/semconv v0.108.1 // indirect - go.opentelemetry.io/collector/service v0.108.1 // indirect + go.opentelemetry.io/collector v0.109.0 // indirect + go.opentelemetry.io/collector/client v1.15.0 // indirect + go.opentelemetry.io/collector/component/componentprofiles v0.109.0 // indirect + go.opentelemetry.io/collector/component/componentstatus v0.109.0 // indirect + go.opentelemetry.io/collector/config/configauth v0.109.0 // indirect + go.opentelemetry.io/collector/config/configcompression v1.15.0 // indirect + go.opentelemetry.io/collector/config/configgrpc v0.109.0 // indirect + go.opentelemetry.io/collector/config/confighttp v0.109.0 // indirect + go.opentelemetry.io/collector/config/confignet v0.109.0 // indirect + go.opentelemetry.io/collector/config/configopaque v1.15.0 // indirect + go.opentelemetry.io/collector/config/configretry v1.15.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.109.0 // indirect + go.opentelemetry.io/collector/config/configtls v1.15.0 // indirect + go.opentelemetry.io/collector/config/internal v0.109.0 // indirect + go.opentelemetry.io/collector/connector/connectorprofiles v0.109.0 // indirect + go.opentelemetry.io/collector/consumer v0.109.0 // indirect + go.opentelemetry.io/collector/consumer/consumerprofiles v0.109.0 // indirect + go.opentelemetry.io/collector/consumer/consumertest v0.109.0 // indirect + go.opentelemetry.io/collector/exporter/exporterprofiles v0.109.0 // indirect + go.opentelemetry.io/collector/extension/auth v0.109.0 // indirect + go.opentelemetry.io/collector/extension/experimental/storage v0.109.0 // indirect + go.opentelemetry.io/collector/extension/extensioncapabilities v0.109.0 // indirect + go.opentelemetry.io/collector/featuregate v1.15.0 // indirect + go.opentelemetry.io/collector/internal/globalgates v0.109.0 // indirect + go.opentelemetry.io/collector/pdata v1.15.0 // indirect + go.opentelemetry.io/collector/pdata/pprofile v0.109.0 // indirect + go.opentelemetry.io/collector/pdata/testdata v0.109.0 // indirect + go.opentelemetry.io/collector/processor/processorprofiles v0.109.0 // indirect + go.opentelemetry.io/collector/receiver/receiverprofiles v0.109.0 // indirect + go.opentelemetry.io/collector/semconv v0.109.0 // indirect + go.opentelemetry.io/collector/service v0.109.0 // indirect go.opentelemetry.io/contrib/config v0.9.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect go.opentelemetry.io/contrib/propagators/b3 v1.29.0 // indirect go.opentelemetry.io/contrib/zpages v0.54.0 // indirect - go.opentelemetry.io/otel v1.29.0 // indirect + go.opentelemetry.io/otel v1.30.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.5.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.29.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/otlptrace v1.29.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.51.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.5.0 // indirect - go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0 // indirect + go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.30.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.29.0 // indirect go.opentelemetry.io/otel/log v0.5.0 // indirect - go.opentelemetry.io/otel/metric v1.29.0 // indirect - go.opentelemetry.io/otel/sdk v1.29.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/log v0.5.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.29.0 // indirect - go.opentelemetry.io/otel/trace v1.29.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect + go.opentelemetry.io/otel/trace v1.30.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 golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect - golang.org/x/net v0.28.0 // indirect - golang.org/x/text v0.17.0 // indirect + golang.org/x/net v0.29.0 // indirect + golang.org/x/text v0.18.0 // indirect gonum.org/v1/gonum v0.15.1 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd // indirect - google.golang.org/grpc v1.65.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/grpc v1.66.1 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) @@ -224,7 +224,7 @@ 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/extension/ballastextension => ../../extension/ballastextension +replace go.opentelemetry.io/collector/extension/extensioncapabilities => ../../extension/extensioncapabilities replace go.opentelemetry.io/collector/extension/memorylimiterextension => ../../extension/memorylimiterextension diff --git a/cmd/otelcorecol/go.sum b/cmd/otelcorecol/go.sum index b65ce93aa5b..e9e5816f1c6 100644 --- a/cmd/otelcorecol/go.sum +++ b/cmd/otelcorecol/go.sum @@ -74,21 +74,21 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= -github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg= -github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= +github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.56.0 h1:UffReloqkBtvtQEYDg2s+uDPGRrJyC6vZWPGXf6OhPY= -github.com/prometheus/common v0.56.0/go.mod h1:7uRPFSUTbfZWsJ7MHY56sqt7hLQu3bxXHDnNhl8E9qI= +github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= +github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= -github.com/rs/cors v1.11.0 h1:0B9GE/r9Bc2UxRMMtymBkHTenPkHDv0CW4Y98GBY+po= -github.com/rs/cors v1.11.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +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= -github.com/shirou/gopsutil/v4 v4.24.7 h1:V9UGTK4gQ8HvcnPKf6Zt3XHyQq/peaekfxpJ2HSocJk= -github.com/shirou/gopsutil/v4 v4.24.7/go.mod h1:0uW/073rP7FYLOkvxolUQM5rMOLTNmRXnFKafpb71rw= +github.com/shirou/gopsutil/v4 v4.24.8 h1:pVQjIenQkIhqO81mwTaXjTzOMT7d3TZkf43PlVFHENI= +github.com/shirou/gopsutil/v4 v4.24.8/go.mod h1:wE0OrJtj4dG+hYkxqDH3QiBICdKSf04/npcvLLc/oRg= github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= @@ -119,40 +119,40 @@ go.opentelemetry.io/contrib/propagators/b3 v1.29.0 h1:hNjyoRsAACnhoOLWupItUjABze go.opentelemetry.io/contrib/propagators/b3 v1.29.0/go.mod h1:E76MTitU1Niwo5NSN+mVxkyLu4h4h7Dp/yh38F2WuIU= go.opentelemetry.io/contrib/zpages v0.54.0 h1:tSfm/LEK5E46sd5qx/Y9o4iQ65ipLubV0Una7veXFlA= go.opentelemetry.io/contrib/zpages v0.54.0/go.mod h1:sbe4/RH3CFKkdM5zuGwfziKjvkqUOK9hSgLFckiVZUI= -go.opentelemetry.io/otel v1.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= -go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= +go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= +go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.5.0 h1:4d++HQ+Ihdl+53zSjtsCUFDmNMju2FC9qFkUlTxPLqo= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.5.0/go.mod h1:mQX5dTO3Mh5ZF7bPKDkt5c/7C41u/SiDr9XgTpzXXn8= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.29.0 h1:k6fQVDQexDE+3jG2SfCQjnHS7OamcP73YMoxEVq5B6k= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.29.0/go.mod h1:t4BrYLHU450Zo9fnydWlIuswB1bm7rM8havDpWOJeDo= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.29.0 h1:xvhQxJ/C9+RTnAj5DpTg7LSM1vbbMTiXt7e9hsfqHNw= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.29.0/go.mod h1:Fcvs2Bz1jkDM+Wf5/ozBGmi3tQ/c9zPKLnsipnfhGAo= +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/otlptrace v1.29.0 h1:dIIDULZJpgdiHz5tXrTgKIMLkus6jEFa7x5SOKcyR7E= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0/go.mod h1:jlRVBe7+Z1wyxFSUs48L6OBQZ5JwH2Hg/Vbl+t9rAgI= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0 h1:nSiV3s7wiCam610XcLbYOmMfJxB9gO4uK3Xgv5gmTgg= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0/go.mod h1:hKn/e/Nmd19/x1gvIHwtOwVWM+VhuITSWip3JUDghj0= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0 h1:JAv0Jwtl01UFiyWZEMiJZBiTlv5A50zNs8lsthXqIio= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0/go.mod h1:QNKLmUEAq2QUbPQUfvw4fmv0bgbK7UlOSFCnXyfvSNc= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0 h1:G7uexXb/K3T+T9fNLCCKncweEtNEBMTO+46hKX5EdKw= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0/go.mod h1:v0mFe5Kk7woIh938mrZBJBmENYquyA0IICrlYm4Y0t4= +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/stdout/stdoutlog v0.5.0 h1:ThVXnEsdwNcxdBO+r96ci1xbF+PgNjwlk457VNuJODo= go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.5.0/go.mod h1:rHWcSmC4q2h3gje/yOq6sAOaq8+UHxN/Ru3BbmDXOfY= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0 h1:WDdP9acbMYjbKIyJUhTvtzj601sVJOqgWdUxSdR/Ysc= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0/go.mod h1:BLbf7zbNIONBLPwvFnwNHGj4zge8uTCM/UPIVW1Mq2I= +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/stdouttrace v1.29.0 h1:X3ZjNp36/WlkSYx0ul2jw4PtbNEDDeLskw3VPsrpYM0= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.29.0/go.mod h1:2uL/xnOXh0CHOBFCWXz5u1A4GXLiW+0IQIzVbeOEQ0U= go.opentelemetry.io/otel/log v0.5.0 h1:x1Pr6Y3gnXgl1iFBwtGy1W/mnzENoK0w0ZoaeOI3i30= go.opentelemetry.io/otel/log v0.5.0/go.mod h1:NU/ozXeGuOR5/mjCRXYbTC00NFJ3NYuraV/7O78F0rE= -go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= -go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= -go.opentelemetry.io/otel/sdk v1.29.0 h1:vkqKjk7gwhS8VaWb0POZKmIEDimRCMsopNYnriHyryo= -go.opentelemetry.io/otel/sdk v1.29.0/go.mod h1:pM8Dx5WKnvxLCb+8lG1PRNIDxu9g9b9g59Qr7hfAAok= +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/log v0.5.0 h1:A+9lSjlZGxkQOr7QSBJcuyyYBw79CufQ69saiJLey7o= go.opentelemetry.io/otel/sdk/log v0.5.0/go.mod h1:zjxIW7sw1IHolZL2KlSAtrUi8JHttoeiQy43Yl3WuVQ= -go.opentelemetry.io/otel/sdk/metric v1.29.0 h1:K2CfmJohnRgvZ9UAj2/FhIf/okdWcNdBwe1m8xFXiSY= -go.opentelemetry.io/otel/sdk/metric v1.29.0/go.mod h1:6zZLdCl2fkauYoZIOn/soQIDSWFmNSRcICarHfuhNJQ= -go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= -go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= +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/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= @@ -172,8 +172,8 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= -golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= +golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= +golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -184,12 +184,12 @@ 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.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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= -golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -200,12 +200,12 @@ 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-20240822170219-fc7c04adadcd h1:BBOTEWLuuEGQy9n1y9MhVJ9Qt0BDu21X8qZs71/uPZo= -google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:fO8wJzT2zbQbAjbIoos1285VfEIYKDDY+Dt+WpTkh6g= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd h1:6TEm2ZxXoQmFWFlt1vNxvVOa1Q0dXFQD1m/rYjXmS0E= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +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/grpc v1.66.1 h1:hO5qAXR19+/Z44hmvIM4dQFMSYX9XcWsByfoxutBpAM= +google.golang.org/grpc v1.66.1/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= 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= diff --git a/cmd/otelcorecol/main.go b/cmd/otelcorecol/main.go index 0ec51f2c3d2..212d2120d73 100644 --- a/cmd/otelcorecol/main.go +++ b/cmd/otelcorecol/main.go @@ -20,7 +20,7 @@ func main() { info := component.BuildInfo{ Command: "otelcorecol", Description: "Local OpenTelemetry Collector binary, testing only.", - Version: "0.108.1-dev", + Version: "0.109.0-dev", } set := otelcol.CollectorSettings{ diff --git a/component/componentprofiles/go.mod b/component/componentprofiles/go.mod index 2c1aa4642b8..ec64b400ea1 100644 --- a/component/componentprofiles/go.mod +++ b/component/componentprofiles/go.mod @@ -2,22 +2,22 @@ module go.opentelemetry.io/collector/component/componentprofiles go 1.22.0 -require go.opentelemetry.io/collector/component v0.108.1 +require go.opentelemetry.io/collector/component v0.109.0 require ( github.com/gogo/protobuf v1.3.2 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.108.1 // indirect - go.opentelemetry.io/collector/pdata v1.14.1 // indirect - go.opentelemetry.io/otel v1.29.0 // indirect - go.opentelemetry.io/otel/metric v1.29.0 // indirect - go.opentelemetry.io/otel/trace v1.29.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.109.0 // indirect + go.opentelemetry.io/collector/pdata v1.15.0 // indirect + go.opentelemetry.io/otel v1.30.0 // indirect + go.opentelemetry.io/otel/metric v1.30.0 // indirect + go.opentelemetry.io/otel/trace v1.30.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/net v0.27.0 // indirect - golang.org/x/sys v0.24.0 // indirect - golang.org/x/text v0.16.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect - google.golang.org/grpc v1.65.0 // indirect + golang.org/x/net v0.28.0 // indirect + golang.org/x/sys v0.25.0 // indirect + golang.org/x/text v0.17.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect + google.golang.org/grpc v1.66.0 // indirect google.golang.org/protobuf v1.34.2 // indirect ) diff --git a/component/componentprofiles/go.sum b/component/componentprofiles/go.sum index 93d9490962a..abf5443a0b6 100644 --- a/component/componentprofiles/go.sum +++ b/component/componentprofiles/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.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= -go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= -go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= -go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= -go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= -go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= +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.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= @@ -37,20 +37,20 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= -golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -59,10 +59,10 @@ 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/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 h1:Zy9XzmMEflZ/MAaA7vNcoebnRAld7FsPW1EeBB7V0m8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 h1:1GBuWVLM/KMVUv1t1En5Gs+gFZCNd360GGb4sSxtrhU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/component/componentstatus/go.mod b/component/componentstatus/go.mod index e377f44d7ca..cf430233cce 100644 --- a/component/componentstatus/go.mod +++ b/component/componentstatus/go.mod @@ -4,25 +4,25 @@ go 1.22.0 require ( github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector/component v0.108.1 + go.opentelemetry.io/collector/component v0.109.0 ) require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.108.1 // indirect - go.opentelemetry.io/collector/pdata v1.14.1 // indirect - go.opentelemetry.io/otel v1.29.0 // indirect - go.opentelemetry.io/otel/metric v1.29.0 // indirect - go.opentelemetry.io/otel/trace v1.29.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.109.0 // indirect + go.opentelemetry.io/collector/pdata v1.15.0 // indirect + go.opentelemetry.io/otel v1.30.0 // indirect + go.opentelemetry.io/otel/metric v1.30.0 // indirect + go.opentelemetry.io/otel/trace v1.30.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/net v0.27.0 // indirect - golang.org/x/sys v0.24.0 // indirect - golang.org/x/text v0.16.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect - google.golang.org/grpc v1.65.0 // indirect + golang.org/x/net v0.28.0 // indirect + golang.org/x/sys v0.25.0 // indirect + golang.org/x/text v0.17.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect + google.golang.org/grpc v1.66.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/component/componentstatus/go.sum b/component/componentstatus/go.sum index ada81c277f5..41d874ab722 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.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= -go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= -go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= -go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= -go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= -go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= +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.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= @@ -43,20 +43,20 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= -golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -65,10 +65,10 @@ 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/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 h1:Zy9XzmMEflZ/MAaA7vNcoebnRAld7FsPW1EeBB7V0m8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 h1:1GBuWVLM/KMVUv1t1En5Gs+gFZCNd360GGb4sSxtrhU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= 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= diff --git a/component/componentstatus/status_test.go b/component/componentstatus/status_test.go index d34a0fbd2c0..87efdd245a4 100644 --- a/component/componentstatus/status_test.go +++ b/component/componentstatus/status_test.go @@ -27,7 +27,7 @@ func TestNewStatusEvent(t *testing.T) { t.Run(fmt.Sprintf("%s without error", status), func(t *testing.T) { ev := NewEvent(status) require.Equal(t, status, ev.Status()) - require.Nil(t, ev.Err()) + require.NoError(t, ev.Err()) require.False(t, ev.Timestamp().IsZero()) }) } diff --git a/component/componenttest/nop_telemetry_test.go b/component/componenttest/nop_telemetry_test.go index feb7fdb5a56..5f9d2d3aa93 100644 --- a/component/componenttest/nop_telemetry_test.go +++ b/component/componenttest/nop_telemetry_test.go @@ -23,5 +23,5 @@ func TestNewNopTelemetrySettings(t *testing.T) { nts.MeterProvider.Meter("test") }) assert.Equal(t, configtelemetry.LevelNone, nts.MetricsLevel) - assert.Equal(t, nts.Resource.Attributes().Len(), 0) + assert.Equal(t, 0, nts.Resource.Attributes().Len()) } diff --git a/component/componenttest/obsreporttest.go b/component/componenttest/obsreporttest.go index d4f35aee3b6..3662c640671 100644 --- a/component/componenttest/obsreporttest.go +++ b/component/componenttest/obsreporttest.go @@ -45,13 +45,13 @@ type TestTelemetry struct { } // CheckExporterTraces checks that for the current exported values for trace exporter metrics match given values. -// When this function is called it is required to also call SetupTelemetry as first thing. +// Note: SetupTelemetry must be called before this function. func (tts *TestTelemetry) CheckExporterTraces(sentSpans, sendFailedSpans int64) error { return tts.prometheusChecker.checkExporterTraces(tts.id, sentSpans, sendFailedSpans) } // CheckExporterMetrics checks that for the current exported values for metrics exporter metrics match given values. -// When this function is called it is required to also call SetupTelemetry as first thing. +// Note: SetupTelemetry must be called before this function. func (tts *TestTelemetry) CheckExporterMetrics(sentMetricsPoints, sendFailedMetricsPoints int64) error { return tts.prometheusChecker.checkExporterMetrics(tts.id, sentMetricsPoints, sendFailedMetricsPoints) } @@ -69,7 +69,7 @@ func (tts *TestTelemetry) CheckExporterEnqueueFailedLogs(enqueueFailed int64) er } // CheckExporterLogs checks that for the current exported values for logs exporter metrics match given values. -// When this function is called it is required to also call SetupTelemetry as first thing. +// Note: SetupTelemetry must be called before this function. func (tts *TestTelemetry) CheckExporterLogs(sentLogRecords, sendFailedLogRecords int64) error { return tts.prometheusChecker.checkExporterLogs(tts.id, sentLogRecords, sendFailedLogRecords) } @@ -81,43 +81,43 @@ func (tts *TestTelemetry) CheckExporterMetricGauge(metric string, val int64, ext } // CheckProcessorTraces checks that for the current exported values for trace exporter metrics match given values. -// When this function is called it is required to also call SetupTelemetry as first thing. -func (tts *TestTelemetry) CheckProcessorTraces(acceptedSpans, refusedSpans, droppedSpans, insertedSpans int64) error { - return tts.prometheusChecker.checkProcessorTraces(tts.id, acceptedSpans, refusedSpans, droppedSpans, insertedSpans) +// Note: SetupTelemetry must be called before this function. +func (tts *TestTelemetry) CheckProcessorTraces(acceptedSpans, refusedSpans, droppedSpans int64) error { + return tts.prometheusChecker.checkProcessorTraces(tts.id, acceptedSpans, refusedSpans, droppedSpans) } // CheckProcessorMetrics checks that for the current exported values for metrics exporter metrics match given values. -// When this function is called it is required to also call SetupTelemetry as first thing. -func (tts *TestTelemetry) CheckProcessorMetrics(acceptedMetricPoints, refusedMetricPoints, droppedMetricPoints, insertedMetricPoints int64) error { - return tts.prometheusChecker.checkProcessorMetrics(tts.id, acceptedMetricPoints, refusedMetricPoints, droppedMetricPoints, insertedMetricPoints) +// Note: SetupTelemetry must be called before this function. +func (tts *TestTelemetry) CheckProcessorMetrics(acceptedMetricPoints, refusedMetricPoints, droppedMetricPoints int64) error { + return tts.prometheusChecker.checkProcessorMetrics(tts.id, acceptedMetricPoints, refusedMetricPoints, droppedMetricPoints) } // CheckProcessorLogs checks that for the current exported values for logs exporter metrics match given values. -// When this function is called it is required to also call SetupTelemetry as first thing. -func (tts *TestTelemetry) CheckProcessorLogs(acceptedLogRecords, refusedLogRecords, droppedLogRecords, insertedLogRecords int64) error { - return tts.prometheusChecker.checkProcessorLogs(tts.id, acceptedLogRecords, refusedLogRecords, droppedLogRecords, insertedLogRecords) +// Note: SetupTelemetry must be called before this function. +func (tts *TestTelemetry) CheckProcessorLogs(acceptedLogRecords, refusedLogRecords, droppedLogRecords int64) error { + return tts.prometheusChecker.checkProcessorLogs(tts.id, acceptedLogRecords, refusedLogRecords, droppedLogRecords) } // CheckReceiverTraces checks that for the current exported values for trace receiver metrics match given values. -// When this function is called it is required to also call SetupTelemetry as first thing. +// Note: SetupTelemetry must be called before this function. func (tts *TestTelemetry) CheckReceiverTraces(protocol string, acceptedSpans, droppedSpans int64) error { return tts.prometheusChecker.checkReceiverTraces(tts.id, protocol, acceptedSpans, droppedSpans) } // CheckReceiverLogs checks that for the current exported values for logs receiver metrics match given values. -// When this function is called it is required to also call SetupTelemetry as first thing. +// Note: SetupTelemetry must be called before this function. func (tts *TestTelemetry) CheckReceiverLogs(protocol string, acceptedLogRecords, droppedLogRecords int64) error { return tts.prometheusChecker.checkReceiverLogs(tts.id, protocol, acceptedLogRecords, droppedLogRecords) } // CheckReceiverMetrics checks that for the current exported values for metrics receiver metrics match given values. -// When this function is called it is required to also call SetupTelemetry as first thing. +// Note: SetupTelemetry must be called before this function. func (tts *TestTelemetry) CheckReceiverMetrics(protocol string, acceptedMetricPoints, droppedMetricPoints int64) error { return tts.prometheusChecker.checkReceiverMetrics(tts.id, protocol, acceptedMetricPoints, droppedMetricPoints) } // CheckScraperMetrics checks that for the current exported values for metrics scraper metrics match given values. -// When this function is called it is required to also call SetupTelemetry as first thing. +// Note: SetupTelemetry must be called before this function. func (tts *TestTelemetry) CheckScraperMetrics(receiver component.ID, scraper component.ID, scrapedMetricPoints, erroredMetricPoints int64) error { return tts.prometheusChecker.checkScraperMetrics(receiver, scraper, scrapedMetricPoints, erroredMetricPoints) } @@ -137,9 +137,9 @@ func (tts *TestTelemetry) TelemetrySettings() component.TelemetrySettings { return tts.ts } -// SetupTelemetry does setup the testing environment to check the metrics recorded by receivers, producers or exporters. -// The caller must pass the ID of the component that intends to test, so the CreateSettings and Check methods will use. -// The caller should defer a call to Shutdown the returned TestTelemetry. +// SetupTelemetry sets up the testing environment to check the metrics recorded by receivers, producers, or exporters. +// The caller must pass the ID of the component being tested. The ID will be used by the CreateSettings and Check methods. +// The caller must defer a call to `Shutdown` on the returned TestTelemetry. func SetupTelemetry(id component.ID) (TestTelemetry, error) { sr := new(tracetest.SpanRecorder) tp := sdktrace.NewTracerProvider(sdktrace.WithSpanProcessor(sr)) diff --git a/component/componenttest/otelprometheuschecker.go b/component/componenttest/otelprometheuschecker.go index 6a63617c206..14b357b9704 100644 --- a/component/componenttest/otelprometheuschecker.go +++ b/component/componenttest/otelprometheuschecker.go @@ -48,25 +48,24 @@ func (pc *prometheusChecker) checkReceiver(receiver component.ID, datatype, prot pc.checkCounter(fmt.Sprintf("receiver_refused_%s", datatype), droppedMetricPoints, receiverAttrs)) } -func (pc *prometheusChecker) checkProcessorTraces(processor component.ID, accepted, refused, dropped, inserted int64) error { - return pc.checkProcessor(processor, "spans", accepted, refused, dropped, inserted) +func (pc *prometheusChecker) checkProcessorTraces(processor component.ID, accepted, refused, dropped int64) error { + return pc.checkProcessor(processor, "spans", accepted, refused, dropped) } -func (pc *prometheusChecker) checkProcessorMetrics(processor component.ID, accepted, refused, dropped, inserted int64) error { - return pc.checkProcessor(processor, "metric_points", accepted, refused, dropped, inserted) +func (pc *prometheusChecker) checkProcessorMetrics(processor component.ID, accepted, refused, dropped int64) error { + return pc.checkProcessor(processor, "metric_points", accepted, refused, dropped) } -func (pc *prometheusChecker) checkProcessorLogs(processor component.ID, accepted, refused, dropped, inserted int64) error { - return pc.checkProcessor(processor, "log_records", accepted, refused, dropped, inserted) +func (pc *prometheusChecker) checkProcessorLogs(processor component.ID, accepted, refused, dropped int64) error { + return pc.checkProcessor(processor, "log_records", accepted, refused, dropped) } -func (pc *prometheusChecker) checkProcessor(processor component.ID, datatype string, accepted, refused, dropped, inserted int64) error { +func (pc *prometheusChecker) checkProcessor(processor component.ID, datatype string, accepted, refused, dropped int64) error { processorAttrs := attributesForProcessorMetrics(processor) return multierr.Combine( pc.checkCounter(fmt.Sprintf("processor_accepted_%s", datatype), accepted, processorAttrs), pc.checkCounter(fmt.Sprintf("processor_refused_%s", datatype), refused, processorAttrs), pc.checkCounter(fmt.Sprintf("processor_dropped_%s", datatype), dropped, processorAttrs), - pc.checkCounter(fmt.Sprintf("processor_inserted_%s", datatype), inserted, processorAttrs), ) } diff --git a/component/componenttest/otelprometheuschecker_test.go b/component/componenttest/otelprometheuschecker_test.go index a2efb109355..d7176134f54 100644 --- a/component/componenttest/otelprometheuschecker_test.go +++ b/component/componenttest/otelprometheuschecker_test.go @@ -88,17 +88,17 @@ func TestPromChecker(t *testing.T) { ) assert.NoError(t, - pc.checkProcessorTraces(processor, 42, 13, 7, 5), + pc.checkProcessorTraces(processor, 42, 13, 7), "metrics from Receiver Traces should be valid", ) assert.NoError(t, - pc.checkProcessorMetrics(processor, 7, 41, 13, 4), + pc.checkProcessorMetrics(processor, 7, 41, 13), "metrics from Receiver Metrics should be valid", ) assert.NoError(t, - pc.checkProcessorLogs(processor, 102, 35, 14, 3), + pc.checkProcessorLogs(processor, 102, 35, 14), "metrics from Receiver Logs should be valid", ) diff --git a/component/config_test.go b/component/config_test.go index f47a9edc87c..afdbc61b06e 100644 --- a/component/config_test.go +++ b/component/config_test.go @@ -313,7 +313,6 @@ func TestNewType(t *testing.T) { {name: "loki"}, {name: "mdatagen"}, {name: "memcached"}, - {name: "memory_ballast"}, {name: "memory_limiter"}, {name: "metricstransform"}, {name: "mezmo"}, diff --git a/component/go.mod b/component/go.mod index 708c4140a1d..8b83b1c2f2b 100644 --- a/component/go.mod +++ b/component/go.mod @@ -3,18 +3,18 @@ module go.opentelemetry.io/collector/component go 1.22.0 require ( - github.com/prometheus/client_golang v1.20.2 + github.com/prometheus/client_golang v1.20.3 github.com/prometheus/client_model v0.6.1 - github.com/prometheus/common v0.56.0 + github.com/prometheus/common v0.59.1 github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector/config/configtelemetry v0.108.1 - go.opentelemetry.io/collector/pdata v1.14.1 - go.opentelemetry.io/otel v1.29.0 - go.opentelemetry.io/otel/exporters/prometheus v0.51.0 - go.opentelemetry.io/otel/metric v1.29.0 - go.opentelemetry.io/otel/sdk v1.29.0 - go.opentelemetry.io/otel/sdk/metric v1.29.0 - go.opentelemetry.io/otel/trace v1.29.0 + go.opentelemetry.io/collector/config/configtelemetry v0.109.0 + go.opentelemetry.io/collector/pdata v1.15.0 + go.opentelemetry.io/otel v1.30.0 + go.opentelemetry.io/otel/exporters/prometheus v0.52.0 + go.opentelemetry.io/otel/metric v1.30.0 + go.opentelemetry.io/otel/sdk v1.30.0 + go.opentelemetry.io/otel/sdk/metric v1.30.0 + go.opentelemetry.io/otel/trace v1.30.0 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.27.0 @@ -32,11 +32,11 @@ require ( github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect - golang.org/x/net v0.27.0 // indirect - golang.org/x/sys v0.24.0 // indirect - golang.org/x/text v0.16.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect - google.golang.org/grpc v1.65.0 // indirect + golang.org/x/net v0.28.0 // indirect + golang.org/x/sys v0.25.0 // indirect + golang.org/x/text v0.17.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect + google.golang.org/grpc v1.66.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/component/go.sum b/component/go.sum index fe1d77fb117..dc25c056423 100644 --- a/component/go.sum +++ b/component/go.sum @@ -29,12 +29,12 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg= -github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= +github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.56.0 h1:UffReloqkBtvtQEYDg2s+uDPGRrJyC6vZWPGXf6OhPY= -github.com/prometheus/common v0.56.0/go.mod h1:7uRPFSUTbfZWsJ7MHY56sqt7hLQu3bxXHDnNhl8E9qI= +github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= +github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= @@ -43,18 +43,18 @@ 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.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= -go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0 h1:G7uexXb/K3T+T9fNLCCKncweEtNEBMTO+46hKX5EdKw= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0/go.mod h1:v0mFe5Kk7woIh938mrZBJBmENYquyA0IICrlYm4Y0t4= -go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= -go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= -go.opentelemetry.io/otel/sdk v1.29.0 h1:vkqKjk7gwhS8VaWb0POZKmIEDimRCMsopNYnriHyryo= -go.opentelemetry.io/otel/sdk v1.29.0/go.mod h1:pM8Dx5WKnvxLCb+8lG1PRNIDxu9g9b9g59Qr7hfAAok= -go.opentelemetry.io/otel/sdk/metric v1.29.0 h1:K2CfmJohnRgvZ9UAj2/FhIf/okdWcNdBwe1m8xFXiSY= -go.opentelemetry.io/otel/sdk/metric v1.29.0/go.mod h1:6zZLdCl2fkauYoZIOn/soQIDSWFmNSRcICarHfuhNJQ= -go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= -go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= +go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= +go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= +go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= +go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= +go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= +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.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= @@ -70,20 +70,20 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= -golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -92,10 +92,10 @@ 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/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 h1:Zy9XzmMEflZ/MAaA7vNcoebnRAld7FsPW1EeBB7V0m8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 h1:1GBuWVLM/KMVUv1t1En5Gs+gFZCNd360GGb4sSxtrhU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= 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= diff --git a/config/configauth/go.mod b/config/configauth/go.mod index 1f4a1830c95..838162c7da2 100644 --- a/config/configauth/go.mod +++ b/config/configauth/go.mod @@ -4,43 +4,34 @@ go 1.22.0 require ( github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector/component v0.108.1 - go.opentelemetry.io/collector/extension v0.108.1 - go.opentelemetry.io/collector/extension/auth v0.108.1 + go.opentelemetry.io/collector/component v0.109.0 + go.opentelemetry.io/collector/extension v0.109.0 + go.opentelemetry.io/collector/extension/auth v0.109.0 go.uber.org/goleak v1.3.0 ) require ( github.com/davecgh/go-spew v1.1.1 // indirect - github.com/go-viper/mapstructure/v2 v2.1.0 // 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 - github.com/knadh/koanf/v2 v2.1.1 // indirect - github.com/mitchellh/copystructure v1.2.0 // indirect - github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.108.1 // indirect - go.opentelemetry.io/collector/confmap v1.14.1 // indirect - go.opentelemetry.io/collector/pdata v1.14.1 // indirect - go.opentelemetry.io/otel v1.29.0 // indirect - go.opentelemetry.io/otel/metric v1.29.0 // indirect - go.opentelemetry.io/otel/trace v1.29.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.109.0 // indirect + go.opentelemetry.io/collector/pdata v1.15.0 // indirect + go.opentelemetry.io/otel v1.30.0 // indirect + go.opentelemetry.io/otel/metric v1.30.0 // indirect + go.opentelemetry.io/otel/trace v1.30.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/net v0.27.0 // indirect - golang.org/x/sys v0.24.0 // indirect - golang.org/x/text v0.16.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect - google.golang.org/grpc v1.65.0 // indirect + golang.org/x/net v0.28.0 // indirect + golang.org/x/sys v0.25.0 // indirect + golang.org/x/text v0.17.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect + google.golang.org/grpc v1.66.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) replace go.opentelemetry.io/collector/pdata => ../../pdata -replace go.opentelemetry.io/collector/confmap => ../../confmap - replace go.opentelemetry.io/collector/component => ../../component replace go.opentelemetry.io/collector/config/configtelemetry => ../configtelemetry @@ -48,5 +39,3 @@ replace go.opentelemetry.io/collector/config/configtelemetry => ../configtelemet replace go.opentelemetry.io/collector/extension => ../../extension replace go.opentelemetry.io/collector/extension/auth => ../../extension/auth - -replace go.opentelemetry.io/collector/component/componentstatus => ../../component/componentstatus diff --git a/config/configauth/go.sum b/config/configauth/go.sum index 6b44477f2d9..69f293e7bf3 100644 --- a/config/configauth/go.sum +++ b/config/configauth/go.sum @@ -8,8 +8,6 @@ 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/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= @@ -20,30 +18,20 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= -github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= -github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= -github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= -github.com/knadh/koanf/providers/confmap v0.1.0/go.mod h1:2uLhxQzJnyHKfxG927awZC7+fyHFdQkd697K4MdLnIU= -github.com/knadh/koanf/v2 v2.1.1 h1:/R8eXqasSTsmDCsAyYj+81Wteg8AqrV9CP6gvsTsOmM= -github.com/knadh/koanf/v2 v2.1.1/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= -github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= -github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= -github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg= -github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= +github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.56.0 h1:UffReloqkBtvtQEYDg2s+uDPGRrJyC6vZWPGXf6OhPY= -github.com/prometheus/common v0.56.0/go.mod h1:7uRPFSUTbfZWsJ7MHY56sqt7hLQu3bxXHDnNhl8E9qI= +github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= +github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= @@ -52,18 +40,18 @@ 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.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= -go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0 h1:G7uexXb/K3T+T9fNLCCKncweEtNEBMTO+46hKX5EdKw= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0/go.mod h1:v0mFe5Kk7woIh938mrZBJBmENYquyA0IICrlYm4Y0t4= -go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= -go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= -go.opentelemetry.io/otel/sdk v1.29.0 h1:vkqKjk7gwhS8VaWb0POZKmIEDimRCMsopNYnriHyryo= -go.opentelemetry.io/otel/sdk v1.29.0/go.mod h1:pM8Dx5WKnvxLCb+8lG1PRNIDxu9g9b9g59Qr7hfAAok= -go.opentelemetry.io/otel/sdk/metric v1.29.0 h1:K2CfmJohnRgvZ9UAj2/FhIf/okdWcNdBwe1m8xFXiSY= -go.opentelemetry.io/otel/sdk/metric v1.29.0/go.mod h1:6zZLdCl2fkauYoZIOn/soQIDSWFmNSRcICarHfuhNJQ= -go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= -go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= +go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= +go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= +go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= +go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= +go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= +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.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,20 +67,20 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= -golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -101,10 +89,10 @@ 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/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 h1:Zy9XzmMEflZ/MAaA7vNcoebnRAld7FsPW1EeBB7V0m8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 h1:1GBuWVLM/KMVUv1t1En5Gs+gFZCNd360GGb4sSxtrhU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= 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= diff --git a/config/configgrpc/configgrpc_test.go b/config/configgrpc/configgrpc_test.go index a172eaaafa3..da97997545c 100644 --- a/config/configgrpc/configgrpc_test.go +++ b/config/configgrpc/configgrpc_test.go @@ -35,7 +35,7 @@ import ( "go.opentelemetry.io/collector/extension/auth" "go.opentelemetry.io/collector/extension/auth/authtest" "go.opentelemetry.io/collector/featuregate" - "go.opentelemetry.io/collector/internal/localhostgate" + "go.opentelemetry.io/collector/internal/globalgates" "go.opentelemetry.io/collector/pdata/ptrace/ptraceotlp" ) @@ -494,11 +494,11 @@ func TestUseSecure(t *testing.T) { } func TestGRPCServerWarning(t *testing.T) { - prev := localhostgate.UseLocalHostAsDefaultHostfeatureGate.IsEnabled() - require.NoError(t, featuregate.GlobalRegistry().Set(localhostgate.UseLocalHostAsDefaultHostID, false)) + prev := globalgates.UseLocalHostAsDefaultHostfeatureGate.IsEnabled() + require.NoError(t, featuregate.GlobalRegistry().Set(globalgates.UseLocalHostAsDefaultHostID, false)) defer func() { // Restore previous value. - require.NoError(t, featuregate.GlobalRegistry().Set(localhostgate.UseLocalHostAsDefaultHostID, prev)) + require.NoError(t, featuregate.GlobalRegistry().Set(globalgates.UseLocalHostAsDefaultHostID, prev)) }() tests := []struct { diff --git a/config/configgrpc/go.mod b/config/configgrpc/go.mod index 8b03b296bcf..c5ac470b783 100644 --- a/config/configgrpc/go.mod +++ b/config/configgrpc/go.mod @@ -5,25 +5,25 @@ go 1.22.0 require ( github.com/mostynb/go-grpc-compression v1.2.3 github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector v0.108.1 - go.opentelemetry.io/collector/client v1.14.1 - go.opentelemetry.io/collector/component v0.108.1 - go.opentelemetry.io/collector/config/configauth v0.108.1 - go.opentelemetry.io/collector/config/configcompression v1.14.1 - go.opentelemetry.io/collector/config/confignet v0.108.1 - go.opentelemetry.io/collector/config/configopaque v1.14.1 - go.opentelemetry.io/collector/config/configtelemetry v0.108.1 - go.opentelemetry.io/collector/config/configtls v1.14.1 - go.opentelemetry.io/collector/config/internal v0.108.1 - go.opentelemetry.io/collector/extension/auth v0.108.1 - go.opentelemetry.io/collector/featuregate v1.14.1 - go.opentelemetry.io/collector/pdata v1.14.1 - go.opentelemetry.io/collector/pdata/testdata v0.108.1 + go.opentelemetry.io/collector/client v1.15.0 + go.opentelemetry.io/collector/component v0.109.0 + go.opentelemetry.io/collector/config/configauth v0.109.0 + go.opentelemetry.io/collector/config/configcompression v1.15.0 + go.opentelemetry.io/collector/config/confignet v0.109.0 + go.opentelemetry.io/collector/config/configopaque v1.15.0 + go.opentelemetry.io/collector/config/configtelemetry v0.109.0 + go.opentelemetry.io/collector/config/configtls v1.15.0 + go.opentelemetry.io/collector/config/internal v0.109.0 + go.opentelemetry.io/collector/extension/auth v0.109.0 + go.opentelemetry.io/collector/featuregate v1.15.0 + go.opentelemetry.io/collector/internal/globalgates v0.109.0 + go.opentelemetry.io/collector/pdata v1.15.0 + go.opentelemetry.io/collector/pdata/testdata v0.109.0 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 - go.opentelemetry.io/otel v1.29.0 + go.opentelemetry.io/otel v1.30.0 go.uber.org/goleak v1.3.0 go.uber.org/zap v1.27.0 - google.golang.org/grpc v1.65.0 + google.golang.org/grpc v1.66.0 ) require ( @@ -33,45 +33,36 @@ 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/gogo/protobuf v1.3.2 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/uuid v1.6.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.9 // indirect - github.com/knadh/koanf/maps v0.1.1 // indirect - github.com/knadh/koanf/providers/confmap v0.1.0 // indirect - github.com/knadh/koanf/v2 v2.1.1 // indirect - github.com/mitchellh/copystructure v1.2.0 // indirect - github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.20.2 // indirect + github.com/prometheus/client_golang v1.20.3 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.56.0 // indirect + github.com/prometheus/common v0.59.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect - go.opentelemetry.io/collector/confmap v1.14.1 // indirect - go.opentelemetry.io/collector/extension v0.108.1 // indirect - go.opentelemetry.io/collector/pdata/pprofile v0.108.1 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.51.0 // indirect - go.opentelemetry.io/otel/metric v1.29.0 // indirect - go.opentelemetry.io/otel/sdk v1.29.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.29.0 // indirect - go.opentelemetry.io/otel/trace v1.29.0 // indirect + go.opentelemetry.io/collector/extension v0.109.0 // indirect + go.opentelemetry.io/collector/pdata/pprofile v0.109.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect + go.opentelemetry.io/otel/metric v1.30.0 // indirect + go.opentelemetry.io/otel/sdk v1.30.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect + go.opentelemetry.io/otel/trace v1.30.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.24.0 // indirect + golang.org/x/sys v0.25.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.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) -replace go.opentelemetry.io/collector => ../../ - replace go.opentelemetry.io/collector/client => ../../client replace go.opentelemetry.io/collector/config/configauth => ../configauth @@ -92,8 +83,6 @@ replace go.opentelemetry.io/collector/extension => ../../extension replace go.opentelemetry.io/collector/extension/auth => ../../extension/auth -replace go.opentelemetry.io/collector/confmap => ../../confmap - replace go.opentelemetry.io/collector/featuregate => ../../featuregate replace go.opentelemetry.io/collector/pdata => ../../pdata @@ -106,8 +95,4 @@ replace go.opentelemetry.io/collector/component => ../../component replace go.opentelemetry.io/collector/consumer => ../../consumer -replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../../consumer/consumerprofiles - -replace go.opentelemetry.io/collector/consumer/consumertest => ../../consumer/consumertest - -replace go.opentelemetry.io/collector/component/componentstatus => ../../component/componentstatus +replace go.opentelemetry.io/collector/internal/globalgates => ../../internal/globalgates diff --git a/config/configgrpc/go.sum b/config/configgrpc/go.sum index 5c04d206a56..39bfa0a61db 100644 --- a/config/configgrpc/go.sum +++ b/config/configgrpc/go.sum @@ -12,8 +12,6 @@ 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/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= @@ -31,22 +29,12 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= -github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= -github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= -github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= -github.com/knadh/koanf/providers/confmap v0.1.0/go.mod h1:2uLhxQzJnyHKfxG927awZC7+fyHFdQkd697K4MdLnIU= -github.com/knadh/koanf/v2 v2.1.1 h1:/R8eXqasSTsmDCsAyYj+81Wteg8AqrV9CP6gvsTsOmM= -github.com/knadh/koanf/v2 v2.1.1/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= -github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= -github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= -github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -58,16 +46,16 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg= -github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= +github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.56.0 h1:UffReloqkBtvtQEYDg2s+uDPGRrJyC6vZWPGXf6OhPY= -github.com/prometheus/common v0.56.0/go.mod h1:7uRPFSUTbfZWsJ7MHY56sqt7hLQu3bxXHDnNhl8E9qI= +github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= +github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= @@ -76,18 +64,18 @@ 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.54.0 h1:r6I7RJCN86bpD/FQwedZ0vSixDpwuWREjW9oRMsmqDc= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0/go.mod h1:B9yO6b04uB80CzjedvewuqDhxJxi11s7/GtiGa8bAjI= -go.opentelemetry.io/otel v1.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= -go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0 h1:G7uexXb/K3T+T9fNLCCKncweEtNEBMTO+46hKX5EdKw= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0/go.mod h1:v0mFe5Kk7woIh938mrZBJBmENYquyA0IICrlYm4Y0t4= -go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= -go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= -go.opentelemetry.io/otel/sdk v1.29.0 h1:vkqKjk7gwhS8VaWb0POZKmIEDimRCMsopNYnriHyryo= -go.opentelemetry.io/otel/sdk v1.29.0/go.mod h1:pM8Dx5WKnvxLCb+8lG1PRNIDxu9g9b9g59Qr7hfAAok= -go.opentelemetry.io/otel/sdk/metric v1.29.0 h1:K2CfmJohnRgvZ9UAj2/FhIf/okdWcNdBwe1m8xFXiSY= -go.opentelemetry.io/otel/sdk/metric v1.29.0/go.mod h1:6zZLdCl2fkauYoZIOn/soQIDSWFmNSRcICarHfuhNJQ= -go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= -go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= +go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= +go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= +go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= +go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= +go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= +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.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= @@ -111,8 +99,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.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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= @@ -127,8 +115,8 @@ 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= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd h1:6TEm2ZxXoQmFWFlt1vNxvVOa1Q0dXFQD1m/rYjXmS0E= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= 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= diff --git a/config/confighttp/README.md b/config/confighttp/README.md index d72a3805953..24d2905d7af 100644 --- a/config/confighttp/README.md +++ b/config/confighttp/README.md @@ -78,7 +78,7 @@ will not be enabled. header, allowing clients to cache the response to CORS preflight requests. If not set, browsers use a default of 5 seconds. - `endpoint`: Valid value syntax available [here](https://github.com/grpc/grpc/blob/master/doc/naming.md) -- `max_request_body_size`: configures the maximum allowed body size in bytes for a single request. Default: `0` (no restriction) +- `max_request_body_size`: configures the maximum allowed body size in bytes for a single request. Default: `20971520` (20MiB) - `compression_algorithms`: configures the list of compression algorithms the server can accept. Default: ["", "gzip", "zstd", "zlib", "snappy", "deflate"] - [`tls`](../configtls/README.md) - [`auth`](../configauth/README.md) diff --git a/config/confighttp/confighttp_test.go b/config/confighttp/confighttp_test.go index 78f0d2159be..9d08b561cc7 100644 --- a/config/confighttp/confighttp_test.go +++ b/config/confighttp/confighttp_test.go @@ -35,7 +35,7 @@ import ( "go.opentelemetry.io/collector/extension/auth" "go.opentelemetry.io/collector/extension/auth/authtest" "go.opentelemetry.io/collector/featuregate" - "go.opentelemetry.io/collector/internal/localhostgate" + "go.opentelemetry.io/collector/internal/globalgates" ) type customRoundTripper struct { @@ -520,11 +520,11 @@ func TestHTTPServerSettingsError(t *testing.T) { } func TestHTTPServerWarning(t *testing.T) { - prev := localhostgate.UseLocalHostAsDefaultHostfeatureGate.IsEnabled() - require.NoError(t, featuregate.GlobalRegistry().Set(localhostgate.UseLocalHostAsDefaultHostID, false)) + prev := globalgates.UseLocalHostAsDefaultHostfeatureGate.IsEnabled() + require.NoError(t, featuregate.GlobalRegistry().Set(globalgates.UseLocalHostAsDefaultHostID, false)) defer func() { // Restore previous value. - require.NoError(t, featuregate.GlobalRegistry().Set(localhostgate.UseLocalHostAsDefaultHostID, prev)) + require.NoError(t, featuregate.GlobalRegistry().Set(globalgates.UseLocalHostAsDefaultHostID, prev)) }() tests := []struct { @@ -1249,8 +1249,8 @@ func TestFailedServerAuth(t *testing.T) { srv.Handler.ServeHTTP(response, httptest.NewRequest("GET", "/", nil)) // verify - assert.Equal(t, response.Result().StatusCode, http.StatusUnauthorized) - assert.Equal(t, response.Result().Status, fmt.Sprintf("%v %s", http.StatusUnauthorized, http.StatusText(http.StatusUnauthorized))) + assert.Equal(t, http.StatusUnauthorized, response.Result().StatusCode) + assert.Equal(t, fmt.Sprintf("%v %s", http.StatusUnauthorized, http.StatusText(http.StatusUnauthorized)), response.Result().Status) } func TestServerWithErrorHandler(t *testing.T) { @@ -1259,7 +1259,7 @@ func TestServerWithErrorHandler(t *testing.T) { Endpoint: "localhost:0", } eh := func(w http.ResponseWriter, _ *http.Request, _ string, statusCode int) { - assert.Equal(t, statusCode, http.StatusBadRequest) + assert.Equal(t, http.StatusBadRequest, statusCode) // custom error handler changes returned status code http.Error(w, "invalid request", http.StatusInternalServerError) } @@ -1281,7 +1281,7 @@ func TestServerWithErrorHandler(t *testing.T) { srv.Handler.ServeHTTP(response, req) // verify - assert.Equal(t, response.Result().StatusCode, http.StatusInternalServerError) + assert.Equal(t, http.StatusInternalServerError, response.Result().StatusCode) } func TestServerWithDecoder(t *testing.T) { @@ -1309,7 +1309,7 @@ func TestServerWithDecoder(t *testing.T) { srv.Handler.ServeHTTP(response, req) // verify - assert.Equal(t, response.Result().StatusCode, http.StatusOK) + assert.Equal(t, http.StatusOK, response.Result().StatusCode) } @@ -1356,7 +1356,7 @@ func TestServerWithDecompression(t *testing.T) { // verifications is done mostly within the test, but this is only a sanity check // that we got into the test handler - assert.Equal(t, resp.StatusCode, http.StatusBadRequest) + assert.Equal(t, http.StatusBadRequest, resp.StatusCode) } func TestDefaultMaxRequestBodySize(t *testing.T) { diff --git a/config/confighttp/go.mod b/config/confighttp/go.mod index 86168be5788..edad28f0bb7 100644 --- a/config/confighttp/go.mod +++ b/config/confighttp/go.mod @@ -5,25 +5,25 @@ go 1.22.0 require ( github.com/golang/snappy v0.0.4 github.com/klauspost/compress v1.17.9 - github.com/rs/cors v1.11.0 + github.com/rs/cors v1.11.1 github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector v0.108.1 - go.opentelemetry.io/collector/client v1.14.1 - go.opentelemetry.io/collector/component v0.108.1 - go.opentelemetry.io/collector/config/configauth v0.108.1 - go.opentelemetry.io/collector/config/configcompression v1.14.1 - go.opentelemetry.io/collector/config/configopaque v1.14.1 - go.opentelemetry.io/collector/config/configtelemetry v0.108.1 - go.opentelemetry.io/collector/config/configtls v1.14.1 - go.opentelemetry.io/collector/config/internal v0.108.1 - go.opentelemetry.io/collector/extension/auth v0.108.1 - go.opentelemetry.io/collector/featuregate v1.14.1 + go.opentelemetry.io/collector/client v1.15.0 + go.opentelemetry.io/collector/component v0.109.0 + go.opentelemetry.io/collector/config/configauth v0.109.0 + go.opentelemetry.io/collector/config/configcompression v1.15.0 + go.opentelemetry.io/collector/config/configopaque v1.15.0 + go.opentelemetry.io/collector/config/configtelemetry v0.109.0 + go.opentelemetry.io/collector/config/configtls v1.15.0 + go.opentelemetry.io/collector/config/internal v0.109.0 + go.opentelemetry.io/collector/extension/auth v0.109.0 + go.opentelemetry.io/collector/featuregate v1.15.0 + go.opentelemetry.io/collector/internal/globalgates v0.109.0 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 - go.opentelemetry.io/otel v1.29.0 - go.opentelemetry.io/otel/metric v1.29.0 + go.opentelemetry.io/otel v1.30.0 + go.opentelemetry.io/otel/metric v1.30.0 go.uber.org/goleak v1.3.0 go.uber.org/zap v1.27.0 - golang.org/x/net v0.28.0 + golang.org/x/net v0.29.0 ) require ( @@ -34,39 +34,30 @@ 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/gogo/protobuf v1.3.2 // indirect github.com/google/uuid v1.6.0 // indirect github.com/hashicorp/go-version v1.7.0 // indirect - github.com/knadh/koanf/maps v0.1.1 // indirect - github.com/knadh/koanf/providers/confmap v0.1.0 // indirect - github.com/knadh/koanf/v2 v2.1.1 // indirect - github.com/mitchellh/copystructure v1.2.0 // indirect - github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.20.2 // indirect + github.com/prometheus/client_golang v1.20.3 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.56.0 // indirect + github.com/prometheus/common v0.59.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect - go.opentelemetry.io/collector/confmap v1.14.1 // indirect - go.opentelemetry.io/collector/extension v0.108.1 // indirect - go.opentelemetry.io/collector/pdata v1.14.1 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.51.0 // indirect - go.opentelemetry.io/otel/sdk v1.29.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.29.0 // indirect - go.opentelemetry.io/otel/trace v1.29.0 // indirect + go.opentelemetry.io/collector/extension v0.109.0 // indirect + go.opentelemetry.io/collector/pdata v1.15.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect + go.opentelemetry.io/otel/sdk v1.30.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect + go.opentelemetry.io/otel/trace v1.30.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/sys v0.24.0 // indirect - golang.org/x/text v0.17.0 // indirect + golang.org/x/sys v0.25.0 // indirect + golang.org/x/text v0.18.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd // indirect - google.golang.org/grpc v1.65.0 // indirect + google.golang.org/grpc v1.66.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) -replace go.opentelemetry.io/collector => ../../ - replace go.opentelemetry.io/collector/config/configauth => ../configauth replace go.opentelemetry.io/collector/config/configcompression => ../configcompression @@ -83,8 +74,6 @@ replace go.opentelemetry.io/collector/extension => ../../extension replace go.opentelemetry.io/collector/extension/auth => ../../extension/auth -replace go.opentelemetry.io/collector/confmap => ../../confmap - replace go.opentelemetry.io/collector/featuregate => ../../featuregate replace go.opentelemetry.io/collector/pdata => ../../pdata @@ -99,8 +88,4 @@ replace go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata replace go.opentelemetry.io/collector/pdata/pprofile => ../../pdata/pprofile -replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../../consumer/consumerprofiles - -replace go.opentelemetry.io/collector/consumer/consumertest => ../../consumer/consumertest - -replace go.opentelemetry.io/collector/component/componentstatus => ../../component/componentstatus +replace go.opentelemetry.io/collector/internal/globalgates => ../../internal/globalgates diff --git a/config/confighttp/go.sum b/config/confighttp/go.sum index 2a94662bbab..0a5b63ac7c5 100644 --- a/config/confighttp/go.sum +++ b/config/confighttp/go.sum @@ -13,8 +13,6 @@ 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/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= @@ -31,22 +29,12 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= -github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= -github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= -github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= -github.com/knadh/koanf/providers/confmap v0.1.0/go.mod h1:2uLhxQzJnyHKfxG927awZC7+fyHFdQkd697K4MdLnIU= -github.com/knadh/koanf/v2 v2.1.1 h1:/R8eXqasSTsmDCsAyYj+81Wteg8AqrV9CP6gvsTsOmM= -github.com/knadh/koanf/v2 v2.1.1/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= -github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= -github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= -github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= @@ -55,36 +43,36 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg= -github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= +github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.56.0 h1:UffReloqkBtvtQEYDg2s+uDPGRrJyC6vZWPGXf6OhPY= -github.com/prometheus/common v0.56.0/go.mod h1:7uRPFSUTbfZWsJ7MHY56sqt7hLQu3bxXHDnNhl8E9qI= +github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= +github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= -github.com/rs/cors v1.11.0 h1:0B9GE/r9Bc2UxRMMtymBkHTenPkHDv0CW4Y98GBY+po= -github.com/rs/cors v1.11.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= +github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= +github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= 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= 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/contrib/instrumentation/net/http/otelhttp v0.54.0 h1:TT4fX+nBOA/+LUkobKGW1ydGcn+G3vRw9+g5HwCphpk= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0/go.mod h1:L7UH0GbB0p47T4Rri3uHjbpCFYrVrwc1I25QhNPiGK8= -go.opentelemetry.io/otel v1.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= -go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0 h1:G7uexXb/K3T+T9fNLCCKncweEtNEBMTO+46hKX5EdKw= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0/go.mod h1:v0mFe5Kk7woIh938mrZBJBmENYquyA0IICrlYm4Y0t4= -go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= -go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= -go.opentelemetry.io/otel/sdk v1.29.0 h1:vkqKjk7gwhS8VaWb0POZKmIEDimRCMsopNYnriHyryo= -go.opentelemetry.io/otel/sdk v1.29.0/go.mod h1:pM8Dx5WKnvxLCb+8lG1PRNIDxu9g9b9g59Qr7hfAAok= -go.opentelemetry.io/otel/sdk/metric v1.29.0 h1:K2CfmJohnRgvZ9UAj2/FhIf/okdWcNdBwe1m8xFXiSY= -go.opentelemetry.io/otel/sdk/metric v1.29.0/go.mod h1:6zZLdCl2fkauYoZIOn/soQIDSWFmNSRcICarHfuhNJQ= -go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= -go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= +go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= +go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= +go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= +go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= +go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= +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.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= @@ -100,20 +88,20 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= -golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= +golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= +golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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= -golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -124,8 +112,8 @@ 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= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd h1:6TEm2ZxXoQmFWFlt1vNxvVOa1Q0dXFQD1m/rYjXmS0E= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= 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= diff --git a/config/configtls/configtls_test.go b/config/configtls/configtls_test.go index 91c0e871055..cbcd7433db4 100644 --- a/config/configtls/configtls_test.go +++ b/config/configtls/configtls_test.go @@ -679,7 +679,7 @@ func TestConfigValidate(t *testing.T) { err := test.tlsConfig.Validate() if test.errorTxt == "" { - assert.Nil(t, err) + assert.NoError(t, err) } else { assert.EqualError(t, err, test.errorTxt) } diff --git a/config/configtls/go.mod b/config/configtls/go.mod index b0f03303b77..f1f71f3bd3a 100644 --- a/config/configtls/go.mod +++ b/config/configtls/go.mod @@ -5,7 +5,7 @@ go 1.22.0 require ( github.com/fsnotify/fsnotify v1.7.0 github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector/config/configopaque v1.14.1 + go.opentelemetry.io/collector/config/configopaque v1.15.0 ) require ( diff --git a/config/internal/go.mod b/config/internal/go.mod index 85e332c7b8d..8fad43d6125 100644 --- a/config/internal/go.mod +++ b/config/internal/go.mod @@ -4,7 +4,7 @@ go 1.22.0 require ( github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector v0.108.1 + go.opentelemetry.io/collector/internal/globalgates v0.109.0 go.uber.org/goleak v1.3.0 go.uber.org/zap v1.27.0 ) @@ -13,31 +13,12 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/hashicorp/go-version v1.7.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - go.opentelemetry.io/collector/featuregate v1.14.1 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect + go.opentelemetry.io/collector/featuregate v1.15.0 // indirect go.uber.org/multierr v1.11.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) -replace go.opentelemetry.io/collector => ../../ +replace go.opentelemetry.io/collector/internal/globalgates => ../../internal/globalgates replace go.opentelemetry.io/collector/featuregate => ../../featuregate - -replace go.opentelemetry.io/collector/confmap => ../../confmap - -replace go.opentelemetry.io/collector/config/configtelemetry => ../configtelemetry - -replace go.opentelemetry.io/collector/pdata => ../../pdata - -replace go.opentelemetry.io/collector/consumer => ../../consumer - -replace go.opentelemetry.io/collector/component => ../../component - -replace go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata - -replace go.opentelemetry.io/collector/pdata/pprofile => ../../pdata/pprofile - -replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../../consumer/consumerprofiles - -replace go.opentelemetry.io/collector/consumer/consumertest => ../../consumer/consumertest - -replace go.opentelemetry.io/collector/component/componentstatus => ../../component/componentstatus diff --git a/config/internal/go.sum b/config/internal/go.sum index 8ecb783497e..9e6446c034d 100644 --- a/config/internal/go.sum +++ b/config/internal/go.sum @@ -8,8 +8,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= 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/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/stretchr/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= diff --git a/config/internal/warning.go b/config/internal/warning.go index f9e32fc1c64..26eca49a7bb 100644 --- a/config/internal/warning.go +++ b/config/internal/warning.go @@ -10,7 +10,7 @@ import ( "go.uber.org/zap" - "go.opentelemetry.io/collector/internal/localhostgate" + "go.opentelemetry.io/collector/internal/globalgates" ) func shouldWarn(endpoint string) bool { @@ -38,14 +38,14 @@ func shouldWarn(endpoint string) bool { // WarnOnUnspecifiedHost emits a warning if an endpoint has an unspecified host. func WarnOnUnspecifiedHost(logger *zap.Logger, endpoint string) { - if !localhostgate.UseLocalHostAsDefaultHostfeatureGate.IsEnabled() && shouldWarn(endpoint) { + if !globalgates.UseLocalHostAsDefaultHostfeatureGate.IsEnabled() && shouldWarn(endpoint) { logger.Warn( "Using the 0.0.0.0 address exposes this server to every network interface, which may facilitate Denial of Service attacks. Enable the feature gate to change the default and remove this warning.", zap.String( "documentation", "https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/security-best-practices.md#safeguards-against-denial-of-service-attacks", ), - zap.String("feature gate ID", localhostgate.UseLocalHostAsDefaultHostID), + zap.String("feature gate ID", globalgates.UseLocalHostAsDefaultHostID), ) } } diff --git a/confmap/confmap.go b/confmap/confmap.go index a340dabbd1c..fce5d0267d0 100644 --- a/confmap/confmap.go +++ b/confmap/confmap.go @@ -172,8 +172,13 @@ func (l *Conf) Sub(key string) (*Conf, error) { return New(), nil } - if v, ok := data.(map[string]any); ok { + switch v := data.(type) { + case map[string]any: return NewFromStringMap(v), nil + case expandedValue: + if m, ok := v.Value.(map[string]any); ok { + return NewFromStringMap(m), nil + } } return nil, fmt.Errorf("unexpected sub-config value kind for key:%s value:%v kind:%v", key, data, reflect.TypeOf(data).Kind()) diff --git a/confmap/confmap_test.go b/confmap/confmap_test.go index 3c5a118836c..24682c20347 100644 --- a/confmap/confmap_test.go +++ b/confmap/confmap_test.go @@ -876,6 +876,28 @@ func TestExpandedValue(t *testing.T) { assert.Error(t, cm.Unmarshal(&cfgBool)) } +func TestSubExpandedValue(t *testing.T) { + cm := NewFromStringMap(map[string]any{ + "key": map[string]any{ + "subkey": expandedValue{ + Value: map[string]any{"subsubkey": "value"}, + Original: "subsubkey: value", + }, + }, + }) + + assert.Equal(t, map[string]any{"subkey": map[string]any{"subsubkey": "value"}}, cm.Get("key")) + assert.Equal(t, map[string]any{"key": map[string]any{"subkey": map[string]any{"subsubkey": "value"}}}, cm.ToStringMap()) + assert.Equal(t, map[string]any{"subsubkey": "value"}, cm.Get("key::subkey")) + + sub, err := cm.Sub("key::subkey") + assert.NoError(t, err) + assert.Equal(t, map[string]any{"subsubkey": "value"}, sub.ToStringMap()) + + // This should return value, but currently `Get` does not support keys within expanded values. + assert.Nil(t, cm.Get("key::subkey::subsubkey")) +} + func TestStringyTypes(t *testing.T) { tests := []struct { valueOfType any diff --git a/confmap/converter/expandconverter/go.mod b/confmap/converter/expandconverter/go.mod index ef0aaf3137a..be326dccce9 100644 --- a/confmap/converter/expandconverter/go.mod +++ b/confmap/converter/expandconverter/go.mod @@ -6,7 +6,7 @@ go 1.22.0 require ( github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector/confmap v1.14.1 + go.opentelemetry.io/collector/confmap v1.15.0 go.uber.org/goleak v1.3.0 go.uber.org/zap v1.27.0 ) diff --git a/confmap/internal/e2e/go.mod b/confmap/internal/e2e/go.mod index 0898c5b5dce..158020f33ec 100644 --- a/confmap/internal/e2e/go.mod +++ b/confmap/internal/e2e/go.mod @@ -4,10 +4,10 @@ go 1.22.0 require ( github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector/config/configopaque v1.14.1 - go.opentelemetry.io/collector/confmap v1.14.1 - go.opentelemetry.io/collector/confmap/provider/envprovider v0.108.1 - go.opentelemetry.io/collector/confmap/provider/fileprovider v0.108.1 + go.opentelemetry.io/collector/config/configopaque v1.15.0 + go.opentelemetry.io/collector/confmap v1.15.0 + go.opentelemetry.io/collector/confmap/provider/envprovider v1.15.0 + go.opentelemetry.io/collector/confmap/provider/fileprovider v1.15.0 ) require ( diff --git a/confmap/internal/e2e/types_test.go b/confmap/internal/e2e/types_test.go index f95e6bf56a7..6085ba0a438 100644 --- a/confmap/internal/e2e/types_test.go +++ b/confmap/internal/e2e/types_test.go @@ -419,43 +419,42 @@ func TestIssue10787(t *testing.T) { resolver := NewResolver(t, "issue-10787-main.yaml") conf, err := resolver.Resolve(context.Background()) require.NoError(t, err) - assert.Equal(t, conf.ToStringMap(), - map[string]any{ - "exporters": map[string]any{ - "debug": map[string]any{ - "verbosity": "detailed", - }, - }, - "processors": map[string]any{ - "batch": nil, + assert.Equal(t, map[string]any{ + "exporters": map[string]any{ + "debug": map[string]any{ + "verbosity": "detailed", }, - "receivers": map[string]any{ - "otlp": map[string]any{ - "protocols": map[string]any{ - "grpc": map[string]any{ - "endpoint": "0.0.0.0:4317", - }, - "http": map[string]any{ - "endpoint": "0.0.0.0:4318", - }, + }, + "processors": map[string]any{ + "batch": nil, + }, + "receivers": map[string]any{ + "otlp": map[string]any{ + "protocols": map[string]any{ + "grpc": map[string]any{ + "endpoint": "0.0.0.0:4317", + }, + "http": map[string]any{ + "endpoint": "0.0.0.0:4318", }, }, }, - "service": map[string]any{ - "pipelines": map[string]any{ - "traces": map[string]any{ - "exporters": []any{"debug"}, - "processors": []any{"batch"}, - "receivers": []any{"otlp"}, - }, + }, + "service": map[string]any{ + "pipelines": map[string]any{ + "traces": map[string]any{ + "exporters": []any{"debug"}, + "processors": []any{"batch"}, + "receivers": []any{"otlp"}, }, - "telemetry": map[string]any{ - "metrics": map[string]any{ - "level": "detailed", - }, + }, + "telemetry": map[string]any{ + "metrics": map[string]any{ + "level": "detailed", }, }, }, + }, conf.ToStringMap(), ) } @@ -582,9 +581,9 @@ func TestIndirectSliceEnvVar(t *testing.T) { var collectorConf CollectorConf err = conf.Unmarshal(&collectorConf) require.NoError(t, err) - assert.Equal(t, collectorConf.Exporters.OTLP.Endpoint, "localhost:4317") - assert.Equal(t, collectorConf.Service.Pipelines.Logs.Receivers, []string{"nop", "otlp"}) - assert.Equal(t, collectorConf.Service.Pipelines.Logs.Exporters, []string{"otlp", "nop"}) + assert.Equal(t, "localhost:4317", collectorConf.Exporters.OTLP.Endpoint) + assert.Equal(t, []string{"nop", "otlp"}, collectorConf.Service.Pipelines.Logs.Receivers) + assert.Equal(t, []string{"otlp", "nop"}, collectorConf.Service.Pipelines.Logs.Exporters) } func TestIssue10937_MapType(t *testing.T) { @@ -647,6 +646,7 @@ func TestIssue10937_ComplexType(t *testing.T) { } func TestIssue10949_UnsetVar(t *testing.T) { + t.Setenv("ENV", "") resolver := NewResolver(t, "types_expand.yaml") conf, err := resolver.Resolve(context.Background()) require.NoError(t, err) diff --git a/confmap/internal/mapstructure/encoder_test.go b/confmap/internal/mapstructure/encoder_test.go index a0cdb75fb75..e6da809703a 100644 --- a/confmap/internal/mapstructure/encoder_test.go +++ b/confmap/internal/mapstructure/encoder_test.go @@ -306,7 +306,7 @@ func TestEncodeNonStringEncodedKey(t *testing.T) { } got, err := enc.Encode(testCase) require.Error(t, err) - require.True(t, errors.Is(err, errNonStringEncodedKey)) + require.ErrorIs(t, err, errNonStringEncodedKey) require.Nil(t, got) } @@ -358,7 +358,7 @@ func TestEncodeStructError(t *testing.T) { } got, err := enc.Encode(testCase) require.Error(t, err) - require.True(t, errors.Is(err, wantErr)) + require.ErrorIs(t, err, wantErr) require.Nil(t, got) } diff --git a/confmap/provider/envprovider/go.mod b/confmap/provider/envprovider/go.mod index 417153f4471..0199fb72936 100644 --- a/confmap/provider/envprovider/go.mod +++ b/confmap/provider/envprovider/go.mod @@ -4,7 +4,7 @@ go 1.22.0 require ( github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector/confmap v1.14.1 + go.opentelemetry.io/collector/confmap v1.15.0 go.uber.org/goleak v1.3.0 go.uber.org/zap v1.27.0 ) diff --git a/confmap/provider/envprovider/provider.go b/confmap/provider/envprovider/provider.go index 4db1cb7601a..8a0b87a9174 100644 --- a/confmap/provider/envprovider/provider.go +++ b/confmap/provider/envprovider/provider.go @@ -27,6 +27,11 @@ type provider struct { // // This Provider supports "env" scheme, and can be called with a selector: // `env:NAME_OF_ENVIRONMENT_VARIABLE` +// +// A default value for unset variable can be provided after :- suffix, for example: +// `env:NAME_OF_ENVIRONMENT_VARIABLE:-default_value` +// +// See also: https://opentelemetry.io/docs/specs/otel/configuration/file-configuration/#environment-variable-substitution func NewFactory() confmap.ProviderFactory { return confmap.NewProviderFactory(newProvider) } @@ -41,14 +46,18 @@ func (emp *provider) Retrieve(_ context.Context, uri string, _ confmap.WatcherFu if !strings.HasPrefix(uri, schemeName+":") { return nil, fmt.Errorf("%q uri is not supported by %q provider", uri, schemeName) } - envVarName := uri[len(schemeName)+1:] + envVarName, defaultValuePtr := parseEnvVarURI(uri[len(schemeName)+1:]) if !envvar.ValidationRegexp.MatchString(envVarName) { return nil, fmt.Errorf("environment variable %q has invalid name: must match regex %s", envVarName, envvar.ValidationPattern) - } + val, exists := os.LookupEnv(envVarName) if !exists { - emp.logger.Warn("Configuration references unset environment variable", zap.String("name", envVarName)) + if defaultValuePtr != nil { + val = *defaultValuePtr + } else { + emp.logger.Warn("Configuration references unset environment variable", zap.String("name", envVarName)) + } } else if len(val) == 0 { emp.logger.Info("Configuration references empty environment variable", zap.String("name", envVarName)) } @@ -63,3 +72,13 @@ func (*provider) Scheme() string { func (*provider) Shutdown(context.Context) error { return nil } + +// returns (var name, default value) +func parseEnvVarURI(uri string) (string, *string) { + const defaultSuffix = ":-" + if strings.Contains(uri, defaultSuffix) { + parts := strings.SplitN(uri, defaultSuffix, 2) + return parts[0], &parts[1] + } + return uri, nil +} diff --git a/confmap/provider/envprovider/provider_test.go b/confmap/provider/envprovider/provider_test.go index 1f4b99c8318..482c7c03431 100644 --- a/confmap/provider/envprovider/provider_test.go +++ b/confmap/provider/envprovider/provider_test.go @@ -154,6 +154,42 @@ func TestEmptyEnvWithLoggerWarn(t *testing.T) { assert.Equal(t, envName, logLine.Context[0].String) } +func TestEnvWithDefaultValue(t *testing.T) { + env := createProvider() + tests := []struct { + name string + unset bool + value string + uri string + expectedVal string + expectedErr string + }{ + {name: "unset", unset: true, uri: "env:MY_VAR:-default % value", expectedVal: "default % value"}, + {name: "unset2", unset: true, uri: "env:MY_VAR:-", expectedVal: ""}, // empty default still applies + {name: "empty", value: "", uri: "env:MY_VAR:-foo", expectedVal: ""}, + {name: "not empty", value: "value", uri: "env:MY_VAR:-", expectedVal: "value"}, + {name: "syntax1", unset: true, uri: "env:-MY_VAR", expectedErr: "invalid name"}, + {name: "syntax2", unset: true, uri: "env:MY_VAR:-test:-test", expectedVal: "test:-test"}, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + if !test.unset { + t.Setenv("MY_VAR", test.value) + } + ret, err := env.Retrieve(context.Background(), test.uri, nil) + if test.expectedErr != "" { + require.ErrorContains(t, err, test.expectedErr) + return + } + require.NoError(t, err) + str, err := ret.AsString() + require.NoError(t, err) + assert.Equal(t, test.expectedVal, str) + }) + } + assert.NoError(t, env.Shutdown(context.Background())) +} + func createProvider() confmap.Provider { return NewFactory().Create(confmaptest.NewNopProviderSettings()) } diff --git a/confmap/provider/fileprovider/go.mod b/confmap/provider/fileprovider/go.mod index 0acefdd1420..1e2d279397a 100644 --- a/confmap/provider/fileprovider/go.mod +++ b/confmap/provider/fileprovider/go.mod @@ -4,7 +4,7 @@ go 1.22.0 require ( github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector/confmap v1.14.1 + go.opentelemetry.io/collector/confmap v1.15.0 go.uber.org/goleak v1.3.0 ) diff --git a/confmap/provider/httpprovider/go.mod b/confmap/provider/httpprovider/go.mod index f22a4a96720..fe05d95f1b0 100644 --- a/confmap/provider/httpprovider/go.mod +++ b/confmap/provider/httpprovider/go.mod @@ -4,7 +4,7 @@ go 1.22.0 require ( github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector/confmap v1.14.1 + go.opentelemetry.io/collector/confmap v1.15.0 go.uber.org/goleak v1.3.0 ) diff --git a/confmap/provider/httpsprovider/go.mod b/confmap/provider/httpsprovider/go.mod index 932781cdf5e..1b83510df6c 100644 --- a/confmap/provider/httpsprovider/go.mod +++ b/confmap/provider/httpsprovider/go.mod @@ -4,7 +4,7 @@ go 1.22.0 require ( github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector/confmap v1.14.1 + go.opentelemetry.io/collector/confmap v1.15.0 go.uber.org/goleak v1.3.0 ) diff --git a/confmap/provider/yamlprovider/go.mod b/confmap/provider/yamlprovider/go.mod index abb097aad20..6a3bf4e458e 100644 --- a/confmap/provider/yamlprovider/go.mod +++ b/confmap/provider/yamlprovider/go.mod @@ -4,7 +4,7 @@ go 1.22.0 require ( github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector/confmap v1.14.1 + go.opentelemetry.io/collector/confmap v1.15.0 go.uber.org/goleak v1.3.0 ) diff --git a/confmap/resolver_test.go b/confmap/resolver_test.go index e939d124acb..8509ba4fdc1 100644 --- a/confmap/resolver_test.go +++ b/confmap/resolver_test.go @@ -389,7 +389,7 @@ func TestResolverShutdownClosesWatch(t *testing.T) { go func() { errW, ok := <-resolver.Watch() // Channel is closed, no exception - assert.Nil(t, errW) + assert.NoError(t, errW) assert.False(t, ok) watcherWG.Done() }() diff --git a/connector/connectorprofiles/go.mod b/connector/connectorprofiles/go.mod index d25dde93266..ff8769d5bab 100644 --- a/connector/connectorprofiles/go.mod +++ b/connector/connectorprofiles/go.mod @@ -4,15 +4,15 @@ go 1.22.0 require ( github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector v0.108.1 - go.opentelemetry.io/collector/component v0.108.1 - go.opentelemetry.io/collector/component/componentprofiles v0.108.1 - go.opentelemetry.io/collector/connector v0.108.1 - go.opentelemetry.io/collector/consumer v0.108.1 - go.opentelemetry.io/collector/consumer/consumerprofiles v0.108.1 - go.opentelemetry.io/collector/consumer/consumertest v0.108.1 - go.opentelemetry.io/collector/pdata/pprofile v0.108.1 - go.opentelemetry.io/collector/pdata/testdata v0.108.1 + go.opentelemetry.io/collector v0.109.0 + go.opentelemetry.io/collector/component v0.109.0 + go.opentelemetry.io/collector/component/componentprofiles v0.109.0 + go.opentelemetry.io/collector/connector v0.109.0 + go.opentelemetry.io/collector/consumer v0.109.0 + go.opentelemetry.io/collector/consumer/consumerprofiles v0.109.0 + go.opentelemetry.io/collector/consumer/consumertest v0.109.0 + go.opentelemetry.io/collector/pdata/pprofile v0.109.0 + go.opentelemetry.io/collector/pdata/testdata v0.109.0 ) require ( @@ -22,18 +22,18 @@ 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/config/configtelemetry v0.108.1 // indirect - go.opentelemetry.io/collector/pdata v1.14.1 // indirect - go.opentelemetry.io/otel v1.29.0 // indirect - go.opentelemetry.io/otel/metric v1.29.0 // indirect - go.opentelemetry.io/otel/trace v1.29.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.109.0 // indirect + go.opentelemetry.io/collector/pdata v1.15.0 // indirect + go.opentelemetry.io/otel v1.30.0 // indirect + go.opentelemetry.io/otel/metric v1.30.0 // indirect + go.opentelemetry.io/otel/trace v1.30.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.24.0 // indirect + golang.org/x/sys v0.25.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.65.0 // indirect + google.golang.org/grpc v1.66.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) @@ -46,8 +46,6 @@ replace go.opentelemetry.io/collector/consumer/consumertest => ../../consumer/co replace go.opentelemetry.io/collector/pdata/pprofile => ../../pdata/pprofile -replace go.opentelemetry.io/collector/featuregate => ../../featuregate - replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../../consumer/consumerprofiles replace go.opentelemetry.io/collector/component/componentprofiles => ../../component/componentprofiles diff --git a/connector/connectorprofiles/go.sum b/connector/connectorprofiles/go.sum index 3d0d9cc3299..227adf3dbde 100644 --- a/connector/connectorprofiles/go.sum +++ b/connector/connectorprofiles/go.sum @@ -25,20 +25,20 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 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= 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.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= -go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= -go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= -go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= -go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= -go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= +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.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.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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= @@ -78,8 +78,8 @@ 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= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd h1:6TEm2ZxXoQmFWFlt1vNxvVOa1Q0dXFQD1m/rYjXmS0E= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= 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= diff --git a/connector/connectorprofiles/profiles_router_test.go b/connector/connectorprofiles/profiles_router_test.go index fcec379dfba..08dc2490c11 100644 --- a/connector/connectorprofiles/profiles_router_test.go +++ b/connector/connectorprofiles/profiles_router_test.go @@ -120,8 +120,8 @@ func TestProfilessRouterConsumer(t *testing.T) { assert.Len(t, rcs, 2) assert.ElementsMatch(t, []component.ID{fooID, barID}, rcs) - assert.Len(t, foo.AllProfiles(), 0) - assert.Len(t, bar.AllProfiles(), 0) + assert.Empty(t, foo.AllProfiles()) + assert.Empty(t, bar.AllProfiles()) both, err := r.Consumer(fooID, barID) assert.NotNil(t, both) diff --git a/connector/forwardconnector/forward_test.go b/connector/forwardconnector/forward_test.go index f21711d0160..e3a9ef894b0 100644 --- a/connector/forwardconnector/forward_test.go +++ b/connector/forwardconnector/forward_test.go @@ -57,7 +57,7 @@ func TestForward(t *testing.T) { assert.NoError(t, metricsToMetrics.Shutdown(ctx)) assert.NoError(t, logsToLogs.Shutdown(ctx)) - assert.Equal(t, 1, len(tracesSink.AllTraces())) - assert.Equal(t, 2, len(metricsSink.AllMetrics())) - assert.Equal(t, 3, len(logsSink.AllLogs())) + assert.Len(t, tracesSink.AllTraces(), 1) + assert.Len(t, metricsSink.AllMetrics(), 2) + assert.Len(t, logsSink.AllLogs(), 3) } diff --git a/connector/forwardconnector/go.mod b/connector/forwardconnector/go.mod index 736c9a910ee..a40c074e75e 100644 --- a/connector/forwardconnector/go.mod +++ b/connector/forwardconnector/go.mod @@ -4,12 +4,12 @@ go 1.22.0 require ( github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector/component v0.108.1 - go.opentelemetry.io/collector/confmap v1.14.1 - go.opentelemetry.io/collector/connector v0.108.1 - go.opentelemetry.io/collector/consumer v0.108.1 - go.opentelemetry.io/collector/consumer/consumertest v0.108.1 - go.opentelemetry.io/collector/pdata v1.14.1 + go.opentelemetry.io/collector/component v0.109.0 + go.opentelemetry.io/collector/confmap v1.15.0 + go.opentelemetry.io/collector/connector v0.109.0 + go.opentelemetry.io/collector/consumer v0.109.0 + go.opentelemetry.io/collector/consumer/consumertest v0.109.0 + go.opentelemetry.io/collector/pdata v1.15.0 go.uber.org/goleak v1.3.0 ) @@ -33,29 +33,29 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.20.2 // indirect + github.com/prometheus/client_golang v1.20.3 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.56.0 // indirect + github.com/prometheus/common v0.59.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect - go.opentelemetry.io/collector v0.108.1 // indirect - go.opentelemetry.io/collector/component/componentprofiles v0.108.1 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.108.1 // indirect - go.opentelemetry.io/collector/connector/connectorprofiles v0.108.1 // indirect - go.opentelemetry.io/collector/consumer/consumerprofiles v0.108.1 // indirect - go.opentelemetry.io/collector/pdata/pprofile v0.108.1 // indirect - go.opentelemetry.io/otel v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.51.0 // indirect - go.opentelemetry.io/otel/metric v1.29.0 // indirect - go.opentelemetry.io/otel/sdk v1.29.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.29.0 // indirect - go.opentelemetry.io/otel/trace v1.29.0 // indirect + go.opentelemetry.io/collector v0.109.0 // indirect + go.opentelemetry.io/collector/component/componentprofiles v0.109.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.109.0 // indirect + go.opentelemetry.io/collector/connector/connectorprofiles v0.109.0 // indirect + go.opentelemetry.io/collector/consumer/consumerprofiles v0.109.0 // indirect + go.opentelemetry.io/collector/pdata/pprofile v0.109.0 // indirect + go.opentelemetry.io/otel v1.30.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect + go.opentelemetry.io/otel/metric v1.30.0 // indirect + go.opentelemetry.io/otel/sdk v1.30.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect + go.opentelemetry.io/otel/trace v1.30.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.24.0 // indirect + golang.org/x/sys v0.25.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.65.0 // indirect + google.golang.org/grpc v1.66.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) @@ -70,8 +70,6 @@ replace go.opentelemetry.io/collector/pdata => ../../pdata replace go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata -replace go.opentelemetry.io/collector/featuregate => ../../featuregate - replace go.opentelemetry.io/collector/consumer => ../../consumer replace go.opentelemetry.io/collector/confmap => ../../confmap diff --git a/connector/forwardconnector/go.sum b/connector/forwardconnector/go.sum index 916c7ef13dd..ac12e3d31e7 100644 --- a/connector/forwardconnector/go.sum +++ b/connector/forwardconnector/go.sum @@ -50,34 +50,34 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg= -github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= +github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.56.0 h1:UffReloqkBtvtQEYDg2s+uDPGRrJyC6vZWPGXf6OhPY= -github.com/prometheus/common v0.56.0/go.mod h1:7uRPFSUTbfZWsJ7MHY56sqt7hLQu3bxXHDnNhl8E9qI= +github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= +github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 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= 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.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= -go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0 h1:G7uexXb/K3T+T9fNLCCKncweEtNEBMTO+46hKX5EdKw= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0/go.mod h1:v0mFe5Kk7woIh938mrZBJBmENYquyA0IICrlYm4Y0t4= -go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= -go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= -go.opentelemetry.io/otel/sdk v1.29.0 h1:vkqKjk7gwhS8VaWb0POZKmIEDimRCMsopNYnriHyryo= -go.opentelemetry.io/otel/sdk v1.29.0/go.mod h1:pM8Dx5WKnvxLCb+8lG1PRNIDxu9g9b9g59Qr7hfAAok= -go.opentelemetry.io/otel/sdk/metric v1.29.0 h1:K2CfmJohnRgvZ9UAj2/FhIf/okdWcNdBwe1m8xFXiSY= -go.opentelemetry.io/otel/sdk/metric v1.29.0/go.mod h1:6zZLdCl2fkauYoZIOn/soQIDSWFmNSRcICarHfuhNJQ= -go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= -go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= +go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= +go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= +go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= +go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= +go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= +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.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= @@ -101,8 +101,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.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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= @@ -117,8 +117,8 @@ 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= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd h1:6TEm2ZxXoQmFWFlt1vNxvVOa1Q0dXFQD1m/rYjXmS0E= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= 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= diff --git a/connector/go.mod b/connector/go.mod index 33cb691e942..35ef7f7e441 100644 --- a/connector/go.mod +++ b/connector/go.mod @@ -5,16 +5,16 @@ go 1.22.0 require ( github.com/google/uuid v1.6.0 github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector v0.108.1 - go.opentelemetry.io/collector/component v0.108.1 - go.opentelemetry.io/collector/component/componentprofiles v0.108.1 - go.opentelemetry.io/collector/connector/connectorprofiles v0.108.1 - go.opentelemetry.io/collector/consumer v0.108.1 - go.opentelemetry.io/collector/consumer/consumerprofiles v0.108.1 - go.opentelemetry.io/collector/consumer/consumertest v0.108.1 - go.opentelemetry.io/collector/pdata v1.14.1 - go.opentelemetry.io/collector/pdata/pprofile v0.108.1 - go.opentelemetry.io/collector/pdata/testdata v0.108.1 + go.opentelemetry.io/collector v0.109.0 + go.opentelemetry.io/collector/component v0.109.0 + go.opentelemetry.io/collector/component/componentprofiles v0.109.0 + go.opentelemetry.io/collector/connector/connectorprofiles v0.109.0 + go.opentelemetry.io/collector/consumer v0.109.0 + go.opentelemetry.io/collector/consumer/consumerprofiles v0.109.0 + go.opentelemetry.io/collector/consumer/consumertest v0.109.0 + go.opentelemetry.io/collector/pdata v1.15.0 + go.opentelemetry.io/collector/pdata/pprofile v0.109.0 + go.opentelemetry.io/collector/pdata/testdata v0.109.0 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 ) @@ -32,23 +32,23 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.20.2 // indirect + github.com/prometheus/client_golang v1.20.3 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.56.0 // indirect + github.com/prometheus/common v0.59.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.108.1 // indirect - go.opentelemetry.io/otel v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.51.0 // indirect - go.opentelemetry.io/otel/metric v1.29.0 // indirect - go.opentelemetry.io/otel/sdk v1.29.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.29.0 // indirect - go.opentelemetry.io/otel/trace v1.29.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.109.0 // indirect + go.opentelemetry.io/otel v1.30.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect + go.opentelemetry.io/otel/metric v1.30.0 // indirect + go.opentelemetry.io/otel/sdk v1.30.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect + go.opentelemetry.io/otel/trace v1.30.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.24.0 // indirect + golang.org/x/sys v0.25.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.65.0 // indirect + google.golang.org/grpc v1.66.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) @@ -63,8 +63,6 @@ replace go.opentelemetry.io/collector/confmap => ../confmap replace go.opentelemetry.io/collector/consumer => ../consumer -replace go.opentelemetry.io/collector/featuregate => ../featuregate - replace go.opentelemetry.io/collector/pdata => ../pdata replace go.opentelemetry.io/collector/pdata/testdata => ../pdata/testdata diff --git a/connector/go.sum b/connector/go.sum index 6e09c0083d5..2fb10b5d6d7 100644 --- a/connector/go.sum +++ b/connector/go.sum @@ -38,34 +38,34 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg= -github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= +github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.56.0 h1:UffReloqkBtvtQEYDg2s+uDPGRrJyC6vZWPGXf6OhPY= -github.com/prometheus/common v0.56.0/go.mod h1:7uRPFSUTbfZWsJ7MHY56sqt7hLQu3bxXHDnNhl8E9qI= +github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= +github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 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= 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.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= -go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0 h1:G7uexXb/K3T+T9fNLCCKncweEtNEBMTO+46hKX5EdKw= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0/go.mod h1:v0mFe5Kk7woIh938mrZBJBmENYquyA0IICrlYm4Y0t4= -go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= -go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= -go.opentelemetry.io/otel/sdk v1.29.0 h1:vkqKjk7gwhS8VaWb0POZKmIEDimRCMsopNYnriHyryo= -go.opentelemetry.io/otel/sdk v1.29.0/go.mod h1:pM8Dx5WKnvxLCb+8lG1PRNIDxu9g9b9g59Qr7hfAAok= -go.opentelemetry.io/otel/sdk/metric v1.29.0 h1:K2CfmJohnRgvZ9UAj2/FhIf/okdWcNdBwe1m8xFXiSY= -go.opentelemetry.io/otel/sdk/metric v1.29.0/go.mod h1:6zZLdCl2fkauYoZIOn/soQIDSWFmNSRcICarHfuhNJQ= -go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= -go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= +go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= +go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= +go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= +go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= +go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= +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.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.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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= @@ -105,8 +105,8 @@ 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= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd h1:6TEm2ZxXoQmFWFlt1vNxvVOa1Q0dXFQD1m/rYjXmS0E= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= 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= diff --git a/connector/logs_router_test.go b/connector/logs_router_test.go index a4074762ac1..a8af2fc41ab 100644 --- a/connector/logs_router_test.go +++ b/connector/logs_router_test.go @@ -119,8 +119,8 @@ func TestLogsRouterConsumers(t *testing.T) { assert.Len(t, rcs, 2) assert.ElementsMatch(t, []component.ID{fooID, barID}, rcs) - assert.Len(t, foo.AllLogs(), 0) - assert.Len(t, bar.AllLogs(), 0) + assert.Empty(t, foo.AllLogs()) + assert.Empty(t, bar.AllLogs()) both, err := r.Consumer(fooID, barID) assert.NotNil(t, both) diff --git a/connector/metrics_router_test.go b/connector/metrics_router_test.go index c3fe824992a..04072f05389 100644 --- a/connector/metrics_router_test.go +++ b/connector/metrics_router_test.go @@ -119,8 +119,8 @@ func TestMetricsRouterConsumers(t *testing.T) { assert.Len(t, rcs, 2) assert.ElementsMatch(t, []component.ID{fooID, barID}, rcs) - assert.Len(t, foo.AllMetrics(), 0) - assert.Len(t, bar.AllMetrics(), 0) + assert.Empty(t, foo.AllMetrics()) + assert.Empty(t, bar.AllMetrics()) both, err := r.Consumer(fooID, barID) assert.NotNil(t, both) diff --git a/connector/traces_router_test.go b/connector/traces_router_test.go index 8c93b10528a..42dc957c1a6 100644 --- a/connector/traces_router_test.go +++ b/connector/traces_router_test.go @@ -119,8 +119,8 @@ func TestTracesRouterConsumer(t *testing.T) { assert.Len(t, rcs, 2) assert.ElementsMatch(t, []component.ID{fooID, barID}, rcs) - assert.Len(t, foo.AllTraces(), 0) - assert.Len(t, bar.AllTraces(), 0) + assert.Empty(t, foo.AllTraces()) + assert.Empty(t, bar.AllTraces()) both, err := r.Consumer(fooID, barID) assert.NotNil(t, both) diff --git a/consumer/consumererror/signalerrors_test.go b/consumer/consumererror/signalerrors_test.go index 475d3173bb9..6ec64710b8c 100644 --- a/consumer/consumererror/signalerrors_test.go +++ b/consumer/consumererror/signalerrors_test.go @@ -21,7 +21,7 @@ func TestTraces(t *testing.T) { var target Traces assert.False(t, errors.As(nil, &target)) assert.False(t, errors.As(err, &target)) - assert.True(t, errors.As(traceErr, &target)) + assert.ErrorAs(t, traceErr, &target) assert.Equal(t, td, target.Data()) } @@ -33,7 +33,7 @@ func TestTraces_Unwrap(t *testing.T) { target := testErrorType{} require.NotEqual(t, err, target) // Unwrapping traceErr for err and assigning to target. - require.True(t, errors.As(traceErr, &target)) + require.ErrorAs(t, traceErr, &target) require.Equal(t, err, target) } @@ -45,7 +45,7 @@ func TestLogs(t *testing.T) { var target Logs assert.False(t, errors.As(nil, &target)) assert.False(t, errors.As(err, &target)) - assert.True(t, errors.As(logsErr, &target)) + assert.ErrorAs(t, logsErr, &target) assert.Equal(t, td, target.Data()) } @@ -57,7 +57,7 @@ func TestLogs_Unwrap(t *testing.T) { target := testErrorType{} require.NotEqual(t, err, target) // Unwrapping logsErr for err and assigning to target. - require.True(t, errors.As(logsErr, &target)) + require.ErrorAs(t, logsErr, &target) require.Equal(t, err, target) } @@ -69,7 +69,7 @@ func TestMetrics(t *testing.T) { var target Metrics assert.False(t, errors.As(nil, &target)) assert.False(t, errors.As(err, &target)) - assert.True(t, errors.As(metricErr, &target)) + assert.ErrorAs(t, metricErr, &target) assert.Equal(t, td, target.Data()) } @@ -81,6 +81,6 @@ func TestMetrics_Unwrap(t *testing.T) { target := testErrorType{} require.NotEqual(t, err, target) // Unwrapping metricErr for err and assigning to target. - require.True(t, errors.As(metricErr, &target)) + require.ErrorAs(t, metricErr, &target) require.Equal(t, err, target) } diff --git a/consumer/consumerprofiles/go.mod b/consumer/consumerprofiles/go.mod index 143439883d3..f43bc1a5638 100644 --- a/consumer/consumerprofiles/go.mod +++ b/consumer/consumerprofiles/go.mod @@ -10,8 +10,8 @@ replace go.opentelemetry.io/collector/consumer => ../ require ( github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector/consumer v0.108.1 - go.opentelemetry.io/collector/pdata/pprofile v0.108.1 + go.opentelemetry.io/collector/consumer v0.109.0 + go.opentelemetry.io/collector/pdata/pprofile v0.109.0 ) require ( @@ -21,13 +21,13 @@ 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/pdata v1.14.1 // indirect + go.opentelemetry.io/collector/pdata v1.15.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/net v0.25.0 // indirect - golang.org/x/sys v0.20.0 // indirect - golang.org/x/text v0.15.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect - google.golang.org/grpc v1.65.0 // indirect + golang.org/x/net v0.26.0 // indirect + golang.org/x/sys v0.21.0 // indirect + golang.org/x/text v0.16.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect + google.golang.org/grpc v1.66.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/consumer/consumerprofiles/go.sum b/consumer/consumerprofiles/go.sum index 528166b78c0..03ca0e47eea 100644 --- a/consumer/consumerprofiles/go.sum +++ b/consumer/consumerprofiles/go.sum @@ -42,20 +42,20 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= -golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= +golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.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.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= -golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -64,10 +64,10 @@ 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/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 h1:Zy9XzmMEflZ/MAaA7vNcoebnRAld7FsPW1EeBB7V0m8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 h1:1GBuWVLM/KMVUv1t1En5Gs+gFZCNd360GGb4sSxtrhU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= 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= diff --git a/consumer/consumertest/go.mod b/consumer/consumertest/go.mod index f8ad910b393..8ff1801690a 100644 --- a/consumer/consumertest/go.mod +++ b/consumer/consumertest/go.mod @@ -6,11 +6,11 @@ replace go.opentelemetry.io/collector/consumer => ../ require ( github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector/consumer v0.108.1 - go.opentelemetry.io/collector/consumer/consumerprofiles v0.108.1 - go.opentelemetry.io/collector/pdata v1.14.1 - go.opentelemetry.io/collector/pdata/pprofile v0.108.1 - go.opentelemetry.io/collector/pdata/testdata v0.108.1 + go.opentelemetry.io/collector/consumer v0.109.0 + go.opentelemetry.io/collector/consumer/consumerprofiles v0.109.0 + go.opentelemetry.io/collector/pdata v1.15.0 + go.opentelemetry.io/collector/pdata/pprofile v0.109.0 + go.opentelemetry.io/collector/pdata/testdata v0.109.0 go.uber.org/goleak v1.3.0 ) @@ -22,11 +22,11 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/net v0.25.0 // indirect - golang.org/x/sys v0.20.0 // indirect - golang.org/x/text v0.15.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect - google.golang.org/grpc v1.65.0 // indirect + golang.org/x/net v0.26.0 // indirect + golang.org/x/sys v0.21.0 // indirect + golang.org/x/text v0.16.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect + google.golang.org/grpc v1.66.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/consumer/consumertest/go.sum b/consumer/consumertest/go.sum index 528166b78c0..03ca0e47eea 100644 --- a/consumer/consumertest/go.sum +++ b/consumer/consumertest/go.sum @@ -42,20 +42,20 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= -golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= +golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.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.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= -golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -64,10 +64,10 @@ 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/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 h1:Zy9XzmMEflZ/MAaA7vNcoebnRAld7FsPW1EeBB7V0m8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 h1:1GBuWVLM/KMVUv1t1En5Gs+gFZCNd360GGb4sSxtrhU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= 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= diff --git a/consumer/consumertest/sink_test.go b/consumer/consumertest/sink_test.go index 3c813cf2f71..3a377345fc4 100644 --- a/consumer/consumertest/sink_test.go +++ b/consumer/consumertest/sink_test.go @@ -28,7 +28,7 @@ func TestTracesSink(t *testing.T) { assert.Equal(t, want, sink.AllTraces()) assert.Equal(t, len(want), sink.SpanCount()) sink.Reset() - assert.Equal(t, 0, len(sink.AllTraces())) + assert.Empty(t, sink.AllTraces()) assert.Equal(t, 0, sink.SpanCount()) } @@ -43,7 +43,7 @@ func TestMetricsSink(t *testing.T) { assert.Equal(t, want, sink.AllMetrics()) assert.Equal(t, 2*len(want), sink.DataPointCount()) sink.Reset() - assert.Equal(t, 0, len(sink.AllMetrics())) + assert.Empty(t, sink.AllMetrics()) assert.Equal(t, 0, sink.DataPointCount()) } @@ -58,7 +58,7 @@ func TestLogsSink(t *testing.T) { assert.Equal(t, want, sink.AllLogs()) assert.Equal(t, len(want), sink.LogRecordCount()) sink.Reset() - assert.Equal(t, 0, len(sink.AllLogs())) + assert.Empty(t, sink.AllLogs()) assert.Equal(t, 0, sink.LogRecordCount()) } @@ -72,5 +72,5 @@ func TestProfilesSink(t *testing.T) { } assert.Equal(t, want, sink.AllProfiles()) sink.Reset() - assert.Equal(t, 0, len(sink.AllProfiles())) + assert.Empty(t, sink.AllProfiles()) } diff --git a/consumer/go.mod b/consumer/go.mod index a62b1199aea..d3db6f7b441 100644 --- a/consumer/go.mod +++ b/consumer/go.mod @@ -4,8 +4,8 @@ go 1.22.0 require ( github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector/pdata v1.14.1 - go.opentelemetry.io/collector/pdata/testdata v0.108.1 + go.opentelemetry.io/collector/pdata v1.15.0 + go.opentelemetry.io/collector/pdata/testdata v0.109.0 go.uber.org/goleak v1.3.0 ) @@ -16,13 +16,13 @@ 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/pdata/pprofile v0.108.1 // indirect + go.opentelemetry.io/collector/pdata/pprofile v0.109.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/net v0.25.0 // indirect - golang.org/x/sys v0.20.0 // indirect - golang.org/x/text v0.15.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect - google.golang.org/grpc v1.65.0 // indirect + golang.org/x/net v0.26.0 // indirect + golang.org/x/sys v0.21.0 // indirect + golang.org/x/text v0.16.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect + google.golang.org/grpc v1.66.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/consumer/go.sum b/consumer/go.sum index 528166b78c0..03ca0e47eea 100644 --- a/consumer/go.sum +++ b/consumer/go.sum @@ -42,20 +42,20 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= -golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= +golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.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.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= -golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -64,10 +64,10 @@ 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/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 h1:Zy9XzmMEflZ/MAaA7vNcoebnRAld7FsPW1EeBB7V0m8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 h1:1GBuWVLM/KMVUv1t1En5Gs+gFZCNd360GGb4sSxtrhU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= 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= diff --git a/docs/release.md b/docs/release.md index 9057f06d1c1..81a54154754 100644 --- a/docs/release.md +++ b/docs/release.md @@ -160,9 +160,6 @@ Once a module is ready to be released under the `1.x` version scheme, file a PR | Date | Version | Release manager | |------------|----------|---------------------------------------------------| -| 2024-08-12 | v0.107.0 | [@dmitryax](https://github.com/dmitryax) | -| 2024-08-26 | v0.108.0 | [@codeboten](https://github.com/codeboten) | -| 2024-09-09 | v0.109.0 | [@bogdandrutu](https://github.com/bogdandrutu) | | 2024-09-23 | v0.110.0 | [@jpkrohling](https://github.com/jpkrohling) | | 2024-10-07 | v0.111.0 | [@mx-psi](https://github.com/mx-psi) | | 2024-10-21 | v0.112.0 | [@evan-bradley](https://github.com/evan-bradley) | @@ -170,3 +167,6 @@ Once a module is ready to be released under the `1.x` version scheme, file a PR | 2024-11-18 | v0.114.0 | [@TylerHelmuth](https://github.com/TylerHelmuth) | | 2024-12-02 | v0.115.0 | [@atoulme](https://github.com/atoulme) | | 2024-12-16 | v0.116.0 | [@songy23](https://github.com/songy23) | +| 2025-01-06 | v0.117.0 | [@dmitryax](https://github.com/dmitryax) | +| 2025-01-20 | v0.118.0 | [@codeboten](https://github.com/codeboten) | +| 2025-02-03 | v0.119.0 | [@bogdandrutu](https://github.com/bogdandrutu) | diff --git a/exporter/debugexporter/config_test.go b/exporter/debugexporter/config_test.go index 288ecd9be18..a9fbf9f87e0 100644 --- a/exporter/debugexporter/config_test.go +++ b/exporter/debugexporter/config_test.go @@ -94,7 +94,7 @@ func Test_UnmarshalMarshalled(t *testing.T) { if tc.expectedErr == "" { assert.NoError(t, err) - assert.Equal(t, outCfg, tc.expectedConfig) + assert.Equal(t, tc.expectedConfig, outCfg) return } assert.Error(t, err) diff --git a/exporter/debugexporter/factory.go b/exporter/debugexporter/factory.go index 526c01cc5c9..264b8358d57 100644 --- a/exporter/debugexporter/factory.go +++ b/exporter/debugexporter/factory.go @@ -54,7 +54,7 @@ func createTracesExporter(ctx context.Context, set exporter.Settings, config com return exporterhelper.NewTracesExporter(ctx, set, config, debugExporter.pushTraces, exporterhelper.WithCapabilities(consumer.Capabilities{MutatesData: false}), - exporterhelper.WithTimeout(exporterhelper.TimeoutSettings{Timeout: 0}), + exporterhelper.WithTimeout(exporterhelper.TimeoutConfig{Timeout: 0}), exporterhelper.WithShutdown(otlptext.LoggerSync(exporterLogger)), ) } @@ -66,7 +66,7 @@ func createMetricsExporter(ctx context.Context, set exporter.Settings, config co return exporterhelper.NewMetricsExporter(ctx, set, config, debugExporter.pushMetrics, exporterhelper.WithCapabilities(consumer.Capabilities{MutatesData: false}), - exporterhelper.WithTimeout(exporterhelper.TimeoutSettings{Timeout: 0}), + exporterhelper.WithTimeout(exporterhelper.TimeoutConfig{Timeout: 0}), exporterhelper.WithShutdown(otlptext.LoggerSync(exporterLogger)), ) } @@ -78,7 +78,7 @@ func createLogsExporter(ctx context.Context, set exporter.Settings, config compo return exporterhelper.NewLogsExporter(ctx, set, config, debugExporter.pushLogs, exporterhelper.WithCapabilities(consumer.Capabilities{MutatesData: false}), - exporterhelper.WithTimeout(exporterhelper.TimeoutSettings{Timeout: 0}), + exporterhelper.WithTimeout(exporterhelper.TimeoutConfig{Timeout: 0}), exporterhelper.WithShutdown(otlptext.LoggerSync(exporterLogger)), ) } diff --git a/exporter/debugexporter/go.mod b/exporter/debugexporter/go.mod index 24b47174ffb..88f4dd3818f 100644 --- a/exporter/debugexporter/go.mod +++ b/exporter/debugexporter/go.mod @@ -4,13 +4,13 @@ go 1.22.0 require ( github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector/component v0.108.1 - go.opentelemetry.io/collector/config/configtelemetry v0.108.1 - go.opentelemetry.io/collector/confmap v1.14.1 - go.opentelemetry.io/collector/consumer v0.108.1 - go.opentelemetry.io/collector/exporter v0.108.1 - go.opentelemetry.io/collector/pdata v1.14.1 - go.opentelemetry.io/collector/pdata/testdata v0.108.1 + go.opentelemetry.io/collector/component v0.109.0 + go.opentelemetry.io/collector/config/configtelemetry v0.109.0 + go.opentelemetry.io/collector/confmap v1.15.0 + go.opentelemetry.io/collector/consumer v0.109.0 + go.opentelemetry.io/collector/exporter v0.109.0 + go.opentelemetry.io/collector/pdata v1.15.0 + go.opentelemetry.io/collector/pdata/testdata v0.109.0 go.uber.org/goleak v1.3.0 go.uber.org/zap v1.27.0 ) @@ -36,38 +36,35 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.20.2 // indirect + github.com/prometheus/client_golang v1.20.3 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.56.0 // indirect + github.com/prometheus/common v0.59.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect - go.opentelemetry.io/collector v0.108.1 // indirect - go.opentelemetry.io/collector/config/configretry v1.14.1 // indirect - go.opentelemetry.io/collector/consumer/consumerprofiles v0.108.1 // indirect - go.opentelemetry.io/collector/consumer/consumertest v0.108.1 // indirect - go.opentelemetry.io/collector/exporter/exporterprofiles v0.108.1 // indirect - go.opentelemetry.io/collector/extension v0.108.1 // indirect - go.opentelemetry.io/collector/extension/experimental/storage v0.0.0-20240902085631-cd1f7623fe67 // indirect - go.opentelemetry.io/collector/pdata/pprofile v0.108.1 // indirect - go.opentelemetry.io/collector/receiver v0.108.1 // indirect - go.opentelemetry.io/collector/receiver/receiverprofiles v0.108.1 // indirect - go.opentelemetry.io/otel v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.51.0 // indirect - go.opentelemetry.io/otel/metric v1.29.0 // indirect - go.opentelemetry.io/otel/sdk v1.29.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.29.0 // indirect - go.opentelemetry.io/otel/trace v1.29.0 // indirect + go.opentelemetry.io/collector/config/configretry v1.15.0 // indirect + go.opentelemetry.io/collector/consumer/consumerprofiles v0.109.0 // indirect + go.opentelemetry.io/collector/consumer/consumertest v0.109.0 // indirect + go.opentelemetry.io/collector/exporter/exporterprofiles v0.109.0 // indirect + go.opentelemetry.io/collector/extension v0.109.0 // indirect + go.opentelemetry.io/collector/extension/experimental/storage v0.109.0 // indirect + go.opentelemetry.io/collector/pdata/pprofile v0.109.0 // indirect + go.opentelemetry.io/collector/receiver v0.109.0 // indirect + go.opentelemetry.io/collector/receiver/receiverprofiles v0.109.0 // indirect + go.opentelemetry.io/otel v1.30.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect + go.opentelemetry.io/otel/metric v1.30.0 // indirect + go.opentelemetry.io/otel/sdk v1.30.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect + go.opentelemetry.io/otel/trace v1.30.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.24.0 // indirect + golang.org/x/sys v0.25.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.65.0 // indirect + google.golang.org/grpc v1.66.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) -replace go.opentelemetry.io/collector => ../../ - replace go.opentelemetry.io/collector/component => ../../component replace go.opentelemetry.io/collector/confmap => ../../confmap @@ -76,8 +73,6 @@ replace go.opentelemetry.io/collector/consumer => ../../consumer replace go.opentelemetry.io/collector/exporter => ../ -replace go.opentelemetry.io/collector/featuregate => ../../featuregate - replace go.opentelemetry.io/collector/pdata => ../../pdata replace go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata @@ -98,8 +93,6 @@ replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../../consume replace go.opentelemetry.io/collector/consumer/consumertest => ../../consumer/consumertest -replace go.opentelemetry.io/collector/component/componentstatus => ../../component/componentstatus - replace go.opentelemetry.io/collector/receiver/receiverprofiles => ../../receiver/receiverprofiles replace go.opentelemetry.io/collector/exporter/exporterprofiles => ../exporterprofiles diff --git a/exporter/debugexporter/go.sum b/exporter/debugexporter/go.sum index 3272860f60f..6890ef19e46 100644 --- a/exporter/debugexporter/go.sum +++ b/exporter/debugexporter/go.sum @@ -52,12 +52,12 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg= -github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= +github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.56.0 h1:UffReloqkBtvtQEYDg2s+uDPGRrJyC6vZWPGXf6OhPY= -github.com/prometheus/common v0.56.0/go.mod h1:7uRPFSUTbfZWsJ7MHY56sqt7hLQu3bxXHDnNhl8E9qI= +github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= +github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= @@ -68,18 +68,18 @@ 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.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= -go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0 h1:G7uexXb/K3T+T9fNLCCKncweEtNEBMTO+46hKX5EdKw= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0/go.mod h1:v0mFe5Kk7woIh938mrZBJBmENYquyA0IICrlYm4Y0t4= -go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= -go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= -go.opentelemetry.io/otel/sdk v1.29.0 h1:vkqKjk7gwhS8VaWb0POZKmIEDimRCMsopNYnriHyryo= -go.opentelemetry.io/otel/sdk v1.29.0/go.mod h1:pM8Dx5WKnvxLCb+8lG1PRNIDxu9g9b9g59Qr7hfAAok= -go.opentelemetry.io/otel/sdk/metric v1.29.0 h1:K2CfmJohnRgvZ9UAj2/FhIf/okdWcNdBwe1m8xFXiSY= -go.opentelemetry.io/otel/sdk/metric v1.29.0/go.mod h1:6zZLdCl2fkauYoZIOn/soQIDSWFmNSRcICarHfuhNJQ= -go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= -go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= +go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= +go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= +go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= +go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= +go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= +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.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= @@ -103,8 +103,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.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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= @@ -119,8 +119,8 @@ 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= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd h1:6TEm2ZxXoQmFWFlt1vNxvVOa1Q0dXFQD1m/rYjXmS0E= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= 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= diff --git a/exporter/exporterhelper/batch_sender_test.go b/exporter/exporterhelper/batch_sender_test.go index 5b93dd1466a..5f5d49bec9a 100644 --- a/exporter/exporterhelper/batch_sender_test.go +++ b/exporter/exporterhelper/batch_sender_test.go @@ -561,7 +561,7 @@ func TestBatchSender_ShutdownDeadlock(t *testing.T) { doneShutdown := make(chan struct{}) go func() { close(startShutdown) - require.Nil(t, be.Shutdown(context.Background())) + require.NoError(t, be.Shutdown(context.Background())) close(doneShutdown) }() <-startShutdown @@ -575,7 +575,7 @@ func TestBatchSender_ShutdownDeadlock(t *testing.T) { func TestBatchSenderWithTimeout(t *testing.T) { bCfg := exporterbatcher.NewDefaultConfig() bCfg.MinSizeItems = 10 - tCfg := NewDefaultTimeoutSettings() + tCfg := NewDefaultTimeoutConfig() tCfg.Timeout = 50 * time.Millisecond be, err := newBaseExporter(defaultSettings, defaultDataType, newNoopObsrepSender, WithBatcher(bCfg, WithRequestBatchFuncs(fakeBatchMergeFunc, fakeBatchMergeSplitFunc)), diff --git a/exporter/exporterhelper/common.go b/exporter/exporterhelper/common.go index 258efb02edd..0a3238d3561 100644 --- a/exporter/exporterhelper/common.go +++ b/exporter/exporterhelper/common.go @@ -64,11 +64,11 @@ func WithShutdown(shutdown component.ShutdownFunc) Option { } } -// WithTimeout overrides the default TimeoutSettings for an exporter. -// The default TimeoutSettings is 5 seconds. -func WithTimeout(timeoutSettings TimeoutSettings) Option { +// WithTimeout overrides the default TimeoutConfig for an exporter. +// The default TimeoutConfig is 5 seconds. +func WithTimeout(timeoutConfig TimeoutConfig) Option { return func(o *baseExporter) error { - o.timeoutSender.cfg = timeoutSettings + o.timeoutSender.cfg = timeoutConfig return nil } } @@ -86,10 +86,10 @@ func WithRetry(config configretry.BackOffConfig) Option { } } -// WithQueue overrides the default QueueSettings for an exporter. -// The default QueueSettings is to disable queueing. +// WithQueue overrides the default QueueConfig for an exporter. +// The default QueueConfig is to disable queueing. // This option cannot be used with the new exporter helpers New[Traces|Metrics|Logs]RequestExporter. -func WithQueue(config QueueSettings) Option { +func WithQueue(config QueueConfig) Option { return func(o *baseExporter) error { if o.marshaler == nil || o.unmarshaler == nil { return fmt.Errorf("WithQueue option is not available for the new request exporters, use WithRequestQueue instead") @@ -128,11 +128,8 @@ func WithRequestQueue(cfg exporterqueue.Config, queueFactory exporterqueue.Facto o.exportFailureMessage += " Try enabling sending_queue to survive temporary failures." return nil } - set := exporterqueue.Settings{ - DataType: o.signal, - ExporterSettings: o.set, - } - o.queueSender = newQueueSender(queueFactory(context.Background(), set, cfg), o.set, cfg.NumConsumers, o.exportFailureMessage, o.obsrep) + o.queueCfg = cfg + o.queueFactory = queueFactory return nil } } @@ -172,20 +169,8 @@ func WithRequestBatchFuncs(mf exporterbatcher.BatchMergeFunc[Request], msf expor // until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved. func WithBatcher(cfg exporterbatcher.Config, opts ...BatcherOption) Option { return func(o *baseExporter) error { - if !cfg.Enabled { - return nil - } - - bs := newBatchSender(cfg, o.set, o.batchMergeFunc, o.batchMergeSplitfunc) - for _, opt := range opts { - if err := opt(bs); err != nil { - return err - } - } - if bs.mergeFunc == nil || bs.mergeSplitFunc == nil { - return fmt.Errorf("WithRequestBatchFuncs must be provided for the batcher applied to the request-based exporters") - } - o.batchSender = bs + o.batcherCfg = cfg + o.batcherOpts = opts return nil } } @@ -247,6 +232,11 @@ type baseExporter struct { timeoutSender *timeoutSender // timeoutSender is always initialized. consumerOptions []consumer.Option + + queueCfg exporterqueue.Config + queueFactory exporterqueue.Factory[Request] + batcherCfg exporterbatcher.Config + batcherOpts []BatcherOption } func newBaseExporter(set exporter.Settings, signal component.DataType, osf obsrepSenderFactory, options ...Option) (*baseExporter, error) { @@ -262,7 +252,7 @@ func newBaseExporter(set exporter.Settings, signal component.DataType, osf obsre queueSender: &baseRequestSender{}, obsrepSender: osf(obsReport), retrySender: &baseRequestSender{}, - timeoutSender: &timeoutSender{cfg: NewDefaultTimeoutSettings()}, + timeoutSender: &timeoutSender{cfg: NewDefaultTimeoutConfig()}, set: set, obsrep: obsReport, @@ -275,6 +265,32 @@ func newBaseExporter(set exporter.Settings, signal component.DataType, osf obsre return nil, err } + if be.batcherCfg.Enabled { + bs := newBatchSender(be.batcherCfg, be.set, be.batchMergeFunc, be.batchMergeSplitfunc) + for _, opt := range be.batcherOpts { + err = multierr.Append(err, opt(bs)) + } + if bs.mergeFunc == nil || bs.mergeSplitFunc == nil { + err = multierr.Append(err, fmt.Errorf("WithRequestBatchFuncs must be provided for the batcher applied to the request-based exporters")) + } + be.batchSender = bs + } + + if be.queueCfg.Enabled { + set := exporterqueue.Settings{ + DataType: be.signal, + ExporterSettings: be.set, + } + be.queueSender = newQueueSender(be.queueFactory(context.Background(), set, be.queueCfg), be.set, be.queueCfg.NumConsumers, be.exportFailureMessage, be.obsrep) + for _, op := range options { + err = multierr.Append(err, op(be)) + } + } + + if err != nil { + return nil, err + } + be.connectSenders() if bs, ok := be.batchSender.(*batchSender); ok { diff --git a/exporter/exporterhelper/common_test.go b/exporter/exporterhelper/common_test.go index 9e014929761..512233ae1c7 100644 --- a/exporter/exporterhelper/common_test.go +++ b/exporter/exporterhelper/common_test.go @@ -50,7 +50,7 @@ func TestBaseExporterWithOptions(t *testing.T) { defaultSettings, defaultDataType, newNoopObsrepSender, WithStart(func(context.Context, component.Host) error { return want }), WithShutdown(func(context.Context) error { return want }), - WithTimeout(NewDefaultTimeoutSettings()), + WithTimeout(NewDefaultTimeoutConfig()), ) require.NoError(t, err) require.Equal(t, want, be.Start(context.Background(), componenttest.NewNopHost())) @@ -69,11 +69,11 @@ func checkStatus(t *testing.T, sd sdktrace.ReadOnlySpan, err error) { func TestQueueOptionsWithRequestExporter(t *testing.T) { bs, err := newBaseExporter(exportertest.NewNopSettings(), defaultDataType, newNoopObsrepSender, WithRetry(configretry.NewDefaultBackOffConfig())) - require.Nil(t, err) + require.NoError(t, err) require.Nil(t, bs.marshaler) require.Nil(t, bs.unmarshaler) _, err = newBaseExporter(exportertest.NewNopSettings(), defaultDataType, newNoopObsrepSender, - WithRetry(configretry.NewDefaultBackOffConfig()), WithQueue(NewDefaultQueueSettings())) + WithRetry(configretry.NewDefaultBackOffConfig()), WithQueue(NewDefaultQueueConfig())) require.Error(t, err) _, err = newBaseExporter(exportertest.NewNopSettings(), defaultDataType, newNoopObsrepSender, @@ -90,7 +90,7 @@ func TestBaseExporterLogging(t *testing.T) { rCfg := configretry.NewDefaultBackOffConfig() rCfg.Enabled = false bs, err := newBaseExporter(set, defaultDataType, newNoopObsrepSender, WithRetry(rCfg)) - require.Nil(t, err) + require.NoError(t, err) sendErr := bs.send(context.Background(), newErrorRequest()) require.Error(t, sendErr) diff --git a/exporter/exporterhelper/exporterhelper.go b/exporter/exporterhelper/exporterhelper.go new file mode 100644 index 00000000000..0890ec71af1 --- /dev/null +++ b/exporter/exporterhelper/exporterhelper.go @@ -0,0 +1,24 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package exporterhelper // import "go.opentelemetry.io/collector/exporter/exporterhelper" +import "go.opentelemetry.io/collector/exporter/internal" + +// Request represents a single request that can be sent to an external endpoint. +// Experimental: This API is at the early stage of development and may change without backward compatibility +// until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved. +type Request = internal.Request + +// RequestErrorHandler is an optional interface that can be implemented by Request to provide a way handle partial +// temporary failures. For example, if some items failed to process and can be retried, this interface allows to +// return a new Request that contains the items left to be sent. Otherwise, the original Request should be returned. +// If not implemented, the original Request will be returned assuming the error is applied to the whole Request. +// Experimental: This API is at the early stage of development and may change without backward compatibility +// until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved. +type RequestErrorHandler = internal.RequestErrorHandler + +// extractPartialRequest returns a new Request that may contain the items left to be sent +// if only some items failed to process and can be retried. Otherwise, it returns the original Request. +func extractPartialRequest(req Request, err error) Request { + return internal.ExtractPartialRequest(req, err) +} diff --git a/exporter/exporterhelper/internal/metadata/generated_telemetry.go b/exporter/exporterhelper/internal/metadata/generated_telemetry.go index a35625ac0a5..b61d6cda6f2 100644 --- a/exporter/exporterhelper/internal/metadata/generated_telemetry.go +++ b/exporter/exporterhelper/internal/metadata/generated_telemetry.go @@ -44,8 +44,16 @@ type TelemetryBuilder struct { meters map[configtelemetry.Level]metric.Meter } -// telemetryBuilderOption applies changes to default builder. -type telemetryBuilderOption func(*TelemetryBuilder) +// TelemetryBuilderOption applies changes to default builder. +type TelemetryBuilderOption interface { + apply(*TelemetryBuilder) +} + +type telemetryBuilderOptionFunc func(mb *TelemetryBuilder) + +func (tbof telemetryBuilderOptionFunc) apply(mb *TelemetryBuilder) { + tbof(mb) +} // InitExporterQueueCapacity configures the ExporterQueueCapacity metric. func (builder *TelemetryBuilder) InitExporterQueueCapacity(cb func() int64, opts ...metric.ObserveOption) error { @@ -85,10 +93,10 @@ func (builder *TelemetryBuilder) InitExporterQueueSize(cb func() int64, opts ... // NewTelemetryBuilder provides a struct with methods to update all internal telemetry // for a component -func NewTelemetryBuilder(settings component.TelemetrySettings, options ...telemetryBuilderOption) (*TelemetryBuilder, error) { +func NewTelemetryBuilder(settings component.TelemetrySettings, options ...TelemetryBuilderOption) (*TelemetryBuilder, error) { builder := TelemetryBuilder{meters: map[configtelemetry.Level]metric.Meter{}} for _, op := range options { - op(&builder) + op.apply(&builder) } builder.meters[configtelemetry.LevelBasic] = LeveledMeter(settings, configtelemetry.LevelBasic) var err, errs error diff --git a/exporter/exporterhelper/internal/metadata/generated_telemetry_test.go b/exporter/exporterhelper/internal/metadata/generated_telemetry_test.go index ad1906945a4..20372daee92 100644 --- a/exporter/exporterhelper/internal/metadata/generated_telemetry_test.go +++ b/exporter/exporterhelper/internal/metadata/generated_telemetry_test.go @@ -75,9 +75,9 @@ func TestNewTelemetryBuilder(t *testing.T) { TracerProvider: mockTracerProvider{}, } applied := false - _, err := NewTelemetryBuilder(set, func(b *TelemetryBuilder) { + _, err := NewTelemetryBuilder(set, telemetryBuilderOptionFunc(func(b *TelemetryBuilder) { applied = true - }) + })) require.NoError(t, err) require.True(t, applied) } diff --git a/internal/obsreportconfig/obsmetrics/obs_exporter.go b/exporter/exporterhelper/internal/obsmetrics.go similarity index 54% rename from internal/obsreportconfig/obsmetrics/obs_exporter.go rename to exporter/exporterhelper/internal/obsmetrics.go index ffaa33a54a4..cc02c0fc4e8 100644 --- a/internal/obsreportconfig/obsmetrics/obs_exporter.go +++ b/exporter/exporterhelper/internal/obsmetrics.go @@ -1,9 +1,12 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package obsmetrics // import "go.opentelemetry.io/collector/internal/obsreportconfig/obsmetrics" +package internal // import "go.opentelemetry.io/collector/exporter/exporterhelper/internal" const ( + // spanNameSep is duplicate between receiver and exporter. + spanNameSep = "/" + // ExporterKey used to identify exporters in metrics and traces. ExporterKey = "exporter" @@ -14,28 +17,19 @@ const ( SentSpansKey = "sent_spans" // FailedToSendSpansKey used to track spans that failed to be sent by exporters. FailedToSendSpansKey = "send_failed_spans" - // FailedToEnqueueSpansKey used to track spans that failed to be enqueued by exporters. - FailedToEnqueueSpansKey = "enqueue_failed_spans" // SentMetricPointsKey used to track metric points sent by exporters. SentMetricPointsKey = "sent_metric_points" // FailedToSendMetricPointsKey used to track metric points that failed to be sent by exporters. FailedToSendMetricPointsKey = "send_failed_metric_points" - // FailedToEnqueueMetricPointsKey used to track metric points that failed to be enqueued by exporters. - FailedToEnqueueMetricPointsKey = "enqueue_failed_metric_points" // SentLogRecordsKey used to track logs sent by exporters. SentLogRecordsKey = "sent_log_records" // FailedToSendLogRecordsKey used to track logs that failed to be sent by exporters. FailedToSendLogRecordsKey = "send_failed_log_records" - // FailedToEnqueueLogRecordsKey used to track logs that failed to be enqueued by exporters. - FailedToEnqueueLogRecordsKey = "enqueue_failed_log_records" -) -var ( - ExporterPrefix = ExporterKey + SpanNameSep - ExporterMetricPrefix = ExporterKey + MetricNameSep - ExportTraceDataOperationSuffix = SpanNameSep + "traces" - ExportMetricsOperationSuffix = SpanNameSep + "metrics" - ExportLogsOperationSuffix = SpanNameSep + "logs" + ExporterPrefix = ExporterKey + spanNameSep + ExportTraceDataOperationSuffix = spanNameSep + "traces" + ExportMetricsOperationSuffix = spanNameSep + "metrics" + ExportLogsOperationSuffix = spanNameSep + "logs" ) diff --git a/exporter/exporterhelper/logs_batch_test.go b/exporter/exporterhelper/logs_batch_test.go index 72255ff551e..2ed1f152aa3 100644 --- a/exporter/exporterhelper/logs_batch_test.go +++ b/exporter/exporterhelper/logs_batch_test.go @@ -18,7 +18,7 @@ func TestMergeLogs(t *testing.T) { lr1 := &logsRequest{ld: testdata.GenerateLogs(2)} lr2 := &logsRequest{ld: testdata.GenerateLogs(3)} res, err := mergeLogs(context.Background(), lr1, lr2) - assert.Nil(t, err) + assert.NoError(t, err) assert.Equal(t, 5, res.(*logsRequest).ld.LogRecordCount()) } @@ -132,7 +132,7 @@ func TestMergeSplitLogs(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { res, err := mergeSplitLogs(context.Background(), tt.cfg, tt.lr1, tt.lr2) - assert.Nil(t, err) + assert.NoError(t, err) assert.Equal(t, len(tt.expected), len(res)) for i, r := range res { assert.Equal(t, tt.expected[i], r.(*logsRequest)) diff --git a/exporter/exporterhelper/logs_test.go b/exporter/exporterhelper/logs_test.go index aa50cf1f623..e42a40159d0 100644 --- a/exporter/exporterhelper/logs_test.go +++ b/exporter/exporterhelper/logs_test.go @@ -25,9 +25,9 @@ import ( "go.opentelemetry.io/collector/consumer/consumererror" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/exporter" + "go.opentelemetry.io/collector/exporter/exporterhelper/internal" "go.opentelemetry.io/collector/exporter/exportertest" "go.opentelemetry.io/collector/exporter/internal/queue" - "go.opentelemetry.io/collector/internal/obsreportconfig/obsmetrics" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/testdata" ) @@ -156,7 +156,7 @@ func TestLogsRequestExporter_Default_ExportError(t *testing.T) { } func TestLogsExporter_WithPersistentQueue(t *testing.T) { - qCfg := NewDefaultQueueSettings() + qCfg := NewDefaultQueueConfig() storageID := component.MustNewIDWithName("file_storage", "storage") qCfg.StorageID = &storageID rCfg := configretry.NewDefaultBackOffConfig() @@ -227,7 +227,7 @@ func TestLogsExporter_WithRecordMetrics_ReturnError(t *testing.T) { t.Cleanup(func() { require.NoError(t, tt.Shutdown(context.Background())) }) le, err := NewLogsExporter(context.Background(), exporter.Settings{ID: fakeLogsExporterName, TelemetrySettings: tt.TelemetrySettings(), BuildInfo: component.NewDefaultBuildInfo()}, &fakeLogsExporterConfig, newPushLogsData(want)) - require.Nil(t, err) + require.NoError(t, err) require.NotNil(t, le) checkRecordedMetricsForLogsExporter(t, tt, le, want) @@ -241,7 +241,7 @@ func TestLogsRequestExporter_WithRecordMetrics_ExportError(t *testing.T) { le, err := NewLogsRequestExporter(context.Background(), exporter.Settings{ID: fakeLogsExporterName, TelemetrySettings: tt.TelemetrySettings(), BuildInfo: component.NewDefaultBuildInfo()}, (&fakeRequestConverter{requestError: want}).requestFromLogsFunc) - require.Nil(t, err) + require.NoError(t, err) require.NotNil(t, le) checkRecordedMetricsForLogsExporter(t, tt, le, want) @@ -253,7 +253,7 @@ func TestLogsExporter_WithRecordEnqueueFailedMetrics(t *testing.T) { t.Cleanup(func() { require.NoError(t, tt.Shutdown(context.Background())) }) rCfg := configretry.NewDefaultBackOffConfig() - qCfg := NewDefaultQueueSettings() + qCfg := NewDefaultQueueConfig() qCfg.NumConsumers = 1 qCfg.QueueSize = 2 wantErr := errors.New("some-error") @@ -280,7 +280,7 @@ func TestLogsExporter_WithSpan(t *testing.T) { defer otel.SetTracerProvider(nooptrace.NewTracerProvider()) le, err := NewLogsExporter(context.Background(), set, &fakeLogsExporterConfig, newPushLogsData(nil)) - require.Nil(t, err) + require.NoError(t, err) require.NotNil(t, le) checkWrapSpanForLogsExporter(t, sr, set.TracerProvider.Tracer("test"), le, nil, 1) } @@ -293,7 +293,7 @@ func TestLogsRequestExporter_WithSpan(t *testing.T) { defer otel.SetTracerProvider(nooptrace.NewTracerProvider()) le, err := NewLogsRequestExporter(context.Background(), set, (&fakeRequestConverter{}).requestFromLogsFunc) - require.Nil(t, err) + require.NoError(t, err) require.NotNil(t, le) checkWrapSpanForLogsExporter(t, sr, set.TracerProvider.Tracer("test"), le, nil, 1) } @@ -307,7 +307,7 @@ func TestLogsExporter_WithSpan_ReturnError(t *testing.T) { want := errors.New("my_error") le, err := NewLogsExporter(context.Background(), set, &fakeLogsExporterConfig, newPushLogsData(want)) - require.Nil(t, err) + require.NoError(t, err) require.NotNil(t, le) checkWrapSpanForLogsExporter(t, sr, set.TracerProvider.Tracer("test"), le, want, 1) } @@ -321,7 +321,7 @@ func TestLogsRequestExporter_WithSpan_ReturnError(t *testing.T) { want := errors.New("my_error") le, err := NewLogsRequestExporter(context.Background(), set, (&fakeRequestConverter{requestError: want}).requestFromLogsFunc) - require.Nil(t, err) + require.NoError(t, err) require.NotNil(t, le) checkWrapSpanForLogsExporter(t, sr, set.TracerProvider.Tracer("test"), le, want, 1) } @@ -334,7 +334,7 @@ func TestLogsExporter_WithShutdown(t *testing.T) { assert.NotNil(t, le) assert.NoError(t, err) - assert.Nil(t, le.Shutdown(context.Background())) + assert.NoError(t, le.Shutdown(context.Background())) assert.True(t, shutdownCalled) } @@ -347,7 +347,7 @@ func TestLogsRequestExporter_WithShutdown(t *testing.T) { assert.NotNil(t, le) assert.NoError(t, err) - assert.Nil(t, le.Shutdown(context.Background())) + assert.NoError(t, le.Shutdown(context.Background())) assert.True(t, shutdownCalled) } @@ -359,7 +359,7 @@ func TestLogsExporter_WithShutdown_ReturnError(t *testing.T) { assert.NotNil(t, le) assert.NoError(t, err) - assert.Equal(t, le.Shutdown(context.Background()), want) + assert.Equal(t, want, le.Shutdown(context.Background())) } func TestLogsRequestExporter_WithShutdown_ReturnError(t *testing.T) { @@ -371,7 +371,7 @@ func TestLogsRequestExporter_WithShutdown_ReturnError(t *testing.T) { assert.NotNil(t, le) assert.NoError(t, err) - assert.Equal(t, le.Shutdown(context.Background()), want) + assert.Equal(t, want, le.Shutdown(context.Background())) } func newPushLogsDataModifiedDownstream(retError error) consumer.ConsumeLogsFunc { @@ -418,7 +418,7 @@ func checkWrapSpanForLogsExporter(t *testing.T, sr *tracetest.SpanRecorder, trac // Inspection time! gotSpanData := sr.Ended() - require.Equal(t, numRequests+1, len(gotSpanData)) + require.Len(t, gotSpanData, numRequests+1) parentSpan := gotSpanData[numRequests] require.Equalf(t, fakeLogsParentSpanName, parentSpan.Name(), "SpanData %v", parentSpan) @@ -432,7 +432,7 @@ func checkWrapSpanForLogsExporter(t *testing.T, sr *tracetest.SpanRecorder, trac sentLogRecords = 0 failedToSendLogRecords = numLogRecords } - require.Containsf(t, sd.Attributes(), attribute.KeyValue{Key: obsmetrics.SentLogRecordsKey, Value: attribute.Int64Value(sentLogRecords)}, "SpanData %v", sd) - require.Containsf(t, sd.Attributes(), attribute.KeyValue{Key: obsmetrics.FailedToSendLogRecordsKey, Value: attribute.Int64Value(failedToSendLogRecords)}, "SpanData %v", sd) + require.Containsf(t, sd.Attributes(), attribute.KeyValue{Key: internal.SentLogRecordsKey, Value: attribute.Int64Value(sentLogRecords)}, "SpanData %v", sd) + require.Containsf(t, sd.Attributes(), attribute.KeyValue{Key: internal.FailedToSendLogRecordsKey, Value: attribute.Int64Value(failedToSendLogRecords)}, "SpanData %v", sd) } } diff --git a/exporter/exporterhelper/metrics_batch_test.go b/exporter/exporterhelper/metrics_batch_test.go index 9a5bc9815a9..34aac146e22 100644 --- a/exporter/exporterhelper/metrics_batch_test.go +++ b/exporter/exporterhelper/metrics_batch_test.go @@ -18,7 +18,7 @@ func TestMergeMetrics(t *testing.T) { mr1 := &metricsRequest{md: testdata.GenerateMetrics(2)} mr2 := &metricsRequest{md: testdata.GenerateMetrics(3)} res, err := mergeMetrics(context.Background(), mr1, mr2) - assert.Nil(t, err) + assert.NoError(t, err) assert.Equal(t, 5, res.(*metricsRequest).md.MetricCount()) } @@ -133,7 +133,7 @@ func TestMergeSplitMetrics(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { res, err := mergeSplitMetrics(context.Background(), tt.cfg, tt.mr1, tt.mr2) - assert.Nil(t, err) + assert.NoError(t, err) assert.Equal(t, len(tt.expected), len(res)) for i := range res { assert.Equal(t, tt.expected[i], res[i].(*metricsRequest)) diff --git a/exporter/exporterhelper/metrics_test.go b/exporter/exporterhelper/metrics_test.go index f849ded612c..b97b2cdc650 100644 --- a/exporter/exporterhelper/metrics_test.go +++ b/exporter/exporterhelper/metrics_test.go @@ -25,9 +25,9 @@ import ( "go.opentelemetry.io/collector/consumer/consumererror" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/exporter" + "go.opentelemetry.io/collector/exporter/exporterhelper/internal" "go.opentelemetry.io/collector/exporter/exportertest" "go.opentelemetry.io/collector/exporter/internal/queue" - "go.opentelemetry.io/collector/internal/obsreportconfig/obsmetrics" "go.opentelemetry.io/collector/pdata/pmetric" "go.opentelemetry.io/collector/pdata/testdata" ) @@ -157,7 +157,7 @@ func TestMetricsRequestExporter_Default_ExportError(t *testing.T) { } func TestMetricsExporter_WithPersistentQueue(t *testing.T) { - qCfg := NewDefaultQueueSettings() + qCfg := NewDefaultQueueConfig() storageID := component.MustNewIDWithName("file_storage", "storage") qCfg.StorageID = &storageID rCfg := configretry.NewDefaultBackOffConfig() @@ -255,7 +255,7 @@ func TestMetricsExporter_WithRecordEnqueueFailedMetrics(t *testing.T) { t.Cleanup(func() { require.NoError(t, tt.Shutdown(context.Background())) }) rCfg := configretry.NewDefaultBackOffConfig() - qCfg := NewDefaultQueueSettings() + qCfg := NewDefaultQueueConfig() qCfg.NumConsumers = 1 qCfg.QueueSize = 2 wantErr := errors.New("some-error") @@ -424,7 +424,7 @@ func checkWrapSpanForMetricsExporter(t *testing.T, sr *tracetest.SpanRecorder, t // Inspection time! gotSpanData := sr.Ended() - require.Equal(t, numRequests+1, len(gotSpanData)) + require.Len(t, gotSpanData, numRequests+1) parentSpan := gotSpanData[numRequests] require.Equalf(t, fakeMetricsParentSpanName, parentSpan.Name(), "SpanData %v", parentSpan) @@ -438,7 +438,7 @@ func checkWrapSpanForMetricsExporter(t *testing.T, sr *tracetest.SpanRecorder, t sentMetricPoints = 0 failedToSendMetricPoints = numMetricPoints } - require.Containsf(t, sd.Attributes(), attribute.KeyValue{Key: obsmetrics.SentMetricPointsKey, Value: attribute.Int64Value(sentMetricPoints)}, "SpanData %v", sd) - require.Containsf(t, sd.Attributes(), attribute.KeyValue{Key: obsmetrics.FailedToSendMetricPointsKey, Value: attribute.Int64Value(failedToSendMetricPoints)}, "SpanData %v", sd) + require.Containsf(t, sd.Attributes(), attribute.KeyValue{Key: internal.SentMetricPointsKey, Value: attribute.Int64Value(sentMetricPoints)}, "SpanData %v", sd) + require.Containsf(t, sd.Attributes(), attribute.KeyValue{Key: internal.FailedToSendMetricPointsKey, Value: attribute.Int64Value(failedToSendMetricPoints)}, "SpanData %v", sd) } } diff --git a/exporter/exporterhelper/obsexporter.go b/exporter/exporterhelper/obsexporter.go index 751aaf1aac5..20821d9c779 100644 --- a/exporter/exporterhelper/obsexporter.go +++ b/exporter/exporterhelper/obsexporter.go @@ -13,8 +13,8 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/exporter" + "go.opentelemetry.io/collector/exporter/exporterhelper/internal" "go.opentelemetry.io/collector/exporter/exporterhelper/internal/metadata" - "go.opentelemetry.io/collector/internal/obsreportconfig/obsmetrics" ) // obsReport is a helper to add observability to an exporter. @@ -41,11 +41,11 @@ func newExporter(cfg obsReportSettings) (*obsReport, error) { } return &obsReport{ - spanNamePrefix: obsmetrics.ExporterPrefix + cfg.exporterID.String(), + spanNamePrefix: internal.ExporterPrefix + cfg.exporterID.String(), tracer: cfg.exporterCreateSettings.TracerProvider.Tracer(cfg.exporterID.String()), dataType: cfg.dataType, otelAttrs: []attribute.KeyValue{ - attribute.String(obsmetrics.ExporterKey, cfg.exporterID.String()), + attribute.String(internal.ExporterKey, cfg.exporterID.String()), }, telemetryBuilder: telemetryBuilder, }, nil @@ -55,21 +55,21 @@ func newExporter(cfg obsReportSettings) (*obsReport, error) { // The returned context should be used in other calls to the Exporter functions // dealing with the same export operation. func (or *obsReport) startTracesOp(ctx context.Context) context.Context { - return or.startOp(ctx, obsmetrics.ExportTraceDataOperationSuffix) + return or.startOp(ctx, internal.ExportTraceDataOperationSuffix) } // endTracesOp completes the export operation that was started with startTracesOp. func (or *obsReport) endTracesOp(ctx context.Context, numSpans int, err error) { numSent, numFailedToSend := toNumItems(numSpans, err) or.recordMetrics(context.WithoutCancel(ctx), component.DataTypeTraces, numSent, numFailedToSend) - endSpan(ctx, err, numSent, numFailedToSend, obsmetrics.SentSpansKey, obsmetrics.FailedToSendSpansKey) + endSpan(ctx, err, numSent, numFailedToSend, internal.SentSpansKey, internal.FailedToSendSpansKey) } // startMetricsOp is called at the start of an Export operation. // The returned context should be used in other calls to the Exporter functions // dealing with the same export operation. func (or *obsReport) startMetricsOp(ctx context.Context) context.Context { - return or.startOp(ctx, obsmetrics.ExportMetricsOperationSuffix) + return or.startOp(ctx, internal.ExportMetricsOperationSuffix) } // endMetricsOp completes the export operation that was started with @@ -79,21 +79,21 @@ func (or *obsReport) startMetricsOp(ctx context.Context) context.Context { func (or *obsReport) endMetricsOp(ctx context.Context, numMetricPoints int, err error) { numSent, numFailedToSend := toNumItems(numMetricPoints, err) or.recordMetrics(context.WithoutCancel(ctx), component.DataTypeMetrics, numSent, numFailedToSend) - endSpan(ctx, err, numSent, numFailedToSend, obsmetrics.SentMetricPointsKey, obsmetrics.FailedToSendMetricPointsKey) + endSpan(ctx, err, numSent, numFailedToSend, internal.SentMetricPointsKey, internal.FailedToSendMetricPointsKey) } // startLogsOp is called at the start of an Export operation. // The returned context should be used in other calls to the Exporter functions // dealing with the same export operation. func (or *obsReport) startLogsOp(ctx context.Context) context.Context { - return or.startOp(ctx, obsmetrics.ExportLogsOperationSuffix) + return or.startOp(ctx, internal.ExportLogsOperationSuffix) } // endLogsOp completes the export operation that was started with startLogsOp. func (or *obsReport) endLogsOp(ctx context.Context, numLogRecords int, err error) { numSent, numFailedToSend := toNumItems(numLogRecords, err) or.recordMetrics(context.WithoutCancel(ctx), component.DataTypeLogs, numSent, numFailedToSend) - endSpan(ctx, err, numSent, numFailedToSend, obsmetrics.SentLogRecordsKey, obsmetrics.FailedToSendLogRecordsKey) + endSpan(ctx, err, numSent, numFailedToSend, internal.SentLogRecordsKey, internal.FailedToSendLogRecordsKey) } // startOp creates the span used to trace the operation. Returning diff --git a/exporter/exporterhelper/obsexporter_test.go b/exporter/exporterhelper/obsexporter_test.go index 05f55f6fbd1..802068983f0 100644 --- a/exporter/exporterhelper/obsexporter_test.go +++ b/exporter/exporterhelper/obsexporter_test.go @@ -16,7 +16,7 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/exporter" - "go.opentelemetry.io/collector/internal/obsreportconfig/obsmetrics" + "go.opentelemetry.io/collector/exporter/exporterhelper/internal" ) var ( @@ -55,13 +55,13 @@ func TestExportTraceDataOp(t *testing.T) { switch { case params[i].err == nil: sentSpans += params[i].items - require.Contains(t, span.Attributes(), attribute.KeyValue{Key: obsmetrics.SentSpansKey, Value: attribute.Int64Value(int64(params[i].items))}) - require.Contains(t, span.Attributes(), attribute.KeyValue{Key: obsmetrics.FailedToSendSpansKey, Value: attribute.Int64Value(0)}) + require.Contains(t, span.Attributes(), attribute.KeyValue{Key: internal.SentSpansKey, Value: attribute.Int64Value(int64(params[i].items))}) + require.Contains(t, span.Attributes(), attribute.KeyValue{Key: internal.FailedToSendSpansKey, Value: attribute.Int64Value(0)}) assert.Equal(t, codes.Unset, span.Status().Code) case errors.Is(params[i].err, errFake): failedToSendSpans += params[i].items - require.Contains(t, span.Attributes(), attribute.KeyValue{Key: obsmetrics.SentSpansKey, Value: attribute.Int64Value(0)}) - require.Contains(t, span.Attributes(), attribute.KeyValue{Key: obsmetrics.FailedToSendSpansKey, Value: attribute.Int64Value(int64(params[i].items))}) + require.Contains(t, span.Attributes(), attribute.KeyValue{Key: internal.SentSpansKey, Value: attribute.Int64Value(0)}) + require.Contains(t, span.Attributes(), attribute.KeyValue{Key: internal.FailedToSendSpansKey, Value: attribute.Int64Value(int64(params[i].items))}) assert.Equal(t, codes.Error, span.Status().Code) assert.Equal(t, params[i].err.Error(), span.Status().Description) default: @@ -104,13 +104,13 @@ func TestExportMetricsOp(t *testing.T) { switch { case params[i].err == nil: sentMetricPoints += params[i].items - require.Contains(t, span.Attributes(), attribute.KeyValue{Key: obsmetrics.SentMetricPointsKey, Value: attribute.Int64Value(int64(params[i].items))}) - require.Contains(t, span.Attributes(), attribute.KeyValue{Key: obsmetrics.FailedToSendMetricPointsKey, Value: attribute.Int64Value(0)}) + require.Contains(t, span.Attributes(), attribute.KeyValue{Key: internal.SentMetricPointsKey, Value: attribute.Int64Value(int64(params[i].items))}) + require.Contains(t, span.Attributes(), attribute.KeyValue{Key: internal.FailedToSendMetricPointsKey, Value: attribute.Int64Value(0)}) assert.Equal(t, codes.Unset, span.Status().Code) case errors.Is(params[i].err, errFake): failedToSendMetricPoints += params[i].items - require.Contains(t, span.Attributes(), attribute.KeyValue{Key: obsmetrics.SentMetricPointsKey, Value: attribute.Int64Value(0)}) - require.Contains(t, span.Attributes(), attribute.KeyValue{Key: obsmetrics.FailedToSendMetricPointsKey, Value: attribute.Int64Value(int64(params[i].items))}) + require.Contains(t, span.Attributes(), attribute.KeyValue{Key: internal.SentMetricPointsKey, Value: attribute.Int64Value(0)}) + require.Contains(t, span.Attributes(), attribute.KeyValue{Key: internal.FailedToSendMetricPointsKey, Value: attribute.Int64Value(int64(params[i].items))}) assert.Equal(t, codes.Error, span.Status().Code) assert.Equal(t, params[i].err.Error(), span.Status().Description) default: @@ -153,13 +153,13 @@ func TestExportLogsOp(t *testing.T) { switch { case params[i].err == nil: sentLogRecords += params[i].items - require.Contains(t, span.Attributes(), attribute.KeyValue{Key: obsmetrics.SentLogRecordsKey, Value: attribute.Int64Value(int64(params[i].items))}) - require.Contains(t, span.Attributes(), attribute.KeyValue{Key: obsmetrics.FailedToSendLogRecordsKey, Value: attribute.Int64Value(0)}) + require.Contains(t, span.Attributes(), attribute.KeyValue{Key: internal.SentLogRecordsKey, Value: attribute.Int64Value(int64(params[i].items))}) + require.Contains(t, span.Attributes(), attribute.KeyValue{Key: internal.FailedToSendLogRecordsKey, Value: attribute.Int64Value(0)}) assert.Equal(t, codes.Unset, span.Status().Code) case errors.Is(params[i].err, errFake): failedToSendLogRecords += params[i].items - require.Contains(t, span.Attributes(), attribute.KeyValue{Key: obsmetrics.SentLogRecordsKey, Value: attribute.Int64Value(0)}) - require.Contains(t, span.Attributes(), attribute.KeyValue{Key: obsmetrics.FailedToSendLogRecordsKey, Value: attribute.Int64Value(int64(params[i].items))}) + require.Contains(t, span.Attributes(), attribute.KeyValue{Key: internal.SentLogRecordsKey, Value: attribute.Int64Value(0)}) + require.Contains(t, span.Attributes(), attribute.KeyValue{Key: internal.FailedToSendLogRecordsKey, Value: attribute.Int64Value(int64(params[i].items))}) assert.Equal(t, codes.Error, span.Status().Code) assert.Equal(t, params[i].err.Error(), span.Status().Description) default: diff --git a/exporter/exporterhelper/queue_sender.go b/exporter/exporterhelper/queue_sender.go index 060edab813a..58edbcc8732 100644 --- a/exporter/exporterhelper/queue_sender.go +++ b/exporter/exporterhelper/queue_sender.go @@ -15,15 +15,18 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/exporter" + "go.opentelemetry.io/collector/exporter/exporterhelper/internal" "go.opentelemetry.io/collector/exporter/exporterqueue" "go.opentelemetry.io/collector/exporter/internal/queue" - "go.opentelemetry.io/collector/internal/obsreportconfig/obsmetrics" ) const defaultQueueSize = 1000 -// QueueSettings defines configuration for queueing batches before sending to the consumerSender. -type QueueSettings struct { +// Deprecated: [v0.110.0] Use QueueConfig instead. +type QueueSettings = QueueConfig + +// QueueConfig defines configuration for queueing batches before sending to the consumerSender. +type QueueConfig struct { // Enabled indicates whether to not enqueue batches before sending to the consumerSender. Enabled bool `mapstructure:"enabled"` // NumConsumers is the number of consumers from the queue. Defaults to 10. @@ -37,9 +40,14 @@ type QueueSettings struct { StorageID *component.ID `mapstructure:"storage"` } -// NewDefaultQueueSettings returns the default settings for QueueSettings. +// Deprecated: [v0.110.0] Use NewDefaultQueueConfig instead. func NewDefaultQueueSettings() QueueSettings { - return QueueSettings{ + return NewDefaultQueueConfig() +} + +// NewDefaultQueueConfig returns the default config for QueueConfig. +func NewDefaultQueueConfig() QueueConfig { + return QueueConfig{ Enabled: true, NumConsumers: 10, // By default, batches are 8192 spans, for a total of up to 8 million spans in the queue @@ -49,8 +57,8 @@ func NewDefaultQueueSettings() QueueSettings { } } -// Validate checks if the QueueSettings configuration is valid -func (qCfg *QueueSettings) Validate() error { +// Validate checks if the QueueConfig configuration is valid +func (qCfg *QueueConfig) Validate() error { if !qCfg.Enabled { return nil } @@ -82,7 +90,7 @@ func newQueueSender(q exporterqueue.Queue[Request], set exporter.Settings, numCo qs := &queueSender{ queue: q, numConsumers: numConsumers, - traceAttribute: attribute.String(obsmetrics.ExporterKey, set.ID.String()), + traceAttribute: attribute.String(internal.ExporterKey, set.ID.String()), obsrep: obsrep, exporterID: set.ID, } @@ -104,7 +112,7 @@ func (qs *queueSender) Start(ctx context.Context, host component.Host) error { return err } - dataTypeAttr := attribute.String(obsmetrics.DataTypeKey, qs.obsrep.dataType.String()) + dataTypeAttr := attribute.String(internal.DataTypeKey, qs.obsrep.dataType.String()) return multierr.Append( qs.obsrep.telemetryBuilder.InitExporterQueueSize(func() int64 { return int64(qs.queue.Size()) }, metric.WithAttributeSet(attribute.NewSet(qs.traceAttribute, dataTypeAttr))), diff --git a/exporter/exporterhelper/queue_sender_test.go b/exporter/exporterhelper/queue_sender_test.go index 6fab17da4bb..08484ad0496 100644 --- a/exporter/exporterhelper/queue_sender_test.go +++ b/exporter/exporterhelper/queue_sender_test.go @@ -19,14 +19,14 @@ import ( "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/config/configretry" "go.opentelemetry.io/collector/exporter" + "go.opentelemetry.io/collector/exporter/exporterhelper/internal" "go.opentelemetry.io/collector/exporter/exporterqueue" "go.opentelemetry.io/collector/exporter/exportertest" "go.opentelemetry.io/collector/exporter/internal/queue" - "go.opentelemetry.io/collector/internal/obsreportconfig/obsmetrics" ) func TestQueuedRetry_StopWhileWaiting(t *testing.T) { - qCfg := NewDefaultQueueSettings() + qCfg := NewDefaultQueueConfig() qCfg.NumConsumers = 1 rCfg := configretry.NewDefaultBackOffConfig() be, err := newBaseExporter(defaultSettings, defaultDataType, newObservabilityConsumerSender, @@ -60,7 +60,7 @@ func TestQueuedRetry_StopWhileWaiting(t *testing.T) { } func TestQueuedRetry_DoNotPreserveCancellation(t *testing.T) { - qCfg := NewDefaultQueueSettings() + qCfg := NewDefaultQueueConfig() qCfg.NumConsumers = 1 rCfg := configretry.NewDefaultBackOffConfig() be, err := newBaseExporter(defaultSettings, defaultDataType, newObservabilityConsumerSender, @@ -89,7 +89,7 @@ func TestQueuedRetry_DoNotPreserveCancellation(t *testing.T) { } func TestQueuedRetry_RejectOnFull(t *testing.T) { - qCfg := NewDefaultQueueSettings() + qCfg := NewDefaultQueueConfig() qCfg.QueueSize = 0 qCfg.NumConsumers = 0 set := exportertest.NewNopSettings() @@ -119,7 +119,7 @@ func TestQueuedRetryHappyPath(t *testing.T) { queueOptions: []Option{ withMarshaler(mockRequestMarshaler), withUnmarshaler(mockRequestUnmarshaler(&mockRequest{})), - WithQueue(QueueSettings{ + WithQueue(QueueConfig{ Enabled: true, QueueSize: 10, NumConsumers: 1, @@ -210,7 +210,7 @@ func TestQueuedRetry_QueueMetricsReported(t *testing.T) { tt, err := componenttest.SetupTelemetry(defaultID) require.NoError(t, err) - qCfg := NewDefaultQueueSettings() + qCfg := NewDefaultQueueConfig() qCfg.NumConsumers = 0 // to make every request go straight to the queue rCfg := configretry.NewDefaultBackOffConfig() set := exporter.Settings{ID: defaultID, TelemetrySettings: tt.TelemetrySettings(), BuildInfo: component.NewDefaultBuildInfo()} @@ -226,7 +226,7 @@ func TestQueuedRetry_QueueMetricsReported(t *testing.T) { require.NoError(t, be.send(context.Background(), newErrorRequest())) } require.NoError(t, tt.CheckExporterMetricGauge("otelcol_exporter_queue_size", int64(7), - attribute.String(obsmetrics.DataTypeKey, dataType.String()))) + attribute.String(internal.DataTypeKey, dataType.String()))) assert.NoError(t, be.Shutdown(context.Background())) } @@ -248,14 +248,14 @@ func TestNoCancellationContext(t *testing.T) { assert.True(t, d.IsZero()) } -func TestQueueSettings_Validate(t *testing.T) { - qCfg := NewDefaultQueueSettings() +func TestQueueConfig_Validate(t *testing.T) { + qCfg := NewDefaultQueueConfig() assert.NoError(t, qCfg.Validate()) qCfg.QueueSize = 0 assert.EqualError(t, qCfg.Validate(), "queue size must be positive") - qCfg = NewDefaultQueueSettings() + qCfg = NewDefaultQueueConfig() qCfg.NumConsumers = 0 assert.EqualError(t, qCfg.Validate(), "number of queue consumers must be positive") @@ -276,7 +276,7 @@ func TestQueueRetryWithDisabledQueue(t *testing.T) { withMarshaler(mockRequestMarshaler), withUnmarshaler(mockRequestUnmarshaler(&mockRequest{})), func() Option { - qs := NewDefaultQueueSettings() + qs := NewDefaultQueueConfig() qs.Enabled = false return WithQueue(qs) }(), @@ -340,7 +340,7 @@ func TestQueuedRetryPersistenceEnabled(t *testing.T) { require.NoError(t, err) t.Cleanup(func() { require.NoError(t, tt.Shutdown(context.Background())) }) - qCfg := NewDefaultQueueSettings() + qCfg := NewDefaultQueueConfig() storageID := component.MustNewIDWithName("file_storage", "storage") qCfg.StorageID = &storageID // enable persistence rCfg := configretry.NewDefaultBackOffConfig() @@ -366,7 +366,7 @@ func TestQueuedRetryPersistenceEnabledStorageError(t *testing.T) { require.NoError(t, err) t.Cleanup(func() { require.NoError(t, tt.Shutdown(context.Background())) }) - qCfg := NewDefaultQueueSettings() + qCfg := NewDefaultQueueConfig() storageID := component.MustNewIDWithName("file_storage", "storage") qCfg.StorageID = &storageID // enable persistence rCfg := configretry.NewDefaultBackOffConfig() @@ -385,7 +385,7 @@ func TestQueuedRetryPersistenceEnabledStorageError(t *testing.T) { } func TestQueuedRetryPersistentEnabled_NoDataLossOnShutdown(t *testing.T) { - qCfg := NewDefaultQueueSettings() + qCfg := NewDefaultQueueConfig() qCfg.NumConsumers = 1 storageID := component.MustNewIDWithName("file_storage", "storage") qCfg.StorageID = &storageID // enable persistence to ensure data is re-queued on shutdown diff --git a/exporter/exporterhelper/retry_sender.go b/exporter/exporterhelper/retry_sender.go index 03b1dba80cc..0caa10ad72f 100644 --- a/exporter/exporterhelper/retry_sender.go +++ b/exporter/exporterhelper/retry_sender.go @@ -17,8 +17,8 @@ import ( "go.opentelemetry.io/collector/config/configretry" "go.opentelemetry.io/collector/consumer/consumererror" "go.opentelemetry.io/collector/exporter" + "go.opentelemetry.io/collector/exporter/exporterhelper/internal" "go.opentelemetry.io/collector/exporter/internal/experr" - "go.opentelemetry.io/collector/internal/obsreportconfig/obsmetrics" ) // TODO: Clean this by forcing all exporters to return an internal error type that always include the information about retries. @@ -53,7 +53,7 @@ type retrySender struct { func newRetrySender(config configretry.BackOffConfig, set exporter.Settings) *retrySender { return &retrySender{ - traceAttribute: attribute.String(obsmetrics.ExporterKey, set.ID.String()), + traceAttribute: attribute.String(internal.ExporterKey, set.ID.String()), cfg: config, stopCh: make(chan struct{}), logger: set.Logger, diff --git a/exporter/exporterhelper/retry_sender_test.go b/exporter/exporterhelper/retry_sender_test.go index e4de2a7a764..a0dab1f8782 100644 --- a/exporter/exporterhelper/retry_sender_test.go +++ b/exporter/exporterhelper/retry_sender_test.go @@ -36,7 +36,7 @@ func mockRequestMarshaler(Request) ([]byte, error) { } func TestQueuedRetry_DropOnPermanentError(t *testing.T) { - qCfg := NewDefaultQueueSettings() + qCfg := NewDefaultQueueConfig() rCfg := configretry.NewDefaultBackOffConfig() mockR := newMockRequest(2, consumererror.NewPermanent(errors.New("bad data"))) be, err := newBaseExporter(defaultSettings, defaultDataType, newObservabilityConsumerSender, @@ -60,7 +60,7 @@ func TestQueuedRetry_DropOnPermanentError(t *testing.T) { } func TestQueuedRetry_DropOnNoRetry(t *testing.T) { - qCfg := NewDefaultQueueSettings() + qCfg := NewDefaultQueueConfig() rCfg := configretry.NewDefaultBackOffConfig() rCfg.Enabled = false be, err := newBaseExporter(defaultSettings, defaultDataType, newObservabilityConsumerSender, withMarshaler(mockRequestMarshaler), @@ -86,7 +86,7 @@ func TestQueuedRetry_DropOnNoRetry(t *testing.T) { } func TestQueuedRetry_OnError(t *testing.T) { - qCfg := NewDefaultQueueSettings() + qCfg := NewDefaultQueueConfig() qCfg.NumConsumers = 1 rCfg := configretry.NewDefaultBackOffConfig() rCfg.InitialInterval = 0 @@ -115,7 +115,7 @@ func TestQueuedRetry_OnError(t *testing.T) { } func TestQueuedRetry_MaxElapsedTime(t *testing.T) { - qCfg := NewDefaultQueueSettings() + qCfg := NewDefaultQueueConfig() qCfg.NumConsumers = 1 rCfg := configretry.NewDefaultBackOffConfig() rCfg.InitialInterval = time.Millisecond @@ -164,7 +164,7 @@ func (e wrappedError) Unwrap() error { } func TestQueuedRetry_ThrottleError(t *testing.T) { - qCfg := NewDefaultQueueSettings() + qCfg := NewDefaultQueueConfig() qCfg.NumConsumers = 1 rCfg := configretry.NewDefaultBackOffConfig() rCfg.InitialInterval = 10 * time.Millisecond @@ -188,7 +188,7 @@ func TestQueuedRetry_ThrottleError(t *testing.T) { ocs.awaitAsyncProcessing() // The initial backoff is 10ms, but because of the throttle this should wait at least 100ms. - assert.True(t, 100*time.Millisecond < time.Since(start)) + assert.Less(t, 100*time.Millisecond, time.Since(start)) mockR.checkNumRequests(t, 2) ocs.checkSendItemsCount(t, 2) @@ -197,7 +197,7 @@ func TestQueuedRetry_ThrottleError(t *testing.T) { } func TestQueuedRetry_RetryOnError(t *testing.T) { - qCfg := NewDefaultQueueSettings() + qCfg := NewDefaultQueueConfig() qCfg.NumConsumers = 1 qCfg.QueueSize = 1 rCfg := configretry.NewDefaultBackOffConfig() diff --git a/exporter/exporterhelper/timeout_sender.go b/exporter/exporterhelper/timeout_sender.go index 2a6364a2aaf..9e489f54ded 100644 --- a/exporter/exporterhelper/timeout_sender.go +++ b/exporter/exporterhelper/timeout_sender.go @@ -9,14 +9,17 @@ import ( "time" ) -// TimeoutSettings for timeout. The timeout applies to individual attempts to send data to the backend. -type TimeoutSettings struct { +// Deprecated: [v0.110.0] Use TimeoutConfig instead. +type TimeoutSettings = TimeoutConfig + +// TimeoutConfig for timeout. The timeout applies to individual attempts to send data to the backend. +type TimeoutConfig struct { // Timeout is the timeout for every attempt to send data to the backend. // A zero timeout means no timeout. Timeout time.Duration `mapstructure:"timeout"` } -func (ts *TimeoutSettings) Validate() error { +func (ts *TimeoutConfig) Validate() error { // Negative timeouts are not acceptable, since all sends will fail. if ts.Timeout < 0 { return errors.New("'timeout' must be non-negative") @@ -24,9 +27,14 @@ func (ts *TimeoutSettings) Validate() error { return nil } -// NewDefaultTimeoutSettings returns the default settings for TimeoutSettings. +// Deprecated: [v0.110.0] Use NewDefaultTimeoutConfig instead. func NewDefaultTimeoutSettings() TimeoutSettings { - return TimeoutSettings{ + return NewDefaultTimeoutConfig() +} + +// NewDefaultTimeoutConfig returns the default config for TimeoutConfig. +func NewDefaultTimeoutConfig() TimeoutConfig { + return TimeoutConfig{ Timeout: 5 * time.Second, } } @@ -34,7 +42,7 @@ func NewDefaultTimeoutSettings() TimeoutSettings { // timeoutSender is a requestSender that adds a `timeout` to every request that passes this sender. type timeoutSender struct { baseRequestSender - cfg TimeoutSettings + cfg TimeoutConfig } func (ts *timeoutSender) send(ctx context.Context, req Request) error { diff --git a/exporter/exporterhelper/timeout_sender_test.go b/exporter/exporterhelper/timeout_sender_test.go index 205ac094c07..a0dac589821 100644 --- a/exporter/exporterhelper/timeout_sender_test.go +++ b/exporter/exporterhelper/timeout_sender_test.go @@ -10,14 +10,14 @@ import ( "github.com/stretchr/testify/assert" ) -func TestNewDefaultTimeoutSettings(t *testing.T) { - cfg := NewDefaultTimeoutSettings() +func TestNewDefaultTimeoutConfig(t *testing.T) { + cfg := NewDefaultTimeoutConfig() assert.NoError(t, cfg.Validate()) - assert.Equal(t, TimeoutSettings{Timeout: 5 * time.Second}, cfg) + assert.Equal(t, TimeoutConfig{Timeout: 5 * time.Second}, cfg) } func TestInvalidTimeout(t *testing.T) { - cfg := NewDefaultTimeoutSettings() + cfg := NewDefaultTimeoutConfig() assert.NoError(t, cfg.Validate()) cfg.Timeout = -1 assert.Error(t, cfg.Validate()) diff --git a/exporter/exporterhelper/traces_batch_test.go b/exporter/exporterhelper/traces_batch_test.go index 5779b731b63..63bc73e94d0 100644 --- a/exporter/exporterhelper/traces_batch_test.go +++ b/exporter/exporterhelper/traces_batch_test.go @@ -18,7 +18,7 @@ func TestMergeTraces(t *testing.T) { tr1 := &tracesRequest{td: testdata.GenerateTraces(2)} tr2 := &tracesRequest{td: testdata.GenerateTraces(3)} res, err := mergeTraces(context.Background(), tr1, tr2) - assert.Nil(t, err) + assert.NoError(t, err) assert.Equal(t, 5, res.(*tracesRequest).td.SpanCount()) } @@ -133,7 +133,7 @@ func TestMergeSplitTraces(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { res, err := mergeSplitTraces(context.Background(), tt.cfg, tt.tr1, tt.tr2) - assert.Nil(t, err) + assert.NoError(t, err) assert.Equal(t, len(tt.expected), len(res)) for i := range res { assert.Equal(t, tt.expected[i], res[i].(*tracesRequest)) diff --git a/exporter/exporterhelper/traces_test.go b/exporter/exporterhelper/traces_test.go index 82baa5c229c..103b9b76060 100644 --- a/exporter/exporterhelper/traces_test.go +++ b/exporter/exporterhelper/traces_test.go @@ -25,9 +25,9 @@ import ( "go.opentelemetry.io/collector/consumer/consumererror" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/exporter" + "go.opentelemetry.io/collector/exporter/exporterhelper/internal" "go.opentelemetry.io/collector/exporter/exportertest" "go.opentelemetry.io/collector/exporter/internal/queue" - "go.opentelemetry.io/collector/internal/obsreportconfig/obsmetrics" "go.opentelemetry.io/collector/pdata/ptrace" "go.opentelemetry.io/collector/pdata/testdata" ) @@ -154,7 +154,7 @@ func TestTracesRequestExporter_Default_ExportError(t *testing.T) { } func TestTracesExporter_WithPersistentQueue(t *testing.T) { - qCfg := NewDefaultQueueSettings() + qCfg := NewDefaultQueueConfig() storageID := component.MustNewIDWithName("file_storage", "storage") qCfg.StorageID = &storageID rCfg := configretry.NewDefaultBackOffConfig() @@ -252,7 +252,7 @@ func TestTracesExporter_WithRecordEnqueueFailedMetrics(t *testing.T) { t.Cleanup(func() { require.NoError(t, tt.Shutdown(context.Background())) }) rCfg := configretry.NewDefaultBackOffConfig() - qCfg := NewDefaultQueueSettings() + qCfg := NewDefaultQueueConfig() qCfg.NumConsumers = 1 qCfg.QueueSize = 2 wantErr := errors.New("some-error") @@ -365,7 +365,7 @@ func TestTracesExporter_WithShutdown_ReturnError(t *testing.T) { assert.NoError(t, err) assert.NoError(t, te.Start(context.Background(), componenttest.NewNopHost())) - assert.Equal(t, te.Shutdown(context.Background()), want) + assert.Equal(t, want, te.Shutdown(context.Background())) } func TestTracesRequestExporter_WithShutdown_ReturnError(t *testing.T) { @@ -378,7 +378,7 @@ func TestTracesRequestExporter_WithShutdown_ReturnError(t *testing.T) { assert.NoError(t, err) assert.NoError(t, te.Start(context.Background(), componenttest.NewNopHost())) - assert.Equal(t, te.Shutdown(context.Background()), want) + assert.Equal(t, want, te.Shutdown(context.Background())) } func newTraceDataPusher(retError error) consumer.ConsumeTracesFunc { @@ -426,7 +426,7 @@ func checkWrapSpanForTracesExporter(t *testing.T, sr *tracetest.SpanRecorder, tr // Inspection time! gotSpanData := sr.Ended() - require.Equal(t, numRequests+1, len(gotSpanData)) + require.Len(t, gotSpanData, numRequests+1) parentSpan := gotSpanData[numRequests] require.Equalf(t, fakeTraceParentSpanName, parentSpan.Name(), "SpanData %v", parentSpan) @@ -441,7 +441,7 @@ func checkWrapSpanForTracesExporter(t *testing.T, sr *tracetest.SpanRecorder, tr sentSpans = 0 failedToSendSpans = numSpans } - require.Containsf(t, sd.Attributes(), attribute.KeyValue{Key: obsmetrics.SentSpansKey, Value: attribute.Int64Value(sentSpans)}, "SpanData %v", sd) - require.Containsf(t, sd.Attributes(), attribute.KeyValue{Key: obsmetrics.FailedToSendSpansKey, Value: attribute.Int64Value(failedToSendSpans)}, "SpanData %v", sd) + require.Containsf(t, sd.Attributes(), attribute.KeyValue{Key: internal.SentSpansKey, Value: attribute.Int64Value(sentSpans)}, "SpanData %v", sd) + require.Containsf(t, sd.Attributes(), attribute.KeyValue{Key: internal.FailedToSendSpansKey, Value: attribute.Int64Value(failedToSendSpans)}, "SpanData %v", sd) } } diff --git a/exporter/exporterprofiles/go.mod b/exporter/exporterprofiles/go.mod index e97488427ab..e659701ee31 100644 --- a/exporter/exporterprofiles/go.mod +++ b/exporter/exporterprofiles/go.mod @@ -4,9 +4,9 @@ go 1.22.0 require ( github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector/component v0.108.1 - go.opentelemetry.io/collector/consumer/consumertest v0.108.1 - go.opentelemetry.io/collector/exporter v0.108.1 + go.opentelemetry.io/collector/component v0.109.0 + go.opentelemetry.io/collector/consumer/consumertest v0.109.0 + go.opentelemetry.io/collector/exporter v0.109.0 ) require ( @@ -16,21 +16,21 @@ 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/config/configtelemetry v0.108.1 // indirect - go.opentelemetry.io/collector/consumer v0.108.1 // indirect - go.opentelemetry.io/collector/consumer/consumerprofiles v0.108.1 // indirect - go.opentelemetry.io/collector/pdata v1.14.1 // indirect - go.opentelemetry.io/collector/pdata/pprofile v0.108.1 // indirect - go.opentelemetry.io/otel v1.29.0 // indirect - go.opentelemetry.io/otel/metric v1.29.0 // indirect - go.opentelemetry.io/otel/trace v1.29.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.109.0 // indirect + go.opentelemetry.io/collector/consumer v0.109.0 // indirect + go.opentelemetry.io/collector/consumer/consumerprofiles v0.109.0 // indirect + go.opentelemetry.io/collector/pdata v1.15.0 // indirect + go.opentelemetry.io/collector/pdata/pprofile v0.109.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.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.24.0 // indirect + golang.org/x/sys v0.25.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.65.0 // indirect + google.golang.org/grpc v1.66.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) @@ -41,8 +41,6 @@ replace go.opentelemetry.io/collector/extension => ../../extension replace go.opentelemetry.io/collector/extension/experimental/storage => ../../extension/experimental/storage -replace go.opentelemetry.io/collector => ../.. - replace go.opentelemetry.io/collector/pdata/pprofile => ../../pdata/pprofile replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/configtelemetry @@ -51,10 +49,6 @@ replace go.opentelemetry.io/collector/config/configretry => ../../config/configr replace go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata -replace go.opentelemetry.io/collector/featuregate => ../../featuregate - -replace go.opentelemetry.io/collector/confmap => ../../confmap - replace go.opentelemetry.io/collector/component => ../../component replace go.opentelemetry.io/collector/pdata => ../../pdata @@ -67,6 +61,4 @@ replace go.opentelemetry.io/collector/consumer => ../../consumer replace go.opentelemetry.io/collector/exporter => ../ -replace go.opentelemetry.io/collector/component/componentstatus => ../../component/componentstatus - replace go.opentelemetry.io/collector/receiver/receiverprofiles => ../../receiver/receiverprofiles diff --git a/exporter/exporterprofiles/go.sum b/exporter/exporterprofiles/go.sum index 3d0d9cc3299..577d2b128fc 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.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= -go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= -go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= -go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= -go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= -go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= +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.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.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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= @@ -78,8 +78,8 @@ 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= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd h1:6TEm2ZxXoQmFWFlt1vNxvVOa1Q0dXFQD1m/rYjXmS0E= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= 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= diff --git a/exporter/exporterqueue/config.go b/exporter/exporterqueue/config.go index fcc0e0e57b1..b8a2c01e5bb 100644 --- a/exporter/exporterqueue/config.go +++ b/exporter/exporterqueue/config.go @@ -33,7 +33,7 @@ func NewDefaultConfig() Config { } } -// Validate checks if the QueueSettings configuration is valid +// Validate checks if the Config is valid func (qCfg *Config) Validate() error { if !qCfg.Enabled { return nil diff --git a/exporter/exportertest/contract_checker.go b/exporter/exportertest/contract_checker.go index 0ae8f6b5c9a..58c74b55118 100644 --- a/exporter/exportertest/contract_checker.go +++ b/exporter/exportertest/contract_checker.go @@ -228,9 +228,9 @@ func checkLogs(t *testing.T, params CheckConsumeContractParams, mockReceiver com // Test is successful if all the elements were received successfully and no error was returned func alwaysSucceedsPassed(t *testing.T, allRecordsNumber int, reqCounter requestCounter) { require.Equal(t, allRecordsNumber, reqCounter.success) - require.Equal(t, reqCounter.total, allRecordsNumber) - require.Equal(t, reqCounter.error.nonpermanent, 0) - require.Equal(t, reqCounter.error.permanent, 0) + require.Equal(t, allRecordsNumber, reqCounter.total) + require.Equal(t, 0, reqCounter.error.nonpermanent) + require.Equal(t, 0, reqCounter.error.permanent) } // Test is successful if all the elements were retried on non-permanent errors diff --git a/exporter/exportertest/mock_consumer_test.go b/exporter/exportertest/mock_consumer_test.go index 63eec26d7fd..e853be14c6b 100644 --- a/exporter/exportertest/mock_consumer_test.go +++ b/exporter/exportertest/mock_consumer_test.go @@ -130,10 +130,10 @@ func TestConsumeLogsNonPermanent(t *testing.T) { if err != nil { return } - assert.Equal(t, mc.reqCounter.error.nonpermanent, 1) - assert.Equal(t, mc.reqCounter.error.permanent, 0) - assert.Equal(t, mc.reqCounter.success, 0) - assert.Equal(t, mc.reqCounter.total, 1) + assert.Equal(t, 1, mc.reqCounter.error.nonpermanent) + assert.Equal(t, 0, mc.reqCounter.error.permanent) + assert.Equal(t, 0, mc.reqCounter.success) + assert.Equal(t, 1, mc.reqCounter.total) } @@ -145,10 +145,10 @@ func TestConsumeLogsPermanent(t *testing.T) { if err != nil { return } - assert.Equal(t, mc.reqCounter.error.nonpermanent, 0) - assert.Equal(t, mc.reqCounter.error.permanent, 1) - assert.Equal(t, mc.reqCounter.success, 0) - assert.Equal(t, mc.reqCounter.total, 1) + assert.Equal(t, 0, mc.reqCounter.error.nonpermanent) + assert.Equal(t, 1, mc.reqCounter.error.permanent) + assert.Equal(t, 0, mc.reqCounter.success) + assert.Equal(t, 1, mc.reqCounter.total) } @@ -159,10 +159,10 @@ func TestConsumeLogsSuccess(t *testing.T) { if err != nil { return } - assert.Equal(t, mc.reqCounter.error.nonpermanent, 0) - assert.Equal(t, mc.reqCounter.error.permanent, 0) - assert.Equal(t, mc.reqCounter.success, 1) - assert.Equal(t, mc.reqCounter.total, 1) + assert.Equal(t, 0, mc.reqCounter.error.nonpermanent) + assert.Equal(t, 0, mc.reqCounter.error.permanent) + assert.Equal(t, 1, mc.reqCounter.success) + assert.Equal(t, 1, mc.reqCounter.total) } @@ -173,10 +173,10 @@ func TestConsumeTracesNonPermanent(t *testing.T) { if err != nil { return } - assert.Equal(t, mc.reqCounter.error.nonpermanent, 1) - assert.Equal(t, mc.reqCounter.error.permanent, 0) - assert.Equal(t, mc.reqCounter.success, 0) - assert.Equal(t, mc.reqCounter.total, 1) + assert.Equal(t, 1, mc.reqCounter.error.nonpermanent) + assert.Equal(t, 0, mc.reqCounter.error.permanent) + assert.Equal(t, 0, mc.reqCounter.success) + assert.Equal(t, 1, mc.reqCounter.total) } @@ -188,10 +188,10 @@ func TestConsumeTracesPermanent(t *testing.T) { if err != nil { return } - assert.Equal(t, mc.reqCounter.error.nonpermanent, 0) - assert.Equal(t, mc.reqCounter.error.permanent, 1) - assert.Equal(t, mc.reqCounter.success, 0) - assert.Equal(t, mc.reqCounter.total, 1) + assert.Equal(t, 0, mc.reqCounter.error.nonpermanent) + assert.Equal(t, 1, mc.reqCounter.error.permanent) + assert.Equal(t, 0, mc.reqCounter.success) + assert.Equal(t, 1, mc.reqCounter.total) } @@ -202,10 +202,10 @@ func TestConsumeTracesSuccess(t *testing.T) { if err != nil { return } - assert.Equal(t, mc.reqCounter.error.nonpermanent, 0) - assert.Equal(t, mc.reqCounter.error.permanent, 0) - assert.Equal(t, mc.reqCounter.success, 1) - assert.Equal(t, mc.reqCounter.total, 1) + assert.Equal(t, 0, mc.reqCounter.error.nonpermanent) + assert.Equal(t, 0, mc.reqCounter.error.permanent) + assert.Equal(t, 1, mc.reqCounter.success) + assert.Equal(t, 1, mc.reqCounter.total) } func TestConsumeMetricsNonPermanent(t *testing.T) { @@ -215,10 +215,10 @@ func TestConsumeMetricsNonPermanent(t *testing.T) { if err != nil { return } - assert.Equal(t, mc.reqCounter.error.nonpermanent, 1) - assert.Equal(t, mc.reqCounter.error.permanent, 0) - assert.Equal(t, mc.reqCounter.success, 0) - assert.Equal(t, mc.reqCounter.total, 1) + assert.Equal(t, 1, mc.reqCounter.error.nonpermanent) + assert.Equal(t, 0, mc.reqCounter.error.permanent) + assert.Equal(t, 0, mc.reqCounter.success) + assert.Equal(t, 1, mc.reqCounter.total) } @@ -229,10 +229,10 @@ func TestConsumeMetricsPermanent(t *testing.T) { if err != nil { return } - assert.Equal(t, mc.reqCounter.error.nonpermanent, 0) - assert.Equal(t, mc.reqCounter.error.permanent, 1) - assert.Equal(t, mc.reqCounter.success, 0) - assert.Equal(t, mc.reqCounter.total, 1) + assert.Equal(t, 0, mc.reqCounter.error.nonpermanent) + assert.Equal(t, 1, mc.reqCounter.error.permanent) + assert.Equal(t, 0, mc.reqCounter.success) + assert.Equal(t, 1, mc.reqCounter.total) } @@ -243,14 +243,14 @@ func TestConsumeMetricsSuccess(t *testing.T) { if err != nil { return } - assert.Equal(t, mc.reqCounter.error.nonpermanent, 0) - assert.Equal(t, mc.reqCounter.error.permanent, 0) - assert.Equal(t, mc.reqCounter.success, 1) - assert.Equal(t, mc.reqCounter.total, 1) + assert.Equal(t, 0, mc.reqCounter.error.nonpermanent) + assert.Equal(t, 0, mc.reqCounter.error.permanent) + assert.Equal(t, 1, mc.reqCounter.success) + assert.Equal(t, 1, mc.reqCounter.total) } func TestCapabilites(t *testing.T) { mc := newMockConsumer(func() error { return nil }) - assert.Equal(t, mc.Capabilities(), consumer.Capabilities{}) + assert.Equal(t, consumer.Capabilities{}, mc.Capabilities()) } diff --git a/exporter/go.mod b/exporter/go.mod index 4b2ccf6f7bf..9fa3d2f6cab 100644 --- a/exporter/go.mod +++ b/exporter/go.mod @@ -6,30 +6,29 @@ require ( github.com/cenkalti/backoff/v4 v4.3.0 github.com/google/uuid v1.6.0 github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector v0.108.1 - go.opentelemetry.io/collector/component v0.108.1 - go.opentelemetry.io/collector/config/configretry v1.14.1 - go.opentelemetry.io/collector/config/configtelemetry v0.108.1 - go.opentelemetry.io/collector/consumer v0.108.1 - go.opentelemetry.io/collector/consumer/consumerprofiles v0.108.1 - go.opentelemetry.io/collector/consumer/consumertest v0.108.1 - go.opentelemetry.io/collector/exporter/exporterprofiles v0.108.1 - go.opentelemetry.io/collector/extension v0.108.1 - go.opentelemetry.io/collector/extension/experimental/storage v0.0.0-20240902085631-cd1f7623fe67 - go.opentelemetry.io/collector/pdata v1.14.1 - go.opentelemetry.io/collector/pdata/pprofile v0.108.1 - go.opentelemetry.io/collector/pdata/testdata v0.108.1 - go.opentelemetry.io/collector/receiver v0.108.1 - go.opentelemetry.io/otel v1.29.0 - go.opentelemetry.io/otel/metric v1.29.0 - go.opentelemetry.io/otel/sdk v1.29.0 - go.opentelemetry.io/otel/sdk/metric v1.29.0 - go.opentelemetry.io/otel/trace v1.29.0 + go.opentelemetry.io/collector/component v0.109.0 + go.opentelemetry.io/collector/config/configretry v1.15.0 + go.opentelemetry.io/collector/config/configtelemetry v0.109.0 + go.opentelemetry.io/collector/consumer v0.109.0 + go.opentelemetry.io/collector/consumer/consumerprofiles v0.109.0 + go.opentelemetry.io/collector/consumer/consumertest v0.109.0 + go.opentelemetry.io/collector/exporter/exporterprofiles v0.109.0 + go.opentelemetry.io/collector/extension v0.109.0 + go.opentelemetry.io/collector/extension/experimental/storage v0.109.0 + go.opentelemetry.io/collector/pdata v1.15.0 + go.opentelemetry.io/collector/pdata/pprofile v0.109.0 + go.opentelemetry.io/collector/pdata/testdata v0.109.0 + go.opentelemetry.io/collector/receiver v0.109.0 + go.opentelemetry.io/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.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.27.0 - golang.org/x/sys v0.24.0 - google.golang.org/grpc v1.65.0 + golang.org/x/sys v0.25.0 + google.golang.org/grpc v1.66.0 ) require ( @@ -38,27 +37,19 @@ 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/gogo/protobuf v1.3.2 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.17.9 // indirect - github.com/knadh/koanf/maps v0.1.1 // indirect - github.com/knadh/koanf/providers/confmap v0.1.0 // indirect - github.com/knadh/koanf/v2 v2.1.1 // indirect - github.com/mitchellh/copystructure v1.2.0 // indirect - github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.20.2 // indirect + github.com/prometheus/client_golang v1.20.3 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.56.0 // indirect + github.com/prometheus/common v0.59.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect - go.opentelemetry.io/collector/component/componentstatus v0.108.1 // indirect - go.opentelemetry.io/collector/confmap v1.14.1 // indirect - go.opentelemetry.io/collector/receiver/receiverprofiles v0.108.1 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.51.0 // indirect + go.opentelemetry.io/collector/receiver/receiverprofiles v0.109.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect golang.org/x/net v0.28.0 // indirect golang.org/x/text v0.17.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd // indirect @@ -66,20 +57,14 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect ) -replace go.opentelemetry.io/collector => ../ - replace go.opentelemetry.io/collector/component => ../component -replace go.opentelemetry.io/collector/confmap => ../confmap - replace go.opentelemetry.io/collector/consumer => ../consumer replace go.opentelemetry.io/collector/extension => ../extension replace go.opentelemetry.io/collector/extension/experimental/storage => ../extension/experimental/storage -replace go.opentelemetry.io/collector/featuregate => ../featuregate - replace go.opentelemetry.io/collector/pdata => ../pdata replace go.opentelemetry.io/collector/pdata/testdata => ../pdata/testdata @@ -98,8 +83,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/componentstatus => ../component/componentstatus - replace go.opentelemetry.io/collector/receiver/receiverprofiles => ../receiver/receiverprofiles replace go.opentelemetry.io/collector/exporter/exporterprofiles => ./exporterprofiles diff --git a/exporter/go.sum b/exporter/go.sum index 3272860f60f..369679016e1 100644 --- a/exporter/go.sum +++ b/exporter/go.sum @@ -12,8 +12,6 @@ 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/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= @@ -27,22 +25,12 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= -github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= -github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= -github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= -github.com/knadh/koanf/providers/confmap v0.1.0/go.mod h1:2uLhxQzJnyHKfxG927awZC7+fyHFdQkd697K4MdLnIU= -github.com/knadh/koanf/v2 v2.1.1 h1:/R8eXqasSTsmDCsAyYj+81Wteg8AqrV9CP6gvsTsOmM= -github.com/knadh/koanf/v2 v2.1.1/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= -github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= -github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= -github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -52,12 +40,12 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg= -github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= +github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.56.0 h1:UffReloqkBtvtQEYDg2s+uDPGRrJyC6vZWPGXf6OhPY= -github.com/prometheus/common v0.56.0/go.mod h1:7uRPFSUTbfZWsJ7MHY56sqt7hLQu3bxXHDnNhl8E9qI= +github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= +github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= @@ -68,18 +56,18 @@ 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.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= -go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0 h1:G7uexXb/K3T+T9fNLCCKncweEtNEBMTO+46hKX5EdKw= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0/go.mod h1:v0mFe5Kk7woIh938mrZBJBmENYquyA0IICrlYm4Y0t4= -go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= -go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= -go.opentelemetry.io/otel/sdk v1.29.0 h1:vkqKjk7gwhS8VaWb0POZKmIEDimRCMsopNYnriHyryo= -go.opentelemetry.io/otel/sdk v1.29.0/go.mod h1:pM8Dx5WKnvxLCb+8lG1PRNIDxu9g9b9g59Qr7hfAAok= -go.opentelemetry.io/otel/sdk/metric v1.29.0 h1:K2CfmJohnRgvZ9UAj2/FhIf/okdWcNdBwe1m8xFXiSY= -go.opentelemetry.io/otel/sdk/metric v1.29.0/go.mod h1:6zZLdCl2fkauYoZIOn/soQIDSWFmNSRcICarHfuhNJQ= -go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= -go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= +go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= +go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= +go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= +go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= +go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= +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.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= @@ -103,8 +91,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.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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= @@ -119,8 +107,8 @@ 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= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd h1:6TEm2ZxXoQmFWFlt1vNxvVOa1Q0dXFQD1m/rYjXmS0E= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= 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= diff --git a/exporter/internal/common/factory.go b/exporter/internal/common/factory.go index b76e23f89c4..e6380c4ae78 100644 --- a/exporter/internal/common/factory.go +++ b/exporter/internal/common/factory.go @@ -35,7 +35,7 @@ func CreateTracesExporter(ctx context.Context, set exporter.Settings, config com return exporterhelper.NewTracesExporter(ctx, set, config, s.pushTraces, exporterhelper.WithCapabilities(consumer.Capabilities{MutatesData: false}), - exporterhelper.WithTimeout(exporterhelper.TimeoutSettings{Timeout: 0}), + exporterhelper.WithTimeout(exporterhelper.TimeoutConfig{Timeout: 0}), exporterhelper.WithShutdown(otlptext.LoggerSync(exporterLogger)), ) } @@ -46,7 +46,7 @@ func CreateMetricsExporter(ctx context.Context, set exporter.Settings, config co return exporterhelper.NewMetricsExporter(ctx, set, config, s.pushMetrics, exporterhelper.WithCapabilities(consumer.Capabilities{MutatesData: false}), - exporterhelper.WithTimeout(exporterhelper.TimeoutSettings{Timeout: 0}), + exporterhelper.WithTimeout(exporterhelper.TimeoutConfig{Timeout: 0}), exporterhelper.WithShutdown(otlptext.LoggerSync(exporterLogger)), ) } @@ -57,7 +57,7 @@ func CreateLogsExporter(ctx context.Context, set exporter.Settings, config compo return exporterhelper.NewLogsExporter(ctx, set, config, s.pushLogs, exporterhelper.WithCapabilities(consumer.Capabilities{MutatesData: false}), - exporterhelper.WithTimeout(exporterhelper.TimeoutSettings{Timeout: 0}), + exporterhelper.WithTimeout(exporterhelper.TimeoutConfig{Timeout: 0}), exporterhelper.WithShutdown(otlptext.LoggerSync(exporterLogger)), ) } diff --git a/exporter/internal/queue/mock_storage.go b/exporter/internal/queue/mock_storage.go index 6ef9810529b..26e2ae994e0 100644 --- a/exporter/internal/queue/mock_storage.go +++ b/exporter/internal/queue/mock_storage.go @@ -10,6 +10,7 @@ import ( "sync" "sync/atomic" "syscall" + "time" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/extension/experimental/storage" @@ -20,22 +21,31 @@ type mockStorageExtension struct { component.ShutdownFunc st sync.Map getClientError error + executionDelay time.Duration } func (m *mockStorageExtension) GetClient(context.Context, component.Kind, component.ID, string) (storage.Client, error) { if m.getClientError != nil { return nil, m.getClientError } - return &mockStorageClient{st: &m.st, closed: &atomic.Bool{}}, nil + return &mockStorageClient{st: &m.st, closed: &atomic.Bool{}, executionDelay: m.executionDelay}, nil } func NewMockStorageExtension(getClientError error) storage.Extension { - return &mockStorageExtension{getClientError: getClientError} + return NewMockStorageExtensionWithDelay(getClientError, 0) +} + +func NewMockStorageExtensionWithDelay(getClientError error, executionDelay time.Duration) storage.Extension { + return &mockStorageExtension{ + getClientError: getClientError, + executionDelay: executionDelay, + } } type mockStorageClient struct { - st *sync.Map - closed *atomic.Bool + st *sync.Map + closed *atomic.Bool + executionDelay time.Duration // simulate real storage client delay } func (m *mockStorageClient) Get(ctx context.Context, s string) ([]byte, error) { @@ -61,6 +71,9 @@ func (m *mockStorageClient) Batch(_ context.Context, ops ...storage.Operation) e if m.isClosed() { panic("client already closed") } + if m.executionDelay != 0 { + time.Sleep(m.executionDelay) + } for _, op := range ops { switch op.Type { case storage.Get: diff --git a/exporter/internal/queue/persistent_queue_test.go b/exporter/internal/queue/persistent_queue_test.go index f226e35c430..a6a7b8b974e 100644 --- a/exporter/internal/queue/persistent_queue_test.go +++ b/exporter/internal/queue/persistent_queue_test.go @@ -8,6 +8,7 @@ import ( "errors" "fmt" "strconv" + "sync" "sync/atomic" "syscall" "testing" @@ -531,6 +532,70 @@ func TestPersistentQueueStartWithNonDispatched(t *testing.T) { require.Equal(t, 6, newPs.Size()) } +func TestPersistentQueueStartWithNonDispatchedConcurrent(t *testing.T) { + req := newTracesRequest(1, 1) + + ext := NewMockStorageExtensionWithDelay(nil, 20*time.Nanosecond) + pq := createTestPersistentQueueWithItemsCapacity(t, ext, 25) + + proWg := sync.WaitGroup{} + // Sending small amount of data as windows test can't handle the test fast enough + for j := 0; j < 5; j++ { + proWg.Add(1) + go func() { + defer proWg.Done() + // Put in items up to capacity + for i := 0; i < 10; i++ { + for { + // retry infinitely so the exact amount of items are added to the queue eventually + if err := pq.Offer(context.Background(), req); err == nil { + break + } + time.Sleep(50 * time.Nanosecond) + } + } + }() + } + + conWg := sync.WaitGroup{} + for j := 0; j < 5; j++ { + conWg.Add(1) + go func() { + defer conWg.Done() + for i := 0; i < 10; i++ { + require.True(t, pq.Consume(func(context.Context, tracesRequest) error { return nil })) + } + }() + } + + conDone := make(chan struct{}) + go func() { + defer close(conDone) + conWg.Wait() + }() + + proDone := make(chan struct{}) + go func() { + defer close(proDone) + proWg.Wait() + }() + + doneCtx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + select { + case <-conDone: + case <-doneCtx.Done(): + assert.Fail(t, "timed out waiting for consumers to complete") + } + + select { + case <-proDone: + case <-doneCtx.Done(): + assert.Fail(t, "timed out waiting for producers to complete") + } + assert.Zero(t, pq.sizedChannel.Size()) +} + func TestPersistentQueue_PutCloseReadClose(t *testing.T) { req := newTracesRequest(5, 10) ext := NewMockStorageExtension(nil) diff --git a/exporter/internal/queue/sized_channel.go b/exporter/internal/queue/sized_channel.go index 1702a38ac2f..f322e58c01c 100644 --- a/exporter/internal/queue/sized_channel.go +++ b/exporter/internal/queue/sized_channel.go @@ -55,8 +55,16 @@ func (vcq *sizedChannel[T]) push(el T, size int64, callback func() error) error return err } } - vcq.ch <- el - return nil + + select { + // for persistent queue implementation, channel len can be out of sync with used size. Attempt to put it + // into the channel. If it is full, simply returns ErrQueueIsFull error. This prevents potential deadlock issues. + case vcq.ch <- el: + return nil + default: + vcq.used.Add(-size) + return ErrQueueIsFull + } } // pop removes the element from the queue and returns it. diff --git a/exporter/internal/queue/sized_channel_test.go b/exporter/internal/queue/sized_channel_test.go index 02cd4bf8e68..8d25510ff63 100644 --- a/exporter/internal/queue/sized_channel_test.go +++ b/exporter/internal/queue/sized_channel_test.go @@ -42,3 +42,13 @@ func TestSizedCapacityChannel(t *testing.T) { assert.False(t, ok) assert.Equal(t, 0, el) } + +func TestSizedCapacityChannel_Offer_sizedNotFullButChannelFull(t *testing.T) { + q := newSizedChannel[int](1, nil, 0) + assert.NoError(t, q.push(1, 1, nil)) + + q.used.Store(0) + err := q.push(1, 1, nil) + assert.Error(t, err) + assert.Equal(t, ErrQueueIsFull, err) +} diff --git a/exporter/exporterhelper/request.go b/exporter/internal/request.go similarity index 92% rename from exporter/exporterhelper/request.go rename to exporter/internal/request.go index 74f0186541f..319f9946f95 100644 --- a/exporter/exporterhelper/request.go +++ b/exporter/internal/request.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package exporterhelper // import "go.opentelemetry.io/collector/exporter/exporterhelper" +package internal // import "go.opentelemetry.io/collector/exporter/internal" import ( "context" @@ -34,7 +34,7 @@ type RequestErrorHandler interface { // extractPartialRequest returns a new Request that may contain the items left to be sent // if only some items failed to process and can be retried. Otherwise, it returns the original Request. -func extractPartialRequest(req Request, err error) Request { +func ExtractPartialRequest(req Request, err error) Request { if errReq, ok := req.(RequestErrorHandler); ok { return errReq.OnError(err) } diff --git a/exporter/loggingexporter/config_test.go b/exporter/loggingexporter/config_test.go index 70d573cd89e..de9e769846e 100644 --- a/exporter/loggingexporter/config_test.go +++ b/exporter/loggingexporter/config_test.go @@ -138,7 +138,7 @@ func Test_UnmarshalMarshalled(t *testing.T) { if tc.expectedErr == "" { assert.NoError(t, err) - assert.Equal(t, outCfg, tc.expectedConfig) + assert.Equal(t, tc.expectedConfig, outCfg) return } assert.Error(t, err) diff --git a/exporter/loggingexporter/factory.go b/exporter/loggingexporter/factory.go index 54f68e5bb74..c19d7e16ac6 100644 --- a/exporter/loggingexporter/factory.go +++ b/exporter/loggingexporter/factory.go @@ -44,6 +44,7 @@ func createDefaultConfig() component.Config { } func createTracesExporter(ctx context.Context, set exporter.Settings, config component.Config) (exporter.Traces, error) { + set.TelemetrySettings.Logger.Warn("The logging exporter is DEPRECATED and will be REMOVED in v0.111.0. Use the debug exporter instead: https://github.com/open-telemetry/opentelemetry-collector/tree/main/exporter/debugexporter") cfg := config.(*Config) return common.CreateTracesExporter(ctx, set, config, &common.Common{ Verbosity: cfg.Verbosity, @@ -55,6 +56,7 @@ func createTracesExporter(ctx context.Context, set exporter.Settings, config com } func createMetricsExporter(ctx context.Context, set exporter.Settings, config component.Config) (exporter.Metrics, error) { + set.TelemetrySettings.Logger.Warn("The logging exporter is DEPRECATED and will be REMOVED in v0.111.0. Use the debug exporter instead: https://github.com/open-telemetry/opentelemetry-collector/tree/main/exporter/debugexporter") cfg := config.(*Config) return common.CreateMetricsExporter(ctx, set, config, &common.Common{ Verbosity: cfg.Verbosity, @@ -66,6 +68,7 @@ func createMetricsExporter(ctx context.Context, set exporter.Settings, config co } func createLogsExporter(ctx context.Context, set exporter.Settings, config component.Config) (exporter.Logs, error) { + set.TelemetrySettings.Logger.Warn("The logging exporter is DEPRECATED and will be REMOVED in v0.111.0. Use the debug exporter instead: https://github.com/open-telemetry/opentelemetry-collector/tree/main/exporter/debugexporter") cfg := config.(*Config) return common.CreateLogsExporter(ctx, set, config, &common.Common{ Verbosity: cfg.Verbosity, diff --git a/exporter/loggingexporter/go.mod b/exporter/loggingexporter/go.mod index f240738f7ac..fd226a6073e 100644 --- a/exporter/loggingexporter/go.mod +++ b/exporter/loggingexporter/go.mod @@ -5,11 +5,11 @@ go 1.22.0 require ( github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector/component v0.108.1 - go.opentelemetry.io/collector/config/configtelemetry v0.108.1 - go.opentelemetry.io/collector/confmap v1.14.1 - go.opentelemetry.io/collector/exporter v0.108.1 - go.opentelemetry.io/collector/pdata v1.14.1 + go.opentelemetry.io/collector/component v0.109.0 + go.opentelemetry.io/collector/config/configtelemetry v0.109.0 + go.opentelemetry.io/collector/confmap v1.15.0 + go.opentelemetry.io/collector/exporter v0.109.0 + go.opentelemetry.io/collector/pdata v1.15.0 go.uber.org/goleak v1.3.0 go.uber.org/zap v1.27.0 ) @@ -35,39 +35,36 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.20.2 // indirect + github.com/prometheus/client_golang v1.20.3 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.56.0 // indirect + github.com/prometheus/common v0.59.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect - go.opentelemetry.io/collector v0.108.1 // indirect - go.opentelemetry.io/collector/config/configretry v1.14.1 // indirect - go.opentelemetry.io/collector/consumer v0.108.1 // indirect - go.opentelemetry.io/collector/consumer/consumerprofiles v0.108.1 // indirect - go.opentelemetry.io/collector/consumer/consumertest v0.108.1 // indirect - go.opentelemetry.io/collector/exporter/exporterprofiles v0.108.1 // indirect - go.opentelemetry.io/collector/extension v0.108.1 // indirect - go.opentelemetry.io/collector/extension/experimental/storage v0.0.0-20240902085631-cd1f7623fe67 // indirect - go.opentelemetry.io/collector/pdata/pprofile v0.108.1 // indirect - go.opentelemetry.io/collector/receiver v0.108.1 // indirect - go.opentelemetry.io/collector/receiver/receiverprofiles v0.108.1 // indirect - go.opentelemetry.io/otel v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.51.0 // indirect - go.opentelemetry.io/otel/metric v1.29.0 // indirect - go.opentelemetry.io/otel/sdk v1.29.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.29.0 // indirect - go.opentelemetry.io/otel/trace v1.29.0 // indirect + go.opentelemetry.io/collector/config/configretry v1.15.0 // indirect + go.opentelemetry.io/collector/consumer v0.109.0 // indirect + go.opentelemetry.io/collector/consumer/consumerprofiles v0.109.0 // indirect + go.opentelemetry.io/collector/consumer/consumertest v0.109.0 // indirect + go.opentelemetry.io/collector/exporter/exporterprofiles v0.109.0 // indirect + go.opentelemetry.io/collector/extension v0.109.0 // indirect + go.opentelemetry.io/collector/extension/experimental/storage v0.109.0 // indirect + go.opentelemetry.io/collector/pdata/pprofile v0.109.0 // indirect + go.opentelemetry.io/collector/receiver v0.109.0 // indirect + go.opentelemetry.io/collector/receiver/receiverprofiles v0.109.0 // indirect + go.opentelemetry.io/otel v1.30.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect + go.opentelemetry.io/otel/metric v1.30.0 // indirect + go.opentelemetry.io/otel/sdk v1.30.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect + go.opentelemetry.io/otel/trace v1.30.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.24.0 // indirect + golang.org/x/sys v0.25.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.65.0 // indirect + google.golang.org/grpc v1.66.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) -replace go.opentelemetry.io/collector => ../../ - replace go.opentelemetry.io/collector/component => ../../component replace go.opentelemetry.io/collector/confmap => ../../confmap @@ -80,8 +77,6 @@ replace go.opentelemetry.io/collector/extension => ../../extension replace go.opentelemetry.io/collector/extension/experimental/storage => ../../extension/experimental/storage -replace go.opentelemetry.io/collector/featuregate => ../../featuregate - replace go.opentelemetry.io/collector/pdata => ../../pdata replace go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata @@ -103,8 +98,6 @@ replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../../consume replace go.opentelemetry.io/collector/consumer/consumertest => ../../consumer/consumertest -replace go.opentelemetry.io/collector/component/componentstatus => ../../component/componentstatus - replace go.opentelemetry.io/collector/receiver/receiverprofiles => ../../receiver/receiverprofiles replace go.opentelemetry.io/collector/exporter/exporterprofiles => ../exporterprofiles diff --git a/exporter/loggingexporter/go.sum b/exporter/loggingexporter/go.sum index 3272860f60f..6890ef19e46 100644 --- a/exporter/loggingexporter/go.sum +++ b/exporter/loggingexporter/go.sum @@ -52,12 +52,12 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg= -github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= +github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.56.0 h1:UffReloqkBtvtQEYDg2s+uDPGRrJyC6vZWPGXf6OhPY= -github.com/prometheus/common v0.56.0/go.mod h1:7uRPFSUTbfZWsJ7MHY56sqt7hLQu3bxXHDnNhl8E9qI= +github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= +github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= @@ -68,18 +68,18 @@ 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.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= -go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0 h1:G7uexXb/K3T+T9fNLCCKncweEtNEBMTO+46hKX5EdKw= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0/go.mod h1:v0mFe5Kk7woIh938mrZBJBmENYquyA0IICrlYm4Y0t4= -go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= -go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= -go.opentelemetry.io/otel/sdk v1.29.0 h1:vkqKjk7gwhS8VaWb0POZKmIEDimRCMsopNYnriHyryo= -go.opentelemetry.io/otel/sdk v1.29.0/go.mod h1:pM8Dx5WKnvxLCb+8lG1PRNIDxu9g9b9g59Qr7hfAAok= -go.opentelemetry.io/otel/sdk/metric v1.29.0 h1:K2CfmJohnRgvZ9UAj2/FhIf/okdWcNdBwe1m8xFXiSY= -go.opentelemetry.io/otel/sdk/metric v1.29.0/go.mod h1:6zZLdCl2fkauYoZIOn/soQIDSWFmNSRcICarHfuhNJQ= -go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= -go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= +go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= +go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= +go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= +go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= +go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= +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.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= @@ -103,8 +103,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.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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= @@ -119,8 +119,8 @@ 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= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd h1:6TEm2ZxXoQmFWFlt1vNxvVOa1Q0dXFQD1m/rYjXmS0E= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= 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= diff --git a/exporter/nopexporter/go.mod b/exporter/nopexporter/go.mod index 5623af9839a..f45e33b3c31 100644 --- a/exporter/nopexporter/go.mod +++ b/exporter/nopexporter/go.mod @@ -4,11 +4,11 @@ go 1.22.0 require ( github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector/component v0.108.1 - go.opentelemetry.io/collector/confmap v1.14.1 - go.opentelemetry.io/collector/consumer/consumertest v0.108.1 - go.opentelemetry.io/collector/exporter v0.108.1 - go.opentelemetry.io/collector/pdata v1.14.1 + go.opentelemetry.io/collector/component v0.109.0 + go.opentelemetry.io/collector/confmap v1.15.0 + go.opentelemetry.io/collector/consumer/consumertest v0.109.0 + go.opentelemetry.io/collector/exporter v0.109.0 + go.opentelemetry.io/collector/pdata v1.15.0 go.uber.org/goleak v1.3.0 ) @@ -32,30 +32,30 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.20.2 // indirect + github.com/prometheus/client_golang v1.20.3 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.56.0 // indirect + github.com/prometheus/common v0.59.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.108.1 // indirect - go.opentelemetry.io/collector/consumer v0.108.1 // indirect - go.opentelemetry.io/collector/consumer/consumerprofiles v0.108.1 // indirect - go.opentelemetry.io/collector/exporter/exporterprofiles v0.108.1 // indirect - go.opentelemetry.io/collector/pdata/pprofile v0.108.1 // indirect - go.opentelemetry.io/collector/receiver v0.108.1 // indirect - go.opentelemetry.io/collector/receiver/receiverprofiles v0.108.1 // indirect - go.opentelemetry.io/otel v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.51.0 // indirect - go.opentelemetry.io/otel/metric v1.29.0 // indirect - go.opentelemetry.io/otel/sdk v1.29.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.29.0 // indirect - go.opentelemetry.io/otel/trace v1.29.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.109.0 // indirect + go.opentelemetry.io/collector/consumer v0.109.0 // indirect + go.opentelemetry.io/collector/consumer/consumerprofiles v0.109.0 // indirect + go.opentelemetry.io/collector/exporter/exporterprofiles v0.109.0 // indirect + go.opentelemetry.io/collector/pdata/pprofile v0.109.0 // indirect + go.opentelemetry.io/collector/receiver v0.109.0 // indirect + go.opentelemetry.io/collector/receiver/receiverprofiles v0.109.0 // indirect + go.opentelemetry.io/otel v1.30.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect + go.opentelemetry.io/otel/metric v1.30.0 // indirect + go.opentelemetry.io/otel/sdk v1.30.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect + go.opentelemetry.io/otel/trace v1.30.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.24.0 // indirect + golang.org/x/sys v0.25.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.65.0 // indirect + google.golang.org/grpc v1.66.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) @@ -74,10 +74,6 @@ replace go.opentelemetry.io/collector/config/configretry => ../../config/configr replace go.opentelemetry.io/collector/receiver => ../../receiver -replace go.opentelemetry.io/collector => ../.. - -replace go.opentelemetry.io/collector/featuregate => ../../featuregate - replace go.opentelemetry.io/collector/confmap => ../../confmap replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/configtelemetry @@ -92,8 +88,6 @@ replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../../consume replace go.opentelemetry.io/collector/consumer/consumertest => ../../consumer/consumertest -replace go.opentelemetry.io/collector/component/componentstatus => ../../component/componentstatus - replace go.opentelemetry.io/collector/receiver/receiverprofiles => ../../receiver/receiverprofiles replace go.opentelemetry.io/collector/exporter/exporterprofiles => ../exporterprofiles diff --git a/exporter/nopexporter/go.sum b/exporter/nopexporter/go.sum index 3272860f60f..6890ef19e46 100644 --- a/exporter/nopexporter/go.sum +++ b/exporter/nopexporter/go.sum @@ -52,12 +52,12 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg= -github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= +github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.56.0 h1:UffReloqkBtvtQEYDg2s+uDPGRrJyC6vZWPGXf6OhPY= -github.com/prometheus/common v0.56.0/go.mod h1:7uRPFSUTbfZWsJ7MHY56sqt7hLQu3bxXHDnNhl8E9qI= +github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= +github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= @@ -68,18 +68,18 @@ 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.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= -go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0 h1:G7uexXb/K3T+T9fNLCCKncweEtNEBMTO+46hKX5EdKw= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0/go.mod h1:v0mFe5Kk7woIh938mrZBJBmENYquyA0IICrlYm4Y0t4= -go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= -go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= -go.opentelemetry.io/otel/sdk v1.29.0 h1:vkqKjk7gwhS8VaWb0POZKmIEDimRCMsopNYnriHyryo= -go.opentelemetry.io/otel/sdk v1.29.0/go.mod h1:pM8Dx5WKnvxLCb+8lG1PRNIDxu9g9b9g59Qr7hfAAok= -go.opentelemetry.io/otel/sdk/metric v1.29.0 h1:K2CfmJohnRgvZ9UAj2/FhIf/okdWcNdBwe1m8xFXiSY= -go.opentelemetry.io/otel/sdk/metric v1.29.0/go.mod h1:6zZLdCl2fkauYoZIOn/soQIDSWFmNSRcICarHfuhNJQ= -go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= -go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= +go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= +go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= +go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= +go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= +go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= +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.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= @@ -103,8 +103,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.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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= @@ -119,8 +119,8 @@ 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= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd h1:6TEm2ZxXoQmFWFlt1vNxvVOa1Q0dXFQD1m/rYjXmS0E= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= 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= diff --git a/exporter/otlpexporter/cfg-schema.yaml b/exporter/otlpexporter/cfg-schema.yaml index 073ec5707ee..a79fdfb40c4 100644 --- a/exporter/otlpexporter/cfg-schema.yaml +++ b/exporter/otlpexporter/cfg-schema.yaml @@ -7,7 +7,7 @@ fields: doc: | Timeout is the timeout for every attempt to send data to the backend. - name: sending_queue - type: exporterhelper.QueueSettings + type: exporterhelper.QueueConfig kind: struct fields: - name: enabled diff --git a/exporter/otlpexporter/config.go b/exporter/otlpexporter/config.go index 2aec2995054..b9697125377 100644 --- a/exporter/otlpexporter/config.go +++ b/exporter/otlpexporter/config.go @@ -20,9 +20,9 @@ import ( // Config defines configuration for OTLP exporter. type Config struct { - exporterhelper.TimeoutSettings `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct. - QueueConfig exporterhelper.QueueSettings `mapstructure:"sending_queue"` - RetryConfig configretry.BackOffConfig `mapstructure:"retry_on_failure"` + exporterhelper.TimeoutConfig `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct. + exporterhelper.QueueConfig `mapstructure:"sending_queue"` + RetryConfig configretry.BackOffConfig `mapstructure:"retry_on_failure"` // Experimental: This configuration is at the early stage of development and may change without backward compatibility // until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved diff --git a/exporter/otlpexporter/config_test.go b/exporter/otlpexporter/config_test.go index 7a855d47b51..f3941c83d97 100644 --- a/exporter/otlpexporter/config_test.go +++ b/exporter/otlpexporter/config_test.go @@ -38,7 +38,7 @@ func TestUnmarshalConfig(t *testing.T) { assert.NoError(t, cm.Unmarshal(&cfg)) assert.Equal(t, &Config{ - TimeoutSettings: exporterhelper.TimeoutSettings{ + TimeoutConfig: exporterhelper.TimeoutConfig{ Timeout: 10 * time.Second, }, RetryConfig: configretry.BackOffConfig{ @@ -49,7 +49,7 @@ func TestUnmarshalConfig(t *testing.T) { MaxInterval: 1 * time.Minute, MaxElapsedTime: 10 * time.Minute, }, - QueueConfig: exporterhelper.QueueSettings{ + QueueConfig: exporterhelper.QueueConfig{ Enabled: true, NumConsumers: 2, QueueSize: 10, diff --git a/exporter/otlpexporter/factory.go b/exporter/otlpexporter/factory.go index 84952defdf3..7d0452773ea 100644 --- a/exporter/otlpexporter/factory.go +++ b/exporter/otlpexporter/factory.go @@ -34,10 +34,10 @@ func createDefaultConfig() component.Config { batcherCfg.Enabled = false return &Config{ - TimeoutSettings: exporterhelper.NewDefaultTimeoutSettings(), - RetryConfig: configretry.NewDefaultBackOffConfig(), - QueueConfig: exporterhelper.NewDefaultQueueSettings(), - BatcherConfig: batcherCfg, + TimeoutConfig: exporterhelper.NewDefaultTimeoutConfig(), + RetryConfig: configretry.NewDefaultBackOffConfig(), + QueueConfig: exporterhelper.NewDefaultQueueConfig(), + BatcherConfig: batcherCfg, ClientConfig: configgrpc.ClientConfig{ Headers: map[string]configopaque.String{}, // Default to gzip compression @@ -58,7 +58,7 @@ func createTracesExporter( return exporterhelper.NewTracesExporter(ctx, set, cfg, oce.pushTraces, exporterhelper.WithCapabilities(consumer.Capabilities{MutatesData: false}), - exporterhelper.WithTimeout(oCfg.TimeoutSettings), + exporterhelper.WithTimeout(oCfg.TimeoutConfig), exporterhelper.WithRetry(oCfg.RetryConfig), exporterhelper.WithQueue(oCfg.QueueConfig), exporterhelper.WithBatcher(oCfg.BatcherConfig), @@ -77,7 +77,7 @@ func createMetricsExporter( return exporterhelper.NewMetricsExporter(ctx, set, cfg, oce.pushMetrics, exporterhelper.WithCapabilities(consumer.Capabilities{MutatesData: false}), - exporterhelper.WithTimeout(oCfg.TimeoutSettings), + exporterhelper.WithTimeout(oCfg.TimeoutConfig), exporterhelper.WithRetry(oCfg.RetryConfig), exporterhelper.WithQueue(oCfg.QueueConfig), exporterhelper.WithBatcher(oCfg.BatcherConfig), @@ -96,7 +96,7 @@ func createLogsExporter( return exporterhelper.NewLogsExporter(ctx, set, cfg, oce.pushLogs, exporterhelper.WithCapabilities(consumer.Capabilities{MutatesData: false}), - exporterhelper.WithTimeout(oCfg.TimeoutSettings), + exporterhelper.WithTimeout(oCfg.TimeoutConfig), exporterhelper.WithRetry(oCfg.RetryConfig), exporterhelper.WithQueue(oCfg.QueueConfig), exporterhelper.WithBatcher(oCfg.BatcherConfig), diff --git a/exporter/otlpexporter/factory_test.go b/exporter/otlpexporter/factory_test.go index 622fcdabcdb..3c9722a27b0 100644 --- a/exporter/otlpexporter/factory_test.go +++ b/exporter/otlpexporter/factory_test.go @@ -30,10 +30,10 @@ func TestCreateDefaultConfig(t *testing.T) { assert.NoError(t, componenttest.CheckConfigStruct(cfg)) ocfg, ok := factory.CreateDefaultConfig().(*Config) assert.True(t, ok) - assert.Equal(t, ocfg.RetryConfig, configretry.NewDefaultBackOffConfig()) - assert.Equal(t, ocfg.QueueConfig, exporterhelper.NewDefaultQueueSettings()) - assert.Equal(t, ocfg.TimeoutSettings, exporterhelper.NewDefaultTimeoutSettings()) - assert.Equal(t, ocfg.Compression, configcompression.TypeGzip) + assert.Equal(t, configretry.NewDefaultBackOffConfig(), ocfg.RetryConfig) + assert.Equal(t, exporterhelper.NewDefaultQueueConfig(), ocfg.QueueConfig) + assert.Equal(t, exporterhelper.NewDefaultTimeoutConfig(), ocfg.TimeoutConfig) + assert.Equal(t, configcompression.TypeGzip, ocfg.Compression) } func TestCreateMetricsExporter(t *testing.T) { @@ -43,7 +43,7 @@ func TestCreateMetricsExporter(t *testing.T) { set := exportertest.NewNopSettings() oexp, err := factory.CreateMetricsExporter(context.Background(), set, cfg) - require.Nil(t, err) + require.NoError(t, err) require.NotNil(t, oexp) } @@ -181,7 +181,7 @@ func TestCreateTracesExporter(t *testing.T) { if err != nil { // Since the endpoint of OTLP exporter doesn't actually exist, // exporter may already stop because it cannot connect. - assert.Equal(t, err.Error(), "rpc error: code = Canceled desc = grpc: the client connection is closing") + assert.Equal(t, "rpc error: code = Canceled desc = grpc: the client connection is closing", err.Error()) } }) } @@ -194,6 +194,6 @@ func TestCreateLogsExporter(t *testing.T) { set := exportertest.NewNopSettings() oexp, err := factory.CreateLogsExporter(context.Background(), set, cfg) - require.Nil(t, err) + require.NoError(t, err) require.NotNil(t, oexp) } diff --git a/exporter/otlpexporter/go.mod b/exporter/otlpexporter/go.mod index 870516bc9f8..17b2f95f785 100644 --- a/exporter/otlpexporter/go.mod +++ b/exporter/otlpexporter/go.mod @@ -4,23 +4,23 @@ go 1.22.0 require ( github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector v0.108.1 - go.opentelemetry.io/collector/component v0.108.1 - go.opentelemetry.io/collector/config/configauth v0.108.1 - go.opentelemetry.io/collector/config/configcompression v1.14.1 - go.opentelemetry.io/collector/config/configgrpc v0.108.1 - go.opentelemetry.io/collector/config/configopaque v1.14.1 - go.opentelemetry.io/collector/config/configretry v1.14.1 - go.opentelemetry.io/collector/config/configtls v1.14.1 - go.opentelemetry.io/collector/confmap v1.14.1 - go.opentelemetry.io/collector/consumer v0.108.1 - go.opentelemetry.io/collector/exporter v0.108.1 - go.opentelemetry.io/collector/pdata v1.14.1 - go.opentelemetry.io/collector/pdata/testdata v0.108.1 + go.opentelemetry.io/collector v0.109.0 + go.opentelemetry.io/collector/component v0.109.0 + go.opentelemetry.io/collector/config/configauth v0.109.0 + go.opentelemetry.io/collector/config/configcompression v1.15.0 + go.opentelemetry.io/collector/config/configgrpc v0.109.0 + go.opentelemetry.io/collector/config/configopaque v1.15.0 + go.opentelemetry.io/collector/config/configretry v1.15.0 + go.opentelemetry.io/collector/config/configtls v1.15.0 + go.opentelemetry.io/collector/confmap v1.15.0 + go.opentelemetry.io/collector/consumer v0.109.0 + go.opentelemetry.io/collector/exporter v0.109.0 + go.opentelemetry.io/collector/pdata v1.15.0 + go.opentelemetry.io/collector/pdata/testdata v0.109.0 go.uber.org/goleak v1.3.0 go.uber.org/zap v1.27.0 google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd - google.golang.org/grpc v1.65.0 + google.golang.org/grpc v1.66.0 google.golang.org/protobuf v1.34.2 ) @@ -36,7 +36,6 @@ require ( 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.9 // indirect @@ -50,49 +49,36 @@ require ( github.com/mostynb/go-grpc-compression v1.2.3 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.20.2 // indirect + github.com/prometheus/client_golang v1.20.3 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.56.0 // indirect + github.com/prometheus/common v0.59.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect - go.opentelemetry.io/collector/client v1.14.1 // indirect - go.opentelemetry.io/collector/config/confignet v0.108.1 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.108.1 // indirect - go.opentelemetry.io/collector/config/internal v0.108.1 // indirect - go.opentelemetry.io/collector/consumer/consumerprofiles v0.108.1 // indirect - go.opentelemetry.io/collector/consumer/consumertest v0.108.1 // indirect - go.opentelemetry.io/collector/exporter/exporterprofiles v0.108.1 // indirect - go.opentelemetry.io/collector/extension v0.108.1 // indirect - go.opentelemetry.io/collector/extension/auth v0.108.1 // indirect - go.opentelemetry.io/collector/extension/experimental/storage v0.0.0-20240902085631-cd1f7623fe67 // indirect - go.opentelemetry.io/collector/featuregate v1.14.1 // indirect - go.opentelemetry.io/collector/pdata/pprofile v0.108.1 // indirect - go.opentelemetry.io/collector/receiver v0.108.1 // indirect - go.opentelemetry.io/collector/receiver/receiverprofiles v0.108.1 // indirect - go.opentelemetry.io/contrib/config v0.9.0 // indirect + go.opentelemetry.io/collector/client v1.15.0 // indirect + go.opentelemetry.io/collector/config/confignet v0.109.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.109.0 // indirect + go.opentelemetry.io/collector/config/internal v0.109.0 // indirect + go.opentelemetry.io/collector/consumer/consumerprofiles v0.109.0 // indirect + go.opentelemetry.io/collector/consumer/consumertest v0.109.0 // indirect + go.opentelemetry.io/collector/exporter/exporterprofiles v0.109.0 // indirect + go.opentelemetry.io/collector/extension v0.109.0 // indirect + go.opentelemetry.io/collector/extension/auth v0.109.0 // indirect + go.opentelemetry.io/collector/extension/experimental/storage v0.109.0 // indirect + go.opentelemetry.io/collector/featuregate v1.15.0 // indirect + go.opentelemetry.io/collector/internal/globalgates v0.109.0 // indirect + go.opentelemetry.io/collector/pdata/pprofile v0.109.0 // indirect + go.opentelemetry.io/collector/receiver v0.109.0 // indirect + go.opentelemetry.io/collector/receiver/receiverprofiles v0.109.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 // indirect - go.opentelemetry.io/otel v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.5.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.51.0 // indirect - go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.5.0 // indirect - go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.29.0 // indirect - go.opentelemetry.io/otel/log v0.5.0 // indirect - go.opentelemetry.io/otel/metric v1.29.0 // indirect - go.opentelemetry.io/otel/sdk v1.29.0 // indirect - go.opentelemetry.io/otel/sdk/log v0.5.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.29.0 // indirect - go.opentelemetry.io/otel/trace v1.29.0 // indirect - go.opentelemetry.io/proto/otlp v1.3.1 // indirect + go.opentelemetry.io/otel v1.30.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect + go.opentelemetry.io/otel/metric v1.30.0 // indirect + go.opentelemetry.io/otel/sdk v1.30.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect + go.opentelemetry.io/otel/trace v1.30.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.24.0 // indirect + golang.org/x/sys v0.25.0 // indirect golang.org/x/text v0.17.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) @@ -156,3 +142,5 @@ replace go.opentelemetry.io/collector/component/componentstatus => ../../compone replace go.opentelemetry.io/collector/receiver/receiverprofiles => ../../receiver/receiverprofiles replace go.opentelemetry.io/collector/exporter/exporterprofiles => ../exporterprofiles + +replace go.opentelemetry.io/collector/internal/globalgates => ../../internal/globalgates diff --git a/exporter/otlpexporter/go.sum b/exporter/otlpexporter/go.sum index 6dcab6f8f6a..edf7b021678 100644 --- a/exporter/otlpexporter/go.sum +++ b/exporter/otlpexporter/go.sum @@ -25,8 +25,6 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 h1:asbCHRVmodnJTuQ3qamDwqVOIjwqUPTYmYuemVOx+Ys= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0/go.mod h1:ggCgvZ2r7uOoQjOyu2Y1NhHmEPPzzuhWgcza5M1Ji1I= 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/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= @@ -62,12 +60,12 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg= -github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= +github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.56.0 h1:UffReloqkBtvtQEYDg2s+uDPGRrJyC6vZWPGXf6OhPY= -github.com/prometheus/common v0.56.0/go.mod h1:7uRPFSUTbfZWsJ7MHY56sqt7hLQu3bxXHDnNhl8E9qI= +github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= +github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= @@ -78,46 +76,20 @@ 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/contrib/config v0.9.0 h1:AJ1c6+vJ6SxvqBBhsi2RhLFMlc6SnJOg81Jp4toFyNw= -go.opentelemetry.io/contrib/config v0.9.0/go.mod h1:u/u2L6y/c8GKrq/AP51sfXV4Eu24btVlC3A5f867xwg= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 h1:r6I7RJCN86bpD/FQwedZ0vSixDpwuWREjW9oRMsmqDc= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0/go.mod h1:B9yO6b04uB80CzjedvewuqDhxJxi11s7/GtiGa8bAjI= -go.opentelemetry.io/otel v1.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= -go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= -go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.5.0 h1:4d++HQ+Ihdl+53zSjtsCUFDmNMju2FC9qFkUlTxPLqo= -go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.5.0/go.mod h1:mQX5dTO3Mh5ZF7bPKDkt5c/7C41u/SiDr9XgTpzXXn8= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.29.0 h1:k6fQVDQexDE+3jG2SfCQjnHS7OamcP73YMoxEVq5B6k= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.29.0/go.mod h1:t4BrYLHU450Zo9fnydWlIuswB1bm7rM8havDpWOJeDo= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.29.0 h1:xvhQxJ/C9+RTnAj5DpTg7LSM1vbbMTiXt7e9hsfqHNw= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.29.0/go.mod h1:Fcvs2Bz1jkDM+Wf5/ozBGmi3tQ/c9zPKLnsipnfhGAo= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0 h1:dIIDULZJpgdiHz5tXrTgKIMLkus6jEFa7x5SOKcyR7E= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0/go.mod h1:jlRVBe7+Z1wyxFSUs48L6OBQZ5JwH2Hg/Vbl+t9rAgI= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0 h1:nSiV3s7wiCam610XcLbYOmMfJxB9gO4uK3Xgv5gmTgg= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0/go.mod h1:hKn/e/Nmd19/x1gvIHwtOwVWM+VhuITSWip3JUDghj0= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0 h1:JAv0Jwtl01UFiyWZEMiJZBiTlv5A50zNs8lsthXqIio= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0/go.mod h1:QNKLmUEAq2QUbPQUfvw4fmv0bgbK7UlOSFCnXyfvSNc= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0 h1:G7uexXb/K3T+T9fNLCCKncweEtNEBMTO+46hKX5EdKw= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0/go.mod h1:v0mFe5Kk7woIh938mrZBJBmENYquyA0IICrlYm4Y0t4= -go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.5.0 h1:ThVXnEsdwNcxdBO+r96ci1xbF+PgNjwlk457VNuJODo= -go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.5.0/go.mod h1:rHWcSmC4q2h3gje/yOq6sAOaq8+UHxN/Ru3BbmDXOfY= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0 h1:WDdP9acbMYjbKIyJUhTvtzj601sVJOqgWdUxSdR/Ysc= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0/go.mod h1:BLbf7zbNIONBLPwvFnwNHGj4zge8uTCM/UPIVW1Mq2I= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.29.0 h1:X3ZjNp36/WlkSYx0ul2jw4PtbNEDDeLskw3VPsrpYM0= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.29.0/go.mod h1:2uL/xnOXh0CHOBFCWXz5u1A4GXLiW+0IQIzVbeOEQ0U= -go.opentelemetry.io/otel/log v0.5.0 h1:x1Pr6Y3gnXgl1iFBwtGy1W/mnzENoK0w0ZoaeOI3i30= -go.opentelemetry.io/otel/log v0.5.0/go.mod h1:NU/ozXeGuOR5/mjCRXYbTC00NFJ3NYuraV/7O78F0rE= -go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= -go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= -go.opentelemetry.io/otel/sdk v1.29.0 h1:vkqKjk7gwhS8VaWb0POZKmIEDimRCMsopNYnriHyryo= -go.opentelemetry.io/otel/sdk v1.29.0/go.mod h1:pM8Dx5WKnvxLCb+8lG1PRNIDxu9g9b9g59Qr7hfAAok= -go.opentelemetry.io/otel/sdk/log v0.5.0 h1:A+9lSjlZGxkQOr7QSBJcuyyYBw79CufQ69saiJLey7o= -go.opentelemetry.io/otel/sdk/log v0.5.0/go.mod h1:zjxIW7sw1IHolZL2KlSAtrUi8JHttoeiQy43Yl3WuVQ= -go.opentelemetry.io/otel/sdk/metric v1.29.0 h1:K2CfmJohnRgvZ9UAj2/FhIf/okdWcNdBwe1m8xFXiSY= -go.opentelemetry.io/otel/sdk/metric v1.29.0/go.mod h1:6zZLdCl2fkauYoZIOn/soQIDSWFmNSRcICarHfuhNJQ= -go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= -go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= -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.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= +go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= +go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= +go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= +go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= +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.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= @@ -141,8 +113,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.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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= @@ -155,12 +127,10 @@ 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/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd h1:BBOTEWLuuEGQy9n1y9MhVJ9Qt0BDu21X8qZs71/uPZo= -google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:fO8wJzT2zbQbAjbIoos1285VfEIYKDDY+Dt+WpTkh6g= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd h1:6TEm2ZxXoQmFWFlt1vNxvVOa1Q0dXFQD1m/rYjXmS0E= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= 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= diff --git a/exporter/otlpexporter/otlp_test.go b/exporter/otlpexporter/otlp_test.go index 02d81fa2926..352720555a7 100644 --- a/exporter/otlpexporter/otlp_test.go +++ b/exporter/otlpexporter/otlp_test.go @@ -299,8 +299,8 @@ func TestSendTraces(t *testing.T) { assert.EqualValues(t, td, rcv.getLastRequest()) md := rcv.getMetadata() - require.EqualValues(t, md.Get("header"), expectedHeader) - require.Equal(t, len(md.Get("User-Agent")), 1) + require.EqualValues(t, expectedHeader, md.Get("header")) + require.Len(t, md.Get("User-Agent"), 1) require.Contains(t, md.Get("User-Agent")[0], "Collector/1.2.3test") // Return partial success @@ -471,8 +471,8 @@ func TestSendMetrics(t *testing.T) { assert.EqualValues(t, md, rcv.getLastRequest()) mdata := rcv.getMetadata() - require.EqualValues(t, mdata.Get("header"), expectedHeader) - require.Equal(t, len(mdata.Get("User-Agent")), 1) + require.EqualValues(t, expectedHeader, mdata.Get("header")) + require.Len(t, mdata.Get("User-Agent"), 1) require.Contains(t, mdata.Get("User-Agent")[0], "Collector/1.2.3test") st := status.New(codes.InvalidArgument, "Invalid argument") @@ -763,7 +763,7 @@ func TestSendLogData(t *testing.T) { assert.EqualValues(t, ld, rcv.getLastRequest()) md := rcv.getMetadata() - require.Equal(t, len(md.Get("User-Agent")), 1) + require.Len(t, md.Get("User-Agent"), 1) require.Contains(t, md.Get("User-Agent")[0], "Collector/1.2.3test") st := status.New(codes.InvalidArgument, "Invalid argument") diff --git a/exporter/otlphttpexporter/config.go b/exporter/otlphttpexporter/config.go index ef59fc324a0..f3a70fa2337 100644 --- a/exporter/otlphttpexporter/config.go +++ b/exporter/otlphttpexporter/config.go @@ -45,9 +45,9 @@ func (e *EncodingType) UnmarshalText(text []byte) error { // Config defines configuration for OTLP/HTTP exporter. type Config struct { - confighttp.ClientConfig `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct. - QueueConfig exporterhelper.QueueSettings `mapstructure:"sending_queue"` - RetryConfig configretry.BackOffConfig `mapstructure:"retry_on_failure"` + confighttp.ClientConfig `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct. + exporterhelper.QueueConfig `mapstructure:"sending_queue"` + RetryConfig configretry.BackOffConfig `mapstructure:"retry_on_failure"` // The URL to send traces to. If omitted the Endpoint + "/v1/traces" will be used. TracesEndpoint string `mapstructure:"traces_endpoint"` diff --git a/exporter/otlphttpexporter/config_test.go b/exporter/otlphttpexporter/config_test.go index 9a9e261308f..257f7e25389 100644 --- a/exporter/otlphttpexporter/config_test.go +++ b/exporter/otlphttpexporter/config_test.go @@ -46,7 +46,7 @@ func TestUnmarshalConfig(t *testing.T) { MaxInterval: 1 * time.Minute, MaxElapsedTime: 10 * time.Minute, }, - QueueConfig: exporterhelper.QueueSettings{ + QueueConfig: exporterhelper.QueueConfig{ Enabled: true, NumConsumers: 2, QueueSize: 10, diff --git a/exporter/otlphttpexporter/factory.go b/exporter/otlphttpexporter/factory.go index 96f7ed3c989..c29940eaee7 100644 --- a/exporter/otlphttpexporter/factory.go +++ b/exporter/otlphttpexporter/factory.go @@ -35,7 +35,7 @@ func NewFactory() exporter.Factory { func createDefaultConfig() component.Config { return &Config{ RetryConfig: configretry.NewDefaultBackOffConfig(), - QueueConfig: exporterhelper.NewDefaultQueueSettings(), + QueueConfig: exporterhelper.NewDefaultQueueConfig(), Encoding: EncodingProto, ClientConfig: confighttp.ClientConfig{ Endpoint: "", @@ -88,7 +88,7 @@ func createTracesExporter( exporterhelper.WithStart(oce.start), exporterhelper.WithCapabilities(consumer.Capabilities{MutatesData: false}), // explicitly disable since we rely on http.Client timeout logic. - exporterhelper.WithTimeout(exporterhelper.TimeoutSettings{Timeout: 0}), + exporterhelper.WithTimeout(exporterhelper.TimeoutConfig{Timeout: 0}), exporterhelper.WithRetry(oCfg.RetryConfig), exporterhelper.WithQueue(oCfg.QueueConfig)) } @@ -114,7 +114,7 @@ func createMetricsExporter( exporterhelper.WithStart(oce.start), exporterhelper.WithCapabilities(consumer.Capabilities{MutatesData: false}), // explicitly disable since we rely on http.Client timeout logic. - exporterhelper.WithTimeout(exporterhelper.TimeoutSettings{Timeout: 0}), + exporterhelper.WithTimeout(exporterhelper.TimeoutConfig{Timeout: 0}), exporterhelper.WithRetry(oCfg.RetryConfig), exporterhelper.WithQueue(oCfg.QueueConfig)) } @@ -140,7 +140,7 @@ func createLogsExporter( exporterhelper.WithStart(oce.start), exporterhelper.WithCapabilities(consumer.Capabilities{MutatesData: false}), // explicitly disable since we rely on http.Client timeout logic. - exporterhelper.WithTimeout(exporterhelper.TimeoutSettings{Timeout: 0}), + exporterhelper.WithTimeout(exporterhelper.TimeoutConfig{Timeout: 0}), exporterhelper.WithRetry(oCfg.RetryConfig), exporterhelper.WithQueue(oCfg.QueueConfig)) } diff --git a/exporter/otlphttpexporter/factory_test.go b/exporter/otlphttpexporter/factory_test.go index 5bd5c0bf8c5..8964aeaf4b6 100644 --- a/exporter/otlphttpexporter/factory_test.go +++ b/exporter/otlphttpexporter/factory_test.go @@ -28,15 +28,15 @@ func TestCreateDefaultConfig(t *testing.T) { assert.NoError(t, componenttest.CheckConfigStruct(cfg)) ocfg, ok := factory.CreateDefaultConfig().(*Config) assert.True(t, ok) - assert.Equal(t, ocfg.ClientConfig.Endpoint, "") - assert.Equal(t, ocfg.ClientConfig.Timeout, 30*time.Second, "default timeout is 30 second") + assert.Equal(t, "", ocfg.ClientConfig.Endpoint) + assert.Equal(t, 30*time.Second, ocfg.ClientConfig.Timeout, "default timeout is 30 second") assert.True(t, ocfg.RetryConfig.Enabled, "default retry is enabled") - assert.Equal(t, ocfg.RetryConfig.MaxElapsedTime, 300*time.Second, "default retry MaxElapsedTime") - assert.Equal(t, ocfg.RetryConfig.InitialInterval, 5*time.Second, "default retry InitialInterval") - assert.Equal(t, ocfg.RetryConfig.MaxInterval, 30*time.Second, "default retry MaxInterval") + assert.Equal(t, 300*time.Second, ocfg.RetryConfig.MaxElapsedTime, "default retry MaxElapsedTime") + assert.Equal(t, 5*time.Second, ocfg.RetryConfig.InitialInterval, "default retry InitialInterval") + assert.Equal(t, 30*time.Second, ocfg.RetryConfig.MaxInterval, "default retry MaxInterval") assert.True(t, ocfg.QueueConfig.Enabled, "default sending queue is enabled") - assert.Equal(t, ocfg.Encoding, EncodingProto) - assert.Equal(t, ocfg.Compression, configcompression.TypeGzip) + assert.Equal(t, EncodingProto, ocfg.Encoding) + assert.Equal(t, configcompression.TypeGzip, ocfg.Compression) } func TestCreateMetricsExporter(t *testing.T) { @@ -46,7 +46,7 @@ func TestCreateMetricsExporter(t *testing.T) { set := exportertest.NewNopSettings() oexp, err := factory.CreateMetricsExporter(context.Background(), set, cfg) - require.Nil(t, err) + require.NoError(t, err) require.NotNil(t, oexp) } @@ -192,7 +192,7 @@ func TestCreateTracesExporter(t *testing.T) { if err != nil { // Since the endpoint of OTLP exporter doesn't actually exist, // exporter may already stop because it cannot connect. - assert.Equal(t, err.Error(), "rpc error: code = Canceled desc = grpc: the client connection is closing") + assert.Equal(t, "rpc error: code = Canceled desc = grpc: the client connection is closing", err.Error()) } }) } @@ -205,7 +205,7 @@ func TestCreateLogsExporter(t *testing.T) { set := exportertest.NewNopSettings() oexp, err := factory.CreateLogsExporter(context.Background(), set, cfg) - require.Nil(t, err) + require.NoError(t, err) require.NotNil(t, oexp) } diff --git a/exporter/otlphttpexporter/go.mod b/exporter/otlphttpexporter/go.mod index 79d1c8db902..fd09a924fcb 100644 --- a/exporter/otlphttpexporter/go.mod +++ b/exporter/otlphttpexporter/go.mod @@ -4,21 +4,21 @@ go 1.22.0 require ( github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector v0.108.1 - go.opentelemetry.io/collector/component v0.108.1 - go.opentelemetry.io/collector/config/configcompression v1.14.1 - go.opentelemetry.io/collector/config/confighttp v0.108.1 - go.opentelemetry.io/collector/config/configopaque v1.14.1 - go.opentelemetry.io/collector/config/configretry v1.14.1 - go.opentelemetry.io/collector/config/configtls v1.14.1 - go.opentelemetry.io/collector/confmap v1.14.1 - go.opentelemetry.io/collector/consumer v0.108.1 - go.opentelemetry.io/collector/exporter v0.108.1 - go.opentelemetry.io/collector/pdata v1.14.1 + go.opentelemetry.io/collector v0.109.0 + go.opentelemetry.io/collector/component v0.109.0 + go.opentelemetry.io/collector/config/configcompression v1.15.0 + go.opentelemetry.io/collector/config/confighttp v0.109.0 + go.opentelemetry.io/collector/config/configopaque v1.15.0 + go.opentelemetry.io/collector/config/configretry v1.15.0 + go.opentelemetry.io/collector/config/configtls v1.15.0 + go.opentelemetry.io/collector/confmap v1.15.0 + go.opentelemetry.io/collector/consumer v0.109.0 + go.opentelemetry.io/collector/exporter v0.109.0 + go.opentelemetry.io/collector/pdata v1.15.0 go.uber.org/goleak v1.3.0 go.uber.org/zap v1.27.0 google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd - google.golang.org/grpc v1.65.0 + google.golang.org/grpc v1.66.0 google.golang.org/protobuf v1.34.2 ) @@ -35,7 +35,6 @@ require ( 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.9 // indirect @@ -48,50 +47,37 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.20.2 // indirect + github.com/prometheus/client_golang v1.20.3 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.56.0 // indirect + github.com/prometheus/common v0.59.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect - github.com/rs/cors v1.11.0 // indirect - go.opentelemetry.io/collector/client v1.14.1 // indirect - go.opentelemetry.io/collector/config/configauth v0.108.1 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.108.1 // indirect - go.opentelemetry.io/collector/config/internal v0.108.1 // indirect - go.opentelemetry.io/collector/consumer/consumerprofiles v0.108.1 // indirect - go.opentelemetry.io/collector/consumer/consumertest v0.108.1 // indirect - go.opentelemetry.io/collector/exporter/exporterprofiles v0.108.1 // indirect - go.opentelemetry.io/collector/extension v0.108.1 // indirect - go.opentelemetry.io/collector/extension/auth v0.108.1 // indirect - go.opentelemetry.io/collector/extension/experimental/storage v0.0.0-20240902085631-cd1f7623fe67 // indirect - go.opentelemetry.io/collector/featuregate v1.14.1 // indirect - go.opentelemetry.io/collector/pdata/pprofile v0.108.1 // indirect - go.opentelemetry.io/collector/receiver v0.108.1 // indirect - go.opentelemetry.io/collector/receiver/receiverprofiles v0.108.1 // indirect - go.opentelemetry.io/contrib/config v0.9.0 // indirect + github.com/rs/cors v1.11.1 // indirect + go.opentelemetry.io/collector/client v1.15.0 // indirect + go.opentelemetry.io/collector/config/configauth v0.109.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.109.0 // indirect + go.opentelemetry.io/collector/config/internal v0.109.0 // indirect + go.opentelemetry.io/collector/consumer/consumerprofiles v0.109.0 // indirect + go.opentelemetry.io/collector/consumer/consumertest v0.109.0 // indirect + go.opentelemetry.io/collector/exporter/exporterprofiles v0.109.0 // indirect + go.opentelemetry.io/collector/extension v0.109.0 // indirect + go.opentelemetry.io/collector/extension/auth v0.109.0 // indirect + go.opentelemetry.io/collector/extension/experimental/storage v0.109.0 // indirect + go.opentelemetry.io/collector/featuregate v1.15.0 // indirect + go.opentelemetry.io/collector/internal/globalgates v0.109.0 // indirect + go.opentelemetry.io/collector/pdata/pprofile v0.109.0 // indirect + go.opentelemetry.io/collector/receiver v0.109.0 // indirect + go.opentelemetry.io/collector/receiver/receiverprofiles v0.109.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect - go.opentelemetry.io/otel v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.5.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.51.0 // indirect - go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.5.0 // indirect - go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.29.0 // indirect - go.opentelemetry.io/otel/log v0.5.0 // indirect - go.opentelemetry.io/otel/metric v1.29.0 // indirect - go.opentelemetry.io/otel/sdk v1.29.0 // indirect - go.opentelemetry.io/otel/sdk/log v0.5.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.29.0 // indirect - go.opentelemetry.io/otel/trace v1.29.0 // indirect - go.opentelemetry.io/proto/otlp v1.3.1 // indirect + go.opentelemetry.io/otel v1.30.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect + go.opentelemetry.io/otel/metric v1.30.0 // indirect + go.opentelemetry.io/otel/sdk v1.30.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect + go.opentelemetry.io/otel/trace v1.30.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.24.0 // indirect - golang.org/x/text v0.17.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd // indirect + golang.org/x/net v0.29.0 // indirect + golang.org/x/sys v0.25.0 // indirect + golang.org/x/text v0.18.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) @@ -153,3 +139,5 @@ replace go.opentelemetry.io/collector/component/componentstatus => ../../compone replace go.opentelemetry.io/collector/receiver/receiverprofiles => ../../receiver/receiverprofiles replace go.opentelemetry.io/collector/exporter/exporterprofiles => ../exporterprofiles + +replace go.opentelemetry.io/collector/internal/globalgates => ../../internal/globalgates diff --git a/exporter/otlphttpexporter/go.sum b/exporter/otlphttpexporter/go.sum index 5cb4efcf3da..f06be19ff12 100644 --- a/exporter/otlphttpexporter/go.sum +++ b/exporter/otlphttpexporter/go.sum @@ -27,8 +27,6 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 h1:asbCHRVmodnJTuQ3qamDwqVOIjwqUPTYmYuemVOx+Ys= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0/go.mod h1:ggCgvZ2r7uOoQjOyu2Y1NhHmEPPzzuhWgcza5M1Ji1I= 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/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= @@ -62,64 +60,38 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg= -github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= +github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.56.0 h1:UffReloqkBtvtQEYDg2s+uDPGRrJyC6vZWPGXf6OhPY= -github.com/prometheus/common v0.56.0/go.mod h1:7uRPFSUTbfZWsJ7MHY56sqt7hLQu3bxXHDnNhl8E9qI= +github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= +github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= -github.com/rs/cors v1.11.0 h1:0B9GE/r9Bc2UxRMMtymBkHTenPkHDv0CW4Y98GBY+po= -github.com/rs/cors v1.11.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= +github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 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= 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/contrib/config v0.9.0 h1:AJ1c6+vJ6SxvqBBhsi2RhLFMlc6SnJOg81Jp4toFyNw= -go.opentelemetry.io/contrib/config v0.9.0/go.mod h1:u/u2L6y/c8GKrq/AP51sfXV4Eu24btVlC3A5f867xwg= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 h1:TT4fX+nBOA/+LUkobKGW1ydGcn+G3vRw9+g5HwCphpk= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0/go.mod h1:L7UH0GbB0p47T4Rri3uHjbpCFYrVrwc1I25QhNPiGK8= -go.opentelemetry.io/otel v1.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= -go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= -go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.5.0 h1:4d++HQ+Ihdl+53zSjtsCUFDmNMju2FC9qFkUlTxPLqo= -go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.5.0/go.mod h1:mQX5dTO3Mh5ZF7bPKDkt5c/7C41u/SiDr9XgTpzXXn8= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.29.0 h1:k6fQVDQexDE+3jG2SfCQjnHS7OamcP73YMoxEVq5B6k= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.29.0/go.mod h1:t4BrYLHU450Zo9fnydWlIuswB1bm7rM8havDpWOJeDo= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.29.0 h1:xvhQxJ/C9+RTnAj5DpTg7LSM1vbbMTiXt7e9hsfqHNw= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.29.0/go.mod h1:Fcvs2Bz1jkDM+Wf5/ozBGmi3tQ/c9zPKLnsipnfhGAo= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0 h1:dIIDULZJpgdiHz5tXrTgKIMLkus6jEFa7x5SOKcyR7E= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0/go.mod h1:jlRVBe7+Z1wyxFSUs48L6OBQZ5JwH2Hg/Vbl+t9rAgI= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0 h1:nSiV3s7wiCam610XcLbYOmMfJxB9gO4uK3Xgv5gmTgg= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0/go.mod h1:hKn/e/Nmd19/x1gvIHwtOwVWM+VhuITSWip3JUDghj0= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0 h1:JAv0Jwtl01UFiyWZEMiJZBiTlv5A50zNs8lsthXqIio= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0/go.mod h1:QNKLmUEAq2QUbPQUfvw4fmv0bgbK7UlOSFCnXyfvSNc= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0 h1:G7uexXb/K3T+T9fNLCCKncweEtNEBMTO+46hKX5EdKw= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0/go.mod h1:v0mFe5Kk7woIh938mrZBJBmENYquyA0IICrlYm4Y0t4= -go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.5.0 h1:ThVXnEsdwNcxdBO+r96ci1xbF+PgNjwlk457VNuJODo= -go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.5.0/go.mod h1:rHWcSmC4q2h3gje/yOq6sAOaq8+UHxN/Ru3BbmDXOfY= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0 h1:WDdP9acbMYjbKIyJUhTvtzj601sVJOqgWdUxSdR/Ysc= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0/go.mod h1:BLbf7zbNIONBLPwvFnwNHGj4zge8uTCM/UPIVW1Mq2I= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.29.0 h1:X3ZjNp36/WlkSYx0ul2jw4PtbNEDDeLskw3VPsrpYM0= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.29.0/go.mod h1:2uL/xnOXh0CHOBFCWXz5u1A4GXLiW+0IQIzVbeOEQ0U= -go.opentelemetry.io/otel/log v0.5.0 h1:x1Pr6Y3gnXgl1iFBwtGy1W/mnzENoK0w0ZoaeOI3i30= -go.opentelemetry.io/otel/log v0.5.0/go.mod h1:NU/ozXeGuOR5/mjCRXYbTC00NFJ3NYuraV/7O78F0rE= -go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= -go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= -go.opentelemetry.io/otel/sdk v1.29.0 h1:vkqKjk7gwhS8VaWb0POZKmIEDimRCMsopNYnriHyryo= -go.opentelemetry.io/otel/sdk v1.29.0/go.mod h1:pM8Dx5WKnvxLCb+8lG1PRNIDxu9g9b9g59Qr7hfAAok= -go.opentelemetry.io/otel/sdk/log v0.5.0 h1:A+9lSjlZGxkQOr7QSBJcuyyYBw79CufQ69saiJLey7o= -go.opentelemetry.io/otel/sdk/log v0.5.0/go.mod h1:zjxIW7sw1IHolZL2KlSAtrUi8JHttoeiQy43Yl3WuVQ= -go.opentelemetry.io/otel/sdk/metric v1.29.0 h1:K2CfmJohnRgvZ9UAj2/FhIf/okdWcNdBwe1m8xFXiSY= -go.opentelemetry.io/otel/sdk/metric v1.29.0/go.mod h1:6zZLdCl2fkauYoZIOn/soQIDSWFmNSRcICarHfuhNJQ= -go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= -go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= -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.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= +go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= +go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= +go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= +go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= +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.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= @@ -135,20 +107,20 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= -golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= +golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= +golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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= -golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -157,12 +129,10 @@ 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/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd h1:BBOTEWLuuEGQy9n1y9MhVJ9Qt0BDu21X8qZs71/uPZo= -google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:fO8wJzT2zbQbAjbIoos1285VfEIYKDDY+Dt+WpTkh6g= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd h1:6TEm2ZxXoQmFWFlt1vNxvVOa1Q0dXFQD1m/rYjXmS0E= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= 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= diff --git a/exporter/otlphttpexporter/otlp_test.go b/exporter/otlphttpexporter/otlp_test.go index f2fda5fa822..935d7f115ec 100644 --- a/exporter/otlphttpexporter/otlp_test.go +++ b/exporter/otlphttpexporter/otlp_test.go @@ -215,7 +215,7 @@ func TestErrorResponses(t *testing.T) { cfg := &Config{ Encoding: EncodingProto, TracesEndpoint: fmt.Sprintf("%s/v1/traces", srv.URL), - // Create without QueueSettings and RetryConfig so that ConsumeTraces + // Create without QueueConfig and RetryConfig so that ConsumeTraces // returns the errors that we want to check immediately. } exp, err := createTracesExporter(context.Background(), exportertest.NewNopSettings(), cfg) @@ -607,7 +607,7 @@ func TestPartialResponse_missingHeaderAndBody(t *testing.T) { }, } err = handlePartialSuccessResponse(resp, tt.handler) - assert.Nil(t, err) + assert.NoError(t, err) }) } } diff --git a/extension/auth/go.mod b/extension/auth/go.mod index a96e00fad59..cb0cecd9e82 100644 --- a/extension/auth/go.mod +++ b/extension/auth/go.mod @@ -4,10 +4,10 @@ go 1.22.0 require ( github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector/component v0.108.1 - go.opentelemetry.io/collector/extension v0.108.1 + go.opentelemetry.io/collector/component v0.109.0 + go.opentelemetry.io/collector/extension v0.109.0 go.uber.org/goleak v1.3.0 - google.golang.org/grpc v1.65.0 + google.golang.org/grpc v1.66.0 ) require ( @@ -16,48 +16,37 @@ 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/gogo/protobuf v1.3.2 // indirect github.com/google/uuid v1.6.0 // indirect github.com/klauspost/compress v1.17.9 // indirect - github.com/knadh/koanf/maps v0.1.1 // indirect - github.com/knadh/koanf/providers/confmap v0.1.0 // indirect - github.com/knadh/koanf/v2 v2.1.1 // indirect - github.com/mitchellh/copystructure v1.2.0 // indirect - github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.20.2 // indirect + github.com/prometheus/client_golang v1.20.3 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.56.0 // indirect + github.com/prometheus/common v0.59.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.108.1 // indirect - go.opentelemetry.io/collector/confmap v1.14.1 // indirect - go.opentelemetry.io/collector/pdata v1.14.1 // indirect - go.opentelemetry.io/otel v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.51.0 // indirect - go.opentelemetry.io/otel/metric v1.29.0 // indirect - go.opentelemetry.io/otel/sdk v1.29.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.29.0 // indirect - go.opentelemetry.io/otel/trace v1.29.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.109.0 // indirect + go.opentelemetry.io/collector/pdata v1.15.0 // indirect + go.opentelemetry.io/otel v1.30.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect + go.opentelemetry.io/otel/metric v1.30.0 // indirect + go.opentelemetry.io/otel/sdk v1.30.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect + go.opentelemetry.io/otel/trace v1.30.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/net v0.27.0 // indirect - golang.org/x/sys v0.24.0 // indirect - golang.org/x/text v0.16.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect + golang.org/x/net v0.28.0 // indirect + golang.org/x/sys v0.25.0 // indirect + golang.org/x/text v0.17.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) replace go.opentelemetry.io/collector/component => ../../component -replace go.opentelemetry.io/collector/confmap => ../../confmap - replace go.opentelemetry.io/collector/extension => ../ replace go.opentelemetry.io/collector/pdata => ../../pdata replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/configtelemetry - -replace go.opentelemetry.io/collector/component/componentstatus => ../../component/componentstatus diff --git a/extension/auth/go.sum b/extension/auth/go.sum index 24c5eeacb98..dc25c056423 100644 --- a/extension/auth/go.sum +++ b/extension/auth/go.sum @@ -9,8 +9,6 @@ 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/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= @@ -21,32 +19,22 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= -github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= -github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= -github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= -github.com/knadh/koanf/providers/confmap v0.1.0/go.mod h1:2uLhxQzJnyHKfxG927awZC7+fyHFdQkd697K4MdLnIU= -github.com/knadh/koanf/v2 v2.1.1 h1:/R8eXqasSTsmDCsAyYj+81Wteg8AqrV9CP6gvsTsOmM= -github.com/knadh/koanf/v2 v2.1.1/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= -github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= -github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= -github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg= -github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= +github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.56.0 h1:UffReloqkBtvtQEYDg2s+uDPGRrJyC6vZWPGXf6OhPY= -github.com/prometheus/common v0.56.0/go.mod h1:7uRPFSUTbfZWsJ7MHY56sqt7hLQu3bxXHDnNhl8E9qI= +github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= +github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= @@ -55,18 +43,18 @@ 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.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= -go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0 h1:G7uexXb/K3T+T9fNLCCKncweEtNEBMTO+46hKX5EdKw= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0/go.mod h1:v0mFe5Kk7woIh938mrZBJBmENYquyA0IICrlYm4Y0t4= -go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= -go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= -go.opentelemetry.io/otel/sdk v1.29.0 h1:vkqKjk7gwhS8VaWb0POZKmIEDimRCMsopNYnriHyryo= -go.opentelemetry.io/otel/sdk v1.29.0/go.mod h1:pM8Dx5WKnvxLCb+8lG1PRNIDxu9g9b9g59Qr7hfAAok= -go.opentelemetry.io/otel/sdk/metric v1.29.0 h1:K2CfmJohnRgvZ9UAj2/FhIf/okdWcNdBwe1m8xFXiSY= -go.opentelemetry.io/otel/sdk/metric v1.29.0/go.mod h1:6zZLdCl2fkauYoZIOn/soQIDSWFmNSRcICarHfuhNJQ= -go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= -go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= +go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= +go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= +go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= +go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= +go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= +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.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= @@ -82,20 +70,20 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= -golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -104,10 +92,10 @@ 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/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 h1:Zy9XzmMEflZ/MAaA7vNcoebnRAld7FsPW1EeBB7V0m8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 h1:1GBuWVLM/KMVUv1t1En5Gs+gFZCNd360GGb4sSxtrhU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= 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= diff --git a/extension/ballastextension/README.md b/extension/ballastextension/README.md deleted file mode 100644 index 3115ca39de8..00000000000 --- a/extension/ballastextension/README.md +++ /dev/null @@ -1,63 +0,0 @@ -> [!WARNING] -> The memory ballast extension is deprecated in favor of using the `GOMEMLIMIT` environment variable. -> This environment variable is available on any Collector built with Go 1.19 or higher. Official binary releases are built with Go 1.19 since v0.61.0. See [issue 8343](https://github.com/open-telemetry/opentelemetry-collector/issues/8343) for the deprecation timeline. -> -> To migrate to `GOMEMLIMIT`, set its value to 80% of the hard memory limit of your Collector. -> For example, if the Collector hard memory limit is 1GiB, set `GOMEMLIMIT` to `800MiB`. -> Check [the Go documentation](https://pkg.go.dev/runtime#hdr-Environment_Variables) for more information about `GOMEMLIMIT`'s syntax. - -# Memory Ballast - - -| Status | | -| ------------- |-----------| -| Stability | [deprecated] | -| Distributions | [core], [contrib] | -| Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector?query=is%3Aissue%20is%3Aopen%20label%3Aextension%2Fballast%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector/issues?q=is%3Aopen+is%3Aissue+label%3Aextension%2Fballast) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector?query=is%3Aissue%20is%3Aclosed%20label%3Aextension%2Fballast%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector/issues?q=is%3Aclosed+is%3Aissue+label%3Aextension%2Fballast) | - -[deprecated]: https://github.com/open-telemetry/opentelemetry-collector#deprecated -[core]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol -[contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib - - -Memory Ballast extension enables applications to configure memory ballast for the process. For more details see: -- [Go memory ballast blogpost](https://web.archive.org/web/20210929130001/https://blog.twitch.tv/en/2019/04/10/go-memory-ballast-how-i-learnt-to-stop-worrying-and-love-the-heap-26c2462549a2/) -- [Golang issue related to this](https://github.com/golang/go/issues/23044) - -The following settings can be configured: - -- `size_mib` (default = 0, disabled): Is the memory ballast size, in MiB. - Takes higher priority than `size_in_percentage` if both are specified at the same time. -- `size_in_percentage` (default = 0, disabled): Set the memory ballast based on the - total memory in percentage, value range is `1-100`. - It is supported in both containerized(eg, docker, k8s) and physical host environments. - -**How ballast size is calculated with percentage configuration** -When `size_in_percentage` is enabled with the value(1-100), the absolute `ballast_size` will be calculated by -`size_in_percentage * totalMemory / 100`. The `totalMemory` can be retrieved for hosts and containers(in docker, k8s, etc) by the following steps, -1. Look up Memory Cgroup subsystem on the target host or container, find out if there is any total memory limitation has been set for the running collector process. - Check the value in `memory.limit_in_bytes` file under cgroup memory files (eg, `/sys/fs/cgroup/memory/memory.limit_in_bytes`). - -2. If `memory.limit_in_bytes` is positive value other than `9223372036854771712`(`0x7FFFFFFFFFFFF000`). The `ballast_size` - will be calculated by `memory.limit_in_bytes * size_in_percentage / 100`. - If `memory.limit_in_bytes` value is `9223372036854771712`(`0x7FFFFFFFFFFFF000`), it indicates there is no memory limit has - been set for the collector process or the running container in cgroup. Then the `totalMemory` will be determined in next step. - -3. if there is no memory limit set in cgroup for the collector process or container where the collector is running. The total memory will be - calculated by `github.com/shirou/gopsutil/v3/mem`[[link]](https://github.com/shirou/gopsutil/) on `mem.VirtualMemory().total` which is supported in multiple OS systems. - - -Example: -Config that uses 64 Mib of memory for the ballast: -```yaml -extensions: - memory_ballast: - size_mib: 64 -``` - -Config that uses 20% of the total memory for the ballast: -```yaml -extensions: - memory_ballast: - size_in_percentage: 20 -``` diff --git a/extension/ballastextension/config.go b/extension/ballastextension/config.go deleted file mode 100644 index 6eb166b3dae..00000000000 --- a/extension/ballastextension/config.go +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package ballastextension // import "go.opentelemetry.io/collector/extension/ballastextension" - -import ( - "errors" -) - -// Config has the configuration for the ballast extension. -type Config struct { - // SizeMiB is the size, in MiB, of the memory ballast - // to be created for this process. - SizeMiB uint64 `mapstructure:"size_mib"` - - // SizeInPercentage is the maximum amount of memory ballast, in %, targeted to be - // allocated. The fixed memory settings SizeMiB has a higher precedence. - SizeInPercentage uint64 `mapstructure:"size_in_percentage"` -} - -// Validate checks if the extension configuration is valid -func (cfg *Config) Validate() error { - // no need to validate less than 0 case for uint64 - if cfg.SizeInPercentage > 100 { - return errors.New("size_in_percentage is not in range 0 to 100") - } - return nil -} diff --git a/extension/ballastextension/config_test.go b/extension/ballastextension/config_test.go deleted file mode 100644 index 25e3223fe45..00000000000 --- a/extension/ballastextension/config_test.go +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package ballastextension - -import ( - "path/filepath" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - "go.opentelemetry.io/collector/confmap" - "go.opentelemetry.io/collector/confmap/confmaptest" -) - -func TestUnmarshalDefaultConfig(t *testing.T) { - factory := NewFactory() - cfg := factory.CreateDefaultConfig() - assert.NoError(t, confmap.New().Unmarshal(&cfg)) - assert.Equal(t, factory.CreateDefaultConfig(), cfg) -} - -func TestUnmarshalConfig(t *testing.T) { - cm, err := confmaptest.LoadConf(filepath.Join("testdata", "config.yaml")) - require.NoError(t, err) - factory := NewFactory() - cfg := factory.CreateDefaultConfig() - assert.NoError(t, cm.Unmarshal(&cfg)) - assert.Equal(t, - &Config{ - SizeMiB: 123, - SizeInPercentage: 20, - }, cfg) -} - -func TestConfigValidate(t *testing.T) { - cfg := &Config{SizeInPercentage: 200} - err := cfg.Validate() - require.Error(t, err) - assert.Equal(t, "size_in_percentage is not in range 0 to 100", err.Error()) -} diff --git a/extension/ballastextension/factory.go b/extension/ballastextension/factory.go deleted file mode 100644 index 36d6004c902..00000000000 --- a/extension/ballastextension/factory.go +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -//go:generate mdatagen metadata.yaml - -package ballastextension // import "go.opentelemetry.io/collector/extension/ballastextension" - -import ( - "context" - - "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/extension" - "go.opentelemetry.io/collector/extension/ballastextension/internal/metadata" - "go.opentelemetry.io/collector/internal/iruntime" -) - -// memHandler returns the total memory of the target host/vm -var memHandler = iruntime.TotalMemory - -// NewFactory creates a factory for ballast extension. -func NewFactory() extension.Factory { - return extension.NewFactory(metadata.Type, createDefaultConfig, createExtension, metadata.ExtensionStability) -} - -func createDefaultConfig() component.Config { - return &Config{} -} - -func createExtension(_ context.Context, set extension.Settings, cfg component.Config) (extension.Extension, error) { - return newMemoryBallast(cfg.(*Config), set.TelemetrySettings.Logger, memHandler), nil -} diff --git a/extension/ballastextension/factory_test.go b/extension/ballastextension/factory_test.go deleted file mode 100644 index 0c9e91f8224..00000000000 --- a/extension/ballastextension/factory_test.go +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package ballastextension - -import ( - "context" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - "go.opentelemetry.io/collector/component/componenttest" - "go.opentelemetry.io/collector/extension/extensiontest" -) - -func TestFactory_CreateDefaultConfig(t *testing.T) { - cfg := createDefaultConfig() - assert.Equal(t, &Config{}, cfg) - - assert.NoError(t, componenttest.CheckConfigStruct(cfg)) - ext, err := createExtension(context.Background(), extensiontest.NewNopSettings(), cfg) - require.NoError(t, err) - require.NotNil(t, ext) -} - -func TestFactory_CreateExtension(t *testing.T) { - cfg := createDefaultConfig().(*Config) - ext, err := createExtension(context.Background(), extensiontest.NewNopSettings(), cfg) - require.NoError(t, err) - require.NotNil(t, ext) -} diff --git a/extension/ballastextension/generated_component_test.go b/extension/ballastextension/generated_component_test.go deleted file mode 100644 index d70b7d0498d..00000000000 --- a/extension/ballastextension/generated_component_test.go +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by mdatagen. DO NOT EDIT. - -package ballastextension - -import ( - "context" - "testing" - - "github.com/stretchr/testify/require" - - "go.opentelemetry.io/collector/component/componenttest" - "go.opentelemetry.io/collector/confmap/confmaptest" - "go.opentelemetry.io/collector/extension/extensiontest" -) - -func TestComponentFactoryType(t *testing.T) { - require.Equal(t, "memory_ballast", NewFactory().Type().String()) -} - -func TestComponentConfigStruct(t *testing.T) { - require.NoError(t, componenttest.CheckConfigStruct(NewFactory().CreateDefaultConfig())) -} - -func TestComponentLifecycle(t *testing.T) { - factory := NewFactory() - - cm, err := confmaptest.LoadConf("metadata.yaml") - require.NoError(t, err) - cfg := factory.CreateDefaultConfig() - sub, err := cm.Sub("tests::config") - 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) - 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) - 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) - require.NoError(t, err) - require.NoError(t, secondExt.Start(context.Background(), componenttest.NewNopHost())) - require.NoError(t, secondExt.Shutdown(context.Background())) - }) -} diff --git a/extension/ballastextension/generated_package_test.go b/extension/ballastextension/generated_package_test.go deleted file mode 100644 index 3f80a3e2754..00000000000 --- a/extension/ballastextension/generated_package_test.go +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by mdatagen. DO NOT EDIT. - -package ballastextension - -import ( - "testing" - - "go.uber.org/goleak" -) - -func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) -} diff --git a/extension/ballastextension/go.mod b/extension/ballastextension/go.mod deleted file mode 100644 index dc6f6ed0b03..00000000000 --- a/extension/ballastextension/go.mod +++ /dev/null @@ -1,92 +0,0 @@ -// Deprecated: Use the GOMEMLIMIT environment variable instead. -module go.opentelemetry.io/collector/extension/ballastextension - -go 1.22.0 - -require ( - github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector v0.108.1 - go.opentelemetry.io/collector/component v0.108.1 - go.opentelemetry.io/collector/confmap v1.14.1 - go.opentelemetry.io/collector/extension v0.108.1 - go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.27.0 -) - -require ( - github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/go-logr/logr v1.4.2 // indirect - github.com/go-logr/stdr v1.2.2 // indirect - github.com/go-ole/go-ole v1.2.6 // indirect - github.com/go-viper/mapstructure/v2 v2.1.0 // indirect - github.com/gogo/protobuf v1.3.2 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/klauspost/compress v1.17.9 // indirect - github.com/knadh/koanf/maps v0.1.1 // indirect - github.com/knadh/koanf/providers/confmap v0.1.0 // indirect - github.com/knadh/koanf/v2 v2.1.1 // indirect - github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect - github.com/mitchellh/copystructure v1.2.0 // indirect - github.com/mitchellh/reflectwalk v1.0.2 // indirect - github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect - github.com/prometheus/client_golang v1.20.2 // indirect - github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.56.0 // indirect - github.com/prometheus/procfs v0.15.1 // indirect - github.com/shirou/gopsutil/v4 v4.24.7 // indirect - github.com/tklauser/go-sysconf v0.3.12 // indirect - github.com/tklauser/numcpus v0.6.1 // indirect - github.com/yusufpapurcu/wmi v1.2.4 // indirect - go.opentelemetry.io/collector/component/componentstatus v0.108.1 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.108.1 // indirect - go.opentelemetry.io/collector/pdata v1.14.1 // indirect - go.opentelemetry.io/otel v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.51.0 // indirect - go.opentelemetry.io/otel/metric v1.29.0 // indirect - go.opentelemetry.io/otel/sdk v1.29.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.29.0 // indirect - go.opentelemetry.io/otel/trace v1.29.0 // indirect - go.uber.org/multierr v1.11.0 // indirect - golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.24.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.65.0 // indirect - google.golang.org/protobuf v1.34.2 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect -) - -replace go.opentelemetry.io/collector => ../../ - -replace go.opentelemetry.io/collector/component => ../../component - -replace go.opentelemetry.io/collector/confmap => ../../confmap - -replace go.opentelemetry.io/collector/extension => ../ - -replace go.opentelemetry.io/collector/featuregate => ../../featuregate - -replace go.opentelemetry.io/collector/pdata => ../../pdata - -replace go.opentelemetry.io/collector/consumer => ../../consumer - -retract ( - v0.76.0 // Depends on retracted pdata v1.0.0-rc10 module, use v0.76.1 - v0.69.0 // Release failed, use v0.69.1 -) - -replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/configtelemetry - -replace go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata - -replace go.opentelemetry.io/collector/pdata/pprofile => ../../pdata/pprofile - -replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../../consumer/consumerprofiles - -replace go.opentelemetry.io/collector/consumer/consumertest => ../../consumer/consumertest - -replace go.opentelemetry.io/collector/component/componentstatus => ../../component/componentstatus diff --git a/extension/ballastextension/internal/metadata/generated_status.go b/extension/ballastextension/internal/metadata/generated_status.go deleted file mode 100644 index 2acd5fd7570..00000000000 --- a/extension/ballastextension/internal/metadata/generated_status.go +++ /dev/null @@ -1,16 +0,0 @@ -// Code generated by mdatagen. DO NOT EDIT. - -package metadata - -import ( - "go.opentelemetry.io/collector/component" -) - -var ( - Type = component.MustNewType("memory_ballast") - ScopeName = "go.opentelemetry.io/collector/extension/ballastextension" -) - -const ( - ExtensionStability = component.StabilityLevelDeprecated -) diff --git a/extension/ballastextension/memory_ballast.go b/extension/ballastextension/memory_ballast.go deleted file mode 100644 index afbf6ec6d7d..00000000000 --- a/extension/ballastextension/memory_ballast.go +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package ballastextension // import "go.opentelemetry.io/collector/extension/ballastextension" - -import ( - "context" - - "go.uber.org/zap" - - "go.opentelemetry.io/collector/component" -) - -const megaBytes = 1024 * 1024 - -type memoryBallast struct { - cfg *Config - logger *zap.Logger - ballast []byte - ballastSizeBytes uint64 - getTotalMem func() (uint64, error) -} - -func (m *memoryBallast) Start(context.Context, component.Host) error { - // absolute value supersedes percentage setting - if m.cfg.SizeMiB > 0 { - m.ballastSizeBytes = m.cfg.SizeMiB * megaBytes - } else { - totalMemory, err := m.getTotalMem() - if err != nil { - return err - } - ballastPercentage := m.cfg.SizeInPercentage - m.ballastSizeBytes = ballastPercentage * totalMemory / 100 - } - - if m.ballastSizeBytes > 0 { - m.ballast = make([]byte, m.ballastSizeBytes) - } - - m.logger.Info("Setting memory ballast", zap.Uint32("MiBs", uint32(m.ballastSizeBytes/megaBytes))) - - return nil -} - -func (m *memoryBallast) Shutdown(context.Context) error { - m.ballast = nil - return nil -} - -func newMemoryBallast(cfg *Config, logger *zap.Logger, getTotalMem func() (uint64, error)) *memoryBallast { - return &memoryBallast{ - cfg: cfg, - logger: logger, - getTotalMem: getTotalMem, - } -} - -// GetBallastSize returns the current ballast memory setting in bytes -func (m *memoryBallast) GetBallastSize() uint64 { - return m.ballastSizeBytes -} diff --git a/extension/ballastextension/memory_ballast_test.go b/extension/ballastextension/memory_ballast_test.go deleted file mode 100644 index b7f39114caa..00000000000 --- a/extension/ballastextension/memory_ballast_test.go +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package ballastextension - -import ( - "context" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "go.uber.org/zap" - - "go.opentelemetry.io/collector/component/componenttest" - "go.opentelemetry.io/collector/internal/iruntime" -) - -func TestMemoryBallast(t *testing.T) { - tests := []struct { - name string - config *Config - getTotalMem func() (uint64, error) - expect int - }{ - { - name: "test_abs_ballast", - config: &Config{ - SizeMiB: 13, - }, - getTotalMem: iruntime.TotalMemory, - expect: 13 * megaBytes, - }, - { - name: "test_abs_ballast_priority", - config: &Config{ - SizeMiB: 13, - SizeInPercentage: 20, - }, - getTotalMem: iruntime.TotalMemory, - expect: 13 * megaBytes, - }, - { - name: "test_ballast_zero_val", - config: &Config{}, - getTotalMem: iruntime.TotalMemory, - expect: 0, - }, - { - name: "test_ballast_in_percentage", - config: &Config{ - SizeInPercentage: 20, - }, - getTotalMem: mockTotalMem, - expect: 20 * megaBytes, - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - mbExt := newMemoryBallast(tt.config, zap.NewNop(), tt.getTotalMem) - require.NotNil(t, mbExt) - assert.Nil(t, mbExt.ballast) - - assert.NoError(t, mbExt.Start(context.Background(), componenttest.NewNopHost())) - assert.Equal(t, tt.expect, len(mbExt.ballast)) - - assert.NoError(t, mbExt.Shutdown(context.Background())) - assert.Nil(t, mbExt.ballast) - }) - } -} - -func mockTotalMem() (uint64, error) { - return uint64(100 * megaBytes), nil -} diff --git a/extension/ballastextension/metadata.yaml b/extension/ballastextension/metadata.yaml deleted file mode 100644 index 548d4a4ed75..00000000000 --- a/extension/ballastextension/metadata.yaml +++ /dev/null @@ -1,8 +0,0 @@ -type: memory_ballast -github_project: open-telemetry/opentelemetry-collector - -status: - class: extension - stability: - deprecated: [extension] - distributions: [core, contrib] diff --git a/extension/ballastextension/testdata/config.yaml b/extension/ballastextension/testdata/config.yaml deleted file mode 100644 index 7d58cd6bcc4..00000000000 --- a/extension/ballastextension/testdata/config.yaml +++ /dev/null @@ -1,2 +0,0 @@ -size_mib: 123 -size_in_percentage: 20 diff --git a/extension/experimental/storage/go.mod b/extension/experimental/storage/go.mod index b9cfb002031..978f44dd97f 100644 --- a/extension/experimental/storage/go.mod +++ b/extension/experimental/storage/go.mod @@ -3,33 +3,25 @@ module go.opentelemetry.io/collector/extension/experimental/storage go 1.22.0 require ( - go.opentelemetry.io/collector/component v0.108.1 - go.opentelemetry.io/collector/extension v0.108.1 + go.opentelemetry.io/collector/component v0.109.0 + go.opentelemetry.io/collector/extension v0.109.0 ) require ( - github.com/go-viper/mapstructure/v2 v2.1.0 // 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 - github.com/knadh/koanf/v2 v2.1.1 // indirect - github.com/mitchellh/copystructure v1.2.0 // indirect - github.com/mitchellh/reflectwalk v1.0.2 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.108.1 // indirect - go.opentelemetry.io/collector/confmap v1.14.1 // indirect - go.opentelemetry.io/collector/pdata v1.14.1 // indirect - go.opentelemetry.io/otel v1.29.0 // indirect - go.opentelemetry.io/otel/metric v1.29.0 // indirect - go.opentelemetry.io/otel/trace v1.29.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.109.0 // indirect + go.opentelemetry.io/collector/pdata v1.15.0 // indirect + go.opentelemetry.io/otel v1.30.0 // indirect + go.opentelemetry.io/otel/metric v1.30.0 // indirect + go.opentelemetry.io/otel/trace v1.30.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/net v0.27.0 // indirect - golang.org/x/sys v0.24.0 // indirect - golang.org/x/text v0.16.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect - google.golang.org/grpc v1.65.0 // indirect + golang.org/x/net v0.28.0 // indirect + golang.org/x/sys v0.25.0 // indirect + golang.org/x/text v0.17.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect + google.golang.org/grpc v1.66.0 // indirect google.golang.org/protobuf v1.34.2 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect ) replace go.opentelemetry.io/collector/extension => ../../ @@ -38,8 +30,4 @@ replace go.opentelemetry.io/collector/component => ../../../component replace go.opentelemetry.io/collector/pdata => ../../../pdata -replace go.opentelemetry.io/collector/confmap => ../../../confmap - replace go.opentelemetry.io/collector/config/configtelemetry => ../../../config/configtelemetry - -replace go.opentelemetry.io/collector/component/componentstatus => ../../../component/componentstatus diff --git a/extension/experimental/storage/go.sum b/extension/experimental/storage/go.sum index 209a43a4c44..abf5443a0b6 100644 --- a/extension/experimental/storage/go.sum +++ b/extension/experimental/storage/go.sum @@ -4,42 +4,24 @@ 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/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= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= 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/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= -github.com/knadh/koanf/providers/confmap v0.1.0/go.mod h1:2uLhxQzJnyHKfxG927awZC7+fyHFdQkd697K4MdLnIU= -github.com/knadh/koanf/v2 v2.1.1 h1:/R8eXqasSTsmDCsAyYj+81Wteg8AqrV9CP6gvsTsOmM= -github.com/knadh/koanf/v2 v2.1.1/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es= -github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= -github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= -github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= -github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= -github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= 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.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= -go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= -go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= -go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= -go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= -go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= +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.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= @@ -55,20 +37,20 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= -golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -77,14 +59,11 @@ 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/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 h1:Zy9XzmMEflZ/MAaA7vNcoebnRAld7FsPW1EeBB7V0m8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 h1:1GBuWVLM/KMVUv1t1En5Gs+gFZCNd360GGb4sSxtrhU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= 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-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= 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/extension/extension.go b/extension/extension.go index 06bce2cd1d5..dd7b7a20bc5 100644 --- a/extension/extension.go +++ b/extension/extension.go @@ -8,7 +8,6 @@ import ( "fmt" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/confmap" ) // Extension is the interface for objects hosted by the OpenTelemetry Collector that @@ -16,41 +15,6 @@ import ( // to the service, examples: health check endpoint, z-pages, etc. type Extension = component.Component -// Dependent is an optional interface that can be implemented by extensions -// that depend on other extensions and must be started only after their dependencies. -// See https://github.com/open-telemetry/opentelemetry-collector/pull/8768 for examples. -type Dependent interface { - Extension - Dependencies() []component.ID -} - -// PipelineWatcher is an extra interface for Extension hosted by the OpenTelemetry -// Collector that is to be implemented by extensions interested in changes to pipeline -// states. Typically this will be used by extensions that change their behavior if data is -// being ingested or not, e.g.: a k8s readiness probe. -type PipelineWatcher interface { - // Ready notifies the Extension that all pipelines were built and the - // receivers were started, i.e.: the service is ready to receive data - // (note that it may already have received data when this method is called). - Ready() error - - // NotReady notifies the Extension that all receivers are about to be stopped, - // i.e.: pipeline receivers will not accept new data. - // This is sent before receivers are stopped, so the Extension can take any - // appropriate actions before that happens. - NotReady() error -} - -// ConfigWatcher is an interface that should be implemented by an extension that -// wishes to be notified of the Collector's effective configuration. -type ConfigWatcher interface { - // NotifyConfig notifies the extension of the Collector's current effective configuration. - // The extension owns the `confmap.Conf`. Callers must ensure that it's safe for - // extensions to store the `conf` pointer and use it concurrently with any other - // instances of `conf`. - NotifyConfig(ctx context.Context, conf *confmap.Conf) error -} - // ModuleInfo describes the go module for each component. type ModuleInfo struct { Receiver map[component.Type]string diff --git a/extension/ballastextension/Makefile b/extension/extensioncapabilities/Makefile similarity index 100% rename from extension/ballastextension/Makefile rename to extension/extensioncapabilities/Makefile diff --git a/extension/extensioncapabilities/go.mod b/extension/extensioncapabilities/go.mod new file mode 100644 index 00000000000..b4b257b6d20 --- /dev/null +++ b/extension/extensioncapabilities/go.mod @@ -0,0 +1,43 @@ +module go.opentelemetry.io/collector/extension/extensioncapabilities + +go 1.22.0 + +require ( + go.opentelemetry.io/collector/component v0.109.0 + go.opentelemetry.io/collector/confmap v1.15.0 + go.opentelemetry.io/collector/extension v0.109.0 +) + +require ( + github.com/go-viper/mapstructure/v2 v2.1.0 // 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 + github.com/knadh/koanf/v2 v2.1.1 // indirect + github.com/mitchellh/copystructure v1.2.0 // indirect + github.com/mitchellh/reflectwalk v1.0.2 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.109.0 // indirect + go.opentelemetry.io/collector/pdata v1.15.0 // indirect + go.opentelemetry.io/otel v1.30.0 // indirect + go.opentelemetry.io/otel/metric v1.30.0 // indirect + go.opentelemetry.io/otel/trace v1.30.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/text v0.17.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect + google.golang.org/grpc v1.66.0 // indirect + google.golang.org/protobuf v1.34.2 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) + +replace go.opentelemetry.io/collector/extension => ../ + +replace go.opentelemetry.io/collector/pdata => ../../pdata + +replace go.opentelemetry.io/collector/confmap => ../../confmap + +replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/configtelemetry + +replace go.opentelemetry.io/collector/component => ../../component diff --git a/extension/ballastextension/go.sum b/extension/extensioncapabilities/go.sum similarity index 57% rename from extension/ballastextension/go.sum rename to extension/extensioncapabilities/go.sum index 2e520f3ae04..f0cb2187256 100644 --- a/extension/ballastextension/go.sum +++ b/extension/extensioncapabilities/go.sum @@ -1,29 +1,17 @@ -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= 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-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/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= 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/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= -github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= @@ -34,54 +22,24 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= -github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw= -github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= -github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg= -github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= -github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= -github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.56.0 h1:UffReloqkBtvtQEYDg2s+uDPGRrJyC6vZWPGXf6OhPY= -github.com/prometheus/common v0.56.0/go.mod h1:7uRPFSUTbfZWsJ7MHY56sqt7hLQu3bxXHDnNhl8E9qI= -github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= -github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= -github.com/shirou/gopsutil/v4 v4.24.7 h1:V9UGTK4gQ8HvcnPKf6Zt3XHyQq/peaekfxpJ2HSocJk= -github.com/shirou/gopsutil/v4 v4.24.7/go.mod h1:0uW/073rP7FYLOkvxolUQM5rMOLTNmRXnFKafpb71rw= 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= -github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= -github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= -github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= -github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 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.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= -go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0 h1:G7uexXb/K3T+T9fNLCCKncweEtNEBMTO+46hKX5EdKw= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0/go.mod h1:v0mFe5Kk7woIh938mrZBJBmENYquyA0IICrlYm4Y0t4= -go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= -go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= -go.opentelemetry.io/otel/sdk v1.29.0 h1:vkqKjk7gwhS8VaWb0POZKmIEDimRCMsopNYnriHyryo= -go.opentelemetry.io/otel/sdk v1.29.0/go.mod h1:pM8Dx5WKnvxLCb+8lG1PRNIDxu9g9b9g59Qr7hfAAok= -go.opentelemetry.io/otel/sdk/metric v1.29.0 h1:K2CfmJohnRgvZ9UAj2/FhIf/okdWcNdBwe1m8xFXiSY= -go.opentelemetry.io/otel/sdk/metric v1.29.0/go.mod h1:6zZLdCl2fkauYoZIOn/soQIDSWFmNSRcICarHfuhNJQ= -go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= -go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= +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.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= @@ -104,13 +62,9 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -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.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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= @@ -123,10 +77,10 @@ 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/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd h1:6TEm2ZxXoQmFWFlt1vNxvVOa1Q0dXFQD1m/rYjXmS0E= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 h1:1GBuWVLM/KMVUv1t1En5Gs+gFZCNd360GGb4sSxtrhU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= 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= diff --git a/extension/extensioncapabilities/interfaces.go b/extension/extensioncapabilities/interfaces.go new file mode 100644 index 00000000000..370210970ed --- /dev/null +++ b/extension/extensioncapabilities/interfaces.go @@ -0,0 +1,49 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +// Package extensioncapabilities provides interfaces that can be implemented by extensions +// to provide additional capabilities. +package extensioncapabilities // import "go.opentelemetry.io/collector/extension/extensioncapabilities" + +import ( + "context" + + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/confmap" + "go.opentelemetry.io/collector/extension" +) + +// Dependent is an optional interface that can be implemented by extensions +// that depend on other extensions and must be started only after their dependencies. +// See https://github.com/open-telemetry/opentelemetry-collector/pull/8768 for examples. +type Dependent interface { + extension.Extension + Dependencies() []component.ID +} + +// PipelineWatcher is an extra interface for Extension hosted by the OpenTelemetry +// Collector that is to be implemented by extensions interested in changes to pipeline +// states. Typically this will be used by extensions that change their behavior if data is +// being ingested or not, e.g.: a k8s readiness probe. +type PipelineWatcher interface { + // Ready notifies the Extension that all pipelines were built and the + // receivers were started, i.e.: the service is ready to receive data + // (note that it may already have received data when this method is called). + Ready() error + + // NotReady notifies the Extension that all receivers are about to be stopped, + // i.e.: pipeline receivers will not accept new data. + // This is sent before receivers are stopped, so the Extension can take any + // appropriate actions before that happens. + NotReady() error +} + +// ConfigWatcher is an interface that should be implemented by an extension that +// wishes to be notified of the Collector's effective configuration. +type ConfigWatcher interface { + // NotifyConfig notifies the extension of the Collector's current effective configuration. + // The extension owns the `confmap.Conf`. Callers must ensure that it's safe for + // extensions to store the `conf` pointer and use it concurrently with any other + // instances of `conf`. + NotifyConfig(ctx context.Context, conf *confmap.Conf) error +} diff --git a/extension/extensiontest/statuswatcher_extension.go b/extension/extensiontest/statuswatcher_extension.go deleted file mode 100644 index 8a14bd2e9a1..00000000000 --- a/extension/extensiontest/statuswatcher_extension.go +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package extensiontest // import "go.opentelemetry.io/collector/extension/extensiontest" - -import ( - "context" - - "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componentstatus" - "go.opentelemetry.io/collector/component/componenttest" - "go.opentelemetry.io/collector/extension" -) - -// NewStatusWatcherExtensionCreateSettings returns a new nop settings for Create*Extension functions. -func NewStatusWatcherExtensionCreateSettings() extension.Settings { - return extension.Settings{ - TelemetrySettings: componenttest.NewNopTelemetrySettings(), - BuildInfo: component.NewDefaultBuildInfo(), - } -} - -// NewStatusWatcherExtensionFactory returns a component.ExtensionFactory to construct a status watcher extension. -func NewStatusWatcherExtensionFactory( - onStatusChanged func(source *componentstatus.InstanceID, event *componentstatus.Event), -) extension.Factory { - return extension.NewFactory( - component.MustNewType("statuswatcher"), - func() component.Config { - return &struct{}{} - }, - func(context.Context, extension.Settings, component.Config) (component.Component, error) { - return &statusWatcherExtension{onStatusChanged: onStatusChanged}, nil - }, - component.StabilityLevelStable) -} - -// statusWatcherExtension receives status events reported via component status reporting for testing -// purposes. -type statusWatcherExtension struct { - component.StartFunc - component.ShutdownFunc - onStatusChanged func(source *componentstatus.InstanceID, event *componentstatus.Event) -} - -func (e statusWatcherExtension) ComponentStatusChanged(source *componentstatus.InstanceID, event *componentstatus.Event) { - e.onStatusChanged(source, event) -} diff --git a/extension/extensiontest/statuswatcher_extension_test.go b/extension/extensiontest/statuswatcher_extension_test.go deleted file mode 100644 index cee610795f1..00000000000 --- a/extension/extensiontest/statuswatcher_extension_test.go +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package extensiontest - -import ( - "context" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componentstatus" - "go.opentelemetry.io/collector/component/componenttest" -) - -func TestStatusWatcherExtension(t *testing.T) { - statusChanged := false - factory := NewStatusWatcherExtensionFactory( - func(*componentstatus.InstanceID, *componentstatus.Event) { - statusChanged = true - }, - ) - require.NotNil(t, factory) - assert.Equal(t, component.MustNewType("statuswatcher"), factory.Type()) - cfg := factory.CreateDefaultConfig() - assert.Equal(t, &struct{}{}, cfg) - - ext, err := factory.CreateExtension(context.Background(), NewStatusWatcherExtensionCreateSettings(), cfg) - require.NoError(t, err) - assert.NoError(t, ext.Start(context.Background(), componenttest.NewNopHost())) - assert.False(t, statusChanged) - - ext.(componentstatus.Watcher).ComponentStatusChanged(&componentstatus.InstanceID{}, &componentstatus.Event{}) - - assert.True(t, statusChanged) - assert.NoError(t, ext.Shutdown(context.Background())) -} diff --git a/extension/go.mod b/extension/go.mod index e6288df3a31..0c495fbeada 100644 --- a/extension/go.mod +++ b/extension/go.mod @@ -5,9 +5,7 @@ go 1.22.0 require ( github.com/google/uuid v1.6.0 github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector/component v0.108.1 - go.opentelemetry.io/collector/component/componentstatus v0.108.1 - go.opentelemetry.io/collector/confmap v1.14.1 + go.opentelemetry.io/collector/component v0.109.0 go.uber.org/goleak v1.3.0 ) @@ -17,45 +15,35 @@ 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/gogo/protobuf v1.3.2 // indirect github.com/klauspost/compress v1.17.9 // indirect - github.com/knadh/koanf/maps v0.1.1 // indirect - github.com/knadh/koanf/providers/confmap v0.1.0 // indirect - github.com/knadh/koanf/v2 v2.1.1 // indirect - github.com/mitchellh/copystructure v1.2.0 // indirect - github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.20.2 // indirect + github.com/prometheus/client_golang v1.20.3 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.56.0 // indirect + github.com/prometheus/common v0.59.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.108.1 // indirect - go.opentelemetry.io/collector/pdata v1.14.1 // indirect - go.opentelemetry.io/otel v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.51.0 // indirect - go.opentelemetry.io/otel/metric v1.29.0 // indirect - go.opentelemetry.io/otel/sdk v1.29.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.29.0 // indirect - go.opentelemetry.io/otel/trace v1.29.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.109.0 // indirect + go.opentelemetry.io/collector/pdata v1.15.0 // indirect + go.opentelemetry.io/otel v1.30.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect + go.opentelemetry.io/otel/metric v1.30.0 // indirect + go.opentelemetry.io/otel/sdk v1.30.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect + go.opentelemetry.io/otel/trace v1.30.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/net v0.27.0 // indirect - golang.org/x/sys v0.24.0 // indirect - golang.org/x/text v0.16.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect - google.golang.org/grpc v1.65.0 // indirect + golang.org/x/net v0.28.0 // indirect + golang.org/x/sys v0.25.0 // indirect + golang.org/x/text v0.17.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect + google.golang.org/grpc v1.66.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) replace go.opentelemetry.io/collector/component => ../component -replace go.opentelemetry.io/collector/confmap => ../confmap - replace go.opentelemetry.io/collector/pdata => ../pdata replace go.opentelemetry.io/collector/config/configtelemetry => ../config/configtelemetry - -replace go.opentelemetry.io/collector/component/componentstatus => ../component/componentstatus diff --git a/extension/go.sum b/extension/go.sum index 24c5eeacb98..dc25c056423 100644 --- a/extension/go.sum +++ b/extension/go.sum @@ -9,8 +9,6 @@ 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/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= @@ -21,32 +19,22 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= -github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= -github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= -github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= -github.com/knadh/koanf/providers/confmap v0.1.0/go.mod h1:2uLhxQzJnyHKfxG927awZC7+fyHFdQkd697K4MdLnIU= -github.com/knadh/koanf/v2 v2.1.1 h1:/R8eXqasSTsmDCsAyYj+81Wteg8AqrV9CP6gvsTsOmM= -github.com/knadh/koanf/v2 v2.1.1/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= -github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= -github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= -github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg= -github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= +github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.56.0 h1:UffReloqkBtvtQEYDg2s+uDPGRrJyC6vZWPGXf6OhPY= -github.com/prometheus/common v0.56.0/go.mod h1:7uRPFSUTbfZWsJ7MHY56sqt7hLQu3bxXHDnNhl8E9qI= +github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= +github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= @@ -55,18 +43,18 @@ 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.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= -go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0 h1:G7uexXb/K3T+T9fNLCCKncweEtNEBMTO+46hKX5EdKw= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0/go.mod h1:v0mFe5Kk7woIh938mrZBJBmENYquyA0IICrlYm4Y0t4= -go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= -go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= -go.opentelemetry.io/otel/sdk v1.29.0 h1:vkqKjk7gwhS8VaWb0POZKmIEDimRCMsopNYnriHyryo= -go.opentelemetry.io/otel/sdk v1.29.0/go.mod h1:pM8Dx5WKnvxLCb+8lG1PRNIDxu9g9b9g59Qr7hfAAok= -go.opentelemetry.io/otel/sdk/metric v1.29.0 h1:K2CfmJohnRgvZ9UAj2/FhIf/okdWcNdBwe1m8xFXiSY= -go.opentelemetry.io/otel/sdk/metric v1.29.0/go.mod h1:6zZLdCl2fkauYoZIOn/soQIDSWFmNSRcICarHfuhNJQ= -go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= -go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= +go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= +go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= +go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= +go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= +go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= +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.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= @@ -82,20 +70,20 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= -golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -104,10 +92,10 @@ 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/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 h1:Zy9XzmMEflZ/MAaA7vNcoebnRAld7FsPW1EeBB7V0m8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 h1:1GBuWVLM/KMVUv1t1En5Gs+gFZCNd360GGb4sSxtrhU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= 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= diff --git a/extension/memorylimiterextension/README.md b/extension/memorylimiterextension/README.md index ab45eb8e840..65dbc5eb85e 100644 --- a/extension/memorylimiterextension/README.md +++ b/extension/memorylimiterextension/README.md @@ -1,8 +1,5 @@ # Memory Limiter Extension -> [!WARNING] -> The memory_limiter extension cannot be used if the deprecated memory_ballast extension is enabled. - | Status | | | ------------- |-----------| diff --git a/extension/memorylimiterextension/go.mod b/extension/memorylimiterextension/go.mod index 053c7f7d378..bed21c8dc20 100644 --- a/extension/memorylimiterextension/go.mod +++ b/extension/memorylimiterextension/go.mod @@ -4,10 +4,10 @@ go 1.22.0 require ( github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector v0.108.1 - go.opentelemetry.io/collector/component v0.108.1 - go.opentelemetry.io/collector/confmap v1.14.1 - go.opentelemetry.io/collector/extension v0.108.1 + go.opentelemetry.io/collector v0.109.0 + go.opentelemetry.io/collector/component v0.109.0 + go.opentelemetry.io/collector/confmap v1.15.0 + go.opentelemetry.io/collector/extension v0.109.0 go.uber.org/goleak v1.3.0 go.uber.org/zap v1.27.0 ) @@ -32,29 +32,28 @@ require ( github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect - github.com/prometheus/client_golang v1.20.2 // indirect + github.com/prometheus/client_golang v1.20.3 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.56.0 // indirect + github.com/prometheus/common v0.59.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect - github.com/shirou/gopsutil/v4 v4.24.7 // indirect + github.com/shirou/gopsutil/v4 v4.24.8 // indirect github.com/tklauser/go-sysconf v0.3.12 // indirect github.com/tklauser/numcpus v0.6.1 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect - go.opentelemetry.io/collector/component/componentstatus v0.108.1 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.108.1 // indirect - go.opentelemetry.io/collector/pdata v1.14.1 // indirect - go.opentelemetry.io/otel v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.51.0 // indirect - go.opentelemetry.io/otel/metric v1.29.0 // indirect - go.opentelemetry.io/otel/sdk v1.29.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.29.0 // indirect - go.opentelemetry.io/otel/trace v1.29.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.109.0 // indirect + go.opentelemetry.io/collector/pdata v1.15.0 // indirect + go.opentelemetry.io/otel v1.30.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect + go.opentelemetry.io/otel/metric v1.30.0 // indirect + go.opentelemetry.io/otel/sdk v1.30.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect + go.opentelemetry.io/otel/trace v1.30.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.24.0 // indirect + golang.org/x/sys v0.25.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.65.0 // indirect + google.golang.org/grpc v1.66.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) @@ -67,8 +66,6 @@ replace go.opentelemetry.io/collector/confmap => ../../confmap replace go.opentelemetry.io/collector/extension => ../../extension -replace go.opentelemetry.io/collector/featuregate => ../../featuregate - replace go.opentelemetry.io/collector/pdata => ../../pdata replace go.opentelemetry.io/collector/consumer => ../../consumer diff --git a/extension/memorylimiterextension/go.sum b/extension/memorylimiterextension/go.sum index 2e520f3ae04..97f09cd34bd 100644 --- a/extension/memorylimiterextension/go.sum +++ b/extension/memorylimiterextension/go.sum @@ -48,18 +48,18 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= -github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg= -github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= +github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.56.0 h1:UffReloqkBtvtQEYDg2s+uDPGRrJyC6vZWPGXf6OhPY= -github.com/prometheus/common v0.56.0/go.mod h1:7uRPFSUTbfZWsJ7MHY56sqt7hLQu3bxXHDnNhl8E9qI= +github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= +github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= -github.com/shirou/gopsutil/v4 v4.24.7 h1:V9UGTK4gQ8HvcnPKf6Zt3XHyQq/peaekfxpJ2HSocJk= -github.com/shirou/gopsutil/v4 v4.24.7/go.mod h1:0uW/073rP7FYLOkvxolUQM5rMOLTNmRXnFKafpb71rw= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= +github.com/shirou/gopsutil/v4 v4.24.8 h1:pVQjIenQkIhqO81mwTaXjTzOMT7d3TZkf43PlVFHENI= +github.com/shirou/gopsutil/v4 v4.24.8/go.mod h1:wE0OrJtj4dG+hYkxqDH3QiBICdKSf04/npcvLLc/oRg= 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= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= @@ -70,18 +70,18 @@ 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.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= -go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0 h1:G7uexXb/K3T+T9fNLCCKncweEtNEBMTO+46hKX5EdKw= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0/go.mod h1:v0mFe5Kk7woIh938mrZBJBmENYquyA0IICrlYm4Y0t4= -go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= -go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= -go.opentelemetry.io/otel/sdk v1.29.0 h1:vkqKjk7gwhS8VaWb0POZKmIEDimRCMsopNYnriHyryo= -go.opentelemetry.io/otel/sdk v1.29.0/go.mod h1:pM8Dx5WKnvxLCb+8lG1PRNIDxu9g9b9g59Qr7hfAAok= -go.opentelemetry.io/otel/sdk/metric v1.29.0 h1:K2CfmJohnRgvZ9UAj2/FhIf/okdWcNdBwe1m8xFXiSY= -go.opentelemetry.io/otel/sdk/metric v1.29.0/go.mod h1:6zZLdCl2fkauYoZIOn/soQIDSWFmNSRcICarHfuhNJQ= -go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= -go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= +go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= +go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= +go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= +go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= +go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= +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.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= @@ -109,8 +109,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.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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= @@ -125,8 +125,8 @@ 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= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd h1:6TEm2ZxXoQmFWFlt1vNxvVOa1Q0dXFQD1m/rYjXmS0E= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= 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= diff --git a/extension/zpagesextension/go.mod b/extension/zpagesextension/go.mod index a0e5a622dbd..6632d81b00a 100644 --- a/extension/zpagesextension/go.mod +++ b/extension/zpagesextension/go.mod @@ -4,23 +4,22 @@ go 1.22.0 require ( github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector v0.108.1 - go.opentelemetry.io/collector/component v0.108.1 - go.opentelemetry.io/collector/component/componentstatus v0.108.1 - go.opentelemetry.io/collector/config/configauth v0.108.1 - go.opentelemetry.io/collector/config/confighttp v0.108.1 - go.opentelemetry.io/collector/confmap v1.14.1 - go.opentelemetry.io/collector/extension v0.108.1 + go.opentelemetry.io/collector v0.109.0 + go.opentelemetry.io/collector/component v0.109.0 + go.opentelemetry.io/collector/component/componentstatus v0.109.0 + go.opentelemetry.io/collector/config/configauth v0.109.0 + go.opentelemetry.io/collector/config/confighttp v0.109.0 + go.opentelemetry.io/collector/confmap v1.15.0 + go.opentelemetry.io/collector/extension v0.109.0 go.opentelemetry.io/contrib/zpages v0.54.0 - go.opentelemetry.io/otel/sdk v1.29.0 - go.opentelemetry.io/otel/trace v1.29.0 + go.opentelemetry.io/otel/sdk v1.30.0 + go.opentelemetry.io/otel/trace v1.30.0 go.uber.org/goleak v1.3.0 go.uber.org/zap v1.27.0 ) require ( github.com/beorn7/perks v1.0.1 // indirect - github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect @@ -31,7 +30,6 @@ require ( 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/klauspost/compress v1.17.9 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect @@ -41,45 +39,32 @@ require ( github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.20.2 // indirect + github.com/prometheus/client_golang v1.20.3 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.56.0 // indirect + github.com/prometheus/common v0.59.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect - github.com/rs/cors v1.11.0 // indirect - go.opentelemetry.io/collector/client v1.14.1 // indirect - go.opentelemetry.io/collector/config/configcompression v1.14.1 // indirect - go.opentelemetry.io/collector/config/configopaque v1.14.1 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.108.1 // indirect - go.opentelemetry.io/collector/config/configtls v1.14.1 // indirect - go.opentelemetry.io/collector/config/internal v0.108.1 // indirect - go.opentelemetry.io/collector/extension/auth v0.108.1 // indirect - go.opentelemetry.io/collector/featuregate v1.14.1 // indirect - go.opentelemetry.io/collector/pdata v1.14.1 // indirect - go.opentelemetry.io/contrib/config v0.9.0 // indirect + github.com/rs/cors v1.11.1 // indirect + go.opentelemetry.io/collector/client v1.15.0 // indirect + go.opentelemetry.io/collector/config/configcompression v1.15.0 // indirect + go.opentelemetry.io/collector/config/configopaque v1.15.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.109.0 // indirect + go.opentelemetry.io/collector/config/configtls v1.15.0 // indirect + go.opentelemetry.io/collector/config/internal v0.109.0 // indirect + go.opentelemetry.io/collector/extension/auth v0.109.0 // indirect + go.opentelemetry.io/collector/featuregate v1.15.0 // indirect + go.opentelemetry.io/collector/internal/globalgates v0.109.0 // indirect + go.opentelemetry.io/collector/pdata v1.15.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect - go.opentelemetry.io/otel v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.5.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.51.0 // indirect - go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.5.0 // indirect - go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.29.0 // indirect - go.opentelemetry.io/otel/log v0.5.0 // indirect - go.opentelemetry.io/otel/metric v1.29.0 // indirect - go.opentelemetry.io/otel/sdk/log v0.5.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.29.0 // indirect - go.opentelemetry.io/proto/otlp v1.3.1 // indirect + go.opentelemetry.io/otel v1.30.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect + go.opentelemetry.io/otel/metric v1.30.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.24.0 // indirect - golang.org/x/text v0.17.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd // indirect + golang.org/x/net v0.29.0 // indirect + golang.org/x/sys v0.25.0 // indirect + golang.org/x/text v0.18.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd // indirect - google.golang.org/grpc v1.65.0 // indirect + google.golang.org/grpc v1.66.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) @@ -130,3 +115,5 @@ replace go.opentelemetry.io/collector/consumer/consumertest => ../../consumer/co replace go.opentelemetry.io/collector/client => ../../client replace go.opentelemetry.io/collector/component/componentstatus => ../../component/componentstatus + +replace go.opentelemetry.io/collector/internal/globalgates => ../../internal/globalgates diff --git a/extension/zpagesextension/go.sum b/extension/zpagesextension/go.sum index 9a135755851..479bcbe4f1e 100644 --- a/extension/zpagesextension/go.sum +++ b/extension/zpagesextension/go.sum @@ -1,7 +1,5 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= -github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -25,8 +23,6 @@ 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/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 h1:asbCHRVmodnJTuQ3qamDwqVOIjwqUPTYmYuemVOx+Ys= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0/go.mod h1:ggCgvZ2r7uOoQjOyu2Y1NhHmEPPzzuhWgcza5M1Ji1I= 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/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= @@ -59,64 +55,38 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg= -github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= +github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.56.0 h1:UffReloqkBtvtQEYDg2s+uDPGRrJyC6vZWPGXf6OhPY= -github.com/prometheus/common v0.56.0/go.mod h1:7uRPFSUTbfZWsJ7MHY56sqt7hLQu3bxXHDnNhl8E9qI= +github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= +github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= -github.com/rs/cors v1.11.0 h1:0B9GE/r9Bc2UxRMMtymBkHTenPkHDv0CW4Y98GBY+po= -github.com/rs/cors v1.11.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= +github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= 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= 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/contrib/config v0.9.0 h1:AJ1c6+vJ6SxvqBBhsi2RhLFMlc6SnJOg81Jp4toFyNw= -go.opentelemetry.io/contrib/config v0.9.0/go.mod h1:u/u2L6y/c8GKrq/AP51sfXV4Eu24btVlC3A5f867xwg= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 h1:TT4fX+nBOA/+LUkobKGW1ydGcn+G3vRw9+g5HwCphpk= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0/go.mod h1:L7UH0GbB0p47T4Rri3uHjbpCFYrVrwc1I25QhNPiGK8= go.opentelemetry.io/contrib/zpages v0.54.0 h1:tSfm/LEK5E46sd5qx/Y9o4iQ65ipLubV0Una7veXFlA= go.opentelemetry.io/contrib/zpages v0.54.0/go.mod h1:sbe4/RH3CFKkdM5zuGwfziKjvkqUOK9hSgLFckiVZUI= -go.opentelemetry.io/otel v1.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= -go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= -go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.5.0 h1:4d++HQ+Ihdl+53zSjtsCUFDmNMju2FC9qFkUlTxPLqo= -go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.5.0/go.mod h1:mQX5dTO3Mh5ZF7bPKDkt5c/7C41u/SiDr9XgTpzXXn8= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.29.0 h1:k6fQVDQexDE+3jG2SfCQjnHS7OamcP73YMoxEVq5B6k= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.29.0/go.mod h1:t4BrYLHU450Zo9fnydWlIuswB1bm7rM8havDpWOJeDo= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.29.0 h1:xvhQxJ/C9+RTnAj5DpTg7LSM1vbbMTiXt7e9hsfqHNw= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.29.0/go.mod h1:Fcvs2Bz1jkDM+Wf5/ozBGmi3tQ/c9zPKLnsipnfhGAo= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0 h1:dIIDULZJpgdiHz5tXrTgKIMLkus6jEFa7x5SOKcyR7E= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0/go.mod h1:jlRVBe7+Z1wyxFSUs48L6OBQZ5JwH2Hg/Vbl+t9rAgI= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0 h1:nSiV3s7wiCam610XcLbYOmMfJxB9gO4uK3Xgv5gmTgg= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0/go.mod h1:hKn/e/Nmd19/x1gvIHwtOwVWM+VhuITSWip3JUDghj0= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0 h1:JAv0Jwtl01UFiyWZEMiJZBiTlv5A50zNs8lsthXqIio= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0/go.mod h1:QNKLmUEAq2QUbPQUfvw4fmv0bgbK7UlOSFCnXyfvSNc= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0 h1:G7uexXb/K3T+T9fNLCCKncweEtNEBMTO+46hKX5EdKw= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0/go.mod h1:v0mFe5Kk7woIh938mrZBJBmENYquyA0IICrlYm4Y0t4= -go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.5.0 h1:ThVXnEsdwNcxdBO+r96ci1xbF+PgNjwlk457VNuJODo= -go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.5.0/go.mod h1:rHWcSmC4q2h3gje/yOq6sAOaq8+UHxN/Ru3BbmDXOfY= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0 h1:WDdP9acbMYjbKIyJUhTvtzj601sVJOqgWdUxSdR/Ysc= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0/go.mod h1:BLbf7zbNIONBLPwvFnwNHGj4zge8uTCM/UPIVW1Mq2I= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.29.0 h1:X3ZjNp36/WlkSYx0ul2jw4PtbNEDDeLskw3VPsrpYM0= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.29.0/go.mod h1:2uL/xnOXh0CHOBFCWXz5u1A4GXLiW+0IQIzVbeOEQ0U= -go.opentelemetry.io/otel/log v0.5.0 h1:x1Pr6Y3gnXgl1iFBwtGy1W/mnzENoK0w0ZoaeOI3i30= -go.opentelemetry.io/otel/log v0.5.0/go.mod h1:NU/ozXeGuOR5/mjCRXYbTC00NFJ3NYuraV/7O78F0rE= -go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= -go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= -go.opentelemetry.io/otel/sdk v1.29.0 h1:vkqKjk7gwhS8VaWb0POZKmIEDimRCMsopNYnriHyryo= -go.opentelemetry.io/otel/sdk v1.29.0/go.mod h1:pM8Dx5WKnvxLCb+8lG1PRNIDxu9g9b9g59Qr7hfAAok= -go.opentelemetry.io/otel/sdk/log v0.5.0 h1:A+9lSjlZGxkQOr7QSBJcuyyYBw79CufQ69saiJLey7o= -go.opentelemetry.io/otel/sdk/log v0.5.0/go.mod h1:zjxIW7sw1IHolZL2KlSAtrUi8JHttoeiQy43Yl3WuVQ= -go.opentelemetry.io/otel/sdk/metric v1.29.0 h1:K2CfmJohnRgvZ9UAj2/FhIf/okdWcNdBwe1m8xFXiSY= -go.opentelemetry.io/otel/sdk/metric v1.29.0/go.mod h1:6zZLdCl2fkauYoZIOn/soQIDSWFmNSRcICarHfuhNJQ= -go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= -go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= -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.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= +go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= +go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= +go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= +go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= +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.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= @@ -132,20 +102,20 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= -golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= +golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= +golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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= -golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -154,12 +124,10 @@ 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/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd h1:BBOTEWLuuEGQy9n1y9MhVJ9Qt0BDu21X8qZs71/uPZo= -google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:fO8wJzT2zbQbAjbIoos1285VfEIYKDDY+Dt+WpTkh6g= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd h1:6TEm2ZxXoQmFWFlt1vNxvVOa1Q0dXFQD1m/rYjXmS0E= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= 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= diff --git a/filter/go.mod b/filter/go.mod index 1b0f55aeff6..d023219f32b 100644 --- a/filter/go.mod +++ b/filter/go.mod @@ -4,7 +4,7 @@ go 1.22.0 require ( github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector/confmap v1.14.1 + go.opentelemetry.io/collector/confmap v1.15.0 ) require ( diff --git a/go.mod b/go.mod index ab368c11d3d..5ff241af35e 100644 --- a/go.mod +++ b/go.mod @@ -11,28 +11,25 @@ module go.opentelemetry.io/collector go 1.22.0 require ( - github.com/shirou/gopsutil/v4 v4.24.7 + github.com/shirou/gopsutil/v4 v4.24.8 github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector/component v0.108.1 - go.opentelemetry.io/collector/component/componentstatus v0.108.1 - go.opentelemetry.io/collector/confmap v1.14.1 - go.opentelemetry.io/collector/consumer v0.108.1 - go.opentelemetry.io/collector/consumer/consumerprofiles v0.108.1 - go.opentelemetry.io/collector/consumer/consumertest v0.108.1 - go.opentelemetry.io/collector/featuregate v1.14.1 - go.opentelemetry.io/collector/pdata v1.14.1 - go.opentelemetry.io/collector/pdata/pprofile v0.108.1 - go.opentelemetry.io/collector/pdata/testdata v0.108.1 - go.opentelemetry.io/contrib/config v0.9.0 + go.opentelemetry.io/collector/component v0.109.0 + go.opentelemetry.io/collector/component/componentstatus v0.109.0 + go.opentelemetry.io/collector/confmap v1.15.0 + go.opentelemetry.io/collector/consumer v0.109.0 + go.opentelemetry.io/collector/consumer/consumerprofiles v0.109.0 + go.opentelemetry.io/collector/consumer/consumertest v0.109.0 + go.opentelemetry.io/collector/pdata v1.15.0 + go.opentelemetry.io/collector/pdata/pprofile v0.109.0 + go.opentelemetry.io/collector/pdata/testdata v0.109.0 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.27.0 - google.golang.org/grpc v1.65.0 + google.golang.org/grpc v1.66.0 ) require ( github.com/beorn7/perks v1.0.1 // indirect - github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-logr/logr v1.4.2 // indirect @@ -41,8 +38,6 @@ require ( github.com/go-viper/mapstructure/v2 v2.1.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/google/uuid v1.6.0 // indirect - github.com/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.9 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect @@ -56,36 +51,24 @@ require ( github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect - github.com/prometheus/client_golang v1.20.2 // indirect + github.com/prometheus/client_golang v1.20.3 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.56.0 // indirect + github.com/prometheus/common v0.59.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/tklauser/go-sysconf v0.3.12 // indirect github.com/tklauser/numcpus v0.6.1 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.108.1 // indirect - go.opentelemetry.io/otel v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.5.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.51.0 // indirect - go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.5.0 // indirect - go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.29.0 // indirect - go.opentelemetry.io/otel/log v0.5.0 // indirect - go.opentelemetry.io/otel/metric v1.29.0 // indirect - go.opentelemetry.io/otel/sdk v1.29.0 // indirect - go.opentelemetry.io/otel/sdk/log v0.5.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.29.0 // indirect - go.opentelemetry.io/otel/trace v1.29.0 // indirect - go.opentelemetry.io/proto/otlp v1.3.1 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.109.0 // indirect + go.opentelemetry.io/otel v1.30.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect + go.opentelemetry.io/otel/metric v1.30.0 // indirect + go.opentelemetry.io/otel/sdk v1.30.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect + go.opentelemetry.io/otel/trace v1.30.0 // indirect golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.24.0 // indirect + golang.org/x/sys v0.25.0 // indirect golang.org/x/text v0.17.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect @@ -103,8 +86,6 @@ replace go.opentelemetry.io/collector/consumer => ./consumer replace go.opentelemetry.io/collector/consumer/consumertest => ./consumer/consumertest -replace go.opentelemetry.io/collector/featuregate => ./featuregate - replace go.opentelemetry.io/collector/pdata => ./pdata replace go.opentelemetry.io/collector/pdata/testdata => ./pdata/testdata diff --git a/go.sum b/go.sum index 2574a054a06..556ddb58cb8 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,5 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= -github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -24,10 +22,6 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 h1:asbCHRVmodnJTuQ3qamDwqVOIjwqUPTYmYuemVOx+Ys= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0/go.mod h1:ggCgvZ2r7uOoQjOyu2Y1NhHmEPPzzuhWgcza5M1Ji1I= -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/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= @@ -63,18 +57,18 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= -github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg= -github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= +github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.56.0 h1:UffReloqkBtvtQEYDg2s+uDPGRrJyC6vZWPGXf6OhPY= -github.com/prometheus/common v0.56.0/go.mod h1:7uRPFSUTbfZWsJ7MHY56sqt7hLQu3bxXHDnNhl8E9qI= +github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= +github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= -github.com/shirou/gopsutil/v4 v4.24.7 h1:V9UGTK4gQ8HvcnPKf6Zt3XHyQq/peaekfxpJ2HSocJk= -github.com/shirou/gopsutil/v4 v4.24.7/go.mod h1:0uW/073rP7FYLOkvxolUQM5rMOLTNmRXnFKafpb71rw= +github.com/shirou/gopsutil/v4 v4.24.8 h1:pVQjIenQkIhqO81mwTaXjTzOMT7d3TZkf43PlVFHENI= +github.com/shirou/gopsutil/v4 v4.24.8/go.mod h1:wE0OrJtj4dG+hYkxqDH3QiBICdKSf04/npcvLLc/oRg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= @@ -87,44 +81,18 @@ 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/contrib/config v0.9.0 h1:AJ1c6+vJ6SxvqBBhsi2RhLFMlc6SnJOg81Jp4toFyNw= -go.opentelemetry.io/contrib/config v0.9.0/go.mod h1:u/u2L6y/c8GKrq/AP51sfXV4Eu24btVlC3A5f867xwg= -go.opentelemetry.io/otel v1.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= -go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= -go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.5.0 h1:4d++HQ+Ihdl+53zSjtsCUFDmNMju2FC9qFkUlTxPLqo= -go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.5.0/go.mod h1:mQX5dTO3Mh5ZF7bPKDkt5c/7C41u/SiDr9XgTpzXXn8= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.29.0 h1:k6fQVDQexDE+3jG2SfCQjnHS7OamcP73YMoxEVq5B6k= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.29.0/go.mod h1:t4BrYLHU450Zo9fnydWlIuswB1bm7rM8havDpWOJeDo= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.29.0 h1:xvhQxJ/C9+RTnAj5DpTg7LSM1vbbMTiXt7e9hsfqHNw= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.29.0/go.mod h1:Fcvs2Bz1jkDM+Wf5/ozBGmi3tQ/c9zPKLnsipnfhGAo= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0 h1:dIIDULZJpgdiHz5tXrTgKIMLkus6jEFa7x5SOKcyR7E= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0/go.mod h1:jlRVBe7+Z1wyxFSUs48L6OBQZ5JwH2Hg/Vbl+t9rAgI= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0 h1:nSiV3s7wiCam610XcLbYOmMfJxB9gO4uK3Xgv5gmTgg= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0/go.mod h1:hKn/e/Nmd19/x1gvIHwtOwVWM+VhuITSWip3JUDghj0= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0 h1:JAv0Jwtl01UFiyWZEMiJZBiTlv5A50zNs8lsthXqIio= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0/go.mod h1:QNKLmUEAq2QUbPQUfvw4fmv0bgbK7UlOSFCnXyfvSNc= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0 h1:G7uexXb/K3T+T9fNLCCKncweEtNEBMTO+46hKX5EdKw= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0/go.mod h1:v0mFe5Kk7woIh938mrZBJBmENYquyA0IICrlYm4Y0t4= -go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.5.0 h1:ThVXnEsdwNcxdBO+r96ci1xbF+PgNjwlk457VNuJODo= -go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.5.0/go.mod h1:rHWcSmC4q2h3gje/yOq6sAOaq8+UHxN/Ru3BbmDXOfY= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0 h1:WDdP9acbMYjbKIyJUhTvtzj601sVJOqgWdUxSdR/Ysc= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0/go.mod h1:BLbf7zbNIONBLPwvFnwNHGj4zge8uTCM/UPIVW1Mq2I= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.29.0 h1:X3ZjNp36/WlkSYx0ul2jw4PtbNEDDeLskw3VPsrpYM0= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.29.0/go.mod h1:2uL/xnOXh0CHOBFCWXz5u1A4GXLiW+0IQIzVbeOEQ0U= -go.opentelemetry.io/otel/log v0.5.0 h1:x1Pr6Y3gnXgl1iFBwtGy1W/mnzENoK0w0ZoaeOI3i30= -go.opentelemetry.io/otel/log v0.5.0/go.mod h1:NU/ozXeGuOR5/mjCRXYbTC00NFJ3NYuraV/7O78F0rE= -go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= -go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= -go.opentelemetry.io/otel/sdk v1.29.0 h1:vkqKjk7gwhS8VaWb0POZKmIEDimRCMsopNYnriHyryo= -go.opentelemetry.io/otel/sdk v1.29.0/go.mod h1:pM8Dx5WKnvxLCb+8lG1PRNIDxu9g9b9g59Qr7hfAAok= -go.opentelemetry.io/otel/sdk/log v0.5.0 h1:A+9lSjlZGxkQOr7QSBJcuyyYBw79CufQ69saiJLey7o= -go.opentelemetry.io/otel/sdk/log v0.5.0/go.mod h1:zjxIW7sw1IHolZL2KlSAtrUi8JHttoeiQy43Yl3WuVQ= -go.opentelemetry.io/otel/sdk/metric v1.29.0 h1:K2CfmJohnRgvZ9UAj2/FhIf/okdWcNdBwe1m8xFXiSY= -go.opentelemetry.io/otel/sdk/metric v1.29.0/go.mod h1:6zZLdCl2fkauYoZIOn/soQIDSWFmNSRcICarHfuhNJQ= -go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= -go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= -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.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= +go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= +go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= +go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= +go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= +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.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= @@ -152,8 +120,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.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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= @@ -166,12 +134,10 @@ 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/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd h1:BBOTEWLuuEGQy9n1y9MhVJ9Qt0BDu21X8qZs71/uPZo= -google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:fO8wJzT2zbQbAjbIoos1285VfEIYKDDY+Dt+WpTkh6g= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd h1:6TEm2ZxXoQmFWFlt1vNxvVOa1Q0dXFQD1m/rYjXmS0E= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= 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= diff --git a/internal/cgroups/mountpoint_test.go b/internal/cgroups/mountpoint_test.go index 8ce2810f89f..07f0d0ce3e6 100644 --- a/internal/cgroups/mountpoint_test.go +++ b/internal/cgroups/mountpoint_test.go @@ -106,7 +106,7 @@ func TestNewMountPointFromLineErr(t *testing.T) { errExpected := mountPointFormatInvalidError{line} assert.Nil(t, mountPoint, "[%d] %q", i, line) - assert.Equal(t, err, errExpected, "[%d] %q", i, line) + assert.Equal(t, errExpected, err, "[%d] %q", i, line) } } diff --git a/internal/e2e/consume_contract_test.go b/internal/e2e/consume_contract_test.go index efda43101f3..98beb5cd361 100644 --- a/internal/e2e/consume_contract_test.go +++ b/internal/e2e/consume_contract_test.go @@ -22,7 +22,7 @@ func testExporterConfig(endpoint string) component.Config { retryConfig := configretry.NewDefaultBackOffConfig() retryConfig.InitialInterval = time.Millisecond // interval is short for the test purposes return &otlpexporter.Config{ - QueueConfig: exporterhelper.QueueSettings{Enabled: false}, + QueueConfig: exporterhelper.QueueConfig{Enabled: false}, RetryConfig: retryConfig, ClientConfig: configgrpc.ClientConfig{ Endpoint: endpoint, diff --git a/internal/e2e/go.mod b/internal/e2e/go.mod index 472a3552ef7..515b9e89963 100644 --- a/internal/e2e/go.mod +++ b/internal/e2e/go.mod @@ -4,28 +4,28 @@ go 1.22.0 require ( github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector v0.108.1 - go.opentelemetry.io/collector/component v0.108.1 - go.opentelemetry.io/collector/component/componentstatus v0.108.1 - go.opentelemetry.io/collector/config/configgrpc v0.108.1 - go.opentelemetry.io/collector/config/confighttp v0.108.1 - go.opentelemetry.io/collector/config/configopaque v1.14.1 - go.opentelemetry.io/collector/config/configretry v1.14.1 - go.opentelemetry.io/collector/config/configtelemetry v0.108.1 - go.opentelemetry.io/collector/config/configtls v1.14.1 - go.opentelemetry.io/collector/confmap v1.14.1 - go.opentelemetry.io/collector/connector v0.108.1 - go.opentelemetry.io/collector/consumer v0.108.1 - go.opentelemetry.io/collector/consumer/consumertest v0.108.1 - go.opentelemetry.io/collector/exporter v0.108.1 - go.opentelemetry.io/collector/exporter/otlpexporter v0.108.1 - go.opentelemetry.io/collector/exporter/otlphttpexporter v0.108.1 - go.opentelemetry.io/collector/extension v0.108.1 - go.opentelemetry.io/collector/pdata v1.14.1 - go.opentelemetry.io/collector/pdata/testdata v0.108.1 - go.opentelemetry.io/collector/receiver v0.108.1 - go.opentelemetry.io/collector/receiver/otlpreceiver v0.108.1 - go.opentelemetry.io/collector/service v0.108.1 + go.opentelemetry.io/collector v0.109.0 + go.opentelemetry.io/collector/component v0.109.0 + go.opentelemetry.io/collector/component/componentstatus v0.109.0 + go.opentelemetry.io/collector/config/configgrpc v0.109.0 + go.opentelemetry.io/collector/config/confighttp v0.109.0 + go.opentelemetry.io/collector/config/configopaque v1.15.0 + go.opentelemetry.io/collector/config/configretry v1.15.0 + go.opentelemetry.io/collector/config/configtelemetry v0.109.0 + go.opentelemetry.io/collector/config/configtls v1.15.0 + go.opentelemetry.io/collector/confmap v1.15.0 + go.opentelemetry.io/collector/connector v0.109.0 + go.opentelemetry.io/collector/consumer v0.109.0 + go.opentelemetry.io/collector/consumer/consumertest v0.109.0 + go.opentelemetry.io/collector/exporter v0.109.0 + go.opentelemetry.io/collector/exporter/otlpexporter v0.109.0 + go.opentelemetry.io/collector/exporter/otlphttpexporter v0.109.0 + go.opentelemetry.io/collector/extension v0.109.0 + go.opentelemetry.io/collector/pdata v1.15.0 + go.opentelemetry.io/collector/pdata/testdata v0.109.0 + go.opentelemetry.io/collector/receiver v0.109.0 + go.opentelemetry.io/collector/receiver/otlpreceiver v0.109.0 + go.opentelemetry.io/collector/service v0.109.0 go.uber.org/goleak v1.3.0 go.uber.org/zap v1.27.0 ) @@ -60,64 +60,65 @@ require ( github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect - github.com/prometheus/client_golang v1.20.2 // indirect + github.com/prometheus/client_golang v1.20.3 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.56.0 // indirect + github.com/prometheus/common v0.59.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect - github.com/rs/cors v1.11.0 // indirect - github.com/shirou/gopsutil/v4 v4.24.7 // indirect + github.com/rs/cors v1.11.1 // indirect + github.com/shirou/gopsutil/v4 v4.24.8 // indirect github.com/shoenig/go-m1cpu v0.1.6 // indirect github.com/tklauser/go-sysconf v0.3.12 // indirect github.com/tklauser/numcpus v0.6.1 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect - go.opentelemetry.io/collector/client v1.14.1 // indirect - go.opentelemetry.io/collector/component/componentprofiles v0.108.1 // indirect - go.opentelemetry.io/collector/config/configauth v0.108.1 // indirect - go.opentelemetry.io/collector/config/configcompression v1.14.1 // indirect - go.opentelemetry.io/collector/config/confignet v0.108.1 // indirect - go.opentelemetry.io/collector/config/internal v0.108.1 // indirect - go.opentelemetry.io/collector/connector/connectorprofiles v0.108.1 // indirect - go.opentelemetry.io/collector/consumer/consumerprofiles v0.108.1 // indirect - go.opentelemetry.io/collector/exporter/exporterprofiles v0.108.1 // indirect - go.opentelemetry.io/collector/extension/auth v0.108.1 // indirect - go.opentelemetry.io/collector/extension/experimental/storage v0.0.0-20240902085631-cd1f7623fe67 // indirect - go.opentelemetry.io/collector/featuregate v1.14.1 // indirect - go.opentelemetry.io/collector/internal/globalgates v0.108.1 // indirect - go.opentelemetry.io/collector/pdata/pprofile v0.108.1 // indirect - go.opentelemetry.io/collector/processor v0.108.1 // indirect - go.opentelemetry.io/collector/processor/processorprofiles v0.108.1 // indirect - go.opentelemetry.io/collector/receiver/receiverprofiles v0.108.1 // indirect - go.opentelemetry.io/collector/semconv v0.108.1 // indirect + go.opentelemetry.io/collector/client v1.15.0 // indirect + go.opentelemetry.io/collector/component/componentprofiles v0.109.0 // indirect + go.opentelemetry.io/collector/config/configauth v0.109.0 // indirect + go.opentelemetry.io/collector/config/configcompression v1.15.0 // indirect + go.opentelemetry.io/collector/config/confignet v0.109.0 // indirect + go.opentelemetry.io/collector/config/internal v0.109.0 // indirect + go.opentelemetry.io/collector/connector/connectorprofiles v0.109.0 // indirect + go.opentelemetry.io/collector/consumer/consumerprofiles v0.109.0 // indirect + go.opentelemetry.io/collector/exporter/exporterprofiles v0.109.0 // indirect + go.opentelemetry.io/collector/extension/auth v0.109.0 // indirect + go.opentelemetry.io/collector/extension/experimental/storage v0.109.0 // indirect + go.opentelemetry.io/collector/extension/extensioncapabilities v0.109.0 // indirect + go.opentelemetry.io/collector/featuregate v1.15.0 // indirect + go.opentelemetry.io/collector/internal/globalgates v0.109.0 // indirect + go.opentelemetry.io/collector/pdata/pprofile v0.109.0 // indirect + go.opentelemetry.io/collector/processor v0.109.0 // indirect + go.opentelemetry.io/collector/processor/processorprofiles v0.109.0 // indirect + go.opentelemetry.io/collector/receiver/receiverprofiles v0.109.0 // indirect + go.opentelemetry.io/collector/semconv v0.109.0 // indirect go.opentelemetry.io/contrib/config v0.9.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect go.opentelemetry.io/contrib/propagators/b3 v1.29.0 // indirect - go.opentelemetry.io/otel v1.29.0 // indirect + go.opentelemetry.io/otel v1.30.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.5.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.29.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/otlptrace v1.29.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.51.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.5.0 // indirect - go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0 // indirect + go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.30.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.29.0 // indirect go.opentelemetry.io/otel/log v0.5.0 // indirect - go.opentelemetry.io/otel/metric v1.29.0 // indirect - go.opentelemetry.io/otel/sdk v1.29.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/log v0.5.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.29.0 // indirect - go.opentelemetry.io/otel/trace v1.29.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect + go.opentelemetry.io/otel/trace v1.30.0 // indirect go.opentelemetry.io/proto/otlp v1.3.1 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.24.0 // indirect - golang.org/x/text v0.17.0 // indirect + golang.org/x/net v0.29.0 // indirect + golang.org/x/sys v0.25.0 // indirect + golang.org/x/text v0.18.0 // indirect gonum.org/v1/gonum v0.15.1 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd // indirect - google.golang.org/grpc v1.65.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/grpc v1.66.1 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) @@ -196,6 +197,8 @@ replace go.opentelemetry.io/collector/component/componentprofiles => ../../compo 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 replace go.opentelemetry.io/collector/processor/processorprofiles => ../../processor/processorprofiles diff --git a/internal/e2e/go.sum b/internal/e2e/go.sum index 56800cc627d..3cd8eb87d26 100644 --- a/internal/e2e/go.sum +++ b/internal/e2e/go.sum @@ -71,20 +71,20 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= -github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg= -github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= +github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.56.0 h1:UffReloqkBtvtQEYDg2s+uDPGRrJyC6vZWPGXf6OhPY= -github.com/prometheus/common v0.56.0/go.mod h1:7uRPFSUTbfZWsJ7MHY56sqt7hLQu3bxXHDnNhl8E9qI= +github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= +github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= -github.com/rs/cors v1.11.0 h1:0B9GE/r9Bc2UxRMMtymBkHTenPkHDv0CW4Y98GBY+po= -github.com/rs/cors v1.11.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= -github.com/shirou/gopsutil/v4 v4.24.7 h1:V9UGTK4gQ8HvcnPKf6Zt3XHyQq/peaekfxpJ2HSocJk= -github.com/shirou/gopsutil/v4 v4.24.7/go.mod h1:0uW/073rP7FYLOkvxolUQM5rMOLTNmRXnFKafpb71rw= +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.8 h1:pVQjIenQkIhqO81mwTaXjTzOMT7d3TZkf43PlVFHENI= +github.com/shirou/gopsutil/v4 v4.24.8/go.mod h1:wE0OrJtj4dG+hYkxqDH3QiBICdKSf04/npcvLLc/oRg= github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= @@ -111,40 +111,40 @@ go.opentelemetry.io/contrib/propagators/b3 v1.29.0 h1:hNjyoRsAACnhoOLWupItUjABze go.opentelemetry.io/contrib/propagators/b3 v1.29.0/go.mod h1:E76MTitU1Niwo5NSN+mVxkyLu4h4h7Dp/yh38F2WuIU= go.opentelemetry.io/contrib/zpages v0.54.0 h1:tSfm/LEK5E46sd5qx/Y9o4iQ65ipLubV0Una7veXFlA= go.opentelemetry.io/contrib/zpages v0.54.0/go.mod h1:sbe4/RH3CFKkdM5zuGwfziKjvkqUOK9hSgLFckiVZUI= -go.opentelemetry.io/otel v1.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= -go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= +go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= +go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.5.0 h1:4d++HQ+Ihdl+53zSjtsCUFDmNMju2FC9qFkUlTxPLqo= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.5.0/go.mod h1:mQX5dTO3Mh5ZF7bPKDkt5c/7C41u/SiDr9XgTpzXXn8= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.29.0 h1:k6fQVDQexDE+3jG2SfCQjnHS7OamcP73YMoxEVq5B6k= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.29.0/go.mod h1:t4BrYLHU450Zo9fnydWlIuswB1bm7rM8havDpWOJeDo= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.29.0 h1:xvhQxJ/C9+RTnAj5DpTg7LSM1vbbMTiXt7e9hsfqHNw= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.29.0/go.mod h1:Fcvs2Bz1jkDM+Wf5/ozBGmi3tQ/c9zPKLnsipnfhGAo= +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/otlptrace v1.29.0 h1:dIIDULZJpgdiHz5tXrTgKIMLkus6jEFa7x5SOKcyR7E= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0/go.mod h1:jlRVBe7+Z1wyxFSUs48L6OBQZ5JwH2Hg/Vbl+t9rAgI= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0 h1:nSiV3s7wiCam610XcLbYOmMfJxB9gO4uK3Xgv5gmTgg= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0/go.mod h1:hKn/e/Nmd19/x1gvIHwtOwVWM+VhuITSWip3JUDghj0= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0 h1:JAv0Jwtl01UFiyWZEMiJZBiTlv5A50zNs8lsthXqIio= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0/go.mod h1:QNKLmUEAq2QUbPQUfvw4fmv0bgbK7UlOSFCnXyfvSNc= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0 h1:G7uexXb/K3T+T9fNLCCKncweEtNEBMTO+46hKX5EdKw= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0/go.mod h1:v0mFe5Kk7woIh938mrZBJBmENYquyA0IICrlYm4Y0t4= +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/stdout/stdoutlog v0.5.0 h1:ThVXnEsdwNcxdBO+r96ci1xbF+PgNjwlk457VNuJODo= go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.5.0/go.mod h1:rHWcSmC4q2h3gje/yOq6sAOaq8+UHxN/Ru3BbmDXOfY= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0 h1:WDdP9acbMYjbKIyJUhTvtzj601sVJOqgWdUxSdR/Ysc= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0/go.mod h1:BLbf7zbNIONBLPwvFnwNHGj4zge8uTCM/UPIVW1Mq2I= +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/stdouttrace v1.29.0 h1:X3ZjNp36/WlkSYx0ul2jw4PtbNEDDeLskw3VPsrpYM0= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.29.0/go.mod h1:2uL/xnOXh0CHOBFCWXz5u1A4GXLiW+0IQIzVbeOEQ0U= go.opentelemetry.io/otel/log v0.5.0 h1:x1Pr6Y3gnXgl1iFBwtGy1W/mnzENoK0w0ZoaeOI3i30= go.opentelemetry.io/otel/log v0.5.0/go.mod h1:NU/ozXeGuOR5/mjCRXYbTC00NFJ3NYuraV/7O78F0rE= -go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= -go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= -go.opentelemetry.io/otel/sdk v1.29.0 h1:vkqKjk7gwhS8VaWb0POZKmIEDimRCMsopNYnriHyryo= -go.opentelemetry.io/otel/sdk v1.29.0/go.mod h1:pM8Dx5WKnvxLCb+8lG1PRNIDxu9g9b9g59Qr7hfAAok= +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/log v0.5.0 h1:A+9lSjlZGxkQOr7QSBJcuyyYBw79CufQ69saiJLey7o= go.opentelemetry.io/otel/sdk/log v0.5.0/go.mod h1:zjxIW7sw1IHolZL2KlSAtrUi8JHttoeiQy43Yl3WuVQ= -go.opentelemetry.io/otel/sdk/metric v1.29.0 h1:K2CfmJohnRgvZ9UAj2/FhIf/okdWcNdBwe1m8xFXiSY= -go.opentelemetry.io/otel/sdk/metric v1.29.0/go.mod h1:6zZLdCl2fkauYoZIOn/soQIDSWFmNSRcICarHfuhNJQ= -go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= -go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= +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/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= @@ -164,8 +164,8 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= -golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= +golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= +golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -176,12 +176,12 @@ 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.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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= -golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -192,12 +192,12 @@ 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-20240822170219-fc7c04adadcd h1:BBOTEWLuuEGQy9n1y9MhVJ9Qt0BDu21X8qZs71/uPZo= -google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:fO8wJzT2zbQbAjbIoos1285VfEIYKDDY+Dt+WpTkh6g= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd h1:6TEm2ZxXoQmFWFlt1vNxvVOa1Q0dXFQD1m/rYjXmS0E= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +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/grpc v1.66.1 h1:hO5qAXR19+/Z44hmvIM4dQFMSYX9XcWsByfoxutBpAM= +google.golang.org/grpc v1.66.1/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= 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= diff --git a/internal/e2e/status_test.go b/internal/e2e/status_test.go index 3d886d5c999..617f03b6138 100644 --- a/internal/e2e/status_test.go +++ b/internal/e2e/status_test.go @@ -35,6 +35,8 @@ import ( var nopType = component.MustNewType("nop") +var wg = sync.WaitGroup{} + func Test_ComponentStatusReporting_SharedInstance(t *testing.T) { eventsReceived := make(map[*componentstatus.InstanceID][]*componentstatus.Event) exporterFactory := exportertest.NewNopFactory() @@ -112,13 +114,14 @@ func Test_ComponentStatusReporting_SharedInstance(t *testing.T) { s, err := service.New(context.Background(), set, cfg) require.NoError(t, err) + wg.Add(1) err = s.Start(context.Background()) require.NoError(t, err) - time.Sleep(15 * time.Second) + wg.Wait() err = s.Shutdown(context.Background()) require.NoError(t, err) - require.Equal(t, 2, len(eventsReceived)) + require.Len(t, eventsReceived, 2) for instanceID, events := range eventsReceived { pipelineIDs := "" @@ -170,6 +173,7 @@ func (t *testReceiver) Start(_ context.Context, host component.Host) error { componentstatus.ReportStatus(host, componentstatus.NewRecoverableErrorEvent(errors.New("test recoverable error"))) go func() { componentstatus.ReportStatus(host, componentstatus.NewEvent(componentstatus.StatusOK)) + wg.Done() }() return nil } @@ -246,7 +250,6 @@ func createExtension(_ context.Context, _ extension.Settings, cfg component.Conf type testExtension struct { eventsReceived map[*componentstatus.InstanceID][]*componentstatus.Event - lock sync.Mutex } type extensionConfig struct { @@ -272,24 +275,22 @@ func (t *testExtension) ComponentStatusChanged( source *componentstatus.InstanceID, event *componentstatus.Event, ) { - t.lock.Lock() - defer t.lock.Unlock() if source.ComponentID() == component.NewID(component.MustNewType("test")) { t.eventsReceived[source] = append(t.eventsReceived[source], event) } } -// NotifyConfig implements the extension.ConfigWatcher interface. +// NotifyConfig implements the extensioncapabilities.ConfigWatcher interface. func (t *testExtension) NotifyConfig(_ context.Context, _ *confmap.Conf) error { return nil } -// Ready implements the extension.PipelineWatcher interface. +// Ready implements the extensioncapabilities.PipelineWatcher interface. func (t *testExtension) Ready() error { return nil } -// NotReady implements the extension.PipelineWatcher interface. +// NotReady implements the extensioncapabilities.PipelineWatcher interface. func (t *testExtension) NotReady() error { return nil } diff --git a/internal/fanoutconsumer/logs_test.go b/internal/fanoutconsumer/logs_test.go index c1b91a7a4e8..b7b4d510b4e 100644 --- a/internal/fanoutconsumer/logs_test.go +++ b/internal/fanoutconsumer/logs_test.go @@ -44,18 +44,18 @@ func TestLogsMultiplexingNonMutating(t *testing.T) { } } - assert.True(t, ld == p1.AllLogs()[0]) - assert.True(t, ld == p1.AllLogs()[1]) + assert.Equal(t, ld, p1.AllLogs()[0]) + assert.Equal(t, ld, p1.AllLogs()[1]) assert.EqualValues(t, ld, p1.AllLogs()[0]) assert.EqualValues(t, ld, p1.AllLogs()[1]) - assert.True(t, ld == p2.AllLogs()[0]) - assert.True(t, ld == p2.AllLogs()[1]) + assert.Equal(t, ld, p2.AllLogs()[0]) + assert.Equal(t, ld, p2.AllLogs()[1]) assert.EqualValues(t, ld, p2.AllLogs()[0]) assert.EqualValues(t, ld, p2.AllLogs()[1]) - assert.True(t, ld == p3.AllLogs()[0]) - assert.True(t, ld == p3.AllLogs()[1]) + assert.Equal(t, ld, p3.AllLogs()[0]) + assert.Equal(t, ld, p3.AllLogs()[1]) assert.EqualValues(t, ld, p3.AllLogs()[0]) assert.EqualValues(t, ld, p3.AllLogs()[1]) @@ -80,19 +80,19 @@ func TestLogsMultiplexingMutating(t *testing.T) { } } - assert.True(t, ld != p1.AllLogs()[0]) - assert.True(t, ld != p1.AllLogs()[1]) + assert.NotSame(t, ld, p1.AllLogs()[0]) + assert.NotSame(t, ld, p1.AllLogs()[1]) assert.EqualValues(t, ld, p1.AllLogs()[0]) assert.EqualValues(t, ld, p1.AllLogs()[1]) - assert.True(t, ld != p2.AllLogs()[0]) - assert.True(t, ld != p2.AllLogs()[1]) + assert.NotSame(t, ld, p2.AllLogs()[0]) + assert.NotSame(t, ld, p2.AllLogs()[1]) assert.EqualValues(t, ld, p2.AllLogs()[0]) assert.EqualValues(t, ld, p2.AllLogs()[1]) // For this consumer, will receive the initial data. - assert.True(t, ld == p3.AllLogs()[0]) - assert.True(t, ld == p3.AllLogs()[1]) + assert.Equal(t, ld, p3.AllLogs()[0]) + assert.Equal(t, ld, p3.AllLogs()[1]) assert.EqualValues(t, ld, p3.AllLogs()[0]) assert.EqualValues(t, ld, p3.AllLogs()[1]) @@ -121,18 +121,18 @@ func TestReadOnlyLogsMultiplexingMutating(t *testing.T) { // All consumers should receive the cloned data. - assert.True(t, ld != p1.AllLogs()[0]) - assert.True(t, ld != p1.AllLogs()[1]) + assert.NotEqual(t, ld, p1.AllLogs()[0]) + assert.NotEqual(t, ld, p1.AllLogs()[1]) assert.EqualValues(t, ldOrig, p1.AllLogs()[0]) assert.EqualValues(t, ldOrig, p1.AllLogs()[1]) - assert.True(t, ld != p2.AllLogs()[0]) - assert.True(t, ld != p2.AllLogs()[1]) + assert.NotEqual(t, ld, p2.AllLogs()[0]) + assert.NotEqual(t, ld, p2.AllLogs()[1]) assert.EqualValues(t, ldOrig, p2.AllLogs()[0]) assert.EqualValues(t, ldOrig, p2.AllLogs()[1]) - assert.True(t, ld != p3.AllLogs()[0]) - assert.True(t, ld != p3.AllLogs()[1]) + assert.NotEqual(t, ld, p3.AllLogs()[0]) + assert.NotEqual(t, ld, p3.AllLogs()[1]) assert.EqualValues(t, ldOrig, p3.AllLogs()[0]) assert.EqualValues(t, ldOrig, p3.AllLogs()[1]) } @@ -154,20 +154,20 @@ func TestLogsMultiplexingMixLastMutating(t *testing.T) { } } - assert.True(t, ld != p1.AllLogs()[0]) - assert.True(t, ld != p1.AllLogs()[1]) + assert.NotSame(t, ld, p1.AllLogs()[0]) + assert.NotSame(t, ld, p1.AllLogs()[1]) assert.EqualValues(t, ld, p1.AllLogs()[0]) assert.EqualValues(t, ld, p1.AllLogs()[1]) // For this consumer, will receive the initial data. - assert.True(t, ld == p2.AllLogs()[0]) - assert.True(t, ld == p2.AllLogs()[1]) + assert.Equal(t, ld, p2.AllLogs()[0]) + assert.Equal(t, ld, p2.AllLogs()[1]) assert.EqualValues(t, ld, p2.AllLogs()[0]) assert.EqualValues(t, ld, p2.AllLogs()[1]) // For this consumer, will clone the initial data. - assert.True(t, ld != p3.AllLogs()[0]) - assert.True(t, ld != p3.AllLogs()[1]) + assert.NotSame(t, ld, p3.AllLogs()[0]) + assert.NotSame(t, ld, p3.AllLogs()[1]) assert.EqualValues(t, ld, p3.AllLogs()[0]) assert.EqualValues(t, ld, p3.AllLogs()[1]) @@ -192,19 +192,19 @@ func TestLogsMultiplexingMixLastNonMutating(t *testing.T) { } } - assert.True(t, ld != p1.AllLogs()[0]) - assert.True(t, ld != p1.AllLogs()[1]) + assert.NotSame(t, ld, p1.AllLogs()[0]) + assert.NotSame(t, ld, p1.AllLogs()[1]) assert.EqualValues(t, ld, p1.AllLogs()[0]) assert.EqualValues(t, ld, p1.AllLogs()[1]) - assert.True(t, ld != p2.AllLogs()[0]) - assert.True(t, ld != p2.AllLogs()[1]) + assert.NotSame(t, ld, p2.AllLogs()[0]) + assert.NotSame(t, ld, p2.AllLogs()[1]) assert.EqualValues(t, ld, p2.AllLogs()[0]) assert.EqualValues(t, ld, p2.AllLogs()[1]) // For this consumer, will receive the initial data. - assert.True(t, ld == p3.AllLogs()[0]) - assert.True(t, ld == p3.AllLogs()[1]) + assert.Equal(t, ld, p3.AllLogs()[0]) + assert.Equal(t, ld, p3.AllLogs()[1]) assert.EqualValues(t, ld, p3.AllLogs()[0]) assert.EqualValues(t, ld, p3.AllLogs()[1]) @@ -224,8 +224,8 @@ func TestLogsWhenErrors(t *testing.T) { assert.Error(t, lfc.ConsumeLogs(context.Background(), ld)) } - assert.True(t, ld == p3.AllLogs()[0]) - assert.True(t, ld == p3.AllLogs()[1]) + assert.Equal(t, ld, p3.AllLogs()[0]) + assert.Equal(t, ld, p3.AllLogs()[1]) assert.EqualValues(t, ld, p3.AllLogs()[0]) assert.EqualValues(t, ld, p3.AllLogs()[1]) } diff --git a/internal/fanoutconsumer/metrics_test.go b/internal/fanoutconsumer/metrics_test.go index 51e00791a76..2dad5e7ff26 100644 --- a/internal/fanoutconsumer/metrics_test.go +++ b/internal/fanoutconsumer/metrics_test.go @@ -44,18 +44,18 @@ func TestMetricsMultiplexingNonMutating(t *testing.T) { } } - assert.True(t, md == p1.AllMetrics()[0]) - assert.True(t, md == p1.AllMetrics()[1]) + assert.Equal(t, md, p1.AllMetrics()[0]) + assert.Equal(t, md, p1.AllMetrics()[1]) assert.EqualValues(t, md, p1.AllMetrics()[0]) assert.EqualValues(t, md, p1.AllMetrics()[1]) - assert.True(t, md == p2.AllMetrics()[0]) - assert.True(t, md == p2.AllMetrics()[1]) + assert.Equal(t, md, p2.AllMetrics()[0]) + assert.Equal(t, md, p2.AllMetrics()[1]) assert.EqualValues(t, md, p2.AllMetrics()[0]) assert.EqualValues(t, md, p2.AllMetrics()[1]) - assert.True(t, md == p3.AllMetrics()[0]) - assert.True(t, md == p3.AllMetrics()[1]) + assert.Equal(t, md, p3.AllMetrics()[0]) + assert.Equal(t, md, p3.AllMetrics()[1]) assert.EqualValues(t, md, p3.AllMetrics()[0]) assert.EqualValues(t, md, p3.AllMetrics()[1]) @@ -80,19 +80,19 @@ func TestMetricsMultiplexingMutating(t *testing.T) { } } - assert.True(t, md != p1.AllMetrics()[0]) - assert.True(t, md != p1.AllMetrics()[1]) + assert.NotSame(t, md, p1.AllMetrics()[0]) + assert.NotSame(t, md, p1.AllMetrics()[1]) assert.EqualValues(t, md, p1.AllMetrics()[0]) assert.EqualValues(t, md, p1.AllMetrics()[1]) - assert.True(t, md != p2.AllMetrics()[0]) - assert.True(t, md != p2.AllMetrics()[1]) + assert.NotSame(t, md, p2.AllMetrics()[0]) + assert.NotSame(t, md, p2.AllMetrics()[1]) assert.EqualValues(t, md, p2.AllMetrics()[0]) assert.EqualValues(t, md, p2.AllMetrics()[1]) // For this consumer, will receive the initial data. - assert.True(t, md == p3.AllMetrics()[0]) - assert.True(t, md == p3.AllMetrics()[1]) + assert.Equal(t, md, p3.AllMetrics()[0]) + assert.Equal(t, md, p3.AllMetrics()[1]) assert.EqualValues(t, md, p3.AllMetrics()[0]) assert.EqualValues(t, md, p3.AllMetrics()[1]) @@ -121,18 +121,18 @@ func TestReadOnlyMetricsMultiplexingMixFirstMutating(t *testing.T) { // All consumers should receive the cloned data. - assert.True(t, md != p1.AllMetrics()[0]) - assert.True(t, md != p1.AllMetrics()[1]) + assert.NotEqual(t, md, p1.AllMetrics()[0]) + assert.NotEqual(t, md, p1.AllMetrics()[1]) assert.EqualValues(t, mdOrig, p1.AllMetrics()[0]) assert.EqualValues(t, mdOrig, p1.AllMetrics()[1]) - assert.True(t, md != p2.AllMetrics()[0]) - assert.True(t, md != p2.AllMetrics()[1]) + assert.NotEqual(t, md, p2.AllMetrics()[0]) + assert.NotEqual(t, md, p2.AllMetrics()[1]) assert.EqualValues(t, mdOrig, p2.AllMetrics()[0]) assert.EqualValues(t, mdOrig, p2.AllMetrics()[1]) - assert.True(t, md != p3.AllMetrics()[0]) - assert.True(t, md != p3.AllMetrics()[1]) + assert.NotEqual(t, md, p3.AllMetrics()[0]) + assert.NotEqual(t, md, p3.AllMetrics()[1]) assert.EqualValues(t, mdOrig, p3.AllMetrics()[0]) assert.EqualValues(t, mdOrig, p3.AllMetrics()[1]) } @@ -154,20 +154,20 @@ func TestMetricsMultiplexingMixLastMutating(t *testing.T) { } } - assert.True(t, md != p1.AllMetrics()[0]) - assert.True(t, md != p1.AllMetrics()[1]) + assert.NotSame(t, md, p1.AllMetrics()[0]) + assert.NotSame(t, md, p1.AllMetrics()[1]) assert.EqualValues(t, md, p1.AllMetrics()[0]) assert.EqualValues(t, md, p1.AllMetrics()[1]) // For this consumer, will receive the initial data. - assert.True(t, md == p2.AllMetrics()[0]) - assert.True(t, md == p2.AllMetrics()[1]) + assert.Equal(t, md, p2.AllMetrics()[0]) + assert.Equal(t, md, p2.AllMetrics()[1]) assert.EqualValues(t, md, p2.AllMetrics()[0]) assert.EqualValues(t, md, p2.AllMetrics()[1]) // For this consumer, will clone the initial data. - assert.True(t, md != p3.AllMetrics()[0]) - assert.True(t, md != p3.AllMetrics()[1]) + assert.NotSame(t, md, p3.AllMetrics()[0]) + assert.NotSame(t, md, p3.AllMetrics()[1]) assert.EqualValues(t, md, p3.AllMetrics()[0]) assert.EqualValues(t, md, p3.AllMetrics()[1]) @@ -192,19 +192,19 @@ func TestMetricsMultiplexingMixLastNonMutating(t *testing.T) { } } - assert.True(t, md != p1.AllMetrics()[0]) - assert.True(t, md != p1.AllMetrics()[1]) + assert.NotSame(t, md, p1.AllMetrics()[0]) + assert.NotSame(t, md, p1.AllMetrics()[1]) assert.EqualValues(t, md, p1.AllMetrics()[0]) assert.EqualValues(t, md, p1.AllMetrics()[1]) - assert.True(t, md != p2.AllMetrics()[0]) - assert.True(t, md != p2.AllMetrics()[1]) + assert.NotSame(t, md, p2.AllMetrics()[0]) + assert.NotSame(t, md, p2.AllMetrics()[1]) assert.EqualValues(t, md, p2.AllMetrics()[0]) assert.EqualValues(t, md, p2.AllMetrics()[1]) // For this consumer, will receive the initial data. - assert.True(t, md == p3.AllMetrics()[0]) - assert.True(t, md == p3.AllMetrics()[1]) + assert.Equal(t, md, p3.AllMetrics()[0]) + assert.Equal(t, md, p3.AllMetrics()[1]) assert.EqualValues(t, md, p3.AllMetrics()[0]) assert.EqualValues(t, md, p3.AllMetrics()[1]) @@ -224,8 +224,8 @@ func TestMetricsWhenErrors(t *testing.T) { assert.Error(t, mfc.ConsumeMetrics(context.Background(), md)) } - assert.True(t, md == p3.AllMetrics()[0]) - assert.True(t, md == p3.AllMetrics()[1]) + assert.Equal(t, md, p3.AllMetrics()[0]) + assert.Equal(t, md, p3.AllMetrics()[1]) assert.EqualValues(t, md, p3.AllMetrics()[0]) assert.EqualValues(t, md, p3.AllMetrics()[1]) } diff --git a/internal/fanoutconsumer/profiles_test.go b/internal/fanoutconsumer/profiles_test.go index 0f108239f5d..82915124194 100644 --- a/internal/fanoutconsumer/profiles_test.go +++ b/internal/fanoutconsumer/profiles_test.go @@ -45,18 +45,18 @@ func TestProfilesMultiplexingNonMutating(t *testing.T) { } } - assert.True(t, td == p1.AllProfiles()[0]) - assert.True(t, td == p1.AllProfiles()[1]) + assert.Equal(t, td, p1.AllProfiles()[0]) + assert.Equal(t, td, p1.AllProfiles()[1]) assert.EqualValues(t, td, p1.AllProfiles()[0]) assert.EqualValues(t, td, p1.AllProfiles()[1]) - assert.True(t, td == p2.AllProfiles()[0]) - assert.True(t, td == p2.AllProfiles()[1]) + assert.Equal(t, td, p2.AllProfiles()[0]) + assert.Equal(t, td, p2.AllProfiles()[1]) assert.EqualValues(t, td, p2.AllProfiles()[0]) assert.EqualValues(t, td, p2.AllProfiles()[1]) - assert.True(t, td == p3.AllProfiles()[0]) - assert.True(t, td == p3.AllProfiles()[1]) + assert.Equal(t, td, p3.AllProfiles()[0]) + assert.Equal(t, td, p3.AllProfiles()[1]) assert.EqualValues(t, td, p3.AllProfiles()[0]) assert.EqualValues(t, td, p3.AllProfiles()[1]) @@ -81,19 +81,19 @@ func TestProfilesMultiplexingMutating(t *testing.T) { } } - assert.True(t, td != p1.AllProfiles()[0]) - assert.True(t, td != p1.AllProfiles()[1]) + assert.NotSame(t, td, p1.AllProfiles()[0]) + assert.NotSame(t, td, p1.AllProfiles()[1]) assert.EqualValues(t, td, p1.AllProfiles()[0]) assert.EqualValues(t, td, p1.AllProfiles()[1]) - assert.True(t, td != p2.AllProfiles()[0]) - assert.True(t, td != p2.AllProfiles()[1]) + assert.NotSame(t, td, p2.AllProfiles()[0]) + assert.NotSame(t, td, p2.AllProfiles()[1]) assert.EqualValues(t, td, p2.AllProfiles()[0]) assert.EqualValues(t, td, p2.AllProfiles()[1]) // For this consumer, will receive the initial data. - assert.True(t, td == p3.AllProfiles()[0]) - assert.True(t, td == p3.AllProfiles()[1]) + assert.Equal(t, td, p3.AllProfiles()[0]) + assert.Equal(t, td, p3.AllProfiles()[1]) assert.EqualValues(t, td, p3.AllProfiles()[0]) assert.EqualValues(t, td, p3.AllProfiles()[1]) @@ -123,18 +123,18 @@ func TestReadOnlyProfilesMultiplexingMutating(t *testing.T) { // All consumers should receive the cloned data. - assert.True(t, td != p1.AllProfiles()[0]) - assert.True(t, td != p1.AllProfiles()[1]) + assert.NotEqual(t, td, p1.AllProfiles()[0]) + assert.NotEqual(t, td, p1.AllProfiles()[1]) assert.EqualValues(t, tdOrig, p1.AllProfiles()[0]) assert.EqualValues(t, tdOrig, p1.AllProfiles()[1]) - assert.True(t, td != p2.AllProfiles()[0]) - assert.True(t, td != p2.AllProfiles()[1]) + assert.NotEqual(t, td, p2.AllProfiles()[0]) + assert.NotEqual(t, td, p2.AllProfiles()[1]) assert.EqualValues(t, tdOrig, p2.AllProfiles()[0]) assert.EqualValues(t, tdOrig, p2.AllProfiles()[1]) - assert.True(t, td != p3.AllProfiles()[0]) - assert.True(t, td != p3.AllProfiles()[1]) + assert.NotEqual(t, td, p3.AllProfiles()[0]) + assert.NotEqual(t, td, p3.AllProfiles()[1]) assert.EqualValues(t, tdOrig, p3.AllProfiles()[0]) assert.EqualValues(t, tdOrig, p3.AllProfiles()[1]) } @@ -156,20 +156,20 @@ func TestProfilesMultiplexingMixLastMutating(t *testing.T) { } } - assert.True(t, td != p1.AllProfiles()[0]) - assert.True(t, td != p1.AllProfiles()[1]) + assert.NotSame(t, td, p1.AllProfiles()[0]) + assert.NotSame(t, td, p1.AllProfiles()[1]) assert.EqualValues(t, td, p1.AllProfiles()[0]) assert.EqualValues(t, td, p1.AllProfiles()[1]) // For this consumer, will receive the initial data. - assert.True(t, td == p2.AllProfiles()[0]) - assert.True(t, td == p2.AllProfiles()[1]) + assert.Equal(t, td, p2.AllProfiles()[0]) + assert.Equal(t, td, p2.AllProfiles()[1]) assert.EqualValues(t, td, p2.AllProfiles()[0]) assert.EqualValues(t, td, p2.AllProfiles()[1]) // For this consumer, will clone the initial data. - assert.True(t, td != p3.AllProfiles()[0]) - assert.True(t, td != p3.AllProfiles()[1]) + assert.NotSame(t, td, p3.AllProfiles()[0]) + assert.NotSame(t, td, p3.AllProfiles()[1]) assert.EqualValues(t, td, p3.AllProfiles()[0]) assert.EqualValues(t, td, p3.AllProfiles()[1]) @@ -194,19 +194,19 @@ func TestProfilesMultiplexingMixLastNonMutating(t *testing.T) { } } - assert.True(t, td != p1.AllProfiles()[0]) - assert.True(t, td != p1.AllProfiles()[1]) + assert.NotSame(t, td, p1.AllProfiles()[0]) + assert.NotSame(t, td, p1.AllProfiles()[1]) assert.EqualValues(t, td, p1.AllProfiles()[0]) assert.EqualValues(t, td, p1.AllProfiles()[1]) - assert.True(t, td != p2.AllProfiles()[0]) - assert.True(t, td != p2.AllProfiles()[1]) + assert.NotSame(t, td, p2.AllProfiles()[0]) + assert.NotSame(t, td, p2.AllProfiles()[1]) assert.EqualValues(t, td, p2.AllProfiles()[0]) assert.EqualValues(t, td, p2.AllProfiles()[1]) // For this consumer, will receive the initial data. - assert.True(t, td == p3.AllProfiles()[0]) - assert.True(t, td == p3.AllProfiles()[1]) + assert.Equal(t, td, p3.AllProfiles()[0]) + assert.Equal(t, td, p3.AllProfiles()[1]) assert.EqualValues(t, td, p3.AllProfiles()[0]) assert.EqualValues(t, td, p3.AllProfiles()[1]) @@ -226,8 +226,8 @@ func TestProfilesWhenErrors(t *testing.T) { assert.Error(t, tfc.ConsumeProfiles(context.Background(), td)) } - assert.True(t, td == p3.AllProfiles()[0]) - assert.True(t, td == p3.AllProfiles()[1]) + assert.Equal(t, td, p3.AllProfiles()[0]) + assert.Equal(t, td, p3.AllProfiles()[1]) assert.EqualValues(t, td, p3.AllProfiles()[0]) assert.EqualValues(t, td, p3.AllProfiles()[1]) } diff --git a/internal/fanoutconsumer/traces_test.go b/internal/fanoutconsumer/traces_test.go index 829e4cd9069..b17e674c46e 100644 --- a/internal/fanoutconsumer/traces_test.go +++ b/internal/fanoutconsumer/traces_test.go @@ -44,18 +44,18 @@ func TestTracesMultiplexingNonMutating(t *testing.T) { } } - assert.True(t, td == p1.AllTraces()[0]) - assert.True(t, td == p1.AllTraces()[1]) + assert.Equal(t, td, p1.AllTraces()[0]) + assert.Equal(t, td, p1.AllTraces()[1]) assert.EqualValues(t, td, p1.AllTraces()[0]) assert.EqualValues(t, td, p1.AllTraces()[1]) - assert.True(t, td == p2.AllTraces()[0]) - assert.True(t, td == p2.AllTraces()[1]) + assert.Equal(t, td, p2.AllTraces()[0]) + assert.Equal(t, td, p2.AllTraces()[1]) assert.EqualValues(t, td, p2.AllTraces()[0]) assert.EqualValues(t, td, p2.AllTraces()[1]) - assert.True(t, td == p3.AllTraces()[0]) - assert.True(t, td == p3.AllTraces()[1]) + assert.Equal(t, td, p3.AllTraces()[0]) + assert.Equal(t, td, p3.AllTraces()[1]) assert.EqualValues(t, td, p3.AllTraces()[0]) assert.EqualValues(t, td, p3.AllTraces()[1]) @@ -80,19 +80,19 @@ func TestTracesMultiplexingMutating(t *testing.T) { } } - assert.True(t, td != p1.AllTraces()[0]) - assert.True(t, td != p1.AllTraces()[1]) + assert.NotSame(t, td, p1.AllTraces()[0]) + assert.NotSame(t, td, p1.AllTraces()[1]) assert.EqualValues(t, td, p1.AllTraces()[0]) assert.EqualValues(t, td, p1.AllTraces()[1]) - assert.True(t, td != p2.AllTraces()[0]) - assert.True(t, td != p2.AllTraces()[1]) + assert.NotSame(t, td, p2.AllTraces()[0]) + assert.NotSame(t, td, p2.AllTraces()[1]) assert.EqualValues(t, td, p2.AllTraces()[0]) assert.EqualValues(t, td, p2.AllTraces()[1]) // For this consumer, will receive the initial data. - assert.True(t, td == p3.AllTraces()[0]) - assert.True(t, td == p3.AllTraces()[1]) + assert.Equal(t, td, p3.AllTraces()[0]) + assert.Equal(t, td, p3.AllTraces()[1]) assert.EqualValues(t, td, p3.AllTraces()[0]) assert.EqualValues(t, td, p3.AllTraces()[1]) @@ -122,18 +122,18 @@ func TestReadOnlyTracesMultiplexingMutating(t *testing.T) { // All consumers should receive the cloned data. - assert.True(t, td != p1.AllTraces()[0]) - assert.True(t, td != p1.AllTraces()[1]) + assert.NotEqual(t, td, p1.AllTraces()[0]) + assert.NotEqual(t, td, p1.AllTraces()[1]) assert.EqualValues(t, tdOrig, p1.AllTraces()[0]) assert.EqualValues(t, tdOrig, p1.AllTraces()[1]) - assert.True(t, td != p2.AllTraces()[0]) - assert.True(t, td != p2.AllTraces()[1]) + assert.NotEqual(t, td, p2.AllTraces()[0]) + assert.NotEqual(t, td, p2.AllTraces()[1]) assert.EqualValues(t, tdOrig, p2.AllTraces()[0]) assert.EqualValues(t, tdOrig, p2.AllTraces()[1]) - assert.True(t, td != p3.AllTraces()[0]) - assert.True(t, td != p3.AllTraces()[1]) + assert.NotEqual(t, td, p3.AllTraces()[0]) + assert.NotEqual(t, td, p3.AllTraces()[1]) assert.EqualValues(t, tdOrig, p3.AllTraces()[0]) assert.EqualValues(t, tdOrig, p3.AllTraces()[1]) } @@ -155,20 +155,20 @@ func TestTracesMultiplexingMixLastMutating(t *testing.T) { } } - assert.True(t, td != p1.AllTraces()[0]) - assert.True(t, td != p1.AllTraces()[1]) + assert.NotSame(t, td, p1.AllTraces()[0]) + assert.NotSame(t, td, p1.AllTraces()[1]) assert.EqualValues(t, td, p1.AllTraces()[0]) assert.EqualValues(t, td, p1.AllTraces()[1]) // For this consumer, will receive the initial data. - assert.True(t, td == p2.AllTraces()[0]) - assert.True(t, td == p2.AllTraces()[1]) + assert.Equal(t, td, p2.AllTraces()[0]) + assert.Equal(t, td, p2.AllTraces()[1]) assert.EqualValues(t, td, p2.AllTraces()[0]) assert.EqualValues(t, td, p2.AllTraces()[1]) // For this consumer, will clone the initial data. - assert.True(t, td != p3.AllTraces()[0]) - assert.True(t, td != p3.AllTraces()[1]) + assert.NotSame(t, td, p3.AllTraces()[0]) + assert.NotSame(t, td, p3.AllTraces()[1]) assert.EqualValues(t, td, p3.AllTraces()[0]) assert.EqualValues(t, td, p3.AllTraces()[1]) @@ -193,19 +193,19 @@ func TestTracesMultiplexingMixLastNonMutating(t *testing.T) { } } - assert.True(t, td != p1.AllTraces()[0]) - assert.True(t, td != p1.AllTraces()[1]) + assert.NotSame(t, td, p1.AllTraces()[0]) + assert.NotSame(t, td, p1.AllTraces()[1]) assert.EqualValues(t, td, p1.AllTraces()[0]) assert.EqualValues(t, td, p1.AllTraces()[1]) - assert.True(t, td != p2.AllTraces()[0]) - assert.True(t, td != p2.AllTraces()[1]) + assert.NotSame(t, td, p2.AllTraces()[0]) + assert.NotSame(t, td, p2.AllTraces()[1]) assert.EqualValues(t, td, p2.AllTraces()[0]) assert.EqualValues(t, td, p2.AllTraces()[1]) // For this consumer, will receive the initial data. - assert.True(t, td == p3.AllTraces()[0]) - assert.True(t, td == p3.AllTraces()[1]) + assert.Equal(t, td, p3.AllTraces()[0]) + assert.Equal(t, td, p3.AllTraces()[1]) assert.EqualValues(t, td, p3.AllTraces()[0]) assert.EqualValues(t, td, p3.AllTraces()[1]) @@ -225,8 +225,8 @@ func TestTracesWhenErrors(t *testing.T) { assert.Error(t, tfc.ConsumeTraces(context.Background(), td)) } - assert.True(t, td == p3.AllTraces()[0]) - assert.True(t, td == p3.AllTraces()[1]) + assert.Equal(t, td, p3.AllTraces()[0]) + assert.Equal(t, td, p3.AllTraces()[1]) assert.EqualValues(t, td, p3.AllTraces()[0]) assert.EqualValues(t, td, p3.AllTraces()[1]) } diff --git a/internal/globalgates/globalgates.go b/internal/globalgates/globalgates.go index 0f36ecad4ac..3a44f1fdb61 100644 --- a/internal/globalgates/globalgates.go +++ b/internal/globalgates/globalgates.go @@ -3,10 +3,46 @@ package globalgates // import "go.opentelemetry.io/collector/internal/globalgates" -import "go.opentelemetry.io/collector/featuregate" +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.")) + +const UseLocalHostAsDefaultHostID = "component.UseLocalHostAsDefaultHost" + +// UseLocalHostAsDefaultHostfeatureGate is the feature gate that controls whether +// server-like receivers and extensions such as the OTLP receiver use localhost as the default host for their endpoints. +var UseLocalHostAsDefaultHostfeatureGate = mustRegisterOrLoad( + featuregate.GlobalRegistry(), + UseLocalHostAsDefaultHostID, + featuregate.StageBeta, + 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 index 9d54cd990d1..66f58f46597 100644 --- a/internal/globalgates/go.mod +++ b/internal/globalgates/go.mod @@ -2,7 +2,7 @@ module go.opentelemetry.io/collector/internal/globalgates go 1.22.0 -require go.opentelemetry.io/collector/featuregate v1.14.1 +require go.opentelemetry.io/collector/featuregate v1.15.0 require ( github.com/hashicorp/go-version v1.7.0 // indirect diff --git a/internal/iruntime/mem_info_test.go b/internal/iruntime/mem_info_test.go index 863fbe14028..57d0d857e66 100644 --- a/internal/iruntime/mem_info_test.go +++ b/internal/iruntime/mem_info_test.go @@ -12,5 +12,5 @@ import ( func TestReadMemInfo(t *testing.T) { vmStat, err := readMemInfo() assert.NoError(t, err) - assert.True(t, vmStat > 0) + assert.Positive(t, vmStat) } diff --git a/internal/iruntime/total_memory_linux_test.go b/internal/iruntime/total_memory_linux_test.go index 563f3942207..3e05aee21d8 100644 --- a/internal/iruntime/total_memory_linux_test.go +++ b/internal/iruntime/total_memory_linux_test.go @@ -15,5 +15,5 @@ import ( func TestTotalMemory(t *testing.T) { totalMemory, err := TotalMemory() require.NoError(t, err) - assert.True(t, totalMemory > 0) + assert.Positive(t, totalMemory) } diff --git a/internal/iruntime/total_memory_other_test.go b/internal/iruntime/total_memory_other_test.go index 5b1d9115827..195dc1f196a 100644 --- a/internal/iruntime/total_memory_other_test.go +++ b/internal/iruntime/total_memory_other_test.go @@ -14,5 +14,5 @@ import ( func TestTotalMemory(t *testing.T) { totalMemory, err := TotalMemory() assert.NoError(t, err) - assert.True(t, totalMemory > 0) + assert.Positive(t, totalMemory) } diff --git a/internal/localhostgate/featuregate.go b/internal/localhostgate/featuregate.go deleted file mode 100644 index 568bbcdd786..00000000000 --- a/internal/localhostgate/featuregate.go +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -// package localhostgate defines a feature gate that controls whether server-like receivers and extensions use localhost as the default host for their endpoints. -// This package is duplicated across core and contrib to avoid exposing the feature gate as part of the public API. -// To do this we define a `registerOrLoad` helper and try to register the gate in both modules. -// IMPORTANT NOTE: ANY CHANGES TO THIS PACKAGE MUST BE MIRRORED IN THE CONTRIB COUNTERPART. -package localhostgate // import "go.opentelemetry.io/collector/internal/localhostgate" - -import ( - "errors" - "fmt" - - "go.uber.org/zap" - - "go.opentelemetry.io/collector/featuregate" -) - -const UseLocalHostAsDefaultHostID = "component.UseLocalHostAsDefaultHost" - -// UseLocalHostAsDefaultHostfeatureGate is the feature gate that controls whether -// server-like receivers and extensions such as the OTLP receiver use localhost as the default host for their endpoints. -var UseLocalHostAsDefaultHostfeatureGate = mustRegisterOrLoad( - featuregate.GlobalRegistry(), - UseLocalHostAsDefaultHostID, - featuregate.StageBeta, - 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 -} - -// EndpointForPort gets the endpoint for a given port using localhost or 0.0.0.0 depending on the feature gate. -func EndpointForPort(port int) string { - host := "localhost" - if !UseLocalHostAsDefaultHostfeatureGate.IsEnabled() { - host = "0.0.0.0" - } - return fmt.Sprintf("%s:%d", host, port) -} - -// LogAboutUseLocalHostAsDefault logs about the upcoming change from 0.0.0.0 to localhost on server-like components. -func LogAboutUseLocalHostAsDefault(logger *zap.Logger) { - if UseLocalHostAsDefaultHostfeatureGate.IsEnabled() { - logger.Info( - "The default endpoints for all servers in components have changed to use localhost instead of 0.0.0.0. Disable the feature gate to temporarily revert to the previous default.", - zap.String("feature gate ID", UseLocalHostAsDefaultHostID), - ) - } -} diff --git a/internal/localhostgate/featuregate_test.go b/internal/localhostgate/featuregate_test.go deleted file mode 100644 index bde051c4f15..00000000000 --- a/internal/localhostgate/featuregate_test.go +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package localhostgate - -import ( - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - "go.opentelemetry.io/collector/featuregate" -) - -func setFeatureGateForTest(t testing.TB, gate *featuregate.Gate, enabled bool) func() { - originalValue := gate.IsEnabled() - require.NoError(t, featuregate.GlobalRegistry().Set(gate.ID(), enabled)) - return func() { - require.NoError(t, featuregate.GlobalRegistry().Set(gate.ID(), originalValue)) - } -} - -func TestEndpointForPort(t *testing.T) { - tests := []struct { - port int - enabled bool - endpoint string - }{ - { - port: 4317, - enabled: false, - endpoint: "0.0.0.0:4317", - }, - { - port: 4317, - enabled: true, - endpoint: "localhost:4317", - }, - { - port: 0, - enabled: false, - endpoint: "0.0.0.0:0", - }, - { - port: 0, - enabled: true, - endpoint: "localhost:0", - }, - } - - for _, tt := range tests { - t.Run(tt.endpoint, func(t *testing.T) { - defer setFeatureGateForTest(t, UseLocalHostAsDefaultHostfeatureGate, tt.enabled)() - assert.Equal(t, EndpointForPort(tt.port), tt.endpoint) - }) - } -} diff --git a/internal/obsreportconfig/obsmetrics/obs_processor.go b/internal/obsreportconfig/obsmetrics/obs_processor.go deleted file mode 100644 index 3cbd8fc4a83..00000000000 --- a/internal/obsreportconfig/obsmetrics/obs_processor.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package obsmetrics // import "go.opentelemetry.io/collector/internal/obsreportconfig/obsmetrics" - -const ( - // ProcessorKey is the key used to identify processors in metrics and traces. - ProcessorKey = "processor" - - // DroppedSpansKey is the key used to identify spans dropped by the Collector. - DroppedSpansKey = "dropped_spans" - - // DroppedMetricPointsKey is the key used to identify metric points dropped by the Collector. - DroppedMetricPointsKey = "dropped_metric_points" - - // DroppedLogRecordsKey is the key used to identify log records dropped by the Collector. - DroppedLogRecordsKey = "dropped_log_records" -) - -var ( - ProcessorMetricPrefix = ProcessorKey + MetricNameSep -) diff --git a/internal/obsreportconfig/obsmetrics/obs_scraper.go b/internal/obsreportconfig/obsmetrics/obs_scraper.go deleted file mode 100644 index 4254891f33a..00000000000 --- a/internal/obsreportconfig/obsmetrics/obs_scraper.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package obsmetrics // import "go.opentelemetry.io/collector/internal/obsreportconfig/obsmetrics" - -const ( - // ScraperKey used to identify scrapers in metrics and traces. - ScraperKey = "scraper" - - // ScrapedMetricPointsKey used to identify metric points scraped by the - // Collector. - ScrapedMetricPointsKey = "scraped_metric_points" - // ErroredMetricPointsKey used to identify metric points errored (i.e. - // unable to be scraped) by the Collector. - ErroredMetricPointsKey = "errored_metric_points" -) - -const ( - ScraperPrefix = ScraperKey + SpanNameSep - ScraperMetricPrefix = ScraperKey + MetricNameSep - ScraperMetricsOperationSuffix = SpanNameSep + "MetricsScraped" -) diff --git a/internal/obsreportconfig/obsmetrics/obsmetrics.go b/internal/obsreportconfig/obsmetrics/obsmetrics.go deleted file mode 100644 index 02a49557c88..00000000000 --- a/internal/obsreportconfig/obsmetrics/obsmetrics.go +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -// Package obsmetrics defines the obsreport metrics for each components -package obsmetrics // import "go.opentelemetry.io/collector/internal/obsreportconfig/obsmetrics" - -const ( - SpanNameSep = "/" - MetricNameSep = "_" - Scope = "go.opentelemetry.io/collector/obsreport" -) diff --git a/internal/obsreportconfig/obsreportconfig.go b/internal/obsreportconfig/obsreportconfig.go deleted file mode 100644 index dc5d4915569..00000000000 --- a/internal/obsreportconfig/obsreportconfig.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package obsreportconfig // import "go.opentelemetry.io/collector/internal/obsreportconfig" - -import ( - "go.opentelemetry.io/collector/featuregate" -) - -// DisableHighCardinalityMetricsfeatureGate is the feature gate that controls whether the collector should enable -// potentially high cardinality metrics. The gate will be removed when the collector allows for view configuration. -var DisableHighCardinalityMetricsfeatureGate = featuregate.GlobalRegistry().MustRegister( - "telemetry.disableHighCardinalityMetrics", - featuregate.StageAlpha, - featuregate.WithRegisterDescription("controls whether the collector should enable potentially high"+ - "cardinality metrics. The gate will be removed when the collector allows for view configuration.")) - -// UseOtelWithSDKConfigurationForInternalTelemetryFeatureGate is the feature gate that controls whether the collector -// supports configuring the OpenTelemetry SDK via configuration -var UseOtelWithSDKConfigurationForInternalTelemetryFeatureGate = featuregate.GlobalRegistry().MustRegister( - "telemetry.useOtelWithSDKConfigurationForInternalTelemetry", - featuregate.StageAlpha, - featuregate.WithRegisterDescription("controls whether the collector supports extended OpenTelemetry"+ - "configuration for internal telemetry")) diff --git a/internal/sharedcomponent/sharedcomponent_test.go b/internal/sharedcomponent/sharedcomponent_test.go index 08841a62479..8b908f12586 100644 --- a/internal/sharedcomponent/sharedcomponent_test.go +++ b/internal/sharedcomponent/sharedcomponent_test.go @@ -26,12 +26,12 @@ type baseComponent struct { func TestNewMap(t *testing.T) { comps := NewMap[component.ID, *baseComponent]() - assert.Len(t, comps.components, 0) + assert.Empty(t, comps.components) } func TestNewSharedComponentsCreateError(t *testing.T) { comps := NewMap[component.ID, *baseComponent]() - assert.Len(t, comps.components, 0) + assert.Empty(t, comps.components) myErr := errors.New("my error") _, err := comps.LoadOrStore( id, @@ -39,7 +39,7 @@ func TestNewSharedComponentsCreateError(t *testing.T) { newNopTelemetrySettings(), ) assert.ErrorIs(t, err, myErr) - assert.Len(t, comps.components, 0) + assert.Empty(t, comps.components) } func TestSharedComponentsLoadOrStore(t *testing.T) { @@ -65,7 +65,7 @@ func TestSharedComponentsLoadOrStore(t *testing.T) { // Shutdown nop will remove assert.NoError(t, got.Shutdown(context.Background())) - assert.Len(t, comps.components, 0) + assert.Empty(t, comps.components) gotThird, err := comps.LoadOrStore( id, func() (*baseComponent, error) { return nop, nil }, @@ -200,7 +200,7 @@ func TestReportStatusOnStartShutdown(t *testing.T) { require.Equal(t, tc.shutdownErr, err) } - require.Equal(t, tc.expectedNumReporterInstances, len(reportedStatuses)) + require.Len(t, reportedStatuses, tc.expectedNumReporterInstances) for _, actualStatuses := range reportedStatuses { require.Equal(t, tc.expectedStatuses, actualStatuses) diff --git a/internal/testutil/testutil.go b/internal/testutil/testutil.go index 23f73b06a33..60980e840e7 100644 --- a/internal/testutil/testutil.go +++ b/internal/testutil/testutil.go @@ -8,13 +8,11 @@ import ( "net" "os/exec" "runtime" - "strconv" "strings" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.opentelemetry.io/contrib/config" ) type portpair struct { @@ -86,22 +84,6 @@ func GetAvailableLocalIPv6Address(t testing.TB) string { return endpoint } -func GetAvailableLocalAddressPrometheus(t testing.TB) *config.Prometheus { - address := GetAvailableLocalAddress(t) - host, port, err := net.SplitHostPort(address) - if err != nil { - return nil - } - portInt, err := strconv.Atoi(port) - if err != nil { - return nil - } - return &config.Prometheus{ - Host: &host, - Port: &portInt, - } -} - func findAvailableAddress(network string, t testing.TB) string { var host string switch network { @@ -149,14 +131,14 @@ func createExclusionsList(exclusionsText string, t testing.TB) []portpair { var exclusions []portpair parts := strings.Split(exclusionsText, "--------") - require.Equal(t, len(parts), 3) + require.Len(t, parts, 3) portsText := strings.Split(parts[2], "*") require.Greater(t, len(portsText), 1) // original text may have a suffix like " - Administered port exclusions." lines := strings.Split(portsText[0], "\n") for _, line := range lines { if strings.TrimSpace(line) != "" { entries := strings.Fields(strings.TrimSpace(line)) - require.Equal(t, len(entries), 2) + require.Len(t, entries, 2) pair := portpair{entries[0], entries[1]} exclusions = append(exclusions, pair) } diff --git a/internal/testutil/testutil_test.go b/internal/testutil/testutil_test.go index f8dc5cd5e8a..90c19a6a9b5 100644 --- a/internal/testutil/testutil_test.go +++ b/internal/testutil/testutil_test.go @@ -68,8 +68,8 @@ Start Port End Port * - Administered port exclusions. ` exclusions := createExclusionsList(exclusionsText, t) - require.Equal(t, len(exclusions), 2) + require.Len(t, exclusions, 2) emptyExclusions := createExclusionsList(emptyExclusionsText, t) - require.Equal(t, len(emptyExclusions), 0) + require.Empty(t, emptyExclusions) } diff --git a/internal/tools/go.mod b/internal/tools/go.mod index f7c24193869..5f480c043e5 100644 --- a/internal/tools/go.mod +++ b/internal/tools/go.mod @@ -2,9 +2,10 @@ module go.opentelemetry.io/collector/internal/tools go 1.22.1 -toolchain go1.22.6 +toolchain go1.22.7 require ( + github.com/Antonboom/testifylint v1.4.3 github.com/a8m/envsubst v1.4.2 github.com/client9/misspell v0.3.4 github.com/golangci/golangci-lint v1.60.1 @@ -17,7 +18,7 @@ require ( 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/tools v0.24.0 + golang.org/x/tools v0.25.0 golang.org/x/vuln v1.1.3 ) @@ -29,7 +30,6 @@ require ( github.com/Abirdcfly/dupword v0.0.14 // 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/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect @@ -205,14 +205,14 @@ require ( go.uber.org/automaxprocs v1.5.3 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/crypto v0.26.0 // indirect + golang.org/x/crypto v0.27.0 // indirect golang.org/x/exp/typeparams v0.0.0-20240314144324-c7f7c6466f7f // indirect - golang.org/x/mod v0.20.0 // indirect - golang.org/x/net v0.28.0 // indirect + golang.org/x/mod v0.21.0 // indirect + golang.org/x/net v0.29.0 // indirect golang.org/x/sync v0.8.0 // indirect - golang.org/x/sys v0.23.0 // indirect + golang.org/x/sys v0.25.0 // indirect golang.org/x/telemetry v0.0.0-20240522233618-39ace7a40ae7 // indirect - golang.org/x/text v0.17.0 // indirect + golang.org/x/text v0.18.0 // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect diff --git a/internal/tools/go.sum b/internal/tools/go.sum index beec2147375..160580bb843 100644 --- a/internal/tools/go.sum +++ b/internal/tools/go.sum @@ -497,8 +497,8 @@ golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= -golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= +golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= +golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= 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/typeparams v0.0.0-20220428152302-39d4317da171/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= @@ -515,8 +515,8 @@ golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91 golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= -golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= +golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -533,8 +533,8 @@ golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= -golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= +golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= +golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -568,8 +568,8 @@ golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM= -golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/telemetry v0.0.0-20240522233618-39ace7a40ae7 h1:FemxDzfMUcK2f3YY4H+05K9CDzbSVr2+q/JKN45pey0= golang.org/x/telemetry v0.0.0-20240522233618-39ace7a40ae7/go.mod h1:pRgIJT+bRLFKnoM1ldnzKoxTIn14Yxz928LQRYYgIN0= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -579,8 +579,8 @@ golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= -golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= +golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM= +golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -590,8 +590,8 @@ golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= -golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190321232350-e250d351ecad/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190910044552-dd2b5c81c578/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -614,8 +614,8 @@ golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= golang.org/x/tools v0.5.0/go.mod h1:N+Kgy78s5I24c24dU8OfWNEotWjutIs8SnJvn5IDq+k= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= -golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= +golang.org/x/tools v0.25.0 h1:oFU9pkj/iJgs+0DT+VMHrx+oBKs/LJMV+Uvg78sl+fE= +golang.org/x/tools v0.25.0/go.mod h1:/vtpO8WL1N9cQC3FN5zPqb//fRXskFHbLKk4OW1Q7rg= golang.org/x/vuln v1.1.3 h1:NPGnvPOTgnjBc9HTaUx+nj+EaUYxl5SJOWqaDYGaFYw= golang.org/x/vuln v1.1.3/go.mod h1:7Le6Fadm5FOqE9C926BCD0g12NWyhg7cxV4BwcPFuNY= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/internal/tools/tools.go b/internal/tools/tools.go index 06f143c3701..1abe8027c5a 100644 --- a/internal/tools/tools.go +++ b/internal/tools/tools.go @@ -11,6 +11,7 @@ package tools // import "go.opentelemetry.io/collector/internal/tools" // This ensures that all systems use the same version of tools in addition to regular dependencies. import ( + _ "github.com/Antonboom/testifylint" _ "github.com/a8m/envsubst/cmd/envsubst" _ "github.com/client9/misspell/cmd/misspell" _ "github.com/golangci/golangci-lint/cmd/golangci-lint" diff --git a/otelcol/buffered_core_test.go b/otelcol/buffered_core_test.go index 6417b8a1d9d..ee2d2c9133a 100644 --- a/otelcol/buffered_core_test.go +++ b/otelcol/buffered_core_test.go @@ -72,7 +72,7 @@ func Test_bufferedCore_Write(t *testing.T) { e, fields, } - require.Equal(t, 1, len(bc.logs)) + require.Len(t, bc.logs, 1) require.Equal(t, expected, bc.logs[0]) } diff --git a/otelcol/collector_core_test.go b/otelcol/collector_core_test.go index 6b9deb031e6..304eb25d2ad 100644 --- a/otelcol/collector_core_test.go +++ b/otelcol/collector_core_test.go @@ -72,7 +72,7 @@ func Test_collectorCore_Write(t *testing.T) { e, fields, } - require.Equal(t, 1, len(cc.core.(*bufferedCore).logs)) + require.Len(t, cc.core.(*bufferedCore).logs, 1) require.Equal(t, expected, cc.core.(*bufferedCore).logs[0]) } diff --git a/otelcol/collector_test.go b/otelcol/collector_test.go index 14465dff826..b4381384a44 100644 --- a/otelcol/collector_test.go +++ b/otelcol/collector_test.go @@ -22,7 +22,7 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componentstatus" "go.opentelemetry.io/collector/confmap" - "go.opentelemetry.io/collector/extension/extensiontest" + "go.opentelemetry.io/collector/extension" "go.opentelemetry.io/collector/processor/processortest" ) @@ -136,6 +136,33 @@ func TestCollectorReportError(t *testing.T) { assert.Equal(t, StateClosed, col.GetState()) } +// NewStatusWatcherExtensionFactory returns a component.ExtensionFactory to construct a status watcher extension. +func NewStatusWatcherExtensionFactory( + onStatusChanged func(source *componentstatus.InstanceID, event *componentstatus.Event), +) extension.Factory { + return extension.NewFactory( + component.MustNewType("statuswatcher"), + func() component.Config { + return &struct{}{} + }, + func(context.Context, extension.Settings, component.Config) (component.Component, error) { + return &statusWatcherExtension{onStatusChanged: onStatusChanged}, nil + }, + component.StabilityLevelStable) +} + +// statusWatcherExtension receives status events reported via component status reporting for testing +// purposes. +type statusWatcherExtension struct { + component.StartFunc + component.ShutdownFunc + onStatusChanged func(source *componentstatus.InstanceID, event *componentstatus.Event) +} + +func (e statusWatcherExtension) ComponentStatusChanged(source *componentstatus.InstanceID, event *componentstatus.Event) { + e.onStatusChanged(source, event) +} + func TestComponentStatusWatcher(t *testing.T) { factories, err := nopFactories() assert.NoError(t, err) @@ -159,7 +186,7 @@ func TestComponentStatusWatcher(t *testing.T) { // Add a "statuswatcher" extension that will receive notifications when processor // status changes. - factory := extensiontest.NewStatusWatcherExtensionFactory(onStatusChanged) + factory := NewStatusWatcherExtensionFactory(onStatusChanged) factories.Extensions[factory.Type()] = factory // Create a collector diff --git a/otelcol/collector_windows.go b/otelcol/collector_windows.go index 3df08386bbf..7e9099e02a9 100644 --- a/otelcol/collector_windows.go +++ b/otelcol/collector_windows.go @@ -99,10 +99,7 @@ func (s *windowsService) start(elog *eventlog.Log, colErrorChannel chan error) e // only read at the time of the Run method call. To work around this, we pass the // serviceConfig as a pointer to the logging options, and then read its value // when the zap.Logger is created by the telemetry. - s.col.set.LoggingOptions = append( - s.col.set.LoggingOptions, - zap.WrapCore(withWindowsCore(elog, &s.col.serviceConfig)), - ) + s.col.set.LoggingOptions = loggingOptionsWithEventLogCore(elog, &s.col.serviceConfig, s.col.set.LoggingOptions) // col.Run blocks until receiving a SIGTERM signal, so needs to be started // asynchronously, but it will exit early if an error occurs on startup @@ -141,6 +138,20 @@ func openEventLog(serviceName string) (*eventlog.Log, error) { return elog, nil } +func loggingOptionsWithEventLogCore( + elog *eventlog.Log, + serviceConfig **service.Config, + userOptions []zap.Option, +) []zap.Option { + return append( + // The order below must be preserved - see PR #11051 + // The event log core must run *after* any user provided options, so it + // must be the first option in this list. + []zap.Option{zap.WrapCore(withWindowsCore(elog, serviceConfig))}, + userOptions..., + ) +} + var _ zapcore.Core = (*windowsEventLogCore)(nil) type windowsEventLogCore struct { diff --git a/otelcol/collector_windows_service_test.go b/otelcol/collector_windows_service_test.go index 999fa87bbbc..7b4cdb93b68 100644 --- a/otelcol/collector_windows_service_test.go +++ b/otelcol/collector_windows_service_test.go @@ -25,6 +25,17 @@ const ( // Test the collector as a Windows service. // The test assumes that the service and respective event source are already created. +// +// To test locally: +// * Build the binary: +// - make otelcorecol +// +// * Install the Windows service +// - New-Service -Name "otelcorecol" -StartupType "Manual" -BinaryPathName "${PWD}\bin\otelcorecol_windows_amd64 --config ${PWD}\examples\local\otel-config.yaml" +// +// * Create event log source +// - eventcreate.exe /t information /id 1 /l application /d "Creating event provider for 'otelcorecol'" /so otelcorecol +// // The test also must be executed with administrative privileges. func TestCollectorAsService(t *testing.T) { collector_executable, err := filepath.Abs(filepath.Join("..", "bin", "otelcorecol_windows_amd64")) @@ -58,7 +69,7 @@ func TestCollectorAsService(t *testing.T) { }, { name: "LogToFile", - configFile: filepath.Join(".", "testdata", "otel-log-to-file.yaml"), + configFile: filepath.Join(".", "testdata", "otelcol-log-to-file.yaml"), customSetup: func(t *testing.T) { // Create the folder and clean the log file if it exists programDataPath := os.Getenv("ProgramData") diff --git a/otelcol/go.mod b/otelcol/go.mod index 61b0fa4847a..9ce0b07ecb8 100644 --- a/otelcol/go.mod +++ b/otelcol/go.mod @@ -5,23 +5,23 @@ go 1.22.0 require ( github.com/spf13/cobra v1.8.1 github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector/component v0.108.1 - go.opentelemetry.io/collector/component/componentstatus v0.108.1 - go.opentelemetry.io/collector/config/configtelemetry v0.108.1 - go.opentelemetry.io/collector/confmap v1.14.1 - go.opentelemetry.io/collector/connector v0.108.1 - go.opentelemetry.io/collector/exporter v0.108.1 - go.opentelemetry.io/collector/extension v0.108.1 - go.opentelemetry.io/collector/featuregate v1.14.1 - go.opentelemetry.io/collector/processor v0.108.1 - go.opentelemetry.io/collector/receiver v0.108.1 - go.opentelemetry.io/collector/service v0.108.1 + go.opentelemetry.io/collector/component v0.109.0 + go.opentelemetry.io/collector/component/componentstatus v0.109.0 + go.opentelemetry.io/collector/config/configtelemetry v0.109.0 + go.opentelemetry.io/collector/confmap v1.15.0 + go.opentelemetry.io/collector/connector v0.109.0 + go.opentelemetry.io/collector/exporter v0.109.0 + go.opentelemetry.io/collector/extension v0.109.0 + go.opentelemetry.io/collector/featuregate v1.15.0 + go.opentelemetry.io/collector/processor v0.109.0 + go.opentelemetry.io/collector/receiver v0.109.0 + go.opentelemetry.io/collector/service v0.109.0 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.27.0 golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 - golang.org/x/sys v0.24.0 - google.golang.org/grpc v1.65.0 + golang.org/x/sys v0.25.0 + google.golang.org/grpc v1.66.1 gopkg.in/yaml.v3 v3.0.1 ) @@ -52,55 +52,56 @@ require ( github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect - github.com/prometheus/client_golang v1.20.2 // indirect + github.com/prometheus/client_golang v1.20.3 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.56.0 // indirect + github.com/prometheus/common v0.59.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect - github.com/shirou/gopsutil/v4 v4.24.7 // indirect + github.com/shirou/gopsutil/v4 v4.24.8 // indirect github.com/shoenig/go-m1cpu v0.1.6 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/tklauser/go-sysconf v0.3.12 // indirect github.com/tklauser/numcpus v0.6.1 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect - go.opentelemetry.io/collector v0.108.1 // indirect - go.opentelemetry.io/collector/component/componentprofiles v0.108.1 // indirect - go.opentelemetry.io/collector/connector/connectorprofiles v0.108.1 // indirect - go.opentelemetry.io/collector/consumer v0.108.1 // indirect - go.opentelemetry.io/collector/consumer/consumerprofiles v0.108.1 // indirect - go.opentelemetry.io/collector/consumer/consumertest v0.108.1 // indirect - go.opentelemetry.io/collector/exporter/exporterprofiles v0.108.1 // indirect - go.opentelemetry.io/collector/internal/globalgates v0.108.1 // indirect - go.opentelemetry.io/collector/pdata v1.14.1 // indirect - go.opentelemetry.io/collector/pdata/pprofile v0.108.1 // indirect - go.opentelemetry.io/collector/pdata/testdata v0.108.1 // indirect - go.opentelemetry.io/collector/processor/processorprofiles v0.108.1 // indirect - go.opentelemetry.io/collector/receiver/receiverprofiles v0.108.1 // indirect - go.opentelemetry.io/collector/semconv v0.108.1 // indirect + go.opentelemetry.io/collector v0.109.0 // indirect + go.opentelemetry.io/collector/component/componentprofiles v0.109.0 // indirect + go.opentelemetry.io/collector/connector/connectorprofiles v0.109.0 // indirect + go.opentelemetry.io/collector/consumer v0.109.0 // indirect + go.opentelemetry.io/collector/consumer/consumerprofiles v0.109.0 // indirect + go.opentelemetry.io/collector/consumer/consumertest v0.109.0 // indirect + go.opentelemetry.io/collector/exporter/exporterprofiles v0.109.0 // indirect + go.opentelemetry.io/collector/extension/extensioncapabilities v0.109.0 // indirect + go.opentelemetry.io/collector/internal/globalgates v0.109.0 // indirect + go.opentelemetry.io/collector/pdata v1.15.0 // indirect + go.opentelemetry.io/collector/pdata/pprofile v0.109.0 // indirect + go.opentelemetry.io/collector/pdata/testdata v0.109.0 // indirect + go.opentelemetry.io/collector/processor/processorprofiles v0.109.0 // indirect + go.opentelemetry.io/collector/receiver/receiverprofiles v0.109.0 // indirect + go.opentelemetry.io/collector/semconv v0.109.0 // indirect go.opentelemetry.io/contrib/config v0.9.0 // indirect go.opentelemetry.io/contrib/propagators/b3 v1.29.0 // indirect - go.opentelemetry.io/otel v1.29.0 // indirect + go.opentelemetry.io/otel v1.30.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.5.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.29.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/otlptrace v1.29.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.51.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.5.0 // indirect - go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0 // indirect + go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.30.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.29.0 // indirect go.opentelemetry.io/otel/log v0.5.0 // indirect - go.opentelemetry.io/otel/metric v1.29.0 // indirect - go.opentelemetry.io/otel/sdk v1.29.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/log v0.5.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.29.0 // indirect - go.opentelemetry.io/otel/trace v1.29.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect + go.opentelemetry.io/otel/trace v1.30.0 // indirect go.opentelemetry.io/proto/otlp v1.3.1 // indirect - golang.org/x/net v0.28.0 // indirect - golang.org/x/text v0.17.0 // indirect + golang.org/x/net v0.29.0 // indirect + golang.org/x/text v0.18.0 // indirect gonum.org/v1/gonum v0.15.1 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd // 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/protobuf v1.34.2 // indirect ) @@ -168,6 +169,8 @@ replace go.opentelemetry.io/collector/client => ../client replace go.opentelemetry.io/collector/component/componentstatus => ../component/componentstatus +replace go.opentelemetry.io/collector/extension/extensioncapabilities => ../extension/extensioncapabilities + replace go.opentelemetry.io/collector/receiver/receiverprofiles => ../receiver/receiverprofiles replace go.opentelemetry.io/collector/processor/processorprofiles => ../processor/processorprofiles diff --git a/otelcol/go.sum b/otelcol/go.sum index de58a39d1f2..37ff3f6e9e7 100644 --- a/otelcol/go.sum +++ b/otelcol/go.sum @@ -72,21 +72,21 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= -github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg= -github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= +github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.56.0 h1:UffReloqkBtvtQEYDg2s+uDPGRrJyC6vZWPGXf6OhPY= -github.com/prometheus/common v0.56.0/go.mod h1:7uRPFSUTbfZWsJ7MHY56sqt7hLQu3bxXHDnNhl8E9qI= +github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= +github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= -github.com/rs/cors v1.11.0 h1:0B9GE/r9Bc2UxRMMtymBkHTenPkHDv0CW4Y98GBY+po= -github.com/rs/cors v1.11.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +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= -github.com/shirou/gopsutil/v4 v4.24.7 h1:V9UGTK4gQ8HvcnPKf6Zt3XHyQq/peaekfxpJ2HSocJk= -github.com/shirou/gopsutil/v4 v4.24.7/go.mod h1:0uW/073rP7FYLOkvxolUQM5rMOLTNmRXnFKafpb71rw= +github.com/shirou/gopsutil/v4 v4.24.8 h1:pVQjIenQkIhqO81mwTaXjTzOMT7d3TZkf43PlVFHENI= +github.com/shirou/gopsutil/v4 v4.24.8/go.mod h1:wE0OrJtj4dG+hYkxqDH3QiBICdKSf04/npcvLLc/oRg= github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= @@ -115,40 +115,40 @@ go.opentelemetry.io/contrib/propagators/b3 v1.29.0 h1:hNjyoRsAACnhoOLWupItUjABze go.opentelemetry.io/contrib/propagators/b3 v1.29.0/go.mod h1:E76MTitU1Niwo5NSN+mVxkyLu4h4h7Dp/yh38F2WuIU= go.opentelemetry.io/contrib/zpages v0.54.0 h1:tSfm/LEK5E46sd5qx/Y9o4iQ65ipLubV0Una7veXFlA= go.opentelemetry.io/contrib/zpages v0.54.0/go.mod h1:sbe4/RH3CFKkdM5zuGwfziKjvkqUOK9hSgLFckiVZUI= -go.opentelemetry.io/otel v1.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= -go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= +go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= +go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.5.0 h1:4d++HQ+Ihdl+53zSjtsCUFDmNMju2FC9qFkUlTxPLqo= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.5.0/go.mod h1:mQX5dTO3Mh5ZF7bPKDkt5c/7C41u/SiDr9XgTpzXXn8= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.29.0 h1:k6fQVDQexDE+3jG2SfCQjnHS7OamcP73YMoxEVq5B6k= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.29.0/go.mod h1:t4BrYLHU450Zo9fnydWlIuswB1bm7rM8havDpWOJeDo= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.29.0 h1:xvhQxJ/C9+RTnAj5DpTg7LSM1vbbMTiXt7e9hsfqHNw= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.29.0/go.mod h1:Fcvs2Bz1jkDM+Wf5/ozBGmi3tQ/c9zPKLnsipnfhGAo= +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/otlptrace v1.29.0 h1:dIIDULZJpgdiHz5tXrTgKIMLkus6jEFa7x5SOKcyR7E= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0/go.mod h1:jlRVBe7+Z1wyxFSUs48L6OBQZ5JwH2Hg/Vbl+t9rAgI= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0 h1:nSiV3s7wiCam610XcLbYOmMfJxB9gO4uK3Xgv5gmTgg= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0/go.mod h1:hKn/e/Nmd19/x1gvIHwtOwVWM+VhuITSWip3JUDghj0= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0 h1:JAv0Jwtl01UFiyWZEMiJZBiTlv5A50zNs8lsthXqIio= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0/go.mod h1:QNKLmUEAq2QUbPQUfvw4fmv0bgbK7UlOSFCnXyfvSNc= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0 h1:G7uexXb/K3T+T9fNLCCKncweEtNEBMTO+46hKX5EdKw= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0/go.mod h1:v0mFe5Kk7woIh938mrZBJBmENYquyA0IICrlYm4Y0t4= +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/stdout/stdoutlog v0.5.0 h1:ThVXnEsdwNcxdBO+r96ci1xbF+PgNjwlk457VNuJODo= go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.5.0/go.mod h1:rHWcSmC4q2h3gje/yOq6sAOaq8+UHxN/Ru3BbmDXOfY= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0 h1:WDdP9acbMYjbKIyJUhTvtzj601sVJOqgWdUxSdR/Ysc= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0/go.mod h1:BLbf7zbNIONBLPwvFnwNHGj4zge8uTCM/UPIVW1Mq2I= +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/stdouttrace v1.29.0 h1:X3ZjNp36/WlkSYx0ul2jw4PtbNEDDeLskw3VPsrpYM0= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.29.0/go.mod h1:2uL/xnOXh0CHOBFCWXz5u1A4GXLiW+0IQIzVbeOEQ0U= go.opentelemetry.io/otel/log v0.5.0 h1:x1Pr6Y3gnXgl1iFBwtGy1W/mnzENoK0w0ZoaeOI3i30= go.opentelemetry.io/otel/log v0.5.0/go.mod h1:NU/ozXeGuOR5/mjCRXYbTC00NFJ3NYuraV/7O78F0rE= -go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= -go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= -go.opentelemetry.io/otel/sdk v1.29.0 h1:vkqKjk7gwhS8VaWb0POZKmIEDimRCMsopNYnriHyryo= -go.opentelemetry.io/otel/sdk v1.29.0/go.mod h1:pM8Dx5WKnvxLCb+8lG1PRNIDxu9g9b9g59Qr7hfAAok= +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/log v0.5.0 h1:A+9lSjlZGxkQOr7QSBJcuyyYBw79CufQ69saiJLey7o= go.opentelemetry.io/otel/sdk/log v0.5.0/go.mod h1:zjxIW7sw1IHolZL2KlSAtrUi8JHttoeiQy43Yl3WuVQ= -go.opentelemetry.io/otel/sdk/metric v1.29.0 h1:K2CfmJohnRgvZ9UAj2/FhIf/okdWcNdBwe1m8xFXiSY= -go.opentelemetry.io/otel/sdk/metric v1.29.0/go.mod h1:6zZLdCl2fkauYoZIOn/soQIDSWFmNSRcICarHfuhNJQ= -go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= -go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= +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/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= @@ -168,8 +168,8 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= -golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= +golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= +golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -180,12 +180,12 @@ 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.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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= -golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -196,12 +196,12 @@ 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-20240822170219-fc7c04adadcd h1:BBOTEWLuuEGQy9n1y9MhVJ9Qt0BDu21X8qZs71/uPZo= -google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:fO8wJzT2zbQbAjbIoos1285VfEIYKDDY+Dt+WpTkh6g= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd h1:6TEm2ZxXoQmFWFlt1vNxvVOa1Q0dXFQD1m/rYjXmS0E= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +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/grpc v1.66.1 h1:hO5qAXR19+/Z44hmvIM4dQFMSYX9XcWsByfoxutBpAM= +google.golang.org/grpc v1.66.1/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= 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= diff --git a/otelcol/otelcoltest/go.mod b/otelcol/otelcoltest/go.mod index b7905e0ffd2..bca3cb4814c 100644 --- a/otelcol/otelcoltest/go.mod +++ b/otelcol/otelcoltest/go.mod @@ -4,19 +4,19 @@ go 1.22.0 require ( github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector/component v0.108.1 - go.opentelemetry.io/collector/confmap v1.14.1 - go.opentelemetry.io/collector/confmap/provider/envprovider v0.108.1 - go.opentelemetry.io/collector/confmap/provider/fileprovider v0.108.1 - go.opentelemetry.io/collector/confmap/provider/httpprovider v0.108.1 - go.opentelemetry.io/collector/confmap/provider/yamlprovider v0.108.1 - go.opentelemetry.io/collector/connector v0.108.1 - go.opentelemetry.io/collector/exporter v0.108.1 - go.opentelemetry.io/collector/extension v0.108.1 - go.opentelemetry.io/collector/otelcol v0.108.1 - go.opentelemetry.io/collector/processor v0.108.1 - go.opentelemetry.io/collector/receiver v0.108.1 - go.opentelemetry.io/collector/service v0.108.1 + go.opentelemetry.io/collector/component v0.109.0 + go.opentelemetry.io/collector/confmap v1.15.0 + go.opentelemetry.io/collector/confmap/provider/envprovider v1.15.0 + go.opentelemetry.io/collector/confmap/provider/fileprovider v1.15.0 + go.opentelemetry.io/collector/confmap/provider/httpprovider v0.109.0 + go.opentelemetry.io/collector/confmap/provider/yamlprovider v0.109.0 + go.opentelemetry.io/collector/connector v0.109.0 + go.opentelemetry.io/collector/exporter v0.109.0 + go.opentelemetry.io/collector/extension v0.109.0 + go.opentelemetry.io/collector/otelcol v0.109.0 + go.opentelemetry.io/collector/processor v0.109.0 + go.opentelemetry.io/collector/receiver v0.109.0 + go.opentelemetry.io/collector/service v0.109.0 go.uber.org/goleak v1.3.0 ) @@ -47,64 +47,65 @@ require ( github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect - github.com/prometheus/client_golang v1.20.2 // indirect + github.com/prometheus/client_golang v1.20.3 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.56.0 // indirect + github.com/prometheus/common v0.59.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect - github.com/shirou/gopsutil/v4 v4.24.7 // indirect + github.com/shirou/gopsutil/v4 v4.24.8 // indirect github.com/shoenig/go-m1cpu v0.1.6 // indirect github.com/spf13/cobra v1.8.1 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/tklauser/go-sysconf v0.3.12 // indirect github.com/tklauser/numcpus v0.6.1 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect - go.opentelemetry.io/collector v0.108.1 // indirect - go.opentelemetry.io/collector/component/componentprofiles v0.108.1 // indirect - go.opentelemetry.io/collector/component/componentstatus v0.108.1 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.108.1 // indirect - go.opentelemetry.io/collector/connector/connectorprofiles v0.108.1 // indirect - go.opentelemetry.io/collector/consumer v0.108.1 // indirect - go.opentelemetry.io/collector/consumer/consumerprofiles v0.108.1 // indirect - go.opentelemetry.io/collector/consumer/consumertest v0.108.1 // indirect - go.opentelemetry.io/collector/exporter/exporterprofiles v0.108.1 // indirect - go.opentelemetry.io/collector/featuregate v1.14.1 // indirect - go.opentelemetry.io/collector/internal/globalgates v0.108.1 // indirect - go.opentelemetry.io/collector/pdata v1.14.1 // indirect - go.opentelemetry.io/collector/pdata/pprofile v0.108.1 // indirect - go.opentelemetry.io/collector/pdata/testdata v0.108.1 // indirect - go.opentelemetry.io/collector/processor/processorprofiles v0.108.1 // indirect - go.opentelemetry.io/collector/receiver/receiverprofiles v0.108.1 // indirect - go.opentelemetry.io/collector/semconv v0.108.1 // indirect + go.opentelemetry.io/collector v0.109.0 // indirect + go.opentelemetry.io/collector/component/componentprofiles v0.109.0 // indirect + go.opentelemetry.io/collector/component/componentstatus v0.109.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.109.0 // indirect + go.opentelemetry.io/collector/connector/connectorprofiles v0.109.0 // indirect + go.opentelemetry.io/collector/consumer v0.109.0 // indirect + go.opentelemetry.io/collector/consumer/consumerprofiles v0.109.0 // indirect + go.opentelemetry.io/collector/consumer/consumertest v0.109.0 // indirect + go.opentelemetry.io/collector/exporter/exporterprofiles v0.109.0 // indirect + go.opentelemetry.io/collector/extension/extensioncapabilities v0.109.0 // indirect + go.opentelemetry.io/collector/featuregate v1.15.0 // indirect + go.opentelemetry.io/collector/internal/globalgates v0.109.0 // indirect + go.opentelemetry.io/collector/pdata v1.15.0 // indirect + go.opentelemetry.io/collector/pdata/pprofile v0.109.0 // indirect + go.opentelemetry.io/collector/pdata/testdata v0.109.0 // indirect + go.opentelemetry.io/collector/processor/processorprofiles v0.109.0 // indirect + go.opentelemetry.io/collector/receiver/receiverprofiles v0.109.0 // indirect + go.opentelemetry.io/collector/semconv v0.109.0 // indirect go.opentelemetry.io/contrib/config v0.9.0 // indirect go.opentelemetry.io/contrib/propagators/b3 v1.29.0 // indirect - go.opentelemetry.io/otel v1.29.0 // indirect + go.opentelemetry.io/otel v1.30.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.5.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.29.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/otlptrace v1.29.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.51.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.5.0 // indirect - go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0 // indirect + go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.30.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.29.0 // indirect go.opentelemetry.io/otel/log v0.5.0 // indirect - go.opentelemetry.io/otel/metric v1.29.0 // indirect - go.opentelemetry.io/otel/sdk v1.29.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/log v0.5.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.29.0 // indirect - go.opentelemetry.io/otel/trace v1.29.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect + go.opentelemetry.io/otel/trace v1.30.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 golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect - golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.24.0 // indirect - golang.org/x/text v0.17.0 // indirect + golang.org/x/net v0.29.0 // indirect + golang.org/x/sys v0.25.0 // indirect + golang.org/x/text v0.18.0 // indirect gonum.org/v1/gonum v0.15.1 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd // indirect - google.golang.org/grpc v1.65.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/grpc v1.66.1 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) @@ -183,6 +184,8 @@ replace go.opentelemetry.io/collector/client => ../../client replace go.opentelemetry.io/collector/component/componentstatus => ../../component/componentstatus +replace go.opentelemetry.io/collector/extension/extensioncapabilities => ../../extension/extensioncapabilities + replace go.opentelemetry.io/collector/receiver/receiverprofiles => ../../receiver/receiverprofiles replace go.opentelemetry.io/collector/processor/processorprofiles => ../../processor/processorprofiles diff --git a/otelcol/otelcoltest/go.sum b/otelcol/otelcoltest/go.sum index de58a39d1f2..37ff3f6e9e7 100644 --- a/otelcol/otelcoltest/go.sum +++ b/otelcol/otelcoltest/go.sum @@ -72,21 +72,21 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= -github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg= -github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= +github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.56.0 h1:UffReloqkBtvtQEYDg2s+uDPGRrJyC6vZWPGXf6OhPY= -github.com/prometheus/common v0.56.0/go.mod h1:7uRPFSUTbfZWsJ7MHY56sqt7hLQu3bxXHDnNhl8E9qI= +github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= +github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= -github.com/rs/cors v1.11.0 h1:0B9GE/r9Bc2UxRMMtymBkHTenPkHDv0CW4Y98GBY+po= -github.com/rs/cors v1.11.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +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= -github.com/shirou/gopsutil/v4 v4.24.7 h1:V9UGTK4gQ8HvcnPKf6Zt3XHyQq/peaekfxpJ2HSocJk= -github.com/shirou/gopsutil/v4 v4.24.7/go.mod h1:0uW/073rP7FYLOkvxolUQM5rMOLTNmRXnFKafpb71rw= +github.com/shirou/gopsutil/v4 v4.24.8 h1:pVQjIenQkIhqO81mwTaXjTzOMT7d3TZkf43PlVFHENI= +github.com/shirou/gopsutil/v4 v4.24.8/go.mod h1:wE0OrJtj4dG+hYkxqDH3QiBICdKSf04/npcvLLc/oRg= github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= @@ -115,40 +115,40 @@ go.opentelemetry.io/contrib/propagators/b3 v1.29.0 h1:hNjyoRsAACnhoOLWupItUjABze go.opentelemetry.io/contrib/propagators/b3 v1.29.0/go.mod h1:E76MTitU1Niwo5NSN+mVxkyLu4h4h7Dp/yh38F2WuIU= go.opentelemetry.io/contrib/zpages v0.54.0 h1:tSfm/LEK5E46sd5qx/Y9o4iQ65ipLubV0Una7veXFlA= go.opentelemetry.io/contrib/zpages v0.54.0/go.mod h1:sbe4/RH3CFKkdM5zuGwfziKjvkqUOK9hSgLFckiVZUI= -go.opentelemetry.io/otel v1.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= -go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= +go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= +go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.5.0 h1:4d++HQ+Ihdl+53zSjtsCUFDmNMju2FC9qFkUlTxPLqo= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.5.0/go.mod h1:mQX5dTO3Mh5ZF7bPKDkt5c/7C41u/SiDr9XgTpzXXn8= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.29.0 h1:k6fQVDQexDE+3jG2SfCQjnHS7OamcP73YMoxEVq5B6k= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.29.0/go.mod h1:t4BrYLHU450Zo9fnydWlIuswB1bm7rM8havDpWOJeDo= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.29.0 h1:xvhQxJ/C9+RTnAj5DpTg7LSM1vbbMTiXt7e9hsfqHNw= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.29.0/go.mod h1:Fcvs2Bz1jkDM+Wf5/ozBGmi3tQ/c9zPKLnsipnfhGAo= +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/otlptrace v1.29.0 h1:dIIDULZJpgdiHz5tXrTgKIMLkus6jEFa7x5SOKcyR7E= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0/go.mod h1:jlRVBe7+Z1wyxFSUs48L6OBQZ5JwH2Hg/Vbl+t9rAgI= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0 h1:nSiV3s7wiCam610XcLbYOmMfJxB9gO4uK3Xgv5gmTgg= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0/go.mod h1:hKn/e/Nmd19/x1gvIHwtOwVWM+VhuITSWip3JUDghj0= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0 h1:JAv0Jwtl01UFiyWZEMiJZBiTlv5A50zNs8lsthXqIio= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0/go.mod h1:QNKLmUEAq2QUbPQUfvw4fmv0bgbK7UlOSFCnXyfvSNc= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0 h1:G7uexXb/K3T+T9fNLCCKncweEtNEBMTO+46hKX5EdKw= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0/go.mod h1:v0mFe5Kk7woIh938mrZBJBmENYquyA0IICrlYm4Y0t4= +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/stdout/stdoutlog v0.5.0 h1:ThVXnEsdwNcxdBO+r96ci1xbF+PgNjwlk457VNuJODo= go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.5.0/go.mod h1:rHWcSmC4q2h3gje/yOq6sAOaq8+UHxN/Ru3BbmDXOfY= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0 h1:WDdP9acbMYjbKIyJUhTvtzj601sVJOqgWdUxSdR/Ysc= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0/go.mod h1:BLbf7zbNIONBLPwvFnwNHGj4zge8uTCM/UPIVW1Mq2I= +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/stdouttrace v1.29.0 h1:X3ZjNp36/WlkSYx0ul2jw4PtbNEDDeLskw3VPsrpYM0= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.29.0/go.mod h1:2uL/xnOXh0CHOBFCWXz5u1A4GXLiW+0IQIzVbeOEQ0U= go.opentelemetry.io/otel/log v0.5.0 h1:x1Pr6Y3gnXgl1iFBwtGy1W/mnzENoK0w0ZoaeOI3i30= go.opentelemetry.io/otel/log v0.5.0/go.mod h1:NU/ozXeGuOR5/mjCRXYbTC00NFJ3NYuraV/7O78F0rE= -go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= -go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= -go.opentelemetry.io/otel/sdk v1.29.0 h1:vkqKjk7gwhS8VaWb0POZKmIEDimRCMsopNYnriHyryo= -go.opentelemetry.io/otel/sdk v1.29.0/go.mod h1:pM8Dx5WKnvxLCb+8lG1PRNIDxu9g9b9g59Qr7hfAAok= +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/log v0.5.0 h1:A+9lSjlZGxkQOr7QSBJcuyyYBw79CufQ69saiJLey7o= go.opentelemetry.io/otel/sdk/log v0.5.0/go.mod h1:zjxIW7sw1IHolZL2KlSAtrUi8JHttoeiQy43Yl3WuVQ= -go.opentelemetry.io/otel/sdk/metric v1.29.0 h1:K2CfmJohnRgvZ9UAj2/FhIf/okdWcNdBwe1m8xFXiSY= -go.opentelemetry.io/otel/sdk/metric v1.29.0/go.mod h1:6zZLdCl2fkauYoZIOn/soQIDSWFmNSRcICarHfuhNJQ= -go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= -go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= +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/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= @@ -168,8 +168,8 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= -golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= +golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= +golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -180,12 +180,12 @@ 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.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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= -golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -196,12 +196,12 @@ 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-20240822170219-fc7c04adadcd h1:BBOTEWLuuEGQy9n1y9MhVJ9Qt0BDu21X8qZs71/uPZo= -google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:fO8wJzT2zbQbAjbIoos1285VfEIYKDDY+Dt+WpTkh6g= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd h1:6TEm2ZxXoQmFWFlt1vNxvVOa1Q0dXFQD1m/rYjXmS0E= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +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/grpc v1.66.1 h1:hO5qAXR19+/Z44hmvIM4dQFMSYX9XcWsByfoxutBpAM= +google.golang.org/grpc v1.66.1/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= 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= diff --git a/otelcol/otelcoltest/nop_factories_test.go b/otelcol/otelcoltest/nop_factories_test.go index 1f77ecdd68e..c8f06f01341 100644 --- a/otelcol/otelcoltest/nop_factories_test.go +++ b/otelcol/otelcoltest/nop_factories_test.go @@ -17,27 +17,27 @@ func TestNopFactories(t *testing.T) { nopFactories, err := NopFactories() require.NoError(t, err) - require.Equal(t, 1, len(nopFactories.Receivers)) + require.Len(t, nopFactories.Receivers, 1) nopReceiverFactory, ok := nopFactories.Receivers[nopType] require.True(t, ok) require.Equal(t, nopType, nopReceiverFactory.Type()) - require.Equal(t, 1, len(nopFactories.Processors)) + require.Len(t, nopFactories.Processors, 1) nopProcessorFactory, ok := nopFactories.Processors[nopType] require.True(t, ok) require.Equal(t, nopType, nopProcessorFactory.Type()) - require.Equal(t, 1, len(nopFactories.Exporters)) + require.Len(t, nopFactories.Exporters, 1) nopExporterFactory, ok := nopFactories.Exporters[nopType] require.True(t, ok) require.Equal(t, nopType, nopExporterFactory.Type()) - require.Equal(t, 1, len(nopFactories.Extensions)) + require.Len(t, nopFactories.Extensions, 1) nopExtensionFactory, ok := nopFactories.Extensions[nopType] require.True(t, ok) require.Equal(t, nopType, nopExtensionFactory.Type()) - require.Equal(t, 1, len(nopFactories.Connectors)) + require.Len(t, nopFactories.Connectors, 1) nopConnectorFactory, ok := nopFactories.Connectors[nopType] require.True(t, ok) require.Equal(t, nopType, nopConnectorFactory.Type()) diff --git a/otelcol/testdata/otel-log-to-file.yaml b/otelcol/testdata/otelcol-log-to-file.yaml similarity index 100% rename from otelcol/testdata/otel-log-to-file.yaml rename to otelcol/testdata/otelcol-log-to-file.yaml diff --git a/pdata/go.mod b/pdata/go.mod index 3817fb5eb08..88c3955e5a0 100644 --- a/pdata/go.mod +++ b/pdata/go.mod @@ -8,7 +8,7 @@ require ( github.com/stretchr/testify v1.9.0 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - google.golang.org/grpc v1.65.0 + google.golang.org/grpc v1.66.0 google.golang.org/protobuf v1.34.2 ) @@ -19,10 +19,10 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/rogpeppe/go-internal v1.10.0 // indirect - golang.org/x/net v0.25.0 // indirect - golang.org/x/sys v0.20.0 // indirect - golang.org/x/text v0.15.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect + golang.org/x/net v0.26.0 // indirect + golang.org/x/sys v0.21.0 // indirect + golang.org/x/text v0.16.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/pdata/go.sum b/pdata/go.sum index 84ebb984c67..7ac18ed8750 100644 --- a/pdata/go.sum +++ b/pdata/go.sum @@ -48,20 +48,20 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= -golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= +golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.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.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= -golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -70,10 +70,10 @@ 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/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 h1:Zy9XzmMEflZ/MAaA7vNcoebnRAld7FsPW1EeBB7V0m8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 h1:1GBuWVLM/KMVUv1t1En5Gs+gFZCNd360GGb4sSxtrhU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= 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= diff --git a/pdata/internal/cmd/pdatagen/internal/base_fields.go b/pdata/internal/cmd/pdatagen/internal/base_fields.go index 523ef352149..857125fbbfb 100644 --- a/pdata/internal/cmd/pdatagen/internal/base_fields.go +++ b/pdata/internal/cmd/pdatagen/internal/base_fields.go @@ -177,9 +177,17 @@ const accessorsOneOfPrimitiveTestTemplate = `func Test{{ .structName }}_{{ .acce const accessorsPrimitiveTestTemplate = `func Test{{ .structName }}_{{ .fieldName }}(t *testing.T) { ms := New{{ .structName }}() + {{- if eq .returnType "bool" }} + assert.{{- if eq .defaultVal "true" }}True{{- else }}False{{- end }}(t, ms.{{ .fieldName }}()) + {{- else }} assert.Equal(t, {{ .defaultVal }}, ms.{{ .fieldName }}()) + {{- end }} ms.Set{{ .fieldName }}({{ .testValue }}) + {{- if eq .returnType "bool" }} + assert.{{- if eq .testValue "true" }}True{{- else }}False{{- end }}(t, ms.{{ .fieldName }}()) + {{- else }} assert.Equal(t, {{ .testValue }}, ms.{{ .fieldName }}()) + {{- end }} sharedState := internal.StateReadOnly assert.Panics(t, func() { new{{ .structName }}(&{{ .originStructName }}{}, &sharedState).Set{{ .fieldName }}({{ .testValue }}) }) }` diff --git a/pdata/internal/cmd/pdatagen/internal/base_slices.go b/pdata/internal/cmd/pdatagen/internal/base_slices.go index d556207163a..21646d92bc1 100644 --- a/pdata/internal/cmd/pdatagen/internal/base_slices.go +++ b/pdata/internal/cmd/pdatagen/internal/base_slices.go @@ -272,13 +272,13 @@ func Test{{ .structName }}_Sort(t *testing.T) { return uintptr(unsafe.Pointer(a.orig)) < uintptr(unsafe.Pointer(b.orig)) }) for i := 1; i < es.Len(); i++ { - assert.True(t, uintptr(unsafe.Pointer(es.At(i-1).orig)) < uintptr(unsafe.Pointer(es.At(i).orig))) + 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.True(t, uintptr(unsafe.Pointer(es.At(i-1).orig)) > uintptr(unsafe.Pointer(es.At(i).orig))) + assert.Greater(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) } } {{- end }}` diff --git a/pdata/internal/cmd/pdatagen/internal/pprofile_package.go b/pdata/internal/cmd/pdatagen/internal/pprofile_package.go index bd300eae607..875410c9e51 100644 --- a/pdata/internal/cmd/pdatagen/internal/pprofile_package.go +++ b/pdata/internal/cmd/pdatagen/internal/pprofile_package.go @@ -99,10 +99,15 @@ var profileContainer = &messageValueStruct{ description: "// ProfileContainer are an experimental implementation of the OpenTelemetry Profiles Data Model.\n", originFullName: "otlpprofiles.ProfileContainer", fields: []baseField{ - &sliceField{ + &primitiveTypedField{ fieldName: "ProfileID", originFieldName: "ProfileId", - returnSlice: byteSlice, + returnType: &primitiveType{ + structName: "ProfileID", + rawType: "data.ProfileID", + defaultVal: "data.ProfileID([16]byte{})", + testVal: "data.ProfileID([16]byte{1, 2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 4, 3, 2, 1})", + }, }, &primitiveTypedField{ fieldName: "StartTime", diff --git a/pdata/internal/data/profileid.go b/pdata/internal/data/profileid.go new file mode 100644 index 00000000000..5b4e6f53ceb --- /dev/null +++ b/pdata/internal/data/profileid.go @@ -0,0 +1,79 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package data // import "go.opentelemetry.io/collector/pdata/internal/data" + +import ( + "errors" + + "github.com/gogo/protobuf/proto" +) + +const profileIDSize = 16 + +var ( + errMarshalProfileID = errors.New("marshal: invalid buffer length for ProfileID") + errUnmarshalProfileID = errors.New("unmarshal: invalid ProfileID length") +) + +// ProfileID is a custom data type that is used for all profile_id fields in OTLP +// Protobuf messages. +type ProfileID [profileIDSize]byte + +var _ proto.Sizer = (*SpanID)(nil) + +// Size returns the size of the data to serialize. +func (tid ProfileID) Size() int { + if tid.IsEmpty() { + return 0 + } + return profileIDSize +} + +// IsEmpty returns true if id contains at leas one non-zero byte. +func (tid ProfileID) IsEmpty() bool { + return tid == [profileIDSize]byte{} +} + +// MarshalTo converts profile ID into a binary representation. Called by Protobuf serialization. +func (tid ProfileID) MarshalTo(data []byte) (n int, err error) { + if tid.IsEmpty() { + return 0, nil + } + + if len(data) < profileIDSize { + return 0, errMarshalProfileID + } + + return copy(data, tid[:]), nil +} + +// Unmarshal inflates this profile ID from binary representation. Called by Protobuf serialization. +func (tid *ProfileID) Unmarshal(data []byte) error { + if len(data) == 0 { + *tid = [profileIDSize]byte{} + return nil + } + + if len(data) != profileIDSize { + return errUnmarshalProfileID + } + + copy(tid[:], data) + return nil +} + +// MarshalJSON converts profile id into a hex string enclosed in quotes. +func (tid ProfileID) MarshalJSON() ([]byte, error) { + if tid.IsEmpty() { + return []byte(`""`), nil + } + return marshalJSON(tid[:]) +} + +// UnmarshalJSON inflates profile id from hex string, possibly enclosed in quotes. +// Called by Protobuf JSON deserialization. +func (tid *ProfileID) UnmarshalJSON(data []byte) error { + *tid = [profileIDSize]byte{} + return unmarshalJSON(tid[:], data) +} diff --git a/pdata/internal/data/profileid_test.go b/pdata/internal/data/profileid_test.go new file mode 100644 index 00000000000..c1107cfde46 --- /dev/null +++ b/pdata/internal/data/profileid_test.go @@ -0,0 +1,99 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package data + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestProfileID(t *testing.T) { + tid := ProfileID([16]byte{}) + assert.EqualValues(t, [16]byte{}, tid) + assert.EqualValues(t, 0, tid.Size()) + + b := [16]byte{0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x78} + tid = b + assert.EqualValues(t, b, tid) + assert.EqualValues(t, 16, tid.Size()) +} + +func TestProfileIDMarshal(t *testing.T) { + buf := make([]byte, 20) + + tid := ProfileID([16]byte{}) + n, err := tid.MarshalTo(buf) + assert.EqualValues(t, 0, n) + assert.NoError(t, err) + + tid = [16]byte{0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x78} + n, err = tid.MarshalTo(buf) + assert.EqualValues(t, 16, n) + assert.EqualValues(t, []byte{0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x78}, buf[0:16]) + assert.NoError(t, err) + + _, err = tid.MarshalTo(buf[0:1]) + assert.Error(t, err) +} + +func TestProfileIDMarshalJSON(t *testing.T) { + tid := ProfileID([16]byte{}) + json, err := tid.MarshalJSON() + assert.EqualValues(t, []byte(`""`), json) + assert.NoError(t, err) + + tid = [16]byte{0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x78} + json, err = tid.MarshalJSON() + assert.EqualValues(t, []byte(`"12345678123456781234567812345678"`), json) + assert.NoError(t, err) +} + +func TestProfileIDUnmarshal(t *testing.T) { + buf := [16]byte{0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x78} + + tid := ProfileID{} + err := tid.Unmarshal(buf[0:16]) + assert.NoError(t, err) + assert.EqualValues(t, buf, tid) + + err = tid.Unmarshal(buf[0:0]) + assert.NoError(t, err) + assert.EqualValues(t, [16]byte{}, tid) + + err = tid.Unmarshal(nil) + assert.NoError(t, err) + assert.EqualValues(t, [16]byte{}, tid) +} + +func TestProfileIDUnmarshalJSON(t *testing.T) { + tid := ProfileID([16]byte{}) + err := tid.UnmarshalJSON([]byte(`""`)) + assert.NoError(t, err) + assert.EqualValues(t, [16]byte{}, tid) + + err = tid.UnmarshalJSON([]byte(`""""`)) + assert.Error(t, err) + + tidBytes := [16]byte{0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x78} + err = tid.UnmarshalJSON([]byte(`"12345678123456781234567812345678"`)) + assert.NoError(t, err) + assert.EqualValues(t, tidBytes, tid) + + err = tid.UnmarshalJSON([]byte(`12345678123456781234567812345678`)) + assert.NoError(t, err) + assert.EqualValues(t, tidBytes, tid) + + err = tid.UnmarshalJSON([]byte(`"nothex"`)) + assert.Error(t, err) + + err = tid.UnmarshalJSON([]byte(`"1"`)) + assert.Error(t, err) + + err = tid.UnmarshalJSON([]byte(`"123"`)) + assert.Error(t, err) + + err = tid.UnmarshalJSON([]byte(`"`)) + assert.Error(t, err) +} diff --git a/pdata/internal/data/protogen/profiles/v1experimental/profiles.pb.go b/pdata/internal/data/protogen/profiles/v1experimental/profiles.pb.go index 6e4662c248b..cd1c215adb4 100644 --- a/pdata/internal/data/protogen/profiles/v1experimental/profiles.pb.go +++ b/pdata/internal/data/protogen/profiles/v1experimental/profiles.pb.go @@ -13,6 +13,7 @@ import ( _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" + go_opentelemetry_io_collector_pdata_internal_data "go.opentelemetry.io/collector/pdata/internal/data" v11 "go.opentelemetry.io/collector/pdata/internal/data/protogen/common/v1" v1 "go.opentelemetry.io/collector/pdata/internal/data/protogen/resource/v1" ) @@ -231,7 +232,7 @@ type ProfileContainer struct { // all zeroes is considered invalid. // // This field is required. - ProfileId []byte `protobuf:"bytes,1,opt,name=profile_id,json=profileId,proto3" json:"profile_id,omitempty"` + ProfileId go_opentelemetry_io_collector_pdata_internal_data.ProfileID `protobuf:"bytes,1,opt,name=profile_id,json=profileId,proto3,customtype=go.opentelemetry.io/collector/pdata/internal/data.ProfileID" json:"profile_id"` // start_time_unix_nano is the start time of the profile. // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. // @@ -304,13 +305,6 @@ func (m *ProfileContainer) XXX_DiscardUnknown() { var xxx_messageInfo_ProfileContainer proto.InternalMessageInfo -func (m *ProfileContainer) GetProfileId() []byte { - if m != nil { - return m.ProfileId - } - return nil -} - func (m *ProfileContainer) GetStartTimeUnixNano() uint64 { if m != nil { return m.StartTimeUnixNano @@ -372,48 +366,49 @@ func init() { } var fileDescriptor_394731f2296acea3 = []byte{ - // 652 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0x51, 0x6b, 0xdb, 0x3a, - 0x14, 0xc7, 0xe3, 0xa6, 0x4d, 0x52, 0xb5, 0xb9, 0x4d, 0x45, 0xef, 0xbd, 0xa6, 0x70, 0x73, 0x43, - 0x5e, 0x96, 0xae, 0x60, 0x93, 0x76, 0x8c, 0x51, 0x18, 0x63, 0xed, 0x36, 0xe8, 0xca, 0xd6, 0xe0, - 0xb5, 0x85, 0xed, 0xc5, 0xa8, 0xf1, 0x69, 0xa6, 0x61, 0x4b, 0x46, 0x96, 0x43, 0xba, 0x4f, 0xb1, - 0xcf, 0xb1, 0x4f, 0xd2, 0xc7, 0xee, 0x6d, 0x6c, 0x30, 0x46, 0xfb, 0xb2, 0x7e, 0x8b, 0x61, 0x59, - 0xf6, 0x12, 0x93, 0x51, 0xb2, 0x17, 0x23, 0x9f, 0xf3, 0x3f, 0xbf, 0xa3, 0xff, 0x91, 0x10, 0xda, - 0xe1, 0x21, 0x30, 0x09, 0x3e, 0x04, 0x20, 0xc5, 0xb9, 0x1d, 0x0a, 0x2e, 0x79, 0xf2, 0x3d, 0xa3, - 0x3e, 0x44, 0xf6, 0xb0, 0x0b, 0xa3, 0x10, 0x04, 0x0d, 0x80, 0x49, 0xe2, 0xe7, 0x71, 0x4b, 0xc9, - 0xf0, 0xe6, 0x44, 0x6d, 0x1a, 0xb4, 0x72, 0xcd, 0x64, 0xed, 0xfa, 0xda, 0x80, 0x0f, 0x78, 0x8a, - 0x4f, 0x56, 0xa9, 0x7a, 0xfd, 0xee, 0xb4, 0xf6, 0x7d, 0x1e, 0x04, 0x9c, 0xd9, 0xc3, 0xae, 0x5e, - 0x69, 0xad, 0x35, 0x4d, 0x2b, 0x20, 0xe2, 0xb1, 0xe8, 0x43, 0xa2, 0xce, 0xd6, 0x5a, 0xff, 0x68, - 0x26, 0x6b, 0x49, 0x02, 0x46, 0x12, 0x98, 0x07, 0x5e, 0x0a, 0x68, 0xbf, 0x47, 0xcb, 0x3d, 0x2d, - 0x7f, 0x42, 0x24, 0xc1, 0xef, 0xd0, 0x6a, 0xd6, 0xc2, 0xcd, 0x38, 0xa6, 0xd1, 0x2a, 0x77, 0x96, - 0xb6, 0x1e, 0x5a, 0x33, 0xcc, 0xc2, 0x72, 0x34, 0x25, 0xa3, 0x3b, 0x0d, 0x51, 0x88, 0xb4, 0x6f, - 0x0c, 0xd4, 0x28, 0xca, 0xf0, 0x01, 0xaa, 0x65, 0x42, 0xd3, 0x68, 0x19, 0x9d, 0xa5, 0xad, 0x8d, - 0xa9, 0x7d, 0xf3, 0x41, 0x0c, 0xbb, 0x79, 0xaf, 0xdd, 0xf9, 0x8b, 0x6f, 0xff, 0x97, 0x9c, 0x1c, - 0x80, 0x09, 0xfa, 0x2b, 0xea, 0xf3, 0x70, 0xcc, 0xca, 0x9c, 0xb2, 0xb2, 0x33, 0x93, 0x95, 0x57, - 0x09, 0x22, 0xf7, 0x51, 0x8f, 0xc6, 0x7f, 0xf1, 0x7f, 0x08, 0x45, 0xfd, 0xb7, 0x10, 0x10, 0x37, - 0x16, 0xbe, 0x59, 0x6e, 0x19, 0x9d, 0x45, 0x67, 0x31, 0x8d, 0x1c, 0x0b, 0xff, 0x79, 0xa5, 0xf6, - 0xa3, 0xda, 0xb8, 0xa9, 0xb6, 0xbf, 0x18, 0xa8, 0x3e, 0xc1, 0xc1, 0x87, 0x68, 0x41, 0x91, 0xb4, - 0xcb, 0xed, 0xa9, 0x5b, 0xd2, 0x97, 0x63, 0xd8, 0xb5, 0xf6, 0x59, 0x24, 0x45, 0xac, 0x76, 0x24, - 0x29, 0x67, 0x8a, 0xa5, 0xfd, 0xa6, 0x1c, 0xfc, 0x1a, 0xd5, 0x0a, 0x36, 0x67, 0x3b, 0x31, 0xbd, - 0xb3, 0x3d, 0xce, 0x24, 0xa1, 0x0c, 0x84, 0x93, 0xe3, 0x6e, 0x31, 0xd9, 0xfe, 0x54, 0x46, 0x8d, - 0x62, 0x75, 0x52, 0xa3, 0xeb, 0x5d, 0xea, 0x29, 0x93, 0xcb, 0xce, 0xa2, 0x8e, 0xec, 0x7b, 0xd8, - 0x46, 0x6b, 0x91, 0x24, 0x42, 0xba, 0x92, 0x06, 0xe0, 0xc6, 0x8c, 0x8e, 0x5c, 0x46, 0x18, 0x37, - 0xe7, 0x5a, 0x46, 0xa7, 0xe2, 0xac, 0xaa, 0xdc, 0x11, 0x0d, 0xe0, 0x98, 0xd1, 0xd1, 0x4b, 0xc2, - 0x38, 0xde, 0x44, 0x18, 0x98, 0x57, 0x94, 0x97, 0x95, 0x7c, 0x05, 0x98, 0x37, 0x21, 0x7e, 0x81, - 0x10, 0x91, 0x52, 0xd0, 0xd3, 0x58, 0x42, 0x64, 0xce, 0xab, 0x69, 0xdc, 0xb9, 0x65, 0xc2, 0x07, - 0x70, 0x7e, 0x42, 0xfc, 0x38, 0x9b, 0xea, 0x18, 0x00, 0x3f, 0x40, 0xa6, 0x27, 0x78, 0x18, 0x82, - 0xe7, 0xfe, 0x8a, 0xba, 0x7d, 0x1e, 0x33, 0x69, 0x2e, 0xb4, 0x8c, 0x4e, 0xdd, 0xf9, 0x47, 0xe7, - 0x1f, 0xe7, 0xe9, 0xbd, 0x24, 0x8b, 0xef, 0xa3, 0x7f, 0xb9, 0xa0, 0x03, 0xca, 0x88, 0xef, 0x86, - 0xe4, 0xdc, 0xe7, 0xc4, 0x73, 0xcf, 0xb8, 0x08, 0x88, 0x34, 0x2b, 0x6a, 0x8c, 0x7f, 0x67, 0xe9, - 0x5e, 0x9a, 0x7d, 0xa6, 0x92, 0x78, 0x03, 0x35, 0x8a, 0x75, 0x66, 0x55, 0xcd, 0x70, 0xa5, 0x50, - 0x80, 0x8f, 0x50, 0x55, 0x8f, 0xd5, 0xac, 0xa9, 0xab, 0x74, 0xef, 0x4f, 0x8e, 0x5d, 0xbb, 0xce, - 0x50, 0xbb, 0x5f, 0x8d, 0x8b, 0xab, 0xa6, 0x71, 0x79, 0xd5, 0x34, 0xbe, 0x5f, 0x35, 0x8d, 0x0f, - 0xd7, 0xcd, 0xd2, 0xe5, 0x75, 0xb3, 0xf4, 0xf9, 0xba, 0x59, 0x42, 0x16, 0xe5, 0xb3, 0x74, 0xd8, - 0xad, 0x67, 0x77, 0xbe, 0x97, 0xc8, 0x7a, 0xc6, 0x1b, 0x67, 0x50, 0x04, 0xd0, 0xe4, 0x45, 0xf4, - 0x7d, 0xe8, 0x4b, 0x2e, 0xec, 0xd0, 0x23, 0x92, 0xd8, 0x94, 0x49, 0x10, 0x8c, 0xf8, 0xb6, 0xfa, - 0x53, 0x1d, 0x06, 0xc0, 0x7e, 0xf7, 0xb8, 0x7d, 0x9c, 0xdb, 0x3c, 0x0c, 0x81, 0x1d, 0xe5, 0x44, - 0xd5, 0x2b, 0x33, 0x17, 0x59, 0x27, 0xdd, 0xa7, 0x63, 0xea, 0xd3, 0x8a, 0xe2, 0x6d, 0xff, 0x0c, - 0x00, 0x00, 0xff, 0xff, 0xe1, 0x89, 0x49, 0xa4, 0x1b, 0x06, 0x00, 0x00, + // 671 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0xdf, 0x6e, 0xd3, 0x30, + 0x14, 0xc6, 0xeb, 0xfd, 0x69, 0x3b, 0x6f, 0x65, 0x9d, 0x35, 0x20, 0x9a, 0x44, 0x57, 0xf5, 0x86, + 0x8e, 0x49, 0x89, 0xba, 0x21, 0x84, 0x86, 0x10, 0xa2, 0x1b, 0x48, 0x63, 0x82, 0x55, 0x61, 0x9b, + 0x04, 0x37, 0x91, 0xd7, 0x78, 0xc5, 0x28, 0xb1, 0x23, 0xc7, 0xa9, 0x3a, 0x9e, 0x82, 0x2b, 0x1e, + 0x82, 0x27, 0xd9, 0xe5, 0x2e, 0xd1, 0x90, 0x26, 0xb4, 0xdd, 0xb0, 0xb7, 0x40, 0x71, 0x9c, 0xd0, + 0x46, 0x45, 0x53, 0xb9, 0x89, 0x1c, 0x9f, 0xef, 0xfc, 0xce, 0xf9, 0x7c, 0x9c, 0xc0, 0x2d, 0x1e, + 0x10, 0x26, 0x89, 0x47, 0x7c, 0x22, 0xc5, 0xa9, 0x15, 0x08, 0x2e, 0x79, 0xfc, 0x3c, 0xa1, 0x1e, + 0x09, 0xad, 0x7e, 0x8b, 0x0c, 0x02, 0x22, 0xa8, 0x4f, 0x98, 0xc4, 0x5e, 0xb6, 0x6f, 0x2a, 0x19, + 0x5a, 0x1f, 0xc9, 0x4d, 0x36, 0xcd, 0x4c, 0x33, 0x9a, 0xbb, 0xb2, 0xdc, 0xe3, 0x3d, 0x9e, 0xe0, + 0xe3, 0x55, 0xa2, 0x5e, 0x79, 0x34, 0xae, 0x7c, 0x97, 0xfb, 0x3e, 0x67, 0x56, 0xbf, 0xa5, 0x57, + 0x5a, 0x6b, 0x8e, 0xd3, 0x0a, 0x12, 0xf2, 0x48, 0x74, 0x49, 0xac, 0x4e, 0xd7, 0x5a, 0xff, 0x62, + 0x22, 0x6b, 0x71, 0x80, 0x0c, 0x24, 0x61, 0x2e, 0x71, 0x13, 0x40, 0xe3, 0x0b, 0x5c, 0xe8, 0x68, + 0xf9, 0x0e, 0x96, 0x18, 0x7d, 0x86, 0x4b, 0x69, 0x09, 0x27, 0xe5, 0x18, 0xa0, 0x3e, 0xdd, 0x9c, + 0xdf, 0x78, 0x6e, 0x4e, 0x70, 0x16, 0xa6, 0xad, 0x29, 0x29, 0xdd, 0xae, 0x8a, 0xdc, 0x4e, 0xe3, + 0x06, 0xc0, 0x6a, 0x5e, 0x86, 0xf6, 0x60, 0x39, 0x15, 0x1a, 0xa0, 0x0e, 0x9a, 0xf3, 0x1b, 0x6b, + 0x63, 0xeb, 0x66, 0x07, 0xd1, 0x6f, 0x65, 0xb5, 0xda, 0x33, 0x67, 0x97, 0xab, 0x05, 0x3b, 0x03, + 0x20, 0x0c, 0xef, 0x84, 0x5d, 0x1e, 0x0c, 0x59, 0x99, 0x52, 0x56, 0xb6, 0x26, 0xb2, 0xf2, 0x3e, + 0x46, 0x64, 0x3e, 0x2a, 0xe1, 0xf0, 0x2b, 0x7a, 0x00, 0x61, 0xd8, 0xfd, 0x44, 0x7c, 0xec, 0x44, + 0xc2, 0x33, 0xa6, 0xeb, 0xa0, 0x39, 0x67, 0xcf, 0x25, 0x3b, 0x87, 0xc2, 0x7b, 0x53, 0x2c, 0xff, + 0x2e, 0x55, 0x6f, 0x4a, 0x8d, 0x0b, 0x00, 0x2b, 0x23, 0x1c, 0xb4, 0x0f, 0x67, 0x15, 0x49, 0xbb, + 0xdc, 0x1c, 0xdb, 0x92, 0xbe, 0x1c, 0xfd, 0x96, 0xb9, 0xcb, 0x42, 0x29, 0x22, 0xd5, 0x91, 0xa4, + 0x9c, 0x29, 0x96, 0xf6, 0x9b, 0x70, 0xd0, 0x07, 0x58, 0xce, 0xd9, 0x9c, 0x6c, 0x62, 0xba, 0xb3, + 0x6d, 0xce, 0x24, 0xa6, 0x8c, 0x08, 0x3b, 0xc3, 0xdd, 0x62, 0xb2, 0xf1, 0x6d, 0x06, 0x56, 0xf3, + 0xd9, 0xe8, 0x18, 0x42, 0x9d, 0xef, 0x50, 0x57, 0x99, 0x5c, 0x68, 0x6f, 0xc7, 0xfd, 0x5e, 0x5c, + 0xae, 0x3e, 0xeb, 0xf1, 0x5c, 0x6b, 0x34, 0xfe, 0x24, 0x3c, 0x8f, 0x74, 0x25, 0x17, 0x56, 0xe0, + 0x62, 0x89, 0x2d, 0xca, 0x24, 0x11, 0x0c, 0x7b, 0x56, 0xfc, 0x96, 0x76, 0xb7, 0xbb, 0x63, 0xcf, + 0x69, 0xec, 0xae, 0x8b, 0x2c, 0xb8, 0x1c, 0x4a, 0x2c, 0xa4, 0x23, 0xa9, 0x4f, 0x9c, 0x88, 0xd1, + 0x81, 0xc3, 0x30, 0xe3, 0xc6, 0x54, 0x1d, 0x34, 0x8b, 0xf6, 0x92, 0x8a, 0x1d, 0x50, 0x9f, 0x1c, + 0x32, 0x3a, 0x78, 0x87, 0x19, 0x47, 0xeb, 0x10, 0x11, 0xe6, 0xe6, 0xe5, 0xd3, 0x4a, 0xbe, 0x48, + 0x98, 0x3b, 0x22, 0x7e, 0x0b, 0x21, 0x96, 0x52, 0xd0, 0xe3, 0x48, 0x92, 0xd0, 0x98, 0x51, 0x47, + 0xfa, 0xf0, 0x96, 0x31, 0xed, 0x91, 0xd3, 0x23, 0xec, 0x45, 0xe9, 0x68, 0x86, 0x00, 0xe8, 0x29, + 0x34, 0x5c, 0xc1, 0x83, 0x80, 0xb8, 0xce, 0xdf, 0x5d, 0xa7, 0xcb, 0x23, 0x26, 0x8d, 0xd9, 0x3a, + 0x68, 0x56, 0xec, 0x7b, 0x3a, 0xfe, 0x32, 0x0b, 0x6f, 0xc7, 0x51, 0xf4, 0x04, 0xde, 0xe7, 0x82, + 0xf6, 0x28, 0xc3, 0x9e, 0x13, 0xe0, 0x53, 0x8f, 0x63, 0xd7, 0x39, 0xe1, 0xc2, 0xc7, 0xd2, 0x28, + 0xaa, 0x59, 0xdc, 0x4d, 0xc3, 0x9d, 0x24, 0xfa, 0x5a, 0x05, 0xd1, 0x1a, 0xac, 0xe6, 0xf3, 0x8c, + 0x52, 0x3c, 0x08, 0x7b, 0x31, 0x97, 0x80, 0x0e, 0x60, 0x49, 0x1f, 0xab, 0x51, 0x56, 0xf7, 0xf1, + 0xf1, 0xff, 0xdc, 0x1d, 0xed, 0x3a, 0x45, 0xb5, 0x7f, 0x82, 0xb3, 0xab, 0x1a, 0x38, 0xbf, 0xaa, + 0x81, 0x5f, 0x57, 0x35, 0xf0, 0xf5, 0xba, 0x56, 0x38, 0xbf, 0xae, 0x15, 0x7e, 0x5c, 0xd7, 0x0a, + 0xd0, 0xa4, 0x7c, 0x92, 0x0a, 0xed, 0x4a, 0xfa, 0xe1, 0x74, 0x62, 0x59, 0x07, 0x7c, 0xb4, 0x27, + 0xbe, 0x43, 0xc9, 0xef, 0xb1, 0x47, 0xd8, 0xbf, 0xfe, 0x90, 0xdf, 0xa7, 0xd6, 0xf7, 0x03, 0xc2, + 0x0e, 0x32, 0xa2, 0xaa, 0x95, 0x9a, 0x0b, 0xcd, 0xa3, 0xd6, 0xab, 0x21, 0xf5, 0x71, 0x51, 0xf1, + 0x36, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x73, 0x8f, 0x2e, 0xdd, 0x60, 0x06, 0x00, 0x00, } func (m *ProfilesData) Marshal() (dAtA []byte, err error) { @@ -636,13 +631,16 @@ func (m *ProfileContainer) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x11 } - if len(m.ProfileId) > 0 { - i -= len(m.ProfileId) - copy(dAtA[i:], m.ProfileId) - i = encodeVarintProfiles(dAtA, i, uint64(len(m.ProfileId))) - i-- - dAtA[i] = 0xa + { + size := m.ProfileId.Size() + i -= size + if _, err := m.ProfileId.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintProfiles(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -720,10 +718,8 @@ func (m *ProfileContainer) Size() (n int) { } var l int _ = l - l = len(m.ProfileId) - if l > 0 { - n += 1 + l + sovProfiles(uint64(l)) - } + l = m.ProfileId.Size() + n += 1 + l + sovProfiles(uint64(l)) if m.StartTimeUnixNano != 0 { n += 9 } @@ -1198,9 +1194,8 @@ func (m *ProfileContainer) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ProfileId = append(m.ProfileId[:0], dAtA[iNdEx:postIndex]...) - if m.ProfileId == nil { - m.ProfileId = []byte{} + if err := m.ProfileId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } iNdEx = postIndex case 2: diff --git a/pdata/internal/otlp/profiles.go b/pdata/internal/otlp/profiles.go new file mode 100644 index 00000000000..d134ccf9c06 --- /dev/null +++ b/pdata/internal/otlp/profiles.go @@ -0,0 +1,12 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package otlp // import "go.opentelemetry.io/collector/pdata/internal/otlp" + +import ( + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" +) + +// MigrateProfiles implements any translation needed due to deprecation in OTLP profiles protocol. +// Any pprofile.Unmarshaler implementation from OTLP (proto/json) MUST call this, and the gRPC Server implementation. +func MigrateProfiles(_ []*otlpprofiles.ResourceProfiles) {} diff --git a/pdata/internal/otlp/profiles_test.go b/pdata/internal/otlp/profiles_test.go new file mode 100644 index 00000000000..91f9db32657 --- /dev/null +++ b/pdata/internal/otlp/profiles_test.go @@ -0,0 +1,18 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package otlp + +import ( + "testing" + + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" +) + +func TestMigrateProfiles(_ *testing.T) { + rps := []*otlpprofiles.ResourceProfiles{ + {}, + } + + MigrateProfiles(rps) +} diff --git a/pdata/pcommon/map_test.go b/pdata/pcommon/map_test.go index 2e4f864f6bf..a60d650fdc0 100644 --- a/pdata/pcommon/map_test.go +++ b/pdata/pcommon/map_test.go @@ -320,7 +320,7 @@ func TestMap_Range(t *testing.T) { delete(rawMap, k) return true }) - assert.EqualValues(t, 0, len(rawMap)) + assert.Empty(t, rawMap) } func TestMap_FromRaw(t *testing.T) { @@ -427,7 +427,7 @@ func TestMap_EnsureCapacity_Existing(t *testing.T) { // Ensure previously existing element is still there. assert.Equal(t, 1, am.Len()) v, ok := am.Get("foo") - assert.Equal(t, v.Str(), "bar") + assert.Equal(t, "bar", v.Str()) assert.True(t, ok) assert.Equal(t, 5, cap(*am.getOrig())) @@ -439,11 +439,11 @@ func TestMap_EnsureCapacity_Existing(t *testing.T) { assert.Equal(t, 2, am.Len()) v, ok = am.Get("foo") - assert.Equal(t, v.Str(), "bar") + assert.Equal(t, "bar", v.Str()) assert.True(t, ok) v, ok = am.Get("abc") - assert.Equal(t, v.Str(), "xyz") + assert.Equal(t, "xyz", v.Str()) assert.True(t, ok) } diff --git a/pdata/pcommon/slice_test.go b/pdata/pcommon/slice_test.go index 705f10f88e7..b3628ff9903 100644 --- a/pdata/pcommon/slice_test.go +++ b/pdata/pcommon/slice_test.go @@ -77,7 +77,7 @@ func TestSlice_EnsureCapacity(t *testing.T) { for i := 0; i < es.Len(); i++ { expectedEs[es.At(i).getOrig()] = true } - assert.Equal(t, es.Len(), len(expectedEs)) + assert.Len(t, expectedEs, es.Len()) es.EnsureCapacity(ensureSmallLen) assert.Less(t, ensureSmallLen, es.Len()) foundEs := make(map[*otlpcommon.AnyValue]bool, es.Len()) @@ -89,7 +89,7 @@ func TestSlice_EnsureCapacity(t *testing.T) { // Test ensure larger capacity const ensureLargeLen = 9 oldLen := es.Len() - assert.Equal(t, oldLen, len(expectedEs)) + assert.Len(t, expectedEs, oldLen) es.EnsureCapacity(ensureLargeLen) assert.Equal(t, ensureLargeLen, cap(*es.getOrig())) } diff --git a/pdata/pcommon/value_test.go b/pdata/pcommon/value_test.go index deb03b9965a..11e6ced1692 100644 --- a/pdata/pcommon/value_test.go +++ b/pdata/pcommon/value_test.go @@ -255,7 +255,7 @@ func TestValue_CopyTo(t *testing.T) { av := NewValueEmpty() destVal := otlpcommon.AnyValue{Value: &otlpcommon.AnyValue_IntValue{}} av.CopyTo(newValue(&destVal, &state)) - assert.EqualValues(t, nil, destVal.Value) + assert.Nil(t, destVal.Value) } func TestSliceWithNilValues(t *testing.T) { diff --git a/pdata/plog/generated_logrecordslice_test.go b/pdata/plog/generated_logrecordslice_test.go index ff47a245987..d8f6b5345fb 100644 --- a/pdata/plog/generated_logrecordslice_test.go +++ b/pdata/plog/generated_logrecordslice_test.go @@ -129,13 +129,13 @@ func TestLogRecordSlice_Sort(t *testing.T) { return uintptr(unsafe.Pointer(a.orig)) < uintptr(unsafe.Pointer(b.orig)) }) for i := 1; i < es.Len(); i++ { - assert.True(t, uintptr(unsafe.Pointer(es.At(i-1).orig)) < uintptr(unsafe.Pointer(es.At(i).orig))) + assert.Less(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) } es.Sort(func(a, b LogRecord) bool { return uintptr(unsafe.Pointer(a.orig)) > uintptr(unsafe.Pointer(b.orig)) }) for i := 1; i < es.Len(); i++ { - assert.True(t, uintptr(unsafe.Pointer(es.At(i-1).orig)) > uintptr(unsafe.Pointer(es.At(i).orig))) + assert.Greater(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) } } diff --git a/pdata/plog/generated_resourcelogsslice_test.go b/pdata/plog/generated_resourcelogsslice_test.go index 993a597f119..3505ba5376a 100644 --- a/pdata/plog/generated_resourcelogsslice_test.go +++ b/pdata/plog/generated_resourcelogsslice_test.go @@ -129,13 +129,13 @@ func TestResourceLogsSlice_Sort(t *testing.T) { return uintptr(unsafe.Pointer(a.orig)) < uintptr(unsafe.Pointer(b.orig)) }) for i := 1; i < es.Len(); i++ { - assert.True(t, uintptr(unsafe.Pointer(es.At(i-1).orig)) < uintptr(unsafe.Pointer(es.At(i).orig))) + assert.Less(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) } es.Sort(func(a, b ResourceLogs) bool { return uintptr(unsafe.Pointer(a.orig)) > uintptr(unsafe.Pointer(b.orig)) }) for i := 1; i < es.Len(); i++ { - assert.True(t, uintptr(unsafe.Pointer(es.At(i-1).orig)) > uintptr(unsafe.Pointer(es.At(i).orig))) + assert.Greater(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) } } diff --git a/pdata/plog/generated_scopelogsslice_test.go b/pdata/plog/generated_scopelogsslice_test.go index 12678c7b4fc..6c599906449 100644 --- a/pdata/plog/generated_scopelogsslice_test.go +++ b/pdata/plog/generated_scopelogsslice_test.go @@ -129,13 +129,13 @@ func TestScopeLogsSlice_Sort(t *testing.T) { return uintptr(unsafe.Pointer(a.orig)) < uintptr(unsafe.Pointer(b.orig)) }) for i := 1; i < es.Len(); i++ { - assert.True(t, uintptr(unsafe.Pointer(es.At(i-1).orig)) < uintptr(unsafe.Pointer(es.At(i).orig))) + assert.Less(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) } es.Sort(func(a, b ScopeLogs) bool { return uintptr(unsafe.Pointer(a.orig)) > uintptr(unsafe.Pointer(b.orig)) }) for i := 1; i < es.Len(); i++ { - assert.True(t, uintptr(unsafe.Pointer(es.At(i-1).orig)) > uintptr(unsafe.Pointer(es.At(i).orig))) + assert.Greater(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) } } diff --git a/pdata/plog/pb_test.go b/pdata/plog/pb_test.go index f2d947a8eb0..0a6bf4bb772 100644 --- a/pdata/plog/pb_test.go +++ b/pdata/plog/pb_test.go @@ -44,7 +44,7 @@ func BenchmarkLogsToProto(b *testing.B) { for n := 0; n < b.N; n++ { buf, err := marshaler.MarshalLogs(logs) require.NoError(b, err) - assert.NotEqual(b, 0, len(buf)) + assert.NotEmpty(b, buf) } } @@ -54,7 +54,7 @@ func BenchmarkLogsFromProto(b *testing.B) { baseLogs := generateBenchmarkLogs(128) buf, err := marshaler.MarshalLogs(baseLogs) require.NoError(b, err) - assert.NotEqual(b, 0, len(buf)) + assert.NotEmpty(b, buf) b.ResetTimer() b.ReportAllocs() for n := 0; n < b.N; n++ { diff --git a/pdata/plog/plogotlp/request_test.go b/pdata/plog/plogotlp/request_test.go index a8376c2e87b..1a4acc62b97 100644 --- a/pdata/plog/plogotlp/request_test.go +++ b/pdata/plog/plogotlp/request_test.go @@ -39,9 +39,9 @@ var logsRequestJSON = []byte(` func TestRequestToPData(t *testing.T) { tr := NewExportRequest() - assert.Equal(t, tr.Logs().LogRecordCount(), 0) + assert.Equal(t, 0, tr.Logs().LogRecordCount()) tr.Logs().ResourceLogs().AppendEmpty().ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() - assert.Equal(t, tr.Logs().LogRecordCount(), 1) + assert.Equal(t, 1, tr.Logs().LogRecordCount()) } func TestRequestJSON(t *testing.T) { diff --git a/pdata/pmetric/generated_exponentialhistogramdatapointslice_test.go b/pdata/pmetric/generated_exponentialhistogramdatapointslice_test.go index 7c938c6ee22..7367f854a3a 100644 --- a/pdata/pmetric/generated_exponentialhistogramdatapointslice_test.go +++ b/pdata/pmetric/generated_exponentialhistogramdatapointslice_test.go @@ -129,13 +129,13 @@ func TestExponentialHistogramDataPointSlice_Sort(t *testing.T) { return uintptr(unsafe.Pointer(a.orig)) < uintptr(unsafe.Pointer(b.orig)) }) for i := 1; i < es.Len(); i++ { - assert.True(t, uintptr(unsafe.Pointer(es.At(i-1).orig)) < uintptr(unsafe.Pointer(es.At(i).orig))) + assert.Less(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) } es.Sort(func(a, b ExponentialHistogramDataPoint) bool { return uintptr(unsafe.Pointer(a.orig)) > uintptr(unsafe.Pointer(b.orig)) }) for i := 1; i < es.Len(); i++ { - assert.True(t, uintptr(unsafe.Pointer(es.At(i-1).orig)) > uintptr(unsafe.Pointer(es.At(i).orig))) + assert.Greater(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) } } diff --git a/pdata/pmetric/generated_histogramdatapointslice_test.go b/pdata/pmetric/generated_histogramdatapointslice_test.go index bcf4305b993..14a4cd95c0c 100644 --- a/pdata/pmetric/generated_histogramdatapointslice_test.go +++ b/pdata/pmetric/generated_histogramdatapointslice_test.go @@ -129,13 +129,13 @@ func TestHistogramDataPointSlice_Sort(t *testing.T) { return uintptr(unsafe.Pointer(a.orig)) < uintptr(unsafe.Pointer(b.orig)) }) for i := 1; i < es.Len(); i++ { - assert.True(t, uintptr(unsafe.Pointer(es.At(i-1).orig)) < uintptr(unsafe.Pointer(es.At(i).orig))) + assert.Less(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) } es.Sort(func(a, b HistogramDataPoint) bool { return uintptr(unsafe.Pointer(a.orig)) > uintptr(unsafe.Pointer(b.orig)) }) for i := 1; i < es.Len(); i++ { - assert.True(t, uintptr(unsafe.Pointer(es.At(i-1).orig)) > uintptr(unsafe.Pointer(es.At(i).orig))) + assert.Greater(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) } } diff --git a/pdata/pmetric/generated_metricslice_test.go b/pdata/pmetric/generated_metricslice_test.go index cb89ca8beab..ecd625e9dac 100644 --- a/pdata/pmetric/generated_metricslice_test.go +++ b/pdata/pmetric/generated_metricslice_test.go @@ -129,13 +129,13 @@ func TestMetricSlice_Sort(t *testing.T) { return uintptr(unsafe.Pointer(a.orig)) < uintptr(unsafe.Pointer(b.orig)) }) for i := 1; i < es.Len(); i++ { - assert.True(t, uintptr(unsafe.Pointer(es.At(i-1).orig)) < uintptr(unsafe.Pointer(es.At(i).orig))) + assert.Less(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) } es.Sort(func(a, b Metric) bool { return uintptr(unsafe.Pointer(a.orig)) > uintptr(unsafe.Pointer(b.orig)) }) for i := 1; i < es.Len(); i++ { - assert.True(t, uintptr(unsafe.Pointer(es.At(i-1).orig)) > uintptr(unsafe.Pointer(es.At(i).orig))) + assert.Greater(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) } } diff --git a/pdata/pmetric/generated_numberdatapointslice_test.go b/pdata/pmetric/generated_numberdatapointslice_test.go index 6bc35ff03c2..e431fc4b0e2 100644 --- a/pdata/pmetric/generated_numberdatapointslice_test.go +++ b/pdata/pmetric/generated_numberdatapointslice_test.go @@ -129,13 +129,13 @@ func TestNumberDataPointSlice_Sort(t *testing.T) { return uintptr(unsafe.Pointer(a.orig)) < uintptr(unsafe.Pointer(b.orig)) }) for i := 1; i < es.Len(); i++ { - assert.True(t, uintptr(unsafe.Pointer(es.At(i-1).orig)) < uintptr(unsafe.Pointer(es.At(i).orig))) + assert.Less(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) } es.Sort(func(a, b NumberDataPoint) bool { return uintptr(unsafe.Pointer(a.orig)) > uintptr(unsafe.Pointer(b.orig)) }) for i := 1; i < es.Len(); i++ { - assert.True(t, uintptr(unsafe.Pointer(es.At(i-1).orig)) > uintptr(unsafe.Pointer(es.At(i).orig))) + assert.Greater(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) } } diff --git a/pdata/pmetric/generated_resourcemetricsslice_test.go b/pdata/pmetric/generated_resourcemetricsslice_test.go index 869f7a37503..41672b180c9 100644 --- a/pdata/pmetric/generated_resourcemetricsslice_test.go +++ b/pdata/pmetric/generated_resourcemetricsslice_test.go @@ -129,13 +129,13 @@ func TestResourceMetricsSlice_Sort(t *testing.T) { return uintptr(unsafe.Pointer(a.orig)) < uintptr(unsafe.Pointer(b.orig)) }) for i := 1; i < es.Len(); i++ { - assert.True(t, uintptr(unsafe.Pointer(es.At(i-1).orig)) < uintptr(unsafe.Pointer(es.At(i).orig))) + assert.Less(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) } es.Sort(func(a, b ResourceMetrics) bool { return uintptr(unsafe.Pointer(a.orig)) > uintptr(unsafe.Pointer(b.orig)) }) for i := 1; i < es.Len(); i++ { - assert.True(t, uintptr(unsafe.Pointer(es.At(i-1).orig)) > uintptr(unsafe.Pointer(es.At(i).orig))) + assert.Greater(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) } } diff --git a/pdata/pmetric/generated_scopemetricsslice_test.go b/pdata/pmetric/generated_scopemetricsslice_test.go index b0903bc256e..0374828d6b5 100644 --- a/pdata/pmetric/generated_scopemetricsslice_test.go +++ b/pdata/pmetric/generated_scopemetricsslice_test.go @@ -129,13 +129,13 @@ func TestScopeMetricsSlice_Sort(t *testing.T) { return uintptr(unsafe.Pointer(a.orig)) < uintptr(unsafe.Pointer(b.orig)) }) for i := 1; i < es.Len(); i++ { - assert.True(t, uintptr(unsafe.Pointer(es.At(i-1).orig)) < uintptr(unsafe.Pointer(es.At(i).orig))) + assert.Less(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) } es.Sort(func(a, b ScopeMetrics) bool { return uintptr(unsafe.Pointer(a.orig)) > uintptr(unsafe.Pointer(b.orig)) }) for i := 1; i < es.Len(); i++ { - assert.True(t, uintptr(unsafe.Pointer(es.At(i-1).orig)) > uintptr(unsafe.Pointer(es.At(i).orig))) + assert.Greater(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) } } diff --git a/pdata/pmetric/generated_sum_test.go b/pdata/pmetric/generated_sum_test.go index 98f3574b10f..1ee64cc58e8 100644 --- a/pdata/pmetric/generated_sum_test.go +++ b/pdata/pmetric/generated_sum_test.go @@ -48,9 +48,9 @@ func TestSum_AggregationTemporality(t *testing.T) { func TestSum_IsMonotonic(t *testing.T) { ms := NewSum() - assert.Equal(t, false, ms.IsMonotonic()) + assert.False(t, ms.IsMonotonic()) ms.SetIsMonotonic(true) - assert.Equal(t, true, ms.IsMonotonic()) + assert.True(t, ms.IsMonotonic()) sharedState := internal.StateReadOnly assert.Panics(t, func() { newSum(&otlpmetrics.Sum{}, &sharedState).SetIsMonotonic(true) }) } diff --git a/pdata/pmetric/generated_summarydatapointslice_test.go b/pdata/pmetric/generated_summarydatapointslice_test.go index 10a12b45e5a..2ebbe38c0bd 100644 --- a/pdata/pmetric/generated_summarydatapointslice_test.go +++ b/pdata/pmetric/generated_summarydatapointslice_test.go @@ -129,13 +129,13 @@ func TestSummaryDataPointSlice_Sort(t *testing.T) { return uintptr(unsafe.Pointer(a.orig)) < uintptr(unsafe.Pointer(b.orig)) }) for i := 1; i < es.Len(); i++ { - assert.True(t, uintptr(unsafe.Pointer(es.At(i-1).orig)) < uintptr(unsafe.Pointer(es.At(i).orig))) + assert.Less(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) } es.Sort(func(a, b SummaryDataPoint) bool { return uintptr(unsafe.Pointer(a.orig)) > uintptr(unsafe.Pointer(b.orig)) }) for i := 1; i < es.Len(); i++ { - assert.True(t, uintptr(unsafe.Pointer(es.At(i-1).orig)) > uintptr(unsafe.Pointer(es.At(i).orig))) + assert.Greater(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) } } diff --git a/pdata/pmetric/generated_summarydatapointvalueatquantileslice_test.go b/pdata/pmetric/generated_summarydatapointvalueatquantileslice_test.go index 5ad949f10d1..f879c4bc478 100644 --- a/pdata/pmetric/generated_summarydatapointvalueatquantileslice_test.go +++ b/pdata/pmetric/generated_summarydatapointvalueatquantileslice_test.go @@ -129,13 +129,13 @@ func TestSummaryDataPointValueAtQuantileSlice_Sort(t *testing.T) { return uintptr(unsafe.Pointer(a.orig)) < uintptr(unsafe.Pointer(b.orig)) }) for i := 1; i < es.Len(); i++ { - assert.True(t, uintptr(unsafe.Pointer(es.At(i-1).orig)) < uintptr(unsafe.Pointer(es.At(i).orig))) + assert.Less(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) } es.Sort(func(a, b SummaryDataPointValueAtQuantile) bool { return uintptr(unsafe.Pointer(a.orig)) > uintptr(unsafe.Pointer(b.orig)) }) for i := 1; i < es.Len(); i++ { - assert.True(t, uintptr(unsafe.Pointer(es.At(i-1).orig)) > uintptr(unsafe.Pointer(es.At(i).orig))) + assert.Greater(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) } } diff --git a/pdata/pmetric/pb_test.go b/pdata/pmetric/pb_test.go index f1d4d4f249e..164a6566357 100644 --- a/pdata/pmetric/pb_test.go +++ b/pdata/pmetric/pb_test.go @@ -43,7 +43,7 @@ func BenchmarkMetricsToProto(b *testing.B) { for n := 0; n < b.N; n++ { buf, err := marshaler.MarshalMetrics(metrics) require.NoError(b, err) - assert.NotEqual(b, 0, len(buf)) + assert.NotEmpty(b, buf) } } @@ -53,7 +53,7 @@ func BenchmarkMetricsFromProto(b *testing.B) { baseMetrics := generateBenchmarkMetrics(128) buf, err := marshaler.MarshalMetrics(baseMetrics) require.NoError(b, err) - assert.NotEqual(b, 0, len(buf)) + assert.NotEmpty(b, buf) b.ResetTimer() b.ReportAllocs() for n := 0; n < b.N; n++ { diff --git a/pdata/pmetric/pmetricotlp/request_test.go b/pdata/pmetric/pmetricotlp/request_test.go index 7b8ca7fcc5f..e125ef5fe61 100644 --- a/pdata/pmetric/pmetricotlp/request_test.go +++ b/pdata/pmetric/pmetricotlp/request_test.go @@ -35,9 +35,9 @@ var metricsRequestJSON = []byte(` func TestRequestToPData(t *testing.T) { tr := NewExportRequest() - assert.Equal(t, tr.Metrics().MetricCount(), 0) + assert.Equal(t, 0, tr.Metrics().MetricCount()) tr.Metrics().ResourceMetrics().AppendEmpty().ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() - assert.Equal(t, tr.Metrics().MetricCount(), 1) + assert.Equal(t, 1, tr.Metrics().MetricCount()) } func TestRequestJSON(t *testing.T) { diff --git a/pdata/pprofile/encoding.go b/pdata/pprofile/encoding.go new file mode 100644 index 00000000000..ed37cd6f65b --- /dev/null +++ b/pdata/pprofile/encoding.go @@ -0,0 +1,31 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package pprofile // import "go.opentelemetry.io/collector/pdata/pprofile" + +// MarshalSizer is the interface that groups the basic Marshal and Size methods +type MarshalSizer interface { + Marshaler + Sizer +} + +// Marshaler marshals pprofile.Profiles into bytes. +type Marshaler interface { + // MarshalProfiles the given pprofile.Profiles into bytes. + // If the error is not nil, the returned bytes slice cannot be used. + MarshalProfiles(td Profiles) ([]byte, error) +} + +// Unmarshaler unmarshalls bytes into pprofile.Profiles. +type Unmarshaler interface { + // UnmarshalProfiles the given bytes into pprofile.Profiles. + // If the error is not nil, the returned pprofile.Profiles cannot be used. + UnmarshalProfiles(buf []byte) (Profiles, error) +} + +// Sizer is an optional interface implemented by the Marshaler, +// that calculates the size of a marshaled Profiles. +type Sizer interface { + // ProfilesSize returns the size in bytes of a marshaled Profiles. + ProfilesSize(td Profiles) int +} diff --git a/pdata/pprofile/fuzz_test.go b/pdata/pprofile/fuzz_test.go new file mode 100644 index 00000000000..fcb1927a231 --- /dev/null +++ b/pdata/pprofile/fuzz_test.go @@ -0,0 +1,16 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package pprofile // import "go.opentelemetry.io/collector/pdata/pprofile" + +import ( + "testing" +) + +func FuzzUnmarshalProfiles(f *testing.F) { + f.Fuzz(func(_ *testing.T, data []byte) { + u := &JSONUnmarshaler{} + //nolint: errcheck + _, _ = u.UnmarshalProfiles(data) + }) +} diff --git a/pdata/pprofile/generated_location_test.go b/pdata/pprofile/generated_location_test.go index 60f6d553bb6..fc20d72edcc 100644 --- a/pdata/pprofile/generated_location_test.go +++ b/pdata/pprofile/generated_location_test.go @@ -75,9 +75,9 @@ func TestLocation_Line(t *testing.T) { func TestLocation_IsFolded(t *testing.T) { ms := NewLocation() - assert.Equal(t, false, ms.IsFolded()) + assert.False(t, ms.IsFolded()) ms.SetIsFolded(true) - assert.Equal(t, true, ms.IsFolded()) + assert.True(t, ms.IsFolded()) sharedState := internal.StateReadOnly assert.Panics(t, func() { newLocation(&otlpprofiles.Location{}, &sharedState).SetIsFolded(true) }) } diff --git a/pdata/pprofile/generated_mapping_test.go b/pdata/pprofile/generated_mapping_test.go index 6a50c205084..ab575615297 100644 --- a/pdata/pprofile/generated_mapping_test.go +++ b/pdata/pprofile/generated_mapping_test.go @@ -111,36 +111,36 @@ func TestMapping_Attributes(t *testing.T) { func TestMapping_HasFunctions(t *testing.T) { ms := NewMapping() - assert.Equal(t, false, ms.HasFunctions()) + assert.False(t, ms.HasFunctions()) ms.SetHasFunctions(true) - assert.Equal(t, true, ms.HasFunctions()) + assert.True(t, ms.HasFunctions()) sharedState := internal.StateReadOnly assert.Panics(t, func() { newMapping(&otlpprofiles.Mapping{}, &sharedState).SetHasFunctions(true) }) } func TestMapping_HasFilenames(t *testing.T) { ms := NewMapping() - assert.Equal(t, false, ms.HasFilenames()) + assert.False(t, ms.HasFilenames()) ms.SetHasFilenames(true) - assert.Equal(t, true, ms.HasFilenames()) + assert.True(t, ms.HasFilenames()) sharedState := internal.StateReadOnly assert.Panics(t, func() { newMapping(&otlpprofiles.Mapping{}, &sharedState).SetHasFilenames(true) }) } func TestMapping_HasLineNumbers(t *testing.T) { ms := NewMapping() - assert.Equal(t, false, ms.HasLineNumbers()) + assert.False(t, ms.HasLineNumbers()) ms.SetHasLineNumbers(true) - assert.Equal(t, true, ms.HasLineNumbers()) + assert.True(t, ms.HasLineNumbers()) sharedState := internal.StateReadOnly assert.Panics(t, func() { newMapping(&otlpprofiles.Mapping{}, &sharedState).SetHasLineNumbers(true) }) } func TestMapping_HasInlineFrames(t *testing.T) { ms := NewMapping() - assert.Equal(t, false, ms.HasInlineFrames()) + assert.False(t, ms.HasInlineFrames()) ms.SetHasInlineFrames(true) - assert.Equal(t, true, ms.HasInlineFrames()) + assert.True(t, ms.HasInlineFrames()) sharedState := internal.StateReadOnly assert.Panics(t, func() { newMapping(&otlpprofiles.Mapping{}, &sharedState).SetHasInlineFrames(true) }) } diff --git a/pdata/pprofile/generated_profilecontainer.go b/pdata/pprofile/generated_profilecontainer.go index 6bf15a98b45..9f597728565 100644 --- a/pdata/pprofile/generated_profilecontainer.go +++ b/pdata/pprofile/generated_profilecontainer.go @@ -8,6 +8,7 @@ package pprofile import ( "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" ) @@ -46,9 +47,15 @@ func (ms ProfileContainer) MoveTo(dest ProfileContainer) { *ms.orig = otlpprofiles.ProfileContainer{} } -// ProfileID returns the ProfileId associated with this ProfileContainer. -func (ms ProfileContainer) ProfileID() pcommon.ByteSlice { - return pcommon.ByteSlice(internal.NewByteSlice(&ms.orig.ProfileId, ms.state)) +// ProfileID returns the profileid associated with this ProfileContainer. +func (ms ProfileContainer) ProfileID() ProfileID { + return ProfileID(ms.orig.ProfileId) +} + +// SetProfileID replaces the profileid associated with this ProfileContainer. +func (ms ProfileContainer) SetProfileID(v ProfileID) { + ms.state.AssertMutable() + ms.orig.ProfileId = data.ProfileID(v) } // StartTime returns the starttime associated with this ProfileContainer. @@ -97,7 +104,7 @@ func (ms ProfileContainer) Profile() Profile { // CopyTo copies all properties from the current struct overriding the destination. func (ms ProfileContainer) CopyTo(dest ProfileContainer) { dest.state.AssertMutable() - ms.ProfileID().CopyTo(dest.ProfileID()) + dest.SetProfileID(ms.ProfileID()) dest.SetStartTime(ms.StartTime()) dest.SetEndTime(ms.EndTime()) ms.Attributes().CopyTo(dest.Attributes()) diff --git a/pdata/pprofile/generated_profilecontainer_test.go b/pdata/pprofile/generated_profilecontainer_test.go index 72a922a457d..1af7282f3cf 100644 --- a/pdata/pprofile/generated_profilecontainer_test.go +++ b/pdata/pprofile/generated_profilecontainer_test.go @@ -12,6 +12,7 @@ import ( "github.com/stretchr/testify/assert" "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" ) @@ -41,9 +42,10 @@ func TestProfileContainer_CopyTo(t *testing.T) { func TestProfileContainer_ProfileID(t *testing.T) { ms := NewProfileContainer() - assert.Equal(t, pcommon.NewByteSlice(), ms.ProfileID()) - internal.FillTestByteSlice(internal.ByteSlice(ms.ProfileID())) - assert.Equal(t, pcommon.ByteSlice(internal.GenerateTestByteSlice()), ms.ProfileID()) + assert.Equal(t, ProfileID(data.ProfileID([16]byte{})), ms.ProfileID()) + testValProfileID := ProfileID(data.ProfileID([16]byte{1, 2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 4, 3, 2, 1})) + ms.SetProfileID(testValProfileID) + assert.Equal(t, testValProfileID, ms.ProfileID()) } func TestProfileContainer_StartTime(t *testing.T) { @@ -93,7 +95,7 @@ func generateTestProfileContainer() ProfileContainer { } func fillTestProfileContainer(tv ProfileContainer) { - internal.FillTestByteSlice(internal.NewByteSlice(&tv.orig.ProfileId, tv.state)) + tv.orig.ProfileId = data.ProfileID([16]byte{1, 2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 4, 3, 2, 1}) tv.orig.StartTimeUnixNano = 1234567890 tv.orig.EndTimeUnixNano = 1234567890 internal.FillTestMap(internal.NewMap(&tv.orig.Attributes, tv.state)) diff --git a/pdata/pprofile/generated_profilescontainersslice_test.go b/pdata/pprofile/generated_profilescontainersslice_test.go index 428fd677c3a..902fd4cf24b 100644 --- a/pdata/pprofile/generated_profilescontainersslice_test.go +++ b/pdata/pprofile/generated_profilescontainersslice_test.go @@ -129,13 +129,13 @@ func TestProfilesContainersSlice_Sort(t *testing.T) { return uintptr(unsafe.Pointer(a.orig)) < uintptr(unsafe.Pointer(b.orig)) }) for i := 1; i < es.Len(); i++ { - assert.True(t, uintptr(unsafe.Pointer(es.At(i-1).orig)) < uintptr(unsafe.Pointer(es.At(i).orig))) + assert.Less(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) } es.Sort(func(a, b ProfileContainer) bool { return uintptr(unsafe.Pointer(a.orig)) > uintptr(unsafe.Pointer(b.orig)) }) for i := 1; i < es.Len(); i++ { - assert.True(t, uintptr(unsafe.Pointer(es.At(i-1).orig)) > uintptr(unsafe.Pointer(es.At(i).orig))) + assert.Greater(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) } } diff --git a/pdata/pprofile/generated_resourceprofilesslice_test.go b/pdata/pprofile/generated_resourceprofilesslice_test.go index 3d319fc8b16..32ec740a939 100644 --- a/pdata/pprofile/generated_resourceprofilesslice_test.go +++ b/pdata/pprofile/generated_resourceprofilesslice_test.go @@ -129,13 +129,13 @@ func TestResourceProfilesSlice_Sort(t *testing.T) { return uintptr(unsafe.Pointer(a.orig)) < uintptr(unsafe.Pointer(b.orig)) }) for i := 1; i < es.Len(); i++ { - assert.True(t, uintptr(unsafe.Pointer(es.At(i-1).orig)) < uintptr(unsafe.Pointer(es.At(i).orig))) + assert.Less(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) } es.Sort(func(a, b ResourceProfiles) bool { return uintptr(unsafe.Pointer(a.orig)) > uintptr(unsafe.Pointer(b.orig)) }) for i := 1; i < es.Len(); i++ { - assert.True(t, uintptr(unsafe.Pointer(es.At(i-1).orig)) > uintptr(unsafe.Pointer(es.At(i).orig))) + assert.Greater(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) } } diff --git a/pdata/pprofile/generated_scopeprofilesslice_test.go b/pdata/pprofile/generated_scopeprofilesslice_test.go index 831dafdec09..78dc1f05f1a 100644 --- a/pdata/pprofile/generated_scopeprofilesslice_test.go +++ b/pdata/pprofile/generated_scopeprofilesslice_test.go @@ -129,13 +129,13 @@ func TestScopeProfilesSlice_Sort(t *testing.T) { return uintptr(unsafe.Pointer(a.orig)) < uintptr(unsafe.Pointer(b.orig)) }) for i := 1; i < es.Len(); i++ { - assert.True(t, uintptr(unsafe.Pointer(es.At(i-1).orig)) < uintptr(unsafe.Pointer(es.At(i).orig))) + assert.Less(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) } es.Sort(func(a, b ScopeProfiles) bool { return uintptr(unsafe.Pointer(a.orig)) > uintptr(unsafe.Pointer(b.orig)) }) for i := 1; i < es.Len(); i++ { - assert.True(t, uintptr(unsafe.Pointer(es.At(i-1).orig)) > uintptr(unsafe.Pointer(es.At(i).orig))) + assert.Greater(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) } } diff --git a/pdata/pprofile/go.mod b/pdata/pprofile/go.mod index eb157b6f8bc..7e4cc9d8997 100644 --- a/pdata/pprofile/go.mod +++ b/pdata/pprofile/go.mod @@ -3,21 +3,25 @@ module go.opentelemetry.io/collector/pdata/pprofile go 1.22.0 require ( + github.com/json-iterator/go v1.1.12 github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector/pdata v1.14.1 + go.opentelemetry.io/collector/pdata v1.15.0 + go.uber.org/goleak v1.3.0 + google.golang.org/grpc v1.66.0 ) require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/kr/text v0.2.0 // indirect + 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.uber.org/multierr v1.11.0 // indirect - golang.org/x/net v0.25.0 // indirect - golang.org/x/sys v0.20.0 // indirect - golang.org/x/text v0.15.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect - google.golang.org/grpc v1.65.0 // indirect + golang.org/x/net v0.26.0 // indirect + golang.org/x/sys v0.21.0 // indirect + golang.org/x/text v0.16.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/pdata/pprofile/go.sum b/pdata/pprofile/go.sum index 91090cc782f..a0d13c568ed 100644 --- a/pdata/pprofile/go.sum +++ b/pdata/pprofile/go.sum @@ -1,20 +1,31 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 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= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +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/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 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= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -32,20 +43,20 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= -golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= +golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.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.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= -golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -54,10 +65,10 @@ 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/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 h1:Zy9XzmMEflZ/MAaA7vNcoebnRAld7FsPW1EeBB7V0m8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 h1:1GBuWVLM/KMVUv1t1En5Gs+gFZCNd360GGb4sSxtrhU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= 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= diff --git a/pdata/pprofile/json.go b/pdata/pprofile/json.go new file mode 100644 index 00000000000..0cb8e88a456 --- /dev/null +++ b/pdata/pprofile/json.go @@ -0,0 +1,416 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package pprofile // import "go.opentelemetry.io/collector/pdata/pprofile" + +import ( + "bytes" + "fmt" + + jsoniter "github.com/json-iterator/go" + + "go.opentelemetry.io/collector/pdata/internal" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + "go.opentelemetry.io/collector/pdata/internal/json" + "go.opentelemetry.io/collector/pdata/internal/otlp" +) + +// JSONMarshaler marshals pprofile.Profiles to JSON bytes using the OTLP/JSON format. +type JSONMarshaler struct{} + +// MarshalProfiles to the OTLP/JSON format. +func (*JSONMarshaler) MarshalProfiles(td Profiles) ([]byte, error) { + buf := bytes.Buffer{} + pb := internal.ProfilesToProto(internal.Profiles(td)) + err := json.Marshal(&buf, &pb) + return buf.Bytes(), err +} + +// JSONUnmarshaler unmarshals OTLP/JSON formatted-bytes to pprofile.Profiles. +type JSONUnmarshaler struct{} + +// UnmarshalProfiles from OTLP/JSON format into pprofile.Profiles. +func (*JSONUnmarshaler) UnmarshalProfiles(buf []byte) (Profiles, error) { + iter := jsoniter.ConfigFastest.BorrowIterator(buf) + defer jsoniter.ConfigFastest.ReturnIterator(iter) + td := NewProfiles() + td.unmarshalJsoniter(iter) + if iter.Error != nil { + return Profiles{}, iter.Error + } + otlp.MigrateProfiles(td.getOrig().ResourceProfiles) + return td, nil +} + +func (p Profiles) unmarshalJsoniter(iter *jsoniter.Iterator) { + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "resourceProfiles", "resource_profiles": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + p.ResourceProfiles().AppendEmpty().unmarshalJsoniter(iter) + return true + }) + default: + iter.Skip() + } + return true + }) +} + +func (rp ResourceProfiles) unmarshalJsoniter(iter *jsoniter.Iterator) { + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "resource": + json.ReadResource(iter, internal.GetOrigResource(internal.Resource(rp.Resource()))) + case "scopeProfiles", "scope_profiles": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + rp.ScopeProfiles().AppendEmpty().unmarshalJsoniter(iter) + return true + }) + case "schemaUrl", "schema_url": + rp.orig.SchemaUrl = iter.ReadString() + default: + iter.Skip() + } + return true + }) +} + +func (sp ScopeProfiles) unmarshalJsoniter(iter *jsoniter.Iterator) { + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "scope": + json.ReadScope(iter, &sp.orig.Scope) + case "profiles": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + sp.Profiles().AppendEmpty().unmarshalJsoniter(iter) + return true + }) + case "schemaUrl", "schema_url": + sp.orig.SchemaUrl = iter.ReadString() + default: + iter.Skip() + } + return true + }) +} + +func (pc ProfileContainer) unmarshalJsoniter(iter *jsoniter.Iterator) { + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "profileId", "profile_id": + if err := pc.orig.ProfileId.UnmarshalJSON([]byte(iter.ReadString())); err != nil { + iter.ReportError("profileContainer.profileId", fmt.Sprintf("parse profile_id:%v", err)) + } + case "startTimeUnixNano", "start_time_unix_nano": + pc.orig.StartTimeUnixNano = json.ReadUint64(iter) + case "endTimeUnixNano", "end_time_unix_nano": + pc.orig.EndTimeUnixNano = json.ReadUint64(iter) + case "attributes": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + pc.orig.Attributes = append(pc.orig.Attributes, json.ReadAttribute(iter)) + return true + }) + case "droppedAttributesCount", "dropped_attributes_count": + pc.orig.DroppedAttributesCount = json.ReadUint32(iter) + case "originalPayloadFormat", "original_payload_format": + pc.orig.OriginalPayloadFormat = iter.ReadString() + case "originalPayload", "original_payload": + pc.orig.OriginalPayload = iter.ReadStringAsSlice() + case "profile": + pc.Profile().unmarshalJsoniter(iter) + default: + iter.Skip() + } + return true + }) +} + +func (p Profile) unmarshalJsoniter(iter *jsoniter.Iterator) { + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "sampleType", "sample_type": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + p.SampleType().AppendEmpty().unmarshalJsoniter(iter) + return true + }) + case "sample": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + p.Sample().AppendEmpty().unmarshalJsoniter(iter) + return true + }) + case "mapping": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + p.Mapping().AppendEmpty().unmarshalJsoniter(iter) + return true + }) + case "location": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + p.Location().AppendEmpty().unmarshalJsoniter(iter) + return true + }) + case "locationIndices", "location_indices": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + p.LocationIndices().Append(json.ReadInt64(iter)) + return true + }) + case "function": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + p.Function().AppendEmpty().unmarshalJsoniter(iter) + return true + }) + case "attributeTable", "attribute_table": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + p.orig.AttributeTable = append(p.orig.AttributeTable, json.ReadAttribute(iter)) + return true + }) + case "attributeUnits", "attribute_units": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + p.AttributeUnits().AppendEmpty().unmarshalJsoniter(iter) + return true + }) + case "linkTable", "link_table": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + p.LinkTable().AppendEmpty().unmarshalJsoniter(iter) + return true + }) + case "stringTable", "string_table": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + p.StringTable().Append(iter.ReadString()) + return true + }) + case "dropFrames", "drop_frames": + p.orig.DropFrames = json.ReadInt64(iter) + case "keepFrames", "keep_frames": + p.orig.KeepFrames = json.ReadInt64(iter) + case "timeNanos", "time_nanos": + p.orig.TimeNanos = json.ReadInt64(iter) + case "durationNanos", "duration_nanos": + p.orig.DurationNanos = json.ReadInt64(iter) + case "periodType", "period_type": + p.PeriodType().unmarshalJsoniter(iter) + case "period": + p.orig.Period = json.ReadInt64(iter) + case "comment": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + p.Comment().Append(json.ReadInt64(iter)) + return true + }) + case "defaultSampleType", "default_sample_type": + p.orig.DefaultSampleType = json.ReadInt64(iter) + default: + iter.Skip() + } + return true + }) +} + +func (vt ValueType) unmarshalJsoniter(iter *jsoniter.Iterator) { + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "type": + vt.orig.Type = json.ReadInt64(iter) + case "unit": + vt.orig.Unit = json.ReadInt64(iter) + default: + iter.Skip() + } + return true + }) +} + +func (st Sample) unmarshalJsoniter(iter *jsoniter.Iterator) { + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "locationIndex", "location_index": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + st.LocationIndex().Append(json.ReadUint64(iter)) + return true + }) + case "locationsStartIndex", "locations_start_index": + st.orig.LocationsStartIndex = json.ReadUint64(iter) + case "locationsLength", "locations_length": + st.orig.LocationsLength = json.ReadUint64(iter) + case "stacktraceIdIndex", "stacktrace_id_index": + st.orig.StacktraceIdIndex = json.ReadUint32(iter) + case "value": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + st.Value().Append(json.ReadInt64(iter)) + return true + }) + case "label": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + st.Label().AppendEmpty().unmarshalJsoniter(iter) + return true + }) + case "attributes": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + st.Attributes().Append(json.ReadUint64(iter)) + return true + }) + case "link": + st.orig.Link = json.ReadUint64(iter) + case "timestampsUnixNano", "timestamps_unix_nano": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + st.TimestampsUnixNano().Append(json.ReadUint64(iter)) + return true + }) + default: + iter.Skip() + } + return true + }) +} + +func (m Mapping) unmarshalJsoniter(iter *jsoniter.Iterator) { + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "id": + m.orig.Id = json.ReadUint64(iter) + case "memoryStart", "memory_start": + m.orig.MemoryStart = json.ReadUint64(iter) + case "memoryLimit", "memory_limit": + m.orig.MemoryLimit = json.ReadUint64(iter) + case "fileOffset", "file_offset": + m.orig.FileOffset = json.ReadUint64(iter) + case "filename": + m.orig.Filename = json.ReadInt64(iter) + case "buildId", "build_id": + m.orig.BuildId = json.ReadInt64(iter) + case "buildIDKind", "build_id_kind": + m.SetBuildIDKind(otlpprofiles.BuildIdKind(json.ReadEnumValue(iter, otlpprofiles.BuildIdKind_value))) + case "attributes": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + m.Attributes().Append(json.ReadUint64(iter)) + return true + }) + case "hasFunctions", "has_functions": + m.orig.HasFunctions = iter.ReadBool() + case "hasFilenames", "has_filenames": + m.orig.HasFilenames = iter.ReadBool() + case "hasLineNumbers", "has_line_numbers": + m.orig.HasLineNumbers = iter.ReadBool() + case "hasInlineFrames", "has_inline_frames": + m.orig.HasInlineFrames = iter.ReadBool() + default: + iter.Skip() + } + return true + }) +} + +func (l Location) unmarshalJsoniter(iter *jsoniter.Iterator) { + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "id": + l.orig.Id = json.ReadUint64(iter) + case "mappingIndex", "mapping_index": + l.orig.MappingIndex = json.ReadUint64(iter) + case "address": + l.orig.Address = json.ReadUint64(iter) + case "line": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + l.Line().AppendEmpty().unmarshalJsoniter(iter) + return true + }) + case "isFolded", "is_folded": + l.orig.IsFolded = iter.ReadBool() + case "typeIndex", "type_index": + l.orig.TypeIndex = json.ReadUint32(iter) + case "attributes": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + l.Attributes().Append(json.ReadUint64(iter)) + return true + }) + default: + iter.Skip() + } + return true + }) +} + +func (l Line) unmarshalJsoniter(iter *jsoniter.Iterator) { + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "functionIndex", "function_index": + l.orig.FunctionIndex = json.ReadUint64(iter) + case "line": + l.orig.Line = json.ReadInt64(iter) + case "column": + l.orig.Column = json.ReadInt64(iter) + default: + iter.Skip() + } + return true + }) +} + +func (fn Function) unmarshalJsoniter(iter *jsoniter.Iterator) { + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "id": + fn.orig.Id = json.ReadUint64(iter) + case "name": + fn.orig.Name = json.ReadInt64(iter) + case "systemName", "system_name": + fn.orig.SystemName = json.ReadInt64(iter) + case "filename": + fn.orig.Filename = json.ReadInt64(iter) + case "startLine", "start_line": + fn.orig.StartLine = json.ReadInt64(iter) + default: + iter.Skip() + } + return true + }) +} + +func (at AttributeUnit) unmarshalJsoniter(iter *jsoniter.Iterator) { + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "attributeKey", "attribute_key": + at.orig.AttributeKey = json.ReadInt64(iter) + case "unit": + at.orig.Unit = json.ReadInt64(iter) + default: + iter.Skip() + } + return true + }) +} + +func (l Link) unmarshalJsoniter(iter *jsoniter.Iterator) { + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "traceId", "trace_id": + if err := l.orig.TraceId.UnmarshalJSON([]byte(iter.ReadString())); err != nil { + iter.ReportError("link.traceId", fmt.Sprintf("parse trace_id:%v", err)) + } + case "spanId", "span_id": + if err := l.orig.SpanId.UnmarshalJSON([]byte(iter.ReadString())); err != nil { + iter.ReportError("link.spanId", fmt.Sprintf("parse span_id:%v", err)) + } + default: + iter.Skip() + } + return true + }) +} + +func (l Label) unmarshalJsoniter(iter *jsoniter.Iterator) { + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "key": + l.orig.Key = json.ReadInt64(iter) + case "str": + l.orig.Str = json.ReadInt64(iter) + case "num": + l.orig.Num = json.ReadInt64(iter) + case "numUnit", "num_unit": + l.orig.NumUnit = json.ReadInt64(iter) + default: + iter.Skip() + } + return true + }) +} diff --git a/pdata/pprofile/json_test.go b/pdata/pprofile/json_test.go new file mode 100644 index 00000000000..08b59ea90d6 --- /dev/null +++ b/pdata/pprofile/json_test.go @@ -0,0 +1,329 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package pprofile + +import ( + "testing" + + jsoniter "github.com/json-iterator/go" + "github.com/stretchr/testify/assert" + + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + "go.opentelemetry.io/collector/pdata/pcommon" +) + +var _ Marshaler = (*JSONMarshaler)(nil) +var _ Unmarshaler = (*JSONUnmarshaler)(nil) + +var profilesOTLP = func() Profiles { + startTimestamp := pcommon.Timestamp(1684617382541971000) + endTimestamp := pcommon.Timestamp(1684623646539558000) + profileID := ProfileID([16]byte{0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10}) + traceID := pcommon.TraceID([16]byte{0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10}) + spanID := pcommon.SpanID([8]byte{0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18}) + + pd := NewProfiles() + // Add ResourceProfiles. + rp := pd.ResourceProfiles().AppendEmpty() + rp.SetSchemaUrl("schemaURL") + // Add resource. + rp.Resource().Attributes().PutStr("host.name", "testHost") + rp.Resource().Attributes().PutStr("service.name", "testService") + rp.Resource().SetDroppedAttributesCount(1) + // Add ScopeProfiles. + sp := rp.ScopeProfiles().AppendEmpty() + sp.SetSchemaUrl("schemaURL") + sp.Scope().SetName("scope name") + sp.Scope().SetVersion("scope version") + // Add profiles + pc := sp.Profiles().AppendEmpty() + pc.SetProfileID(profileID) + pc.SetStartTime(startTimestamp) + pc.SetEndTime(endTimestamp) + pc.Attributes().PutStr("hello", "world") + pc.Attributes().PutStr("foo", "bar") + pc.SetDroppedAttributesCount(1) + + pro := pc.Profile() + // Add sample type + st := pro.SampleType().AppendEmpty() + st.SetType(1) + st.SetUnit(2) + // Add samples + s := pro.Sample().AppendEmpty() + s.LocationIndex().Append(1) + s.SetLocationsStartIndex(1) + s.SetLocationsLength(10) + s.SetStacktraceIdIndex(1) + s.Value().Append(3) + s.SetLink(42) + s.Attributes().Append(1) + la := s.Label().AppendEmpty() + la.SetKey(1) + la.SetStr(2) + la.SetNum(3) + la.SetNumUnit(4) + s.TimestampsUnixNano().Append(12345) + // Add mappings + m := pro.Mapping().AppendEmpty() + m.SetID(1) + m.SetMemoryStart(2) + m.SetMemoryLimit(3) + m.SetFileOffset(4) + m.SetFilename(5) + m.SetBuildID(6) + m.SetBuildIDKind(otlpprofiles.BuildIdKind_BUILD_ID_LINKER) + m.Attributes().Append(7) + m.Attributes().Append(8) + m.SetHasFunctions(true) + m.SetHasFilenames(true) + m.SetHasLineNumbers(true) + m.SetHasInlineFrames(true) + // Add location + l := pro.Location().AppendEmpty() + l.SetID(2) + l.SetMappingIndex(3) + l.SetAddress(4) + l.SetIsFolded(true) + l.SetTypeIndex(5) + l.Attributes().Append(6) + l.Attributes().Append(7) + li := l.Line().AppendEmpty() + li.SetFunctionIndex(1) + li.SetLine(2) + li.SetColumn(3) + pro.LocationIndices().Append(1) + // Add function + f := pro.Function().AppendEmpty() + f.SetID(1) + f.SetName(2) + f.SetSystemName(3) + f.SetFilename(4) + f.SetStartLine(5) + // Add attribute table + at := pro.AttributeTable() + at.PutInt("answer", 42) + // Add attribute units + au := pro.AttributeUnits().AppendEmpty() + au.SetAttributeKey(1) + au.SetUnit(5) + // Add link table + lt := pro.LinkTable().AppendEmpty() + lt.SetTraceID(traceID) + lt.SetSpanID(spanID) + // Add string table + pro.StringTable().Append("foobar") + pro.SetDropFrames(1) + pro.SetKeepFrames(2) + pro.SetStartTime(1234) + pro.SetDuration(5678) + pro.PeriodType().SetType(1) + pro.PeriodType().SetUnit(2) + pro.SetPeriod(3) + pro.Comment().Append(1) + pro.Comment().Append(2) + pro.SetDefaultSampleType(4) + + return pd +}() + +var profilesJSON = `{"resourceProfiles":[{"resource":{"attributes":[{"key":"host.name","value":{"stringValue":"testHost"}},{"key":"service.name","value":{"stringValue":"testService"}}],"droppedAttributesCount":1},"scopeProfiles":[{"scope":{"name":"scope name","version":"scope version"},"profiles":[{"profileId":"0102030405060708090a0b0c0d0e0f10","startTimeUnixNano":"1684617382541971000","endTimeUnixNano":"1684623646539558000","attributes":[{"key":"hello","value":{"stringValue":"world"}},{"key":"foo","value":{"stringValue":"bar"}}],"droppedAttributesCount":1,"profile":{"sampleType":[{"type":"1","unit":"2"}],"sample":[{"locationIndex":["1"],"locationsStartIndex":"1","locationsLength":"10","stacktraceIdIndex":1,"value":["3"],"label":[{"key":"1","str":"2","num":"3","numUnit":"4"}],"attributes":["1"],"link":"42","timestampsUnixNano":["12345"]}],"mapping":[{"id":"1","memoryStart":"2","memoryLimit":"3","fileOffset":"4","filename":"5","buildId":"6","attributes":["7","8"],"hasFunctions":true,"hasFilenames":true,"hasLineNumbers":true,"hasInlineFrames":true}],"location":[{"id":"2","mappingIndex":"3","address":"4","line":[{"functionIndex":"1","line":"2","column":"3"}],"isFolded":true,"typeIndex":5,"attributes":["6","7"]}],"locationIndices":["1"],"function":[{"id":"1","name":"2","systemName":"3","filename":"4","startLine":"5"}],"attributeTable":[{"key":"answer","value":{"intValue":"42"}}],"attributeUnits":[{"attributeKey":"1","unit":"5"}],"linkTable":[{"traceId":"0102030405060708090a0b0c0d0e0f10","spanId":"1112131415161718"}],"stringTable":["foobar"],"dropFrames":"1","keepFrames":"2","timeNanos":"1234","durationNanos":"5678","periodType":{"type":"1","unit":"2"},"period":"3","comment":["1","2"],"defaultSampleType":"4"}}],"schemaUrl":"schemaURL"}],"schemaUrl":"schemaURL"}]}` + +func TestJSONUnmarshal(t *testing.T) { + decoder := &JSONUnmarshaler{} + got, err := decoder.UnmarshalProfiles([]byte(profilesJSON)) + assert.NoError(t, err) + assert.EqualValues(t, profilesOTLP, got) +} + +func TestJSONMarshal(t *testing.T) { + encoder := &JSONMarshaler{} + jsonBuf, err := encoder.MarshalProfiles(profilesOTLP) + assert.NoError(t, err) + assert.Equal(t, profilesJSON, string(jsonBuf)) +} + +func TestJSONUnmarshalInvalid(t *testing.T) { + jsonStr := `{"extra":"", "resourceProfiles": "extra"}` + decoder := &JSONUnmarshaler{} + _, err := decoder.UnmarshalProfiles([]byte(jsonStr)) + assert.Error(t, err) +} + +func TestUnmarshalJsoniterProfileData(t *testing.T) { + jsonStr := `{"extra":"", "resourceProfiles": [{"extra":""}]}` + iter := jsoniter.ConfigFastest.BorrowIterator([]byte(jsonStr)) + defer jsoniter.ConfigFastest.ReturnIterator(iter) + val := NewProfiles() + val.unmarshalJsoniter(iter) + assert.NoError(t, iter.Error) + assert.Equal(t, 1, val.ResourceProfiles().Len()) +} + +func TestUnmarshalJsoniterProfileInvalidProfileIDField(t *testing.T) { + jsonStr := `{"profile_id":"--"}` + iter := jsoniter.ConfigFastest.BorrowIterator([]byte(jsonStr)) + defer jsoniter.ConfigFastest.ReturnIterator(iter) + NewProfileContainer().unmarshalJsoniter(iter) + if assert.Error(t, iter.Error) { + assert.Contains(t, iter.Error.Error(), "parse profile_id") + } +} + +func TestUnmarshalJsoniterResourceProfiles(t *testing.T) { + jsonStr := `{"extra":"", "resource": {}, "scopeProfiles": []}` + iter := jsoniter.ConfigFastest.BorrowIterator([]byte(jsonStr)) + defer jsoniter.ConfigFastest.ReturnIterator(iter) + val := NewResourceProfiles() + val.unmarshalJsoniter(iter) + assert.NoError(t, iter.Error) + assert.Equal(t, NewResourceProfiles(), val) +} + +func TestUnmarshalJsoniterScopeProfiles(t *testing.T) { + jsonStr := `{"extra":"", "scope": {}, "profiles": []}` + iter := jsoniter.ConfigFastest.BorrowIterator([]byte(jsonStr)) + defer jsoniter.ConfigFastest.ReturnIterator(iter) + val := NewScopeProfiles() + val.unmarshalJsoniter(iter) + assert.NoError(t, iter.Error) + assert.Equal(t, NewScopeProfiles(), val) +} + +func TestUnmarshalJsoniterProfile(t *testing.T) { + jsonStr := `{"extra":""}` + iter := jsoniter.ConfigFastest.BorrowIterator([]byte(jsonStr)) + defer jsoniter.ConfigFastest.ReturnIterator(iter) + val := NewProfile() + val.unmarshalJsoniter(iter) + assert.NoError(t, iter.Error) + assert.Equal(t, NewProfile(), val) +} + +func TestUnmarshalJsoniterValueType(t *testing.T) { + jsonStr := `{"extra":""}` + iter := jsoniter.ConfigFastest.BorrowIterator([]byte(jsonStr)) + defer jsoniter.ConfigFastest.ReturnIterator(iter) + val := NewValueType() + val.unmarshalJsoniter(iter) + assert.NoError(t, iter.Error) + assert.Equal(t, NewValueType(), val) +} + +func TestUnmarshalJsoniterSample(t *testing.T) { + jsonStr := `{"extra":""}` + iter := jsoniter.ConfigFastest.BorrowIterator([]byte(jsonStr)) + defer jsoniter.ConfigFastest.ReturnIterator(iter) + val := NewSample() + val.unmarshalJsoniter(iter) + assert.NoError(t, iter.Error) + assert.Equal(t, NewSample(), val) +} + +func TestUnmarshalJsoniterMapping(t *testing.T) { + jsonStr := `{"extra":""}` + iter := jsoniter.ConfigFastest.BorrowIterator([]byte(jsonStr)) + defer jsoniter.ConfigFastest.ReturnIterator(iter) + val := NewMapping() + val.unmarshalJsoniter(iter) + assert.NoError(t, iter.Error) + assert.Equal(t, NewMapping(), val) +} + +func TestUnmarshalJsoniterLocation(t *testing.T) { + jsonStr := `{"extra":""}` + iter := jsoniter.ConfigFastest.BorrowIterator([]byte(jsonStr)) + defer jsoniter.ConfigFastest.ReturnIterator(iter) + val := NewLocation() + val.unmarshalJsoniter(iter) + assert.NoError(t, iter.Error) + assert.Equal(t, NewLocation(), val) +} + +func TestUnmarshalJsoniterLine(t *testing.T) { + jsonStr := `{"extra":""}` + iter := jsoniter.ConfigFastest.BorrowIterator([]byte(jsonStr)) + defer jsoniter.ConfigFastest.ReturnIterator(iter) + val := NewLine() + val.unmarshalJsoniter(iter) + assert.NoError(t, iter.Error) + assert.Equal(t, NewLine(), val) +} + +func TestUnmarshalJsoniterFunction(t *testing.T) { + jsonStr := `{"extra":""}` + iter := jsoniter.ConfigFastest.BorrowIterator([]byte(jsonStr)) + defer jsoniter.ConfigFastest.ReturnIterator(iter) + val := NewFunction() + val.unmarshalJsoniter(iter) + assert.NoError(t, iter.Error) + assert.Equal(t, NewFunction(), val) +} + +func TestUnmarshalJsoniterAttributeUnit(t *testing.T) { + jsonStr := `{"extra":""}` + iter := jsoniter.ConfigFastest.BorrowIterator([]byte(jsonStr)) + defer jsoniter.ConfigFastest.ReturnIterator(iter) + val := NewAttributeUnit() + val.unmarshalJsoniter(iter) + assert.NoError(t, iter.Error) + assert.Equal(t, NewAttributeUnit(), val) +} + +func TestUnmarshalJsoniterLink(t *testing.T) { + jsonStr := `{"extra":""}` + iter := jsoniter.ConfigFastest.BorrowIterator([]byte(jsonStr)) + defer jsoniter.ConfigFastest.ReturnIterator(iter) + val := NewLink() + val.unmarshalJsoniter(iter) + assert.NoError(t, iter.Error) + assert.Equal(t, NewLink(), val) +} + +func TestUnmarshalJsoniterLinkInvalidTraceIDField(t *testing.T) { + jsonStr := `{"trace_id":"--"}` + iter := jsoniter.ConfigFastest.BorrowIterator([]byte(jsonStr)) + defer jsoniter.ConfigFastest.ReturnIterator(iter) + NewLink().unmarshalJsoniter(iter) + if assert.Error(t, iter.Error) { + assert.Contains(t, iter.Error.Error(), "parse trace_id") + } +} + +func TestUnmarshalJsoniterSpanLinkInvalidSpanIDField(t *testing.T) { + jsonStr := `{"span_id":"--"}` + iter := jsoniter.ConfigFastest.BorrowIterator([]byte(jsonStr)) + defer jsoniter.ConfigFastest.ReturnIterator(iter) + NewLink().unmarshalJsoniter(iter) + if assert.Error(t, iter.Error) { + assert.Contains(t, iter.Error.Error(), "parse span_id") + } +} + +func TestUnmarshalJsoniterLabel(t *testing.T) { + jsonStr := `{"extra":""}` + iter := jsoniter.ConfigFastest.BorrowIterator([]byte(jsonStr)) + defer jsoniter.ConfigFastest.ReturnIterator(iter) + val := NewLabel() + val.unmarshalJsoniter(iter) + assert.NoError(t, iter.Error) + assert.Equal(t, NewLabel(), val) +} + +func BenchmarkJSONUnmarshal(b *testing.B) { + b.ReportAllocs() + + encoder := &JSONMarshaler{} + jsonBuf, err := encoder.MarshalProfiles(profilesOTLP) + assert.NoError(b, err) + decoder := &JSONUnmarshaler{} + + b.ResetTimer() + b.RunParallel(func(pb *testing.PB) { + for pb.Next() { + _, err := decoder.UnmarshalProfiles(jsonBuf) + assert.NoError(b, err) + } + }) +} diff --git a/pdata/pprofile/pprofileotlp/fuzz_test.go b/pdata/pprofile/pprofileotlp/fuzz_test.go new file mode 100644 index 00000000000..02f0cf57683 --- /dev/null +++ b/pdata/pprofile/pprofileotlp/fuzz_test.go @@ -0,0 +1,40 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package pprofileotlp // import "go.opentelemetry.io/collector/pdata/pprofile/pprofileotlp" + +import ( + "testing" +) + +func FuzzRequestUnmarshalJSON(f *testing.F) { + f.Fuzz(func(_ *testing.T, data []byte) { + er := NewExportRequest() + //nolint: errcheck + er.UnmarshalJSON(data) + }) +} + +func FuzzResponseUnmarshalJSON(f *testing.F) { + f.Fuzz(func(_ *testing.T, data []byte) { + er := NewExportResponse() + //nolint: errcheck + er.UnmarshalJSON(data) + }) +} + +func FuzzRequestUnmarshalProto(f *testing.F) { + f.Fuzz(func(_ *testing.T, data []byte) { + er := NewExportRequest() + //nolint: errcheck + er.UnmarshalProto(data) + }) +} + +func FuzzResponseUnmarshalProto(f *testing.F) { + f.Fuzz(func(_ *testing.T, data []byte) { + er := NewExportResponse() + //nolint: errcheck + er.UnmarshalProto(data) + }) +} diff --git a/pdata/pprofile/pprofileotlp/grpc.go b/pdata/pprofile/pprofileotlp/grpc.go new file mode 100644 index 00000000000..491f14ec348 --- /dev/null +++ b/pdata/pprofile/pprofileotlp/grpc.go @@ -0,0 +1,91 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package pprofileotlp // import "go.opentelemetry.io/collector/pdata/pprofile/pprofileotlp" + +import ( + "context" + + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "go.opentelemetry.io/collector/pdata/internal" + otlpcollectorprofile "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/profiles/v1experimental" + "go.opentelemetry.io/collector/pdata/internal/otlp" +) + +// GRPCClient is the client API for OTLP-GRPC Profiles service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type GRPCClient interface { + // Export pprofile.Profiles to the server. + // + // For performance reasons, it is recommended to keep this RPC + // alive for the entire life of the application. + Export(ctx context.Context, request ExportRequest, opts ...grpc.CallOption) (ExportResponse, error) + + // unexported disallow implementation of the GRPCClient. + unexported() +} + +// NewGRPCClient returns a new GRPCClient connected using the given connection. +func NewGRPCClient(cc *grpc.ClientConn) GRPCClient { + return &grpcClient{rawClient: otlpcollectorprofile.NewProfilesServiceClient(cc)} +} + +type grpcClient struct { + rawClient otlpcollectorprofile.ProfilesServiceClient +} + +// Export implements the Client interface. +func (c *grpcClient) Export(ctx context.Context, request ExportRequest, opts ...grpc.CallOption) (ExportResponse, error) { + rsp, err := c.rawClient.Export(ctx, request.orig, opts...) + if err != nil { + return ExportResponse{}, err + } + state := internal.StateMutable + return ExportResponse{orig: rsp, state: &state}, err +} + +func (c *grpcClient) unexported() {} + +// GRPCServer is the server API for OTLP gRPC ProfilesService service. +// Implementations MUST embed UnimplementedGRPCServer. +type GRPCServer interface { + // Export is called every time a new request is received. + // + // For performance reasons, it is recommended to keep this RPC + // alive for the entire life of the application. + Export(context.Context, ExportRequest) (ExportResponse, error) + + // unexported disallow implementation of the GRPCServer. + unexported() +} + +var _ GRPCServer = (*UnimplementedGRPCServer)(nil) + +// UnimplementedGRPCServer MUST be embedded to have forward compatible implementations. +type UnimplementedGRPCServer struct{} + +func (*UnimplementedGRPCServer) Export(context.Context, ExportRequest) (ExportResponse, error) { + return ExportResponse{}, status.Errorf(codes.Unimplemented, "method Export not implemented") +} + +func (*UnimplementedGRPCServer) unexported() {} + +// RegisterGRPCServer registers the GRPCServer to the grpc.Server. +func RegisterGRPCServer(s *grpc.Server, srv GRPCServer) { + otlpcollectorprofile.RegisterProfilesServiceServer(s, &rawProfilesServer{srv: srv}) +} + +type rawProfilesServer struct { + srv GRPCServer +} + +func (s rawProfilesServer) Export(ctx context.Context, request *otlpcollectorprofile.ExportProfilesServiceRequest) (*otlpcollectorprofile.ExportProfilesServiceResponse, error) { + otlp.MigrateProfiles(request.ResourceProfiles) + state := internal.StateMutable + rsp, err := s.srv.Export(ctx, ExportRequest{orig: request, state: &state}) + return rsp.orig, err +} diff --git a/pdata/pprofile/pprofileotlp/grpc_test.go b/pdata/pprofile/pprofileotlp/grpc_test.go new file mode 100644 index 00000000000..fb6bd922935 --- /dev/null +++ b/pdata/pprofile/pprofileotlp/grpc_test.go @@ -0,0 +1,108 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package pprofileotlp + +import ( + "context" + "errors" + "net" + "sync" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/credentials/insecure" + "google.golang.org/grpc/resolver" + "google.golang.org/grpc/status" + "google.golang.org/grpc/test/bufconn" + + "go.opentelemetry.io/collector/pdata/pprofile" +) + +func TestGrpc(t *testing.T) { + lis := bufconn.Listen(1024 * 1024) + s := grpc.NewServer() + RegisterGRPCServer(s, &fakeProfilesServer{t: t}) + wg := sync.WaitGroup{} + wg.Add(1) + go func() { + defer wg.Done() + assert.NoError(t, s.Serve(lis)) + }() + t.Cleanup(func() { + s.Stop() + wg.Wait() + }) + + resolver.SetDefaultScheme("passthrough") + cc, err := grpc.NewClient("bufnet", + grpc.WithContextDialer(func(context.Context, string) (net.Conn, error) { + return lis.Dial() + }), + grpc.WithTransportCredentials(insecure.NewCredentials())) + assert.NoError(t, err) + t.Cleanup(func() { + assert.NoError(t, cc.Close()) + }) + + logClient := NewGRPCClient(cc) + + resp, err := logClient.Export(context.Background(), generateProfilesRequest()) + assert.NoError(t, err) + assert.Equal(t, NewExportResponse(), resp) +} + +func TestGrpcError(t *testing.T) { + lis := bufconn.Listen(1024 * 1024) + s := grpc.NewServer() + RegisterGRPCServer(s, &fakeProfilesServer{t: t, err: errors.New("my error")}) + wg := sync.WaitGroup{} + wg.Add(1) + go func() { + defer wg.Done() + assert.NoError(t, s.Serve(lis)) + }() + t.Cleanup(func() { + s.Stop() + wg.Wait() + }) + + cc, err := grpc.NewClient("bufnet", + grpc.WithContextDialer(func(context.Context, string) (net.Conn, error) { + return lis.Dial() + }), + grpc.WithTransportCredentials(insecure.NewCredentials())) + assert.NoError(t, err) + t.Cleanup(func() { + assert.NoError(t, cc.Close()) + }) + + logClient := NewGRPCClient(cc) + resp, err := logClient.Export(context.Background(), generateProfilesRequest()) + require.Error(t, err) + st, okSt := status.FromError(err) + require.True(t, okSt) + assert.Equal(t, "my error", st.Message()) + assert.Equal(t, codes.Unknown, st.Code()) + assert.Equal(t, ExportResponse{}, resp) +} + +type fakeProfilesServer struct { + UnimplementedGRPCServer + t *testing.T + err error +} + +func (f fakeProfilesServer) Export(_ context.Context, request ExportRequest) (ExportResponse, error) { + assert.Equal(f.t, generateProfilesRequest(), request) + return NewExportResponse(), f.err +} + +func generateProfilesRequest() ExportRequest { + td := pprofile.NewProfiles() + td.ResourceProfiles().AppendEmpty().ScopeProfiles().AppendEmpty().Profiles().AppendEmpty() + return NewExportRequestFromProfiles(td) +} diff --git a/internal/obsreportconfig/package_test.go b/pdata/pprofile/pprofileotlp/package_test.go similarity index 88% rename from internal/obsreportconfig/package_test.go rename to pdata/pprofile/pprofileotlp/package_test.go index d70955f9088..2df10737926 100644 --- a/internal/obsreportconfig/package_test.go +++ b/pdata/pprofile/pprofileotlp/package_test.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package obsreportconfig +package pprofileotlp import ( "testing" diff --git a/pdata/pprofile/pprofileotlp/request.go b/pdata/pprofile/pprofileotlp/request.go new file mode 100644 index 00000000000..200040772e8 --- /dev/null +++ b/pdata/pprofile/pprofileotlp/request.go @@ -0,0 +1,79 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package pprofileotlp // import "go.opentelemetry.io/collector/pdata/pprofile/pprofileotlp" + +import ( + "bytes" + + "go.opentelemetry.io/collector/pdata/internal" + otlpcollectorprofile "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/profiles/v1experimental" + "go.opentelemetry.io/collector/pdata/internal/json" + "go.opentelemetry.io/collector/pdata/internal/otlp" + "go.opentelemetry.io/collector/pdata/pprofile" +) + +var jsonUnmarshaler = &pprofile.JSONUnmarshaler{} + +// ExportRequest represents the request for gRPC/HTTP client/server. +// It's a wrapper for pprofile.Profiles data. +type ExportRequest struct { + orig *otlpcollectorprofile.ExportProfilesServiceRequest + state *internal.State +} + +// NewExportRequest returns an empty ExportRequest. +func NewExportRequest() ExportRequest { + state := internal.StateMutable + return ExportRequest{ + orig: &otlpcollectorprofile.ExportProfilesServiceRequest{}, + state: &state, + } +} + +// NewExportRequestFromProfiles returns a ExportRequest from pprofile.Profiles. +// Because ExportRequest is a wrapper for pprofile.Profiles, +// any changes to the provided Profiles struct will be reflected in the ExportRequest and vice versa. +func NewExportRequestFromProfiles(td pprofile.Profiles) ExportRequest { + return ExportRequest{ + orig: internal.GetOrigProfiles(internal.Profiles(td)), + state: internal.GetProfilesState(internal.Profiles(td)), + } +} + +// MarshalProto marshals ExportRequest into proto bytes. +func (ms ExportRequest) MarshalProto() ([]byte, error) { + return ms.orig.Marshal() +} + +// UnmarshalProto unmarshalls ExportRequest from proto bytes. +func (ms ExportRequest) UnmarshalProto(data []byte) error { + if err := ms.orig.Unmarshal(data); err != nil { + return err + } + otlp.MigrateProfiles(ms.orig.ResourceProfiles) + return nil +} + +// MarshalJSON marshals ExportRequest into JSON bytes. +func (ms ExportRequest) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + if err := json.Marshal(&buf, ms.orig); err != nil { + return nil, err + } + return buf.Bytes(), nil +} + +// UnmarshalJSON unmarshalls ExportRequest from JSON bytes. +func (ms ExportRequest) UnmarshalJSON(data []byte) error { + td, err := jsonUnmarshaler.UnmarshalProfiles(data) + if err != nil { + return err + } + *ms.orig = *internal.GetOrigProfiles(internal.Profiles(td)) + return nil +} + +func (ms ExportRequest) Profiles() pprofile.Profiles { + return pprofile.Profiles(internal.NewProfiles(ms.orig, ms.state)) +} diff --git a/pdata/pprofile/pprofileotlp/request_test.go b/pdata/pprofile/pprofileotlp/request_test.go new file mode 100644 index 00000000000..c685346f5a7 --- /dev/null +++ b/pdata/pprofile/pprofileotlp/request_test.go @@ -0,0 +1,59 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package pprofileotlp + +import ( + "encoding/json" + "strings" + "testing" + + "github.com/stretchr/testify/assert" +) + +var _ json.Unmarshaler = ExportRequest{} +var _ json.Marshaler = ExportRequest{} + +var profilesRequestJSON = []byte(` + { + "resourceProfiles": [ + { + "resource": {}, + "scopeProfiles": [ + { + "scope": {}, + "profiles": [ + { + "profileId": "", + "profile": { + "sample": [ + { + "locationsStartIndex": "42" + } + ], + "periodType": {} + } + } + ] + } + ] + } + ] + }`) + +func TestRequestToPData(t *testing.T) { + tr := NewExportRequest() + assert.Equal(t, 0, tr.Profiles().SampleCount()) + tr.Profiles().ResourceProfiles().AppendEmpty().ScopeProfiles().AppendEmpty().Profiles().AppendEmpty().Profile().Sample().AppendEmpty() + assert.Equal(t, 1, tr.Profiles().SampleCount()) +} + +func TestRequestJSON(t *testing.T) { + tr := NewExportRequest() + assert.NoError(t, tr.UnmarshalJSON(profilesRequestJSON)) + assert.Equal(t, uint64(42), tr.Profiles().ResourceProfiles().At(0).ScopeProfiles().At(0).Profiles().At(0).Profile().Sample().At(0).LocationsStartIndex()) + + got, err := tr.MarshalJSON() + assert.NoError(t, err) + assert.Equal(t, strings.Join(strings.Fields(string(profilesRequestJSON)), ""), string(got)) +} diff --git a/pdata/pprofile/pprofileotlp/response.go b/pdata/pprofile/pprofileotlp/response.go new file mode 100644 index 00000000000..095ce2f4587 --- /dev/null +++ b/pdata/pprofile/pprofileotlp/response.go @@ -0,0 +1,88 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package pprofileotlp // import "go.opentelemetry.io/collector/pdata/pprofile/pprofileotlp" + +import ( + "bytes" + + jsoniter "github.com/json-iterator/go" + + "go.opentelemetry.io/collector/pdata/internal" + otlpcollectorprofile "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/profiles/v1experimental" + "go.opentelemetry.io/collector/pdata/internal/json" +) + +// ExportResponse represents the response for gRPC/HTTP client/server. +type ExportResponse struct { + orig *otlpcollectorprofile.ExportProfilesServiceResponse + state *internal.State +} + +// NewExportResponse returns an empty ExportResponse. +func NewExportResponse() ExportResponse { + state := internal.StateMutable + return ExportResponse{ + orig: &otlpcollectorprofile.ExportProfilesServiceResponse{}, + state: &state, + } +} + +// MarshalProto marshals ExportResponse into proto bytes. +func (ms ExportResponse) MarshalProto() ([]byte, error) { + return ms.orig.Marshal() +} + +// UnmarshalProto unmarshalls ExportResponse from proto bytes. +func (ms ExportResponse) UnmarshalProto(data []byte) error { + return ms.orig.Unmarshal(data) +} + +// MarshalJSON marshals ExportResponse into JSON bytes. +func (ms ExportResponse) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + if err := json.Marshal(&buf, ms.orig); err != nil { + return nil, err + } + return buf.Bytes(), nil +} + +// UnmarshalJSON unmarshalls ExportResponse from JSON bytes. +func (ms ExportResponse) UnmarshalJSON(data []byte) error { + iter := jsoniter.ConfigFastest.BorrowIterator(data) + defer jsoniter.ConfigFastest.ReturnIterator(iter) + ms.unmarshalJsoniter(iter) + return iter.Error +} + +func (ms ExportResponse) unmarshalJsoniter(iter *jsoniter.Iterator) { + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "partial_success", "partialSuccess": + ms.PartialSuccess().unmarshalJsoniter(iter) + default: + iter.Skip() + } + return true + }) + +} + +// PartialSuccess returns the ExportLogsPartialSuccess associated with this ExportResponse. +func (ms ExportResponse) PartialSuccess() ExportPartialSuccess { + return newExportPartialSuccess(&ms.orig.PartialSuccess, ms.state) +} + +func (ms ExportPartialSuccess) unmarshalJsoniter(iter *jsoniter.Iterator) { + iter.ReadObjectCB(func(_ *jsoniter.Iterator, f string) bool { + switch f { + case "rejected_profiles", "rejectedProfiles": + ms.orig.RejectedProfiles = json.ReadInt64(iter) + case "error_message", "errorMessage": + ms.orig.ErrorMessage = iter.ReadString() + default: + iter.Skip() + } + return true + }) +} diff --git a/pdata/pprofile/pprofileotlp/response_test.go b/pdata/pprofile/pprofileotlp/response_test.go new file mode 100644 index 00000000000..485b3e33850 --- /dev/null +++ b/pdata/pprofile/pprofileotlp/response_test.go @@ -0,0 +1,42 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package pprofileotlp + +import ( + "encoding/json" + "testing" + + jsoniter "github.com/json-iterator/go" + "github.com/stretchr/testify/assert" +) + +var _ json.Unmarshaler = ExportResponse{} +var _ json.Marshaler = ExportResponse{} + +func TestExportResponseJSON(t *testing.T) { + jsonStr := `{"partialSuccess": {"rejectedProfiles":1, "errorMessage":"nothing"}}` + val := NewExportResponse() + assert.NoError(t, val.UnmarshalJSON([]byte(jsonStr))) + expected := NewExportResponse() + expected.PartialSuccess().SetRejectedProfiles(1) + expected.PartialSuccess().SetErrorMessage("nothing") + assert.Equal(t, expected, val) +} + +func TestUnmarshalJSONExportResponse(t *testing.T) { + jsonStr := `{"extra":"", "partialSuccess": {}}` + val := NewExportResponse() + assert.NoError(t, val.UnmarshalJSON([]byte(jsonStr))) + assert.Equal(t, NewExportResponse(), val) +} + +func TestUnmarshalJsoniterExportPartialSuccess(t *testing.T) { + jsonStr := `{"extra":""}` + iter := jsoniter.ConfigFastest.BorrowIterator([]byte(jsonStr)) + defer jsoniter.ConfigFastest.ReturnIterator(iter) + val := NewExportPartialSuccess() + val.unmarshalJsoniter(iter) + assert.NoError(t, iter.Error) + assert.Equal(t, NewExportPartialSuccess(), val) +} diff --git a/pdata/pprofile/profileid.go b/pdata/pprofile/profileid.go new file mode 100644 index 00000000000..d6204022bb1 --- /dev/null +++ b/pdata/pprofile/profileid.go @@ -0,0 +1,37 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package pprofile // import "go.opentelemetry.io/collector/pdata/pprofile" + +import ( + "encoding/hex" + + "go.opentelemetry.io/collector/pdata/internal/data" +) + +var emptyProfileID = ProfileID([16]byte{}) + +// ProfileID is a profile identifier. +type ProfileID [16]byte + +// NewProfileIDEmpty returns a new empty (all zero bytes) ProfileID. +func NewProfileIDEmpty() ProfileID { + return emptyProfileID +} + +// String returns string representation of the ProifleID. +// +// Important: Don't rely on this method to get a string identifier of ProfileID. +// Use hex.EncodeToString explicitly instead. +// This method is meant to implement Stringer interface for display purposes only. +func (ms ProfileID) String() string { + if ms.IsEmpty() { + return "" + } + return hex.EncodeToString(ms[:]) +} + +// IsEmpty returns true if id doesn't contain at least one non-zero byte. +func (ms ProfileID) IsEmpty() bool { + return data.ProfileID(ms).IsEmpty() +} diff --git a/pdata/pprofile/profileid_test.go b/pdata/pprofile/profileid_test.go new file mode 100644 index 00000000000..3f7d3d642c8 --- /dev/null +++ b/pdata/pprofile/profileid_test.go @@ -0,0 +1,42 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package pprofile + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestProfileID(t *testing.T) { + pid := ProfileID([16]byte{1, 2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 4, 3, 2, 1}) + assert.Equal(t, [16]byte{1, 2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 4, 3, 2, 1}, [16]byte(pid)) + assert.False(t, pid.IsEmpty()) +} + +func TestNewProfileIDEmpty(t *testing.T) { + pid := NewProfileIDEmpty() + assert.Equal(t, [16]byte{}, [16]byte(pid)) + assert.True(t, pid.IsEmpty()) +} + +func TestProfileIDString(t *testing.T) { + pid := ProfileID([16]byte{}) + assert.Equal(t, "", pid.String()) + + pid = [16]byte{0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x78} + assert.Equal(t, "12345678123456781234567812345678", pid.String()) +} + +func TestProfileIDImmutable(t *testing.T) { + initialBytes := [16]byte{0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x78} + pid := ProfileID(initialBytes) + assert.Equal(t, ProfileID(initialBytes), pid) + + // Get the bytes and try to mutate. + pid[4] = 0x23 + + // Does not change the already created ProfileID. + assert.NotEqual(t, ProfileID(initialBytes), pid) +} diff --git a/pdata/pprofile/profiles.go b/pdata/pprofile/profiles.go index 4a81effa3d2..69391cd795b 100644 --- a/pdata/pprofile/profiles.go +++ b/pdata/pprofile/profiles.go @@ -49,3 +49,20 @@ func (ms Profiles) ResourceProfiles() ResourceProfilesSlice { func (ms Profiles) MarkReadOnly() { internal.SetProfilesState(internal.Profiles(ms), internal.StateReadOnly) } + +// SampleCount calculates the total number of samples. +func (ms Profiles) SampleCount() int { + sampleCount := 0 + rps := ms.ResourceProfiles() + for i := 0; i < rps.Len(); i++ { + rp := rps.At(i) + sps := rp.ScopeProfiles() + for j := 0; j < sps.Len(); j++ { + pcs := sps.At(j).Profiles() + for k := 0; j < pcs.Len(); j++ { + sampleCount += pcs.At(k).Profile().Sample().Len() + } + } + } + return sampleCount +} diff --git a/pdata/pprofile/profiles_test.go b/pdata/pprofile/profiles_test.go index 010637fcd31..0e78b713b5e 100644 --- a/pdata/pprofile/profiles_test.go +++ b/pdata/pprofile/profiles_test.go @@ -9,6 +9,7 @@ import ( "github.com/stretchr/testify/assert" + "go.opentelemetry.io/collector/pdata/internal/data" "go.opentelemetry.io/collector/pdata/pcommon" ) @@ -26,6 +27,8 @@ func BenchmarkProfilesUsage(b *testing.B) { profiles := NewProfiles() fillTestResourceProfilesSlice(profiles.ResourceProfiles()) ts := pcommon.NewTimestampFromTime(time.Now()) + testValProfileID := ProfileID(data.ProfileID([16]byte{1, 2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 4, 3, 2, 1})) + testSecondValProfileID := ProfileID(data.ProfileID([16]byte{2, 2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 4, 3, 2, 1})) b.ReportAllocs() b.ResetTimer() @@ -47,21 +50,21 @@ func BenchmarkProfilesUsage(b *testing.B) { assert.Equal(b, "new_test_name", iss.Scope().Name()) for k := 0; k < iss.Profiles().Len(); k++ { s := iss.Profiles().At(k) - s.ProfileID().FromRaw([]byte("profile_id")) - assert.Equal(b, "profile_id", string(s.ProfileID().AsRaw())) + s.SetProfileID(testValProfileID) + assert.Equal(b, testValProfileID, s.ProfileID()) s.SetStartTime(ts) assert.Equal(b, ts, s.StartTime()) s.SetEndTime(ts) assert.Equal(b, ts, s.EndTime()) } s := iss.Profiles().AppendEmpty() - s.ProfileID().FromRaw([]byte("new_profile_id")) + s.SetProfileID(testSecondValProfileID) s.SetStartTime(ts) s.SetEndTime(ts) s.Attributes().PutStr("foo1", "bar1") s.Attributes().PutStr("foo2", "bar2") iss.Profiles().RemoveIf(func(lr ProfileContainer) bool { - return string(lr.ProfileID().AsRaw()) == "new_profile_id" + return lr.ProfileID() == testSecondValProfileID }) } } diff --git a/pdata/ptrace/generated_resourcespansslice_test.go b/pdata/ptrace/generated_resourcespansslice_test.go index aa7bdf738a9..0a031d93420 100644 --- a/pdata/ptrace/generated_resourcespansslice_test.go +++ b/pdata/ptrace/generated_resourcespansslice_test.go @@ -129,13 +129,13 @@ func TestResourceSpansSlice_Sort(t *testing.T) { return uintptr(unsafe.Pointer(a.orig)) < uintptr(unsafe.Pointer(b.orig)) }) for i := 1; i < es.Len(); i++ { - assert.True(t, uintptr(unsafe.Pointer(es.At(i-1).orig)) < uintptr(unsafe.Pointer(es.At(i).orig))) + assert.Less(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) } es.Sort(func(a, b ResourceSpans) bool { return uintptr(unsafe.Pointer(a.orig)) > uintptr(unsafe.Pointer(b.orig)) }) for i := 1; i < es.Len(); i++ { - assert.True(t, uintptr(unsafe.Pointer(es.At(i-1).orig)) > uintptr(unsafe.Pointer(es.At(i).orig))) + assert.Greater(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) } } diff --git a/pdata/ptrace/generated_scopespansslice_test.go b/pdata/ptrace/generated_scopespansslice_test.go index 1c3fa931bf1..f7594580658 100644 --- a/pdata/ptrace/generated_scopespansslice_test.go +++ b/pdata/ptrace/generated_scopespansslice_test.go @@ -129,13 +129,13 @@ func TestScopeSpansSlice_Sort(t *testing.T) { return uintptr(unsafe.Pointer(a.orig)) < uintptr(unsafe.Pointer(b.orig)) }) for i := 1; i < es.Len(); i++ { - assert.True(t, uintptr(unsafe.Pointer(es.At(i-1).orig)) < uintptr(unsafe.Pointer(es.At(i).orig))) + assert.Less(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) } es.Sort(func(a, b ScopeSpans) bool { return uintptr(unsafe.Pointer(a.orig)) > uintptr(unsafe.Pointer(b.orig)) }) for i := 1; i < es.Len(); i++ { - assert.True(t, uintptr(unsafe.Pointer(es.At(i-1).orig)) > uintptr(unsafe.Pointer(es.At(i).orig))) + assert.Greater(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) } } diff --git a/pdata/ptrace/generated_spaneventslice_test.go b/pdata/ptrace/generated_spaneventslice_test.go index 86da67e1332..7da302ec805 100644 --- a/pdata/ptrace/generated_spaneventslice_test.go +++ b/pdata/ptrace/generated_spaneventslice_test.go @@ -129,13 +129,13 @@ func TestSpanEventSlice_Sort(t *testing.T) { return uintptr(unsafe.Pointer(a.orig)) < uintptr(unsafe.Pointer(b.orig)) }) for i := 1; i < es.Len(); i++ { - assert.True(t, uintptr(unsafe.Pointer(es.At(i-1).orig)) < uintptr(unsafe.Pointer(es.At(i).orig))) + assert.Less(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) } es.Sort(func(a, b SpanEvent) bool { return uintptr(unsafe.Pointer(a.orig)) > uintptr(unsafe.Pointer(b.orig)) }) for i := 1; i < es.Len(); i++ { - assert.True(t, uintptr(unsafe.Pointer(es.At(i-1).orig)) > uintptr(unsafe.Pointer(es.At(i).orig))) + assert.Greater(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) } } diff --git a/pdata/ptrace/generated_spanlinkslice_test.go b/pdata/ptrace/generated_spanlinkslice_test.go index 9ad8f4dc276..95606c26c0c 100644 --- a/pdata/ptrace/generated_spanlinkslice_test.go +++ b/pdata/ptrace/generated_spanlinkslice_test.go @@ -129,13 +129,13 @@ func TestSpanLinkSlice_Sort(t *testing.T) { return uintptr(unsafe.Pointer(a.orig)) < uintptr(unsafe.Pointer(b.orig)) }) for i := 1; i < es.Len(); i++ { - assert.True(t, uintptr(unsafe.Pointer(es.At(i-1).orig)) < uintptr(unsafe.Pointer(es.At(i).orig))) + assert.Less(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) } es.Sort(func(a, b SpanLink) bool { return uintptr(unsafe.Pointer(a.orig)) > uintptr(unsafe.Pointer(b.orig)) }) for i := 1; i < es.Len(); i++ { - assert.True(t, uintptr(unsafe.Pointer(es.At(i-1).orig)) > uintptr(unsafe.Pointer(es.At(i).orig))) + assert.Greater(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) } } diff --git a/pdata/ptrace/generated_spanslice_test.go b/pdata/ptrace/generated_spanslice_test.go index 1ae585b996f..e8d9e66b161 100644 --- a/pdata/ptrace/generated_spanslice_test.go +++ b/pdata/ptrace/generated_spanslice_test.go @@ -129,13 +129,13 @@ func TestSpanSlice_Sort(t *testing.T) { return uintptr(unsafe.Pointer(a.orig)) < uintptr(unsafe.Pointer(b.orig)) }) for i := 1; i < es.Len(); i++ { - assert.True(t, uintptr(unsafe.Pointer(es.At(i-1).orig)) < uintptr(unsafe.Pointer(es.At(i).orig))) + assert.Less(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) } es.Sort(func(a, b Span) bool { return uintptr(unsafe.Pointer(a.orig)) > uintptr(unsafe.Pointer(b.orig)) }) for i := 1; i < es.Len(); i++ { - assert.True(t, uintptr(unsafe.Pointer(es.At(i-1).orig)) > uintptr(unsafe.Pointer(es.At(i).orig))) + assert.Greater(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) } } diff --git a/pdata/ptrace/pb_test.go b/pdata/ptrace/pb_test.go index 6208819f900..ee774efd75f 100644 --- a/pdata/ptrace/pb_test.go +++ b/pdata/ptrace/pb_test.go @@ -44,7 +44,7 @@ func BenchmarkTracesToProto(b *testing.B) { for n := 0; n < b.N; n++ { buf, err := marshaler.MarshalTraces(traces) require.NoError(b, err) - assert.NotEqual(b, 0, len(buf)) + assert.NotEmpty(b, buf) } } @@ -54,7 +54,7 @@ func BenchmarkTracesFromProto(b *testing.B) { baseTraces := generateBenchmarkTraces(128) buf, err := marshaler.MarshalTraces(baseTraces) require.NoError(b, err) - assert.NotEqual(b, 0, len(buf)) + assert.NotEmpty(b, buf) b.ResetTimer() b.ReportAllocs() for n := 0; n < b.N; n++ { diff --git a/pdata/ptrace/ptraceotlp/request_test.go b/pdata/ptrace/ptraceotlp/request_test.go index d7fb76997b5..be9530f5acd 100644 --- a/pdata/ptrace/ptraceotlp/request_test.go +++ b/pdata/ptrace/ptraceotlp/request_test.go @@ -39,9 +39,9 @@ var tracesRequestJSON = []byte(` func TestRequestToPData(t *testing.T) { tr := NewExportRequest() - assert.Equal(t, tr.Traces().SpanCount(), 0) + assert.Equal(t, 0, tr.Traces().SpanCount()) tr.Traces().ResourceSpans().AppendEmpty().ScopeSpans().AppendEmpty().Spans().AppendEmpty() - assert.Equal(t, tr.Traces().SpanCount(), 1) + assert.Equal(t, 1, tr.Traces().SpanCount()) } func TestRequestJSON(t *testing.T) { diff --git a/pdata/testdata/go.mod b/pdata/testdata/go.mod index cb67233a2ad..b400132f83f 100644 --- a/pdata/testdata/go.mod +++ b/pdata/testdata/go.mod @@ -3,8 +3,8 @@ module go.opentelemetry.io/collector/pdata/testdata go 1.22.0 require ( - go.opentelemetry.io/collector/pdata v1.14.1 - go.opentelemetry.io/collector/pdata/pprofile v0.108.1 + go.opentelemetry.io/collector/pdata v1.15.0 + go.opentelemetry.io/collector/pdata/pprofile v0.109.0 ) require ( @@ -13,11 +13,11 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/net v0.25.0 // indirect - golang.org/x/sys v0.20.0 // indirect - golang.org/x/text v0.15.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect - google.golang.org/grpc v1.65.0 // indirect + golang.org/x/net v0.26.0 // indirect + golang.org/x/sys v0.21.0 // indirect + golang.org/x/text v0.16.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect + google.golang.org/grpc v1.66.0 // indirect google.golang.org/protobuf v1.34.2 // indirect ) diff --git a/pdata/testdata/go.sum b/pdata/testdata/go.sum index 29738983fee..5e21a65fb93 100644 --- a/pdata/testdata/go.sum +++ b/pdata/testdata/go.sum @@ -36,20 +36,20 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= -golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= +golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.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.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= -golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -58,10 +58,10 @@ 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/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 h1:Zy9XzmMEflZ/MAaA7vNcoebnRAld7FsPW1EeBB7V0m8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 h1:1GBuWVLM/KMVUv1t1En5Gs+gFZCNd360GGb4sSxtrhU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/pdata/testdata/profile.go b/pdata/testdata/profile.go index 04df7cc06f8..67233b700c6 100644 --- a/pdata/testdata/profile.go +++ b/pdata/testdata/profile.go @@ -33,14 +33,14 @@ func GenerateProfiles(profilesCount int) pprofile.Profiles { } func fillProfileOne(profile pprofile.ProfileContainer) { - profile.ProfileID().FromRaw([]byte("profileA")) + profile.SetProfileID([16]byte{0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10}) profile.SetStartTime(profileStartTimestamp) profile.SetEndTime(profileEndTimestamp) profile.SetDroppedAttributesCount(1) } func fillProfileTwo(profile pprofile.ProfileContainer) { - profile.ProfileID().FromRaw([]byte("profileB")) + profile.SetProfileID([16]byte{0x02, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10}) profile.SetStartTime(profileStartTimestamp) profile.SetEndTime(profileEndTimestamp) } diff --git a/processor/batchprocessor/batch_processor_test.go b/processor/batchprocessor/batch_processor_test.go index 36ce38d57d7..8647670a3c8 100644 --- a/processor/batchprocessor/batch_processor_test.go +++ b/processor/batchprocessor/batch_processor_test.go @@ -201,7 +201,7 @@ func TestBatchProcessorSentBySize(t *testing.T) { require.Equal(t, requestCount*spansPerRequest, sink.SpanCount()) receivedTraces := sink.AllTraces() - require.EqualValues(t, expectedBatchesNum, len(receivedTraces)) + require.Len(t, receivedTraces, expectedBatchesNum) for _, td := range receivedTraces { sizeSum += sizer.TracesSize(td) rss := td.ResourceSpans() @@ -323,7 +323,7 @@ func TestBatchProcessorSentBySizeWithMaxSize(t *testing.T) { require.Equal(t, totalSpans, sink.SpanCount()) receivedTraces := sink.AllTraces() - require.EqualValues(t, expectedBatchesNum, len(receivedTraces)) + require.Len(t, receivedTraces, 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 @@ -467,7 +467,7 @@ func TestBatchProcessorSentByTimeout(t *testing.T) { require.Equal(t, requestCount*spansPerRequest, sink.SpanCount()) receivedTraces := sink.AllTraces() - require.EqualValues(t, expectedBatchesNum, len(receivedTraces)) + require.Len(t, receivedTraces, expectedBatchesNum) for _, td := range receivedTraces { rss := td.ResourceSpans() require.Equal(t, expectedBatchingFactor, rss.Len()) @@ -500,7 +500,7 @@ func TestBatchProcessorTraceSendWhenClosing(t *testing.T) { require.NoError(t, batcher.Shutdown(context.Background())) require.Equal(t, requestCount*spansPerRequest, sink.SpanCount()) - require.Equal(t, 1, len(sink.AllTraces())) + require.Len(t, sink.AllTraces(), 1) } func TestBatchMetricProcessor_ReceivingData(t *testing.T) { @@ -592,7 +592,7 @@ func TestBatchMetricProcessorBatchSize(t *testing.T) { require.Equal(t, requestCount*2*metricsPerRequest, sink.DataPointCount()) receivedMds := sink.AllMetrics() - require.Equal(t, expectedBatchesNum, len(receivedMds)) + require.Len(t, receivedMds, expectedBatchesNum) for _, md := range receivedMds { require.Equal(t, expectedBatchingFactor, md.ResourceMetrics().Len()) for i := 0; i < expectedBatchingFactor; i++ { @@ -733,7 +733,7 @@ func TestBatchMetricsProcessor_Timeout(t *testing.T) { require.Equal(t, requestCount*2*metricsPerRequest, sink.DataPointCount()) receivedMds := sink.AllMetrics() - require.Equal(t, expectedBatchesNum, len(receivedMds)) + require.Len(t, receivedMds, expectedBatchesNum) for _, md := range receivedMds { require.Equal(t, expectedBatchingFactor, md.ResourceMetrics().Len()) for i := 0; i < expectedBatchingFactor; i++ { @@ -765,7 +765,7 @@ func TestBatchMetricProcessor_Shutdown(t *testing.T) { require.NoError(t, batcher.Shutdown(context.Background())) require.Equal(t, requestCount*2*metricsPerRequest, sink.DataPointCount()) - require.Equal(t, 1, len(sink.AllMetrics())) + require.Len(t, sink.AllMetrics(), 1) } func getTestSpanName(requestNum, index int) string { @@ -972,7 +972,7 @@ func TestBatchLogProcessor_BatchSize(t *testing.T) { require.Equal(t, requestCount*logsPerRequest, sink.LogRecordCount()) receivedMds := sink.AllLogs() - require.Equal(t, expectedBatchesNum, len(receivedMds)) + require.Len(t, receivedMds, expectedBatchesNum) for _, ld := range receivedMds { require.Equal(t, expectedBatchingFactor, ld.ResourceLogs().Len()) for i := 0; i < expectedBatchingFactor; i++ { @@ -1094,7 +1094,7 @@ func TestBatchLogsProcessor_Timeout(t *testing.T) { require.Equal(t, requestCount*logsPerRequest, sink.LogRecordCount()) receivedMds := sink.AllLogs() - require.Equal(t, expectedBatchesNum, len(receivedMds)) + require.Len(t, receivedMds, expectedBatchesNum) for _, ld := range receivedMds { require.Equal(t, expectedBatchingFactor, ld.ResourceLogs().Len()) for i := 0; i < expectedBatchingFactor; i++ { @@ -1126,7 +1126,7 @@ func TestBatchLogProcessor_Shutdown(t *testing.T) { require.NoError(t, batcher.Shutdown(context.Background())) require.Equal(t, requestCount*logsPerRequest, sink.LogRecordCount()) - require.Equal(t, 1, len(sink.AllLogs())) + require.Len(t, sink.AllLogs(), 1) } func getTestLogSeverityText(requestNum, index int) string { @@ -1349,7 +1349,7 @@ func TestBatchZeroConfig(t *testing.T) { // Expect them to be the original sizes. receivedMds := sink.AllLogs() - require.Equal(t, requestCount, len(receivedMds)) + require.Len(t, receivedMds, requestCount) for i, ld := range receivedMds { require.Equal(t, 1, ld.ResourceLogs().Len()) require.Equal(t, logsPerRequest+i, ld.LogRecordCount()) @@ -1387,7 +1387,7 @@ func TestBatchSplitOnly(t *testing.T) { // Expect them to be the limited by maxBatch. receivedMds := sink.AllLogs() - require.Equal(t, requestCount*logsPerRequest/maxBatch, len(receivedMds)) + require.Len(t, receivedMds, requestCount*logsPerRequest/maxBatch) for _, ld := range receivedMds { require.Equal(t, maxBatch, ld.LogRecordCount()) } diff --git a/processor/batchprocessor/go.mod b/processor/batchprocessor/go.mod index 6745812962d..557defcc6c3 100644 --- a/processor/batchprocessor/go.mod +++ b/processor/batchprocessor/go.mod @@ -4,20 +4,19 @@ go 1.22.0 require ( github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector v0.108.1 - go.opentelemetry.io/collector/client v1.14.1 - go.opentelemetry.io/collector/component v0.108.1 - go.opentelemetry.io/collector/config/configtelemetry v0.108.1 - go.opentelemetry.io/collector/confmap v1.14.1 - go.opentelemetry.io/collector/consumer v0.108.1 - go.opentelemetry.io/collector/consumer/consumertest v0.108.1 - go.opentelemetry.io/collector/pdata v1.14.1 - go.opentelemetry.io/collector/pdata/testdata v0.108.1 - go.opentelemetry.io/collector/processor v0.108.1 - go.opentelemetry.io/otel v1.29.0 - go.opentelemetry.io/otel/metric v1.29.0 - go.opentelemetry.io/otel/sdk/metric v1.29.0 - go.opentelemetry.io/otel/trace v1.29.0 + go.opentelemetry.io/collector/client v1.15.0 + go.opentelemetry.io/collector/component v0.109.0 + go.opentelemetry.io/collector/config/configtelemetry v0.109.0 + go.opentelemetry.io/collector/confmap v1.15.0 + go.opentelemetry.io/collector/consumer v0.109.0 + go.opentelemetry.io/collector/consumer/consumertest v0.109.0 + go.opentelemetry.io/collector/pdata v1.15.0 + go.opentelemetry.io/collector/pdata/testdata v0.109.0 + go.opentelemetry.io/collector/processor v0.109.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.uber.org/goleak v1.3.0 go.uber.org/zap v1.27.0 ) @@ -42,28 +41,26 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.20.2 // indirect + github.com/prometheus/client_golang v1.20.3 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.56.0 // indirect + github.com/prometheus/common v0.59.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect - go.opentelemetry.io/collector/component/componentstatus v0.108.1 // indirect - go.opentelemetry.io/collector/consumer/consumerprofiles v0.108.1 // indirect - go.opentelemetry.io/collector/pdata/pprofile v0.108.1 // indirect - go.opentelemetry.io/collector/processor/processorprofiles v0.108.1 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.51.0 // indirect - go.opentelemetry.io/otel/sdk v1.29.0 // indirect + go.opentelemetry.io/collector/component/componentstatus v0.109.0 // indirect + go.opentelemetry.io/collector/consumer/consumerprofiles v0.109.0 // indirect + go.opentelemetry.io/collector/pdata/pprofile v0.109.0 // indirect + go.opentelemetry.io/collector/processor/processorprofiles v0.109.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect + go.opentelemetry.io/otel/sdk v1.30.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.24.0 // indirect + golang.org/x/sys v0.25.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.65.0 // indirect + google.golang.org/grpc v1.66.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) -replace go.opentelemetry.io/collector => ../../ - replace go.opentelemetry.io/collector/processor => ../ replace go.opentelemetry.io/collector/component => ../../component @@ -72,8 +69,6 @@ replace go.opentelemetry.io/collector/client => ../../client replace go.opentelemetry.io/collector/confmap => ../../confmap -replace go.opentelemetry.io/collector/featuregate => ../../featuregate - replace go.opentelemetry.io/collector/pdata => ../../pdata replace go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata diff --git a/processor/batchprocessor/go.sum b/processor/batchprocessor/go.sum index 916c7ef13dd..923e7d7ba7f 100644 --- a/processor/batchprocessor/go.sum +++ b/processor/batchprocessor/go.sum @@ -50,12 +50,12 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg= -github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= +github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.56.0 h1:UffReloqkBtvtQEYDg2s+uDPGRrJyC6vZWPGXf6OhPY= -github.com/prometheus/common v0.56.0/go.mod h1:7uRPFSUTbfZWsJ7MHY56sqt7hLQu3bxXHDnNhl8E9qI= +github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= +github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= @@ -66,18 +66,18 @@ 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.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= -go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0 h1:G7uexXb/K3T+T9fNLCCKncweEtNEBMTO+46hKX5EdKw= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0/go.mod h1:v0mFe5Kk7woIh938mrZBJBmENYquyA0IICrlYm4Y0t4= -go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= -go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= -go.opentelemetry.io/otel/sdk v1.29.0 h1:vkqKjk7gwhS8VaWb0POZKmIEDimRCMsopNYnriHyryo= -go.opentelemetry.io/otel/sdk v1.29.0/go.mod h1:pM8Dx5WKnvxLCb+8lG1PRNIDxu9g9b9g59Qr7hfAAok= -go.opentelemetry.io/otel/sdk/metric v1.29.0 h1:K2CfmJohnRgvZ9UAj2/FhIf/okdWcNdBwe1m8xFXiSY= -go.opentelemetry.io/otel/sdk/metric v1.29.0/go.mod h1:6zZLdCl2fkauYoZIOn/soQIDSWFmNSRcICarHfuhNJQ= -go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= -go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= +go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= +go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= +go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= +go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= +go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= +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.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= @@ -101,8 +101,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.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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= @@ -117,8 +117,8 @@ 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= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd h1:6TEm2ZxXoQmFWFlt1vNxvVOa1Q0dXFQD1m/rYjXmS0E= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= 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= diff --git a/processor/batchprocessor/internal/metadata/generated_telemetry.go b/processor/batchprocessor/internal/metadata/generated_telemetry.go index 38a97468402..f4079ad8f0e 100644 --- a/processor/batchprocessor/internal/metadata/generated_telemetry.go +++ b/processor/batchprocessor/internal/metadata/generated_telemetry.go @@ -39,25 +39,33 @@ type TelemetryBuilder struct { meters map[configtelemetry.Level]metric.Meter } -// telemetryBuilderOption applies changes to default builder. -type telemetryBuilderOption func(*TelemetryBuilder) +// TelemetryBuilderOption applies changes to default builder. +type TelemetryBuilderOption interface { + apply(*TelemetryBuilder) +} + +type telemetryBuilderOptionFunc func(mb *TelemetryBuilder) + +func (tbof telemetryBuilderOptionFunc) apply(mb *TelemetryBuilder) { + tbof(mb) +} // WithProcessorBatchMetadataCardinalityCallback sets callback for observable ProcessorBatchMetadataCardinality metric. -func WithProcessorBatchMetadataCardinalityCallback(cb func() int64, opts ...metric.ObserveOption) telemetryBuilderOption { - return func(builder *TelemetryBuilder) { +func WithProcessorBatchMetadataCardinalityCallback(cb func() int64, opts ...metric.ObserveOption) TelemetryBuilderOption { + return telemetryBuilderOptionFunc(func(builder *TelemetryBuilder) { builder.observeProcessorBatchMetadataCardinality = func(_ context.Context, o metric.Observer) error { o.ObserveInt64(builder.ProcessorBatchMetadataCardinality, cb(), opts...) return nil } - } + }) } // NewTelemetryBuilder provides a struct with methods to update all internal telemetry // for a component -func NewTelemetryBuilder(settings component.TelemetrySettings, options ...telemetryBuilderOption) (*TelemetryBuilder, error) { +func NewTelemetryBuilder(settings component.TelemetrySettings, options ...TelemetryBuilderOption) (*TelemetryBuilder, error) { builder := TelemetryBuilder{meters: map[configtelemetry.Level]metric.Meter{}} for _, op := range options { - op(&builder) + op.apply(&builder) } builder.meters[configtelemetry.LevelBasic] = LeveledMeter(settings, configtelemetry.LevelBasic) builder.meters[configtelemetry.LevelDetailed] = LeveledMeter(settings, configtelemetry.LevelDetailed) diff --git a/processor/batchprocessor/internal/metadata/generated_telemetry_test.go b/processor/batchprocessor/internal/metadata/generated_telemetry_test.go index f05add260c3..1591d07b7fb 100644 --- a/processor/batchprocessor/internal/metadata/generated_telemetry_test.go +++ b/processor/batchprocessor/internal/metadata/generated_telemetry_test.go @@ -75,9 +75,9 @@ func TestNewTelemetryBuilder(t *testing.T) { TracerProvider: mockTracerProvider{}, } applied := false - _, err := NewTelemetryBuilder(set, func(b *TelemetryBuilder) { + _, err := NewTelemetryBuilder(set, telemetryBuilderOptionFunc(func(b *TelemetryBuilder) { applied = true - }) + })) require.NoError(t, err) require.True(t, applied) } diff --git a/processor/batchprocessor/metrics.go b/processor/batchprocessor/metrics.go index 98302403707..0c98063ceb2 100644 --- a/processor/batchprocessor/metrics.go +++ b/processor/batchprocessor/metrics.go @@ -10,15 +10,14 @@ import ( "go.opentelemetry.io/otel/metric" "go.opentelemetry.io/collector/config/configtelemetry" - "go.opentelemetry.io/collector/internal/obsreportconfig/obsmetrics" "go.opentelemetry.io/collector/processor" "go.opentelemetry.io/collector/processor/batchprocessor/internal/metadata" + "go.opentelemetry.io/collector/processor/internal" ) type trigger int const ( - typeStr = "batch" triggerTimeout trigger = iota triggerBatchSize ) @@ -33,7 +32,7 @@ type batchProcessorTelemetry struct { } func newBatchProcessorTelemetry(set processor.Settings, currentMetadataCardinality func() int) (*batchProcessorTelemetry, error) { - attrs := attribute.NewSet(attribute.String(obsmetrics.ProcessorKey, set.ID.String())) + attrs := attribute.NewSet(attribute.String(internal.ProcessorKey, set.ID.String())) telemetryBuilder, err := metadata.NewTelemetryBuilder(set.TelemetrySettings, metadata.WithProcessorBatchMetadataCardinalityCallback(func() int64 { diff --git a/processor/go.mod b/processor/go.mod index f297d3114e8..726c6aff708 100644 --- a/processor/go.mod +++ b/processor/go.mod @@ -5,21 +5,20 @@ go 1.22.0 require ( github.com/google/uuid v1.6.0 github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector v0.108.1 - go.opentelemetry.io/collector/component v0.108.1 - go.opentelemetry.io/collector/component/componentstatus v0.108.1 - go.opentelemetry.io/collector/config/configtelemetry v0.108.1 - go.opentelemetry.io/collector/consumer v0.108.1 - go.opentelemetry.io/collector/consumer/consumerprofiles v0.108.1 - go.opentelemetry.io/collector/consumer/consumertest v0.108.1 - go.opentelemetry.io/collector/pdata v1.14.1 - go.opentelemetry.io/collector/pdata/pprofile v0.108.1 - go.opentelemetry.io/collector/pdata/testdata v0.108.1 - go.opentelemetry.io/collector/processor/processorprofiles v0.108.1 - go.opentelemetry.io/otel v1.29.0 - go.opentelemetry.io/otel/metric v1.29.0 - go.opentelemetry.io/otel/sdk/metric v1.29.0 - go.opentelemetry.io/otel/trace v1.29.0 + go.opentelemetry.io/collector/component v0.109.0 + go.opentelemetry.io/collector/component/componentstatus v0.109.0 + go.opentelemetry.io/collector/config/configtelemetry v0.109.0 + go.opentelemetry.io/collector/consumer v0.109.0 + go.opentelemetry.io/collector/consumer/consumerprofiles v0.109.0 + go.opentelemetry.io/collector/consumer/consumertest v0.109.0 + go.opentelemetry.io/collector/pdata v1.15.0 + go.opentelemetry.io/collector/pdata/pprofile v0.109.0 + go.opentelemetry.io/collector/pdata/testdata v0.109.0 + go.opentelemetry.io/collector/processor/processorprofiles v0.109.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.uber.org/goleak v1.3.0 ) @@ -36,33 +35,27 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.20.2 // indirect + github.com/prometheus/client_golang v1.20.3 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.56.0 // indirect + github.com/prometheus/common v0.59.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.51.0 // indirect - go.opentelemetry.io/otel/sdk v1.29.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect + go.opentelemetry.io/otel/sdk v1.30.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.24.0 // indirect + golang.org/x/sys v0.25.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.65.0 // indirect + google.golang.org/grpc v1.66.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) -replace go.opentelemetry.io/collector => ../ - replace go.opentelemetry.io/collector/component => ../component -replace go.opentelemetry.io/collector/confmap => ../confmap - replace go.opentelemetry.io/collector/consumer => ../consumer -replace go.opentelemetry.io/collector/featuregate => ../featuregate - replace go.opentelemetry.io/collector/pdata => ../pdata replace go.opentelemetry.io/collector/pdata/testdata => ../pdata/testdata diff --git a/processor/go.sum b/processor/go.sum index 6e09c0083d5..46c53d70967 100644 --- a/processor/go.sum +++ b/processor/go.sum @@ -38,12 +38,12 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg= -github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= +github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.56.0 h1:UffReloqkBtvtQEYDg2s+uDPGRrJyC6vZWPGXf6OhPY= -github.com/prometheus/common v0.56.0/go.mod h1:7uRPFSUTbfZWsJ7MHY56sqt7hLQu3bxXHDnNhl8E9qI= +github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= +github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= @@ -54,18 +54,18 @@ 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.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= -go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0 h1:G7uexXb/K3T+T9fNLCCKncweEtNEBMTO+46hKX5EdKw= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0/go.mod h1:v0mFe5Kk7woIh938mrZBJBmENYquyA0IICrlYm4Y0t4= -go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= -go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= -go.opentelemetry.io/otel/sdk v1.29.0 h1:vkqKjk7gwhS8VaWb0POZKmIEDimRCMsopNYnriHyryo= -go.opentelemetry.io/otel/sdk v1.29.0/go.mod h1:pM8Dx5WKnvxLCb+8lG1PRNIDxu9g9b9g59Qr7hfAAok= -go.opentelemetry.io/otel/sdk/metric v1.29.0 h1:K2CfmJohnRgvZ9UAj2/FhIf/okdWcNdBwe1m8xFXiSY= -go.opentelemetry.io/otel/sdk/metric v1.29.0/go.mod h1:6zZLdCl2fkauYoZIOn/soQIDSWFmNSRcICarHfuhNJQ= -go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= -go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= +go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= +go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= +go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= +go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= +go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= +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.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.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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= @@ -105,8 +105,8 @@ 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= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd h1:6TEm2ZxXoQmFWFlt1vNxvVOa1Q0dXFQD1m/rYjXmS0E= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= 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= diff --git a/processor/internal/obsmetrics.go b/processor/internal/obsmetrics.go new file mode 100644 index 00000000000..c96fbe5e9e0 --- /dev/null +++ b/processor/internal/obsmetrics.go @@ -0,0 +1,13 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package internal // import "go.opentelemetry.io/collector/processor/internal" + +const ( + MetricNameSep = "_" + + // ProcessorKey is the key used to identify processors in metrics and traces. + ProcessorKey = "processor" + + ProcessorMetricPrefix = ProcessorKey + MetricNameSep +) diff --git a/processor/memorylimiterprocessor/go.mod b/processor/memorylimiterprocessor/go.mod index ac8c6dc9715..32e125c5222 100644 --- a/processor/memorylimiterprocessor/go.mod +++ b/processor/memorylimiterprocessor/go.mod @@ -4,13 +4,13 @@ go 1.22.0 require ( github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector v0.108.1 - go.opentelemetry.io/collector/component v0.108.1 - go.opentelemetry.io/collector/confmap v1.14.1 - go.opentelemetry.io/collector/consumer v0.108.1 - go.opentelemetry.io/collector/consumer/consumertest v0.108.1 - go.opentelemetry.io/collector/pdata v1.14.1 - go.opentelemetry.io/collector/processor v0.108.1 + go.opentelemetry.io/collector v0.109.0 + go.opentelemetry.io/collector/component v0.109.0 + go.opentelemetry.io/collector/confmap v1.15.0 + go.opentelemetry.io/collector/consumer v0.109.0 + go.opentelemetry.io/collector/consumer/consumertest v0.109.0 + go.opentelemetry.io/collector/pdata v1.15.0 + go.opentelemetry.io/collector/processor v0.109.0 go.uber.org/goleak v1.3.0 ) @@ -37,33 +37,33 @@ require ( github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect - github.com/prometheus/client_golang v1.20.2 // indirect + github.com/prometheus/client_golang v1.20.3 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.56.0 // indirect + github.com/prometheus/common v0.59.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect - github.com/shirou/gopsutil/v4 v4.24.7 // indirect + github.com/shirou/gopsutil/v4 v4.24.8 // indirect github.com/tklauser/go-sysconf v0.3.12 // indirect github.com/tklauser/numcpus v0.6.1 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect - go.opentelemetry.io/collector/component/componentstatus v0.108.1 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.108.1 // indirect - go.opentelemetry.io/collector/consumer/consumerprofiles v0.108.1 // indirect - go.opentelemetry.io/collector/pdata/pprofile v0.108.1 // indirect - go.opentelemetry.io/collector/pdata/testdata v0.108.1 // indirect - go.opentelemetry.io/collector/processor/processorprofiles v0.108.1 // indirect - go.opentelemetry.io/otel v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.51.0 // indirect - go.opentelemetry.io/otel/metric v1.29.0 // indirect - go.opentelemetry.io/otel/sdk v1.29.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.29.0 // indirect - go.opentelemetry.io/otel/trace v1.29.0 // indirect + go.opentelemetry.io/collector/component/componentstatus v0.109.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.109.0 // indirect + go.opentelemetry.io/collector/consumer/consumerprofiles v0.109.0 // indirect + go.opentelemetry.io/collector/pdata/pprofile v0.109.0 // indirect + go.opentelemetry.io/collector/pdata/testdata v0.109.0 // indirect + go.opentelemetry.io/collector/processor/processorprofiles v0.109.0 // indirect + go.opentelemetry.io/otel v1.30.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect + go.opentelemetry.io/otel/metric v1.30.0 // indirect + go.opentelemetry.io/otel/sdk v1.30.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect + go.opentelemetry.io/otel/trace v1.30.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.24.0 // indirect + golang.org/x/sys v0.25.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.65.0 // indirect + google.golang.org/grpc v1.66.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) @@ -76,8 +76,6 @@ replace go.opentelemetry.io/collector/component => ../../component replace go.opentelemetry.io/collector/confmap => ../../confmap -replace go.opentelemetry.io/collector/featuregate => ../../featuregate - replace go.opentelemetry.io/collector/pdata => ../../pdata replace go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata diff --git a/processor/memorylimiterprocessor/go.sum b/processor/memorylimiterprocessor/go.sum index 7eb3f0ddfd7..556ddb58cb8 100644 --- a/processor/memorylimiterprocessor/go.sum +++ b/processor/memorylimiterprocessor/go.sum @@ -57,18 +57,18 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= -github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg= -github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= +github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.56.0 h1:UffReloqkBtvtQEYDg2s+uDPGRrJyC6vZWPGXf6OhPY= -github.com/prometheus/common v0.56.0/go.mod h1:7uRPFSUTbfZWsJ7MHY56sqt7hLQu3bxXHDnNhl8E9qI= +github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= +github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= -github.com/shirou/gopsutil/v4 v4.24.7 h1:V9UGTK4gQ8HvcnPKf6Zt3XHyQq/peaekfxpJ2HSocJk= -github.com/shirou/gopsutil/v4 v4.24.7/go.mod h1:0uW/073rP7FYLOkvxolUQM5rMOLTNmRXnFKafpb71rw= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= +github.com/shirou/gopsutil/v4 v4.24.8 h1:pVQjIenQkIhqO81mwTaXjTzOMT7d3TZkf43PlVFHENI= +github.com/shirou/gopsutil/v4 v4.24.8/go.mod h1:wE0OrJtj4dG+hYkxqDH3QiBICdKSf04/npcvLLc/oRg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= @@ -81,18 +81,18 @@ 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.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= -go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0 h1:G7uexXb/K3T+T9fNLCCKncweEtNEBMTO+46hKX5EdKw= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0/go.mod h1:v0mFe5Kk7woIh938mrZBJBmENYquyA0IICrlYm4Y0t4= -go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= -go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= -go.opentelemetry.io/otel/sdk v1.29.0 h1:vkqKjk7gwhS8VaWb0POZKmIEDimRCMsopNYnriHyryo= -go.opentelemetry.io/otel/sdk v1.29.0/go.mod h1:pM8Dx5WKnvxLCb+8lG1PRNIDxu9g9b9g59Qr7hfAAok= -go.opentelemetry.io/otel/sdk/metric v1.29.0 h1:K2CfmJohnRgvZ9UAj2/FhIf/okdWcNdBwe1m8xFXiSY= -go.opentelemetry.io/otel/sdk/metric v1.29.0/go.mod h1:6zZLdCl2fkauYoZIOn/soQIDSWFmNSRcICarHfuhNJQ= -go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= -go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= +go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= +go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= +go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= +go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= +go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= +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.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= @@ -120,8 +120,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.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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= @@ -136,8 +136,8 @@ 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= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd h1:6TEm2ZxXoQmFWFlt1vNxvVOa1Q0dXFQD1m/rYjXmS0E= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= 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= diff --git a/processor/memorylimiterprocessor/memorylimiter_test.go b/processor/memorylimiterprocessor/memorylimiter_test.go index 6172fa39889..a09c31e1ff0 100644 --- a/processor/memorylimiterprocessor/memorylimiter_test.go +++ b/processor/memorylimiterprocessor/memorylimiter_test.go @@ -57,7 +57,8 @@ func TestNoDataLoss(t *testing.T) { require.NoError(t, err) processor, err := processorhelper.NewLogsProcessor(context.Background(), processor.Settings{ - ID: component.MustNewID("nop"), + ID: component.MustNewID("nop"), + TelemetrySettings: componenttest.NewNopTelemetrySettings(), }, cfg, exporter, limiter.processLogs, processorhelper.WithStart(limiter.start), diff --git a/processor/processorhelper/documentation.md b/processor/processorhelper/documentation.md index 6091e8385a9..4f57c096a8a 100644 --- a/processor/processorhelper/documentation.md +++ b/processor/processorhelper/documentation.md @@ -54,29 +54,21 @@ Number of spans that were dropped. | ---- | ----------- | ---------- | --------- | | {spans} | Sum | Int | true | -### otelcol_processor_inserted_log_records +### otelcol_processor_incoming_items -Number of log records that were inserted. +Number of items passed to the processor. | Unit | Metric Type | Value Type | Monotonic | | ---- | ----------- | ---------- | --------- | -| {records} | Sum | Int | true | - -### otelcol_processor_inserted_metric_points - -Number of metric points that were inserted. - -| Unit | Metric Type | Value Type | Monotonic | -| ---- | ----------- | ---------- | --------- | -| {datapoints} | Sum | Int | true | +| {items} | Sum | Int | true | -### otelcol_processor_inserted_spans +### otelcol_processor_outgoing_items -Number of spans that were inserted. +Number of items emitted from the processor. | Unit | Metric Type | Value Type | Monotonic | | ---- | ----------- | ---------- | --------- | -| {spans} | Sum | Int | true | +| {items} | Sum | Int | true | ### otelcol_processor_refused_log_records diff --git a/processor/processorhelper/internal/metadata/generated_telemetry.go b/processor/processorhelper/internal/metadata/generated_telemetry.go index 114ba9df7c0..83053bdee91 100644 --- a/processor/processorhelper/internal/metadata/generated_telemetry.go +++ b/processor/processorhelper/internal/metadata/generated_telemetry.go @@ -35,24 +35,31 @@ type TelemetryBuilder struct { ProcessorDroppedLogRecords metric.Int64Counter ProcessorDroppedMetricPoints metric.Int64Counter ProcessorDroppedSpans metric.Int64Counter - ProcessorInsertedLogRecords metric.Int64Counter - ProcessorInsertedMetricPoints metric.Int64Counter - ProcessorInsertedSpans metric.Int64Counter + ProcessorIncomingItems metric.Int64Counter + ProcessorOutgoingItems metric.Int64Counter ProcessorRefusedLogRecords metric.Int64Counter ProcessorRefusedMetricPoints metric.Int64Counter ProcessorRefusedSpans metric.Int64Counter meters map[configtelemetry.Level]metric.Meter } -// telemetryBuilderOption applies changes to default builder. -type telemetryBuilderOption func(*TelemetryBuilder) +// TelemetryBuilderOption applies changes to default builder. +type TelemetryBuilderOption interface { + apply(*TelemetryBuilder) +} + +type telemetryBuilderOptionFunc func(mb *TelemetryBuilder) + +func (tbof telemetryBuilderOptionFunc) apply(mb *TelemetryBuilder) { + tbof(mb) +} // NewTelemetryBuilder provides a struct with methods to update all internal telemetry // for a component -func NewTelemetryBuilder(settings component.TelemetrySettings, options ...telemetryBuilderOption) (*TelemetryBuilder, error) { +func NewTelemetryBuilder(settings component.TelemetrySettings, options ...TelemetryBuilderOption) (*TelemetryBuilder, error) { builder := TelemetryBuilder{meters: map[configtelemetry.Level]metric.Meter{}} for _, op := range options { - op(&builder) + op.apply(&builder) } builder.meters[configtelemetry.LevelBasic] = LeveledMeter(settings, configtelemetry.LevelBasic) var err, errs error @@ -92,22 +99,16 @@ func NewTelemetryBuilder(settings component.TelemetrySettings, options ...teleme metric.WithUnit("{spans}"), ) errs = errors.Join(errs, err) - builder.ProcessorInsertedLogRecords, err = builder.meters[configtelemetry.LevelBasic].Int64Counter( - "otelcol_processor_inserted_log_records", - metric.WithDescription("Number of log records that were inserted."), - metric.WithUnit("{records}"), + builder.ProcessorIncomingItems, err = builder.meters[configtelemetry.LevelBasic].Int64Counter( + "otelcol_processor_incoming_items", + metric.WithDescription("Number of items passed to the processor."), + metric.WithUnit("{items}"), ) errs = errors.Join(errs, err) - builder.ProcessorInsertedMetricPoints, err = builder.meters[configtelemetry.LevelBasic].Int64Counter( - "otelcol_processor_inserted_metric_points", - metric.WithDescription("Number of metric points that were inserted."), - metric.WithUnit("{datapoints}"), - ) - errs = errors.Join(errs, err) - builder.ProcessorInsertedSpans, err = builder.meters[configtelemetry.LevelBasic].Int64Counter( - "otelcol_processor_inserted_spans", - metric.WithDescription("Number of spans that were inserted."), - metric.WithUnit("{spans}"), + builder.ProcessorOutgoingItems, err = builder.meters[configtelemetry.LevelBasic].Int64Counter( + "otelcol_processor_outgoing_items", + metric.WithDescription("Number of items emitted from the processor."), + metric.WithUnit("{items}"), ) errs = errors.Join(errs, err) builder.ProcessorRefusedLogRecords, err = builder.meters[configtelemetry.LevelBasic].Int64Counter( diff --git a/processor/processorhelper/internal/metadata/generated_telemetry_test.go b/processor/processorhelper/internal/metadata/generated_telemetry_test.go index dc6fbeca903..21457f0a3fd 100644 --- a/processor/processorhelper/internal/metadata/generated_telemetry_test.go +++ b/processor/processorhelper/internal/metadata/generated_telemetry_test.go @@ -75,9 +75,9 @@ func TestNewTelemetryBuilder(t *testing.T) { TracerProvider: mockTracerProvider{}, } applied := false - _, err := NewTelemetryBuilder(set, func(b *TelemetryBuilder) { + _, err := NewTelemetryBuilder(set, telemetryBuilderOptionFunc(func(b *TelemetryBuilder) { applied = true - }) + })) require.NoError(t, err) require.True(t, applied) } diff --git a/processor/processorhelper/logs.go b/processor/processorhelper/logs.go index d593a5f74a5..f8b76b512a3 100644 --- a/processor/processorhelper/logs.go +++ b/processor/processorhelper/logs.go @@ -7,6 +7,7 @@ import ( "context" "errors" + "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/trace" "go.opentelemetry.io/collector/component" @@ -39,12 +40,22 @@ func NewLogsProcessor( return nil, errors.New("nil logsFunc") } + obs, err := newObsReport(ObsReportSettings{ + ProcessorID: set.ID, + ProcessorCreateSettings: set, + }) + if err != nil { + return nil, err + } + obs.otelAttrs = append(obs.otelAttrs, attribute.String("otel.signal", "logs")) + eventOptions := spanAttributes(set.ID) bs := fromOptions(options) logsConsumer, err := consumer.NewLogs(func(ctx context.Context, ld plog.Logs) error { span := trace.SpanFromContext(ctx) span.AddEvent("Start processing.", eventOptions) - var err error + recordsIn := ld.LogRecordCount() + ld, err = logsFunc(ctx, ld) span.AddEvent("End processing.", eventOptions) if err != nil { @@ -53,6 +64,8 @@ func NewLogsProcessor( } return err } + recordsOut := ld.LogRecordCount() + obs.recordInOut(ctx, recordsIn, recordsOut) return nextConsumer.ConsumeLogs(ctx, ld) }, bs.consumerOptions...) if err != nil { diff --git a/processor/processorhelper/logs_test.go b/processor/processorhelper/logs_test.go index a958ad33130..676155595e5 100644 --- a/processor/processorhelper/logs_test.go +++ b/processor/processorhelper/logs_test.go @@ -10,6 +10,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/sdk/metric/metricdata" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" @@ -59,7 +61,7 @@ func TestNewLogsProcessor_ProcessLogError(t *testing.T) { func TestNewLogsProcessor_ProcessLogsErrSkipProcessingData(t *testing.T) { lp, err := NewLogsProcessor(context.Background(), processortest.NewNopSettings(), &testLogsCfg, consumertest.NewNop(), newTestLProcessor(ErrSkipProcessingData)) require.NoError(t, err) - assert.Equal(t, nil, lp.ConsumeLogs(context.Background(), plog.NewLogs())) + assert.NoError(t, lp.ConsumeLogs(context.Background(), plog.NewLogs())) } func newTestLProcessor(retError error) ProcessLogsFunc { @@ -67,3 +69,61 @@ func newTestLProcessor(retError error) ProcessLogsFunc { return ld, retError } } + +func TestLogsProcessor_RecordInOut(t *testing.T) { + // Regardless of how many logs are ingested, emit just one + mockAggregate := func(_ context.Context, _ plog.Logs) (plog.Logs, error) { + ld := plog.NewLogs() + ld.ResourceLogs().AppendEmpty().ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + return ld, nil + } + + incomingLogs := plog.NewLogs() + incomingLogRecords := incomingLogs.ResourceLogs().AppendEmpty().ScopeLogs().AppendEmpty().LogRecords() + + // Add 3 records to the incoming + incomingLogRecords.AppendEmpty() + incomingLogRecords.AppendEmpty() + incomingLogRecords.AppendEmpty() + + testTelemetry := setupTestTelemetry() + lp, err := NewLogsProcessor(context.Background(), testTelemetry.NewSettings(), &testLogsCfg, consumertest.NewNop(), mockAggregate) + require.NoError(t, err) + + assert.NoError(t, lp.Start(context.Background(), componenttest.NewNopHost())) + assert.NoError(t, lp.ConsumeLogs(context.Background(), incomingLogs)) + assert.NoError(t, lp.Shutdown(context.Background())) + + testTelemetry.assertMetrics(t, []metricdata.Metrics{ + { + Name: "otelcol_processor_incoming_items", + Description: "Number of items passed to the processor.", + Unit: "{items}", + Data: metricdata.Sum[int64]{ + Temporality: metricdata.CumulativeTemporality, + IsMonotonic: true, + DataPoints: []metricdata.DataPoint[int64]{ + { + Value: 3, + Attributes: attribute.NewSet(attribute.String("processor", "processorhelper"), attribute.String("otel.signal", "logs")), + }, + }, + }, + }, + { + Name: "otelcol_processor_outgoing_items", + Description: "Number of items emitted from the processor.", + Unit: "{items}", + Data: metricdata.Sum[int64]{ + Temporality: metricdata.CumulativeTemporality, + IsMonotonic: true, + DataPoints: []metricdata.DataPoint[int64]{ + { + Value: 1, + Attributes: attribute.NewSet(attribute.String("processor", "processorhelper"), attribute.String("otel.signal", "logs")), + }, + }, + }, + }, + }) +} diff --git a/processor/processorhelper/metadata.yaml b/processor/processorhelper/metadata.yaml index 95acaf640b8..90e0992efbf 100644 --- a/processor/processorhelper/metadata.yaml +++ b/processor/processorhelper/metadata.yaml @@ -9,6 +9,23 @@ status: telemetry: metrics: + + processor_incoming_items: + enabled: true + description: Number of items passed to the processor. + unit: "{items}" + sum: + value_type: int + monotonic: true + + processor_outgoing_items: + enabled: true + description: Number of items emitted from the processor. + unit: "{items}" + sum: + value_type: int + monotonic: true + processor_accepted_spans: enabled: true description: Number of spans successfully pushed into the next component in the pipeline. @@ -33,14 +50,6 @@ telemetry: value_type: int monotonic: true - processor_inserted_spans: - enabled: true - description: Number of spans that were inserted. - unit: "{spans}" - sum: - value_type: int - monotonic: true - processor_accepted_metric_points: enabled: true description: Number of metric points successfully pushed into the next component in the pipeline. @@ -65,14 +74,6 @@ telemetry: value_type: int monotonic: true - processor_inserted_metric_points: - enabled: true - description: Number of metric points that were inserted. - unit: "{datapoints}" - sum: - value_type: int - monotonic: true - processor_accepted_log_records: enabled: true description: Number of log records successfully pushed into the next component in the pipeline. @@ -96,11 +97,3 @@ telemetry: sum: value_type: int monotonic: true - - processor_inserted_log_records: - enabled: true - description: Number of log records that were inserted. - unit: "{records}" - sum: - value_type: int - monotonic: true diff --git a/processor/processorhelper/metrics.go b/processor/processorhelper/metrics.go index dc3388444c6..f98db1e240a 100644 --- a/processor/processorhelper/metrics.go +++ b/processor/processorhelper/metrics.go @@ -7,6 +7,7 @@ import ( "context" "errors" + "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/trace" "go.opentelemetry.io/collector/component" @@ -39,12 +40,22 @@ func NewMetricsProcessor( return nil, errors.New("nil metricsFunc") } + obs, err := newObsReport(ObsReportSettings{ + ProcessorID: set.ID, + ProcessorCreateSettings: set, + }) + if err != nil { + return nil, err + } + obs.otelAttrs = append(obs.otelAttrs, attribute.String("otel.signal", "metrics")) + eventOptions := spanAttributes(set.ID) bs := fromOptions(options) metricsConsumer, err := consumer.NewMetrics(func(ctx context.Context, md pmetric.Metrics) error { span := trace.SpanFromContext(ctx) span.AddEvent("Start processing.", eventOptions) - var err error + pointsIn := md.DataPointCount() + md, err = metricsFunc(ctx, md) span.AddEvent("End processing.", eventOptions) if err != nil { @@ -53,6 +64,8 @@ func NewMetricsProcessor( } return err } + pointsOut := md.DataPointCount() + obs.recordInOut(ctx, pointsIn, pointsOut) return nextConsumer.ConsumeMetrics(ctx, md) }, bs.consumerOptions...) if err != nil { diff --git a/processor/processorhelper/metrics_test.go b/processor/processorhelper/metrics_test.go index e3ac40e26bd..db59e4be030 100644 --- a/processor/processorhelper/metrics_test.go +++ b/processor/processorhelper/metrics_test.go @@ -10,6 +10,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/sdk/metric/metricdata" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" @@ -59,7 +61,7 @@ func TestNewMetricsProcessor_ProcessMetricsError(t *testing.T) { func TestNewMetricsProcessor_ProcessMetricsErrSkipProcessingData(t *testing.T) { mp, err := NewMetricsProcessor(context.Background(), processortest.NewNopSettings(), &testMetricsCfg, consumertest.NewNop(), newTestMProcessor(ErrSkipProcessingData)) require.NoError(t, err) - assert.Equal(t, nil, mp.ConsumeMetrics(context.Background(), pmetric.NewMetrics())) + assert.NoError(t, mp.ConsumeMetrics(context.Background(), pmetric.NewMetrics())) } func newTestMProcessor(retError error) ProcessMetricsFunc { @@ -67,3 +69,62 @@ func newTestMProcessor(retError error) ProcessMetricsFunc { return md, retError } } + +func TestMetricsProcessor_RecordInOut(t *testing.T) { + // Regardless of how many data points are ingested, emit 3 + mockAggregate := func(_ context.Context, _ pmetric.Metrics) (pmetric.Metrics, error) { + md := pmetric.NewMetrics() + md.ResourceMetrics().AppendEmpty().ScopeMetrics().AppendEmpty().Metrics().AppendEmpty().SetEmptySum().DataPoints().AppendEmpty() + md.ResourceMetrics().AppendEmpty().ScopeMetrics().AppendEmpty().Metrics().AppendEmpty().SetEmptySum().DataPoints().AppendEmpty() + md.ResourceMetrics().AppendEmpty().ScopeMetrics().AppendEmpty().Metrics().AppendEmpty().SetEmptySum().DataPoints().AppendEmpty() + return md, nil + } + + incomingMetrics := pmetric.NewMetrics() + dps := incomingMetrics.ResourceMetrics().AppendEmpty().ScopeMetrics().AppendEmpty().Metrics().AppendEmpty().SetEmptySum().DataPoints() + + // Add 2 data points to the incoming + dps.AppendEmpty() + dps.AppendEmpty() + + testTelemetry := setupTestTelemetry() + mp, err := NewMetricsProcessor(context.Background(), testTelemetry.NewSettings(), &testMetricsCfg, consumertest.NewNop(), mockAggregate) + require.NoError(t, err) + + assert.NoError(t, mp.Start(context.Background(), componenttest.NewNopHost())) + assert.NoError(t, mp.ConsumeMetrics(context.Background(), incomingMetrics)) + assert.NoError(t, mp.Shutdown(context.Background())) + + testTelemetry.assertMetrics(t, []metricdata.Metrics{ + { + Name: "otelcol_processor_incoming_items", + Description: "Number of items passed to the processor.", + Unit: "{items}", + Data: metricdata.Sum[int64]{ + Temporality: metricdata.CumulativeTemporality, + IsMonotonic: true, + DataPoints: []metricdata.DataPoint[int64]{ + { + Value: 2, + Attributes: attribute.NewSet(attribute.String("processor", "processorhelper"), attribute.String("otel.signal", "metrics")), + }, + }, + }, + }, + { + Name: "otelcol_processor_outgoing_items", + Description: "Number of items emitted from the processor.", + Unit: "{items}", + Data: metricdata.Sum[int64]{ + Temporality: metricdata.CumulativeTemporality, + IsMonotonic: true, + DataPoints: []metricdata.DataPoint[int64]{ + { + Value: 3, + Attributes: attribute.NewSet(attribute.String("processor", "processorhelper"), attribute.String("otel.signal", "metrics")), + }, + }, + }, + }, + }) +} diff --git a/processor/processorhelper/obsreport.go b/processor/processorhelper/obsreport.go index 6fef0fd45ec..791822e0aa7 100644 --- a/processor/processorhelper/obsreport.go +++ b/processor/processorhelper/obsreport.go @@ -11,8 +11,8 @@ import ( "go.opentelemetry.io/otel/metric" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/internal/obsreportconfig/obsmetrics" "go.opentelemetry.io/collector/processor" + "go.opentelemetry.io/collector/processor/internal" "go.opentelemetry.io/collector/processor/processorhelper/internal/metadata" ) @@ -20,14 +20,14 @@ import ( // the standards used in the Collector. The configType should be the same // value used to identify the type on the config. func BuildCustomMetricName(configType, metric string) string { - componentPrefix := obsmetrics.ProcessorMetricPrefix - if !strings.HasSuffix(componentPrefix, obsmetrics.MetricNameSep) { - componentPrefix += obsmetrics.MetricNameSep + componentPrefix := internal.ProcessorMetricPrefix + if !strings.HasSuffix(componentPrefix, internal.MetricNameSep) { + componentPrefix += internal.MetricNameSep } if configType == "" { return componentPrefix } - return componentPrefix + configType + obsmetrics.MetricNameSep + metric + return componentPrefix + configType + internal.MetricNameSep + metric } // ObsReport is a helper to add observability to a processor. @@ -54,94 +54,80 @@ func newObsReport(cfg ObsReportSettings) (*ObsReport, error) { } return &ObsReport{ otelAttrs: []attribute.KeyValue{ - attribute.String(obsmetrics.ProcessorKey, cfg.ProcessorID.String()), + attribute.String(internal.ProcessorKey, cfg.ProcessorID.String()), }, telemetryBuilder: telemetryBuilder, }, nil } -func (or *ObsReport) recordData(ctx context.Context, dataType component.DataType, accepted, refused, dropped, inserted int64) { - var acceptedCount, refusedCount, droppedCount, insertedCount metric.Int64Counter +func (or *ObsReport) recordInOut(ctx context.Context, incoming, outgoing int) { + or.telemetryBuilder.ProcessorIncomingItems.Add(ctx, int64(incoming), metric.WithAttributes(or.otelAttrs...)) + or.telemetryBuilder.ProcessorOutgoingItems.Add(ctx, int64(outgoing), metric.WithAttributes(or.otelAttrs...)) +} + +func (or *ObsReport) recordData(ctx context.Context, dataType component.DataType, accepted, refused, dropped int64) { + var acceptedCount, refusedCount, droppedCount metric.Int64Counter switch dataType { case component.DataTypeTraces: acceptedCount = or.telemetryBuilder.ProcessorAcceptedSpans refusedCount = or.telemetryBuilder.ProcessorRefusedSpans droppedCount = or.telemetryBuilder.ProcessorDroppedSpans - insertedCount = or.telemetryBuilder.ProcessorInsertedSpans case component.DataTypeMetrics: acceptedCount = or.telemetryBuilder.ProcessorAcceptedMetricPoints refusedCount = or.telemetryBuilder.ProcessorRefusedMetricPoints droppedCount = or.telemetryBuilder.ProcessorDroppedMetricPoints - insertedCount = or.telemetryBuilder.ProcessorInsertedMetricPoints case component.DataTypeLogs: acceptedCount = or.telemetryBuilder.ProcessorAcceptedLogRecords refusedCount = or.telemetryBuilder.ProcessorRefusedLogRecords droppedCount = or.telemetryBuilder.ProcessorDroppedLogRecords - insertedCount = or.telemetryBuilder.ProcessorInsertedLogRecords } acceptedCount.Add(ctx, accepted, metric.WithAttributes(or.otelAttrs...)) refusedCount.Add(ctx, refused, metric.WithAttributes(or.otelAttrs...)) droppedCount.Add(ctx, dropped, metric.WithAttributes(or.otelAttrs...)) - insertedCount.Add(ctx, inserted, metric.WithAttributes(or.otelAttrs...)) } // TracesAccepted reports that the trace data was accepted. func (or *ObsReport) TracesAccepted(ctx context.Context, numSpans int) { - or.recordData(ctx, component.DataTypeTraces, int64(numSpans), int64(0), int64(0), int64(0)) + or.recordData(ctx, component.DataTypeTraces, int64(numSpans), int64(0), int64(0)) } // TracesRefused reports that the trace data was refused. func (or *ObsReport) TracesRefused(ctx context.Context, numSpans int) { - or.recordData(ctx, component.DataTypeTraces, int64(0), int64(numSpans), int64(0), int64(0)) + or.recordData(ctx, component.DataTypeTraces, int64(0), int64(numSpans), int64(0)) } // TracesDropped reports that the trace data was dropped. func (or *ObsReport) TracesDropped(ctx context.Context, numSpans int) { - or.recordData(ctx, component.DataTypeTraces, int64(0), int64(0), int64(numSpans), int64(0)) -} - -// TracesInserted reports that the trace data was inserted. -func (or *ObsReport) TracesInserted(ctx context.Context, numSpans int) { - or.recordData(ctx, component.DataTypeTraces, int64(0), int64(0), int64(0), int64(numSpans)) + or.recordData(ctx, component.DataTypeTraces, int64(0), int64(0), int64(numSpans)) } // MetricsAccepted reports that the metrics were accepted. func (or *ObsReport) MetricsAccepted(ctx context.Context, numPoints int) { - or.recordData(ctx, component.DataTypeMetrics, int64(numPoints), int64(0), int64(0), int64(0)) + or.recordData(ctx, component.DataTypeMetrics, int64(numPoints), int64(0), int64(0)) } // MetricsRefused reports that the metrics were refused. func (or *ObsReport) MetricsRefused(ctx context.Context, numPoints int) { - or.recordData(ctx, component.DataTypeMetrics, int64(0), int64(numPoints), int64(0), int64(0)) + or.recordData(ctx, component.DataTypeMetrics, int64(0), int64(numPoints), int64(0)) } // MetricsDropped reports that the metrics were dropped. func (or *ObsReport) MetricsDropped(ctx context.Context, numPoints int) { - or.recordData(ctx, component.DataTypeMetrics, int64(0), int64(0), int64(numPoints), int64(0)) -} - -// MetricsInserted reports that the metrics were inserted. -func (or *ObsReport) MetricsInserted(ctx context.Context, numPoints int) { - or.recordData(ctx, component.DataTypeMetrics, int64(0), int64(0), int64(0), int64(numPoints)) + or.recordData(ctx, component.DataTypeMetrics, int64(0), int64(0), int64(numPoints)) } // LogsAccepted reports that the logs were accepted. func (or *ObsReport) LogsAccepted(ctx context.Context, numRecords int) { - or.recordData(ctx, component.DataTypeLogs, int64(numRecords), int64(0), int64(0), int64(0)) + or.recordData(ctx, component.DataTypeLogs, int64(numRecords), int64(0), int64(0)) } // LogsRefused reports that the logs were refused. func (or *ObsReport) LogsRefused(ctx context.Context, numRecords int) { - or.recordData(ctx, component.DataTypeLogs, int64(0), int64(numRecords), int64(0), int64(0)) + or.recordData(ctx, component.DataTypeLogs, int64(0), int64(numRecords), int64(0)) } // LogsDropped reports that the logs were dropped. func (or *ObsReport) LogsDropped(ctx context.Context, numRecords int) { - or.recordData(ctx, component.DataTypeLogs, int64(0), int64(0), int64(numRecords), int64(0)) -} - -// LogsInserted reports that the logs were inserted. -func (or *ObsReport) LogsInserted(ctx context.Context, numRecords int) { - or.recordData(ctx, component.DataTypeLogs, int64(0), int64(0), int64(0), int64(numRecords)) + or.recordData(ctx, component.DataTypeLogs, int64(0), int64(0), int64(numRecords)) } diff --git a/processor/processorhelper/obsreport_test.go b/processor/processorhelper/obsreport_test.go index f48b6739ef0..6b8aa846e8c 100644 --- a/processor/processorhelper/obsreport_test.go +++ b/processor/processorhelper/obsreport_test.go @@ -27,7 +27,6 @@ func TestProcessorTraceData(t *testing.T) { const acceptedSpans = 27 const refusedSpans = 19 const droppedSpans = 13 - const insertedSpans = 5 obsrep, err := newObsReport(ObsReportSettings{ ProcessorID: processorID, @@ -37,9 +36,8 @@ func TestProcessorTraceData(t *testing.T) { obsrep.TracesAccepted(context.Background(), acceptedSpans) obsrep.TracesRefused(context.Background(), refusedSpans) obsrep.TracesDropped(context.Background(), droppedSpans) - obsrep.TracesInserted(context.Background(), insertedSpans) - require.NoError(t, tt.CheckProcessorTraces(acceptedSpans, refusedSpans, droppedSpans, insertedSpans)) + require.NoError(t, tt.CheckProcessorTraces(acceptedSpans, refusedSpans, droppedSpans)) }) } @@ -48,7 +46,6 @@ func TestProcessorMetricsData(t *testing.T) { const acceptedPoints = 29 const refusedPoints = 11 const droppedPoints = 17 - const insertedPoints = 4 obsrep, err := newObsReport(ObsReportSettings{ ProcessorID: processorID, @@ -58,9 +55,8 @@ func TestProcessorMetricsData(t *testing.T) { obsrep.MetricsAccepted(context.Background(), acceptedPoints) obsrep.MetricsRefused(context.Background(), refusedPoints) obsrep.MetricsDropped(context.Background(), droppedPoints) - obsrep.MetricsInserted(context.Background(), insertedPoints) - require.NoError(t, tt.CheckProcessorMetrics(acceptedPoints, refusedPoints, droppedPoints, insertedPoints)) + require.NoError(t, tt.CheckProcessorMetrics(acceptedPoints, refusedPoints, droppedPoints)) }) } @@ -91,7 +87,6 @@ func TestProcessorLogRecords(t *testing.T) { const acceptedRecords = 29 const refusedRecords = 11 const droppedRecords = 17 - const insertedRecords = 3 obsrep, err := newObsReport(ObsReportSettings{ ProcessorID: processorID, @@ -101,9 +96,8 @@ func TestProcessorLogRecords(t *testing.T) { obsrep.LogsAccepted(context.Background(), acceptedRecords) obsrep.LogsRefused(context.Background(), refusedRecords) obsrep.LogsDropped(context.Background(), droppedRecords) - obsrep.LogsInserted(context.Background(), insertedRecords) - require.NoError(t, tt.CheckProcessorLogs(acceptedRecords, refusedRecords, droppedRecords, insertedRecords)) + require.NoError(t, tt.CheckProcessorLogs(acceptedRecords, refusedRecords, droppedRecords)) }) } @@ -121,24 +115,19 @@ func TestCheckProcessorTracesViews(t *testing.T) { por.TracesAccepted(context.Background(), 7) por.TracesRefused(context.Background(), 8) por.TracesDropped(context.Background(), 9) - por.TracesInserted(context.Background(), 10) - - assert.NoError(t, tt.CheckProcessorTraces(7, 8, 9, 10)) - assert.Error(t, tt.CheckProcessorTraces(0, 0, 0, 0)) - assert.Error(t, tt.CheckProcessorTraces(7, 0, 0, 0)) - assert.Error(t, tt.CheckProcessorTraces(0, 8, 0, 0)) - assert.Error(t, tt.CheckProcessorTraces(0, 0, 9, 0)) - assert.Error(t, tt.CheckProcessorTraces(0, 0, 0, 10)) - assert.Error(t, tt.CheckProcessorTraces(7, 8, 0, 0)) - assert.Error(t, tt.CheckProcessorTraces(7, 0, 9, 0)) - assert.Error(t, tt.CheckProcessorTraces(7, 0, 0, 10)) - assert.Error(t, tt.CheckProcessorTraces(0, 8, 9, 0)) - assert.Error(t, tt.CheckProcessorTraces(0, 8, 0, 10)) - assert.Error(t, tt.CheckProcessorTraces(0, 0, 9, 10)) - assert.Error(t, tt.CheckProcessorTraces(7, 8, 9, 0)) - assert.Error(t, tt.CheckProcessorTraces(7, 8, 0, 10)) - assert.Error(t, tt.CheckProcessorTraces(7, 0, 9, 10)) - assert.Error(t, tt.CheckProcessorTraces(0, 8, 9, 10)) + + assert.NoError(t, tt.CheckProcessorTraces(7, 8, 9)) + assert.Error(t, tt.CheckProcessorTraces(0, 0, 0)) + assert.Error(t, tt.CheckProcessorTraces(7, 0, 0)) + assert.Error(t, tt.CheckProcessorTraces(0, 8, 0)) + assert.Error(t, tt.CheckProcessorTraces(0, 0, 9)) + assert.Error(t, tt.CheckProcessorTraces(0, 0, 0)) + assert.Error(t, tt.CheckProcessorTraces(7, 8, 0)) + assert.Error(t, tt.CheckProcessorTraces(7, 0, 9)) + assert.Error(t, tt.CheckProcessorTraces(7, 0, 0)) + assert.Error(t, tt.CheckProcessorTraces(0, 8, 9)) + assert.Error(t, tt.CheckProcessorTraces(0, 8, 0)) + assert.Error(t, tt.CheckProcessorTraces(0, 0, 9)) } func TestCheckProcessorMetricsViews(t *testing.T) { @@ -155,24 +144,19 @@ func TestCheckProcessorMetricsViews(t *testing.T) { por.MetricsAccepted(context.Background(), 7) por.MetricsRefused(context.Background(), 8) por.MetricsDropped(context.Background(), 9) - por.MetricsInserted(context.Background(), 10) - - assert.NoError(t, tt.CheckProcessorMetrics(7, 8, 9, 10)) - assert.Error(t, tt.CheckProcessorMetrics(0, 0, 0, 0)) - assert.Error(t, tt.CheckProcessorMetrics(7, 0, 0, 0)) - assert.Error(t, tt.CheckProcessorMetrics(0, 8, 0, 0)) - assert.Error(t, tt.CheckProcessorMetrics(0, 0, 9, 0)) - assert.Error(t, tt.CheckProcessorMetrics(0, 0, 0, 10)) - assert.Error(t, tt.CheckProcessorMetrics(7, 8, 0, 0)) - assert.Error(t, tt.CheckProcessorMetrics(7, 0, 9, 0)) - assert.Error(t, tt.CheckProcessorMetrics(7, 0, 0, 10)) - assert.Error(t, tt.CheckProcessorMetrics(0, 8, 9, 0)) - assert.Error(t, tt.CheckProcessorMetrics(0, 8, 0, 10)) - assert.Error(t, tt.CheckProcessorMetrics(0, 0, 9, 10)) - assert.Error(t, tt.CheckProcessorMetrics(7, 8, 9, 0)) - assert.Error(t, tt.CheckProcessorMetrics(7, 8, 0, 10)) - assert.Error(t, tt.CheckProcessorMetrics(7, 0, 9, 10)) - assert.Error(t, tt.CheckProcessorMetrics(0, 8, 9, 10)) + + assert.NoError(t, tt.CheckProcessorMetrics(7, 8, 9)) + assert.Error(t, tt.CheckProcessorMetrics(0, 0, 0)) + assert.Error(t, tt.CheckProcessorMetrics(7, 0, 0)) + assert.Error(t, tt.CheckProcessorMetrics(0, 8, 0)) + assert.Error(t, tt.CheckProcessorMetrics(0, 0, 9)) + assert.Error(t, tt.CheckProcessorMetrics(0, 0, 0)) + assert.Error(t, tt.CheckProcessorMetrics(7, 8, 0)) + assert.Error(t, tt.CheckProcessorMetrics(7, 0, 9)) + assert.Error(t, tt.CheckProcessorMetrics(7, 0, 0)) + assert.Error(t, tt.CheckProcessorMetrics(0, 8, 9)) + assert.Error(t, tt.CheckProcessorMetrics(0, 8, 0)) + assert.Error(t, tt.CheckProcessorMetrics(0, 0, 9)) } func TestCheckProcessorLogViews(t *testing.T) { @@ -189,24 +173,19 @@ func TestCheckProcessorLogViews(t *testing.T) { por.LogsAccepted(context.Background(), 7) por.LogsRefused(context.Background(), 8) por.LogsDropped(context.Background(), 9) - por.LogsInserted(context.Background(), 10) - - assert.NoError(t, tt.CheckProcessorLogs(7, 8, 9, 10)) - assert.Error(t, tt.CheckProcessorLogs(0, 0, 0, 0)) - assert.Error(t, tt.CheckProcessorLogs(7, 0, 0, 0)) - assert.Error(t, tt.CheckProcessorLogs(0, 8, 0, 0)) - assert.Error(t, tt.CheckProcessorLogs(0, 0, 9, 0)) - assert.Error(t, tt.CheckProcessorLogs(0, 0, 0, 10)) - assert.Error(t, tt.CheckProcessorLogs(7, 8, 0, 0)) - assert.Error(t, tt.CheckProcessorLogs(7, 0, 9, 0)) - assert.Error(t, tt.CheckProcessorLogs(7, 0, 0, 10)) - assert.Error(t, tt.CheckProcessorLogs(0, 8, 9, 0)) - assert.Error(t, tt.CheckProcessorLogs(0, 8, 0, 10)) - assert.Error(t, tt.CheckProcessorLogs(0, 0, 9, 10)) - assert.Error(t, tt.CheckProcessorLogs(7, 8, 9, 0)) - assert.Error(t, tt.CheckProcessorLogs(7, 8, 0, 10)) - assert.Error(t, tt.CheckProcessorLogs(7, 0, 9, 10)) - assert.Error(t, tt.CheckProcessorLogs(0, 8, 9, 10)) + + assert.NoError(t, tt.CheckProcessorLogs(7, 8, 9)) + assert.Error(t, tt.CheckProcessorLogs(0, 0, 0)) + assert.Error(t, tt.CheckProcessorLogs(7, 0, 0)) + assert.Error(t, tt.CheckProcessorLogs(0, 8, 0)) + assert.Error(t, tt.CheckProcessorLogs(0, 0, 9)) + assert.Error(t, tt.CheckProcessorLogs(0, 0, 0)) + assert.Error(t, tt.CheckProcessorLogs(7, 8, 0)) + assert.Error(t, tt.CheckProcessorLogs(7, 0, 9)) + assert.Error(t, tt.CheckProcessorLogs(7, 0, 0)) + assert.Error(t, tt.CheckProcessorLogs(0, 8, 9)) + assert.Error(t, tt.CheckProcessorLogs(0, 8, 0)) + assert.Error(t, tt.CheckProcessorLogs(0, 0, 9)) } func TestNoMetrics(t *testing.T) { @@ -215,7 +194,6 @@ func TestNoMetrics(t *testing.T) { const accepted = 29 const refused = 11 const dropped = 17 - const inserted = 5 set := tt.TelemetrySettings() set.LeveledMeterProvider = func(_ configtelemetry.Level) metric.MeterProvider { @@ -231,15 +209,13 @@ func TestNoMetrics(t *testing.T) { por.TracesAccepted(context.Background(), accepted) por.TracesRefused(context.Background(), refused) por.TracesDropped(context.Background(), dropped) - por.TracesInserted(context.Background(), inserted) - require.Error(t, tt.CheckProcessorTraces(accepted, refused, dropped, inserted)) + require.Error(t, tt.CheckProcessorTraces(accepted, refused, dropped)) }) testTelemetry(t, processorID, func(t *testing.T, tt componenttest.TestTelemetry) { const accepted = 29 const refused = 11 const dropped = 17 - const inserted = 4 set := tt.TelemetrySettings() set.LeveledMeterProvider = func(_ configtelemetry.Level) metric.MeterProvider { @@ -255,15 +231,13 @@ func TestNoMetrics(t *testing.T) { por.MetricsAccepted(context.Background(), accepted) por.MetricsRefused(context.Background(), refused) por.MetricsDropped(context.Background(), dropped) - por.MetricsInserted(context.Background(), inserted) - require.Error(t, tt.CheckProcessorMetrics(accepted, refused, dropped, inserted)) + require.Error(t, tt.CheckProcessorMetrics(accepted, refused, dropped)) }) testTelemetry(t, processorID, func(t *testing.T, tt componenttest.TestTelemetry) { const accepted = 29 const refused = 11 const dropped = 17 - const inserted = 3 set := tt.TelemetrySettings() set.LeveledMeterProvider = func(_ configtelemetry.Level) metric.MeterProvider { @@ -279,9 +253,8 @@ func TestNoMetrics(t *testing.T) { por.LogsAccepted(context.Background(), accepted) por.LogsRefused(context.Background(), refused) por.LogsDropped(context.Background(), dropped) - por.LogsInserted(context.Background(), inserted) - require.Error(t, tt.CheckProcessorLogs(accepted, refused, dropped, inserted)) + require.Error(t, tt.CheckProcessorLogs(accepted, refused, dropped)) }) } diff --git a/processor/processorhelper/processor.go b/processor/processorhelper/processor.go index 8bdaa4fbf73..de0c00fb7d2 100644 --- a/processor/processorhelper/processor.go +++ b/processor/processorhelper/processor.go @@ -13,7 +13,7 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/consumer" - "go.opentelemetry.io/collector/internal/obsreportconfig/obsmetrics" + "go.opentelemetry.io/collector/processor/internal" ) // ErrSkipProcessingData is a sentinel value to indicate when traces or metrics should intentionally be dropped @@ -69,5 +69,5 @@ func fromOptions(options []Option) *baseSettings { } func spanAttributes(id component.ID) trace.EventOption { - return trace.WithAttributes(attribute.String(obsmetrics.ProcessorKey, id.String())) + return trace.WithAttributes(attribute.String(internal.ProcessorKey, id.String())) } diff --git a/processor/processorhelper/traces.go b/processor/processorhelper/traces.go index 9f24c2a8b0f..b2b52c58c76 100644 --- a/processor/processorhelper/traces.go +++ b/processor/processorhelper/traces.go @@ -7,6 +7,7 @@ import ( "context" "errors" + "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/trace" "go.opentelemetry.io/collector/component" @@ -39,12 +40,22 @@ func NewTracesProcessor( return nil, errors.New("nil tracesFunc") } + obs, err := newObsReport(ObsReportSettings{ + ProcessorID: set.ID, + ProcessorCreateSettings: set, + }) + if err != nil { + return nil, err + } + obs.otelAttrs = append(obs.otelAttrs, attribute.String("otel.signal", "traces")) + eventOptions := spanAttributes(set.ID) bs := fromOptions(options) traceConsumer, err := consumer.NewTraces(func(ctx context.Context, td ptrace.Traces) error { span := trace.SpanFromContext(ctx) span.AddEvent("Start processing.", eventOptions) - var err error + spansIn := td.SpanCount() + td, err = tracesFunc(ctx, td) span.AddEvent("End processing.", eventOptions) if err != nil { @@ -53,6 +64,8 @@ func NewTracesProcessor( } return err } + spansOut := td.SpanCount() + obs.recordInOut(ctx, spansIn, spansOut) return nextConsumer.ConsumeTraces(ctx, td) }, bs.consumerOptions...) diff --git a/processor/processorhelper/traces_test.go b/processor/processorhelper/traces_test.go index dd6b5eaa18a..1e11564cdfc 100644 --- a/processor/processorhelper/traces_test.go +++ b/processor/processorhelper/traces_test.go @@ -10,6 +10,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/sdk/metric/metricdata" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" @@ -59,7 +61,7 @@ func TestNewTracesProcessor_ProcessTraceError(t *testing.T) { func TestNewTracesProcessor_ProcessTracesErrSkipProcessingData(t *testing.T) { tp, err := NewTracesProcessor(context.Background(), processortest.NewNopSettings(), &testTracesCfg, consumertest.NewNop(), newTestTProcessor(ErrSkipProcessingData)) require.NoError(t, err) - assert.Equal(t, nil, tp.ConsumeTraces(context.Background(), ptrace.NewTraces())) + assert.NoError(t, tp.ConsumeTraces(context.Background(), ptrace.NewTraces())) } func newTestTProcessor(retError error) ProcessTracesFunc { @@ -67,3 +69,62 @@ func newTestTProcessor(retError error) ProcessTracesFunc { return td, retError } } + +func TestTracesProcessor_RecordInOut(t *testing.T) { + // Regardless of how many spans are ingested, emit just one + mockAggregate := func(_ context.Context, _ ptrace.Traces) (ptrace.Traces, error) { + td := ptrace.NewTraces() + td.ResourceSpans().AppendEmpty().ScopeSpans().AppendEmpty().Spans().AppendEmpty() + return td, nil + } + + incomingTraces := ptrace.NewTraces() + incomingSpans := incomingTraces.ResourceSpans().AppendEmpty().ScopeSpans().AppendEmpty().Spans() + + // Add 4 records to the incoming + incomingSpans.AppendEmpty() + incomingSpans.AppendEmpty() + incomingSpans.AppendEmpty() + incomingSpans.AppendEmpty() + + testTelemetry := setupTestTelemetry() + tp, err := NewTracesProcessor(context.Background(), testTelemetry.NewSettings(), &testLogsCfg, consumertest.NewNop(), mockAggregate) + require.NoError(t, err) + + assert.NoError(t, tp.Start(context.Background(), componenttest.NewNopHost())) + assert.NoError(t, tp.ConsumeTraces(context.Background(), incomingTraces)) + assert.NoError(t, tp.Shutdown(context.Background())) + + testTelemetry.assertMetrics(t, []metricdata.Metrics{ + { + Name: "otelcol_processor_incoming_items", + Description: "Number of items passed to the processor.", + Unit: "{items}", + Data: metricdata.Sum[int64]{ + Temporality: metricdata.CumulativeTemporality, + IsMonotonic: true, + DataPoints: []metricdata.DataPoint[int64]{ + { + Value: 4, + Attributes: attribute.NewSet(attribute.String("processor", "processorhelper"), attribute.String("otel.signal", "traces")), + }, + }, + }, + }, + { + Name: "otelcol_processor_outgoing_items", + Description: "Number of items emitted from the processor.", + Unit: "{items}", + Data: metricdata.Sum[int64]{ + Temporality: metricdata.CumulativeTemporality, + IsMonotonic: true, + DataPoints: []metricdata.DataPoint[int64]{ + { + Value: 1, + Attributes: attribute.NewSet(attribute.String("processor", "processorhelper"), attribute.String("otel.signal", "traces")), + }, + }, + }, + }, + }) +} diff --git a/processor/processorprofiles/go.mod b/processor/processorprofiles/go.mod index ae3cb5d894f..558c291fc7e 100644 --- a/processor/processorprofiles/go.mod +++ b/processor/processorprofiles/go.mod @@ -4,10 +4,10 @@ go 1.22.0 require ( github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector/component v0.108.1 - go.opentelemetry.io/collector/consumer/consumerprofiles v0.108.1 - go.opentelemetry.io/collector/consumer/consumertest v0.108.1 - go.opentelemetry.io/collector/processor v0.108.1 + go.opentelemetry.io/collector/component v0.109.0 + go.opentelemetry.io/collector/consumer/consumerprofiles v0.109.0 + go.opentelemetry.io/collector/consumer/consumertest v0.109.0 + go.opentelemetry.io/collector/processor v0.109.0 ) require ( @@ -17,20 +17,20 @@ 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/config/configtelemetry v0.108.1 // indirect - go.opentelemetry.io/collector/consumer v0.108.1 // indirect - go.opentelemetry.io/collector/pdata v1.14.1 // indirect - go.opentelemetry.io/collector/pdata/pprofile v0.108.1 // indirect - go.opentelemetry.io/otel v1.29.0 // indirect - go.opentelemetry.io/otel/metric v1.29.0 // indirect - go.opentelemetry.io/otel/trace v1.29.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.109.0 // indirect + go.opentelemetry.io/collector/consumer v0.109.0 // indirect + go.opentelemetry.io/collector/pdata v1.15.0 // indirect + go.opentelemetry.io/collector/pdata/pprofile v0.109.0 // indirect + go.opentelemetry.io/otel v1.30.0 // indirect + go.opentelemetry.io/otel/metric v1.30.0 // indirect + go.opentelemetry.io/otel/trace v1.30.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.24.0 // indirect + golang.org/x/sys v0.25.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.65.0 // indirect + google.golang.org/grpc v1.66.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) @@ -39,24 +39,18 @@ replace go.opentelemetry.io/collector/processor => ../ replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/configtelemetry -replace go.opentelemetry.io/collector => ../.. - replace go.opentelemetry.io/collector/pdata/pprofile => ../../pdata/pprofile replace go.opentelemetry.io/collector/consumer => ../../consumer replace go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata -replace go.opentelemetry.io/collector/confmap => ../../confmap - replace go.opentelemetry.io/collector/component => ../../component replace go.opentelemetry.io/collector/pdata => ../../pdata replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../../consumer/consumerprofiles -replace go.opentelemetry.io/collector/featuregate => ../../featuregate - replace go.opentelemetry.io/collector/consumer/consumertest => ../../consumer/consumertest replace go.opentelemetry.io/collector/component/componentstatus => ../../component/componentstatus diff --git a/processor/processorprofiles/go.sum b/processor/processorprofiles/go.sum index 3d0d9cc3299..577d2b128fc 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.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= -go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= -go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= -go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= -go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= -go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= +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.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.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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= @@ -78,8 +78,8 @@ 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= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd h1:6TEm2ZxXoQmFWFlt1vNxvVOa1Q0dXFQD1m/rYjXmS0E= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= 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= diff --git a/proto_patch.sed b/proto_patch.sed index 47dd40af35a..50cb2f862fa 100644 --- a/proto_patch.sed +++ b/proto_patch.sed @@ -54,6 +54,13 @@ s+\(.*\)PartialSuccess partial_success = \(.*\);+\1PartialSuccess partial_succes s+opentelemetry.proto.profiles.v1experimental.Profile \(.*\);+opentelemetry.proto.profiles.v1experimental.Profile \1\ [ (gogoproto.nullable) = false ];+g +s+bytes profile_id = \(.*\);+bytes profile_id = \1\ + [\ + // Use custom ProfileId data type for this field.\ + (gogoproto.nullable) = false,\ + (gogoproto.customtype) = "go.opentelemetry.io/collector/pdata/internal/data.ProfileID"\ + ];+g + s+repeated ValueType \(.*\);+repeated ValueType \1\ [ (gogoproto.nullable) = false ];+g diff --git a/receiver/go.mod b/receiver/go.mod index c0db61d8ccb..4a3b2b2f7ee 100644 --- a/receiver/go.mod +++ b/receiver/go.mod @@ -5,19 +5,18 @@ go 1.22.0 require ( github.com/google/uuid v1.6.0 github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector v0.108.1 - go.opentelemetry.io/collector/component v0.108.1 - go.opentelemetry.io/collector/config/configtelemetry v0.108.1 - go.opentelemetry.io/collector/consumer v0.108.1 - go.opentelemetry.io/collector/consumer/consumerprofiles v0.108.1 - go.opentelemetry.io/collector/consumer/consumertest v0.108.1 - go.opentelemetry.io/collector/pdata v1.14.1 - go.opentelemetry.io/collector/receiver/receiverprofiles v0.108.1 - go.opentelemetry.io/otel v1.29.0 - go.opentelemetry.io/otel/metric v1.29.0 - go.opentelemetry.io/otel/sdk v1.29.0 - go.opentelemetry.io/otel/sdk/metric v1.29.0 - go.opentelemetry.io/otel/trace v1.29.0 + go.opentelemetry.io/collector/component v0.109.0 + go.opentelemetry.io/collector/config/configtelemetry v0.109.0 + go.opentelemetry.io/collector/consumer v0.109.0 + go.opentelemetry.io/collector/consumer/consumerprofiles v0.109.0 + go.opentelemetry.io/collector/consumer/consumertest v0.109.0 + go.opentelemetry.io/collector/pdata v1.15.0 + go.opentelemetry.io/collector/receiver/receiverprofiles v0.109.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.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.27.0 @@ -36,37 +35,29 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.20.2 // indirect + github.com/prometheus/client_golang v1.20.3 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.56.0 // indirect + github.com/prometheus/common v0.59.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect - go.opentelemetry.io/collector/pdata/pprofile v0.108.1 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.51.0 // indirect + go.opentelemetry.io/collector/pdata/pprofile v0.109.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.24.0 // indirect + golang.org/x/sys v0.25.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.65.0 // indirect + google.golang.org/grpc v1.66.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) -replace go.opentelemetry.io/collector => ../ - replace go.opentelemetry.io/collector/component => ../component -replace go.opentelemetry.io/collector/confmap => ../confmap - replace go.opentelemetry.io/collector/consumer => ../consumer -replace go.opentelemetry.io/collector/featuregate => ../featuregate - replace go.opentelemetry.io/collector/pdata => ../pdata replace go.opentelemetry.io/collector/pdata/testdata => ../pdata/testdata -retract v0.76.0 // Depends on retracted pdata v1.0.0-rc10 module - replace go.opentelemetry.io/collector/config/configtelemetry => ../config/configtelemetry replace go.opentelemetry.io/collector/pdata/pprofile => ../pdata/pprofile @@ -75,6 +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/componentstatus => ../component/componentstatus - replace go.opentelemetry.io/collector/receiver/receiverprofiles => ./receiverprofiles + +retract v0.76.0 // Depends on retracted pdata v1.0.0-rc10 module diff --git a/receiver/go.sum b/receiver/go.sum index 6e09c0083d5..46c53d70967 100644 --- a/receiver/go.sum +++ b/receiver/go.sum @@ -38,12 +38,12 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg= -github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= +github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.56.0 h1:UffReloqkBtvtQEYDg2s+uDPGRrJyC6vZWPGXf6OhPY= -github.com/prometheus/common v0.56.0/go.mod h1:7uRPFSUTbfZWsJ7MHY56sqt7hLQu3bxXHDnNhl8E9qI= +github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= +github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= @@ -54,18 +54,18 @@ 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.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= -go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0 h1:G7uexXb/K3T+T9fNLCCKncweEtNEBMTO+46hKX5EdKw= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0/go.mod h1:v0mFe5Kk7woIh938mrZBJBmENYquyA0IICrlYm4Y0t4= -go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= -go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= -go.opentelemetry.io/otel/sdk v1.29.0 h1:vkqKjk7gwhS8VaWb0POZKmIEDimRCMsopNYnriHyryo= -go.opentelemetry.io/otel/sdk v1.29.0/go.mod h1:pM8Dx5WKnvxLCb+8lG1PRNIDxu9g9b9g59Qr7hfAAok= -go.opentelemetry.io/otel/sdk/metric v1.29.0 h1:K2CfmJohnRgvZ9UAj2/FhIf/okdWcNdBwe1m8xFXiSY= -go.opentelemetry.io/otel/sdk/metric v1.29.0/go.mod h1:6zZLdCl2fkauYoZIOn/soQIDSWFmNSRcICarHfuhNJQ= -go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= -go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= +go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= +go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= +go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= +go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= +go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= +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.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.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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= @@ -105,8 +105,8 @@ 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= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd h1:6TEm2ZxXoQmFWFlt1vNxvVOa1Q0dXFQD1m/rYjXmS0E= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= 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= diff --git a/internal/obsreportconfig/obsmetrics/obs_receiver.go b/receiver/internal/obsmetrics.go similarity index 67% rename from internal/obsreportconfig/obsmetrics/obs_receiver.go rename to receiver/internal/obsmetrics.go index bcb6306f81b..7a4ba33de32 100644 --- a/internal/obsreportconfig/obsmetrics/obs_receiver.go +++ b/receiver/internal/obsmetrics.go @@ -1,9 +1,12 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package obsmetrics // import "go.opentelemetry.io/collector/internal/obsreportconfig/obsmetrics" +package internal // import "go.opentelemetry.io/collector/receiver/internal" const ( + // SpanNameSep is duplicate between receiver and exporter. + SpanNameSep = "/" + // ReceiverKey used to identify receivers in metrics and traces. ReceiverKey = "receiver" // TransportKey used to identify the transport used to received the data. @@ -27,11 +30,20 @@ const ( // RefusedLogRecordsKey used to identify log records refused (ie.: not ingested) by the // Collector. RefusedLogRecordsKey = "refused_log_records" -) -var ( + // ScraperKey used to identify scrapers in metrics and traces. + ScraperKey = "scraper" + + // ScrapedMetricPointsKey used to identify metric points scraped by the + // Collector. + ScrapedMetricPointsKey = "scraped_metric_points" + // ErroredMetricPointsKey used to identify metric points errored (i.e. + // unable to be scraped) by the Collector. + ErroredMetricPointsKey = "errored_metric_points" + ScraperPrefix = ScraperKey + SpanNameSep + ScraperMetricsOperationSuffix = SpanNameSep + "MetricsScraped" + ReceiverPrefix = ReceiverKey + SpanNameSep - ReceiverMetricPrefix = ReceiverKey + MetricNameSep ReceiveTraceDataOperationSuffix = SpanNameSep + "TraceDataReceived" ReceiverMetricsOperationSuffix = SpanNameSep + "MetricsReceived" ReceiverLogsOperationSuffix = SpanNameSep + "LogsReceived" diff --git a/receiver/nopreceiver/go.mod b/receiver/nopreceiver/go.mod index bbe505bd6a3..80857581489 100644 --- a/receiver/nopreceiver/go.mod +++ b/receiver/nopreceiver/go.mod @@ -4,11 +4,11 @@ go 1.22.0 require ( github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector/component v0.108.1 - go.opentelemetry.io/collector/confmap v1.14.1 - go.opentelemetry.io/collector/consumer v0.108.1 - go.opentelemetry.io/collector/consumer/consumertest v0.108.1 - go.opentelemetry.io/collector/receiver v0.108.1 + go.opentelemetry.io/collector/component v0.109.0 + go.opentelemetry.io/collector/confmap v1.15.0 + go.opentelemetry.io/collector/consumer v0.109.0 + go.opentelemetry.io/collector/consumer/consumertest v0.109.0 + go.opentelemetry.io/collector/receiver v0.109.0 go.uber.org/goleak v1.3.0 ) @@ -32,28 +32,28 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.20.2 // indirect + github.com/prometheus/client_golang v1.20.3 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.56.0 // indirect + github.com/prometheus/common v0.59.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.108.1 // indirect - go.opentelemetry.io/collector/consumer/consumerprofiles v0.108.1 // indirect - go.opentelemetry.io/collector/pdata v1.14.1 // indirect - go.opentelemetry.io/collector/pdata/pprofile v0.108.1 // indirect - go.opentelemetry.io/collector/receiver/receiverprofiles v0.108.1 // indirect - go.opentelemetry.io/otel v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.51.0 // indirect - go.opentelemetry.io/otel/metric v1.29.0 // indirect - go.opentelemetry.io/otel/sdk v1.29.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.29.0 // indirect - go.opentelemetry.io/otel/trace v1.29.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.109.0 // indirect + go.opentelemetry.io/collector/consumer/consumerprofiles v0.109.0 // indirect + go.opentelemetry.io/collector/pdata v1.15.0 // indirect + go.opentelemetry.io/collector/pdata/pprofile v0.109.0 // indirect + go.opentelemetry.io/collector/receiver/receiverprofiles v0.109.0 // indirect + go.opentelemetry.io/otel v1.30.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect + go.opentelemetry.io/otel/metric v1.30.0 // indirect + go.opentelemetry.io/otel/sdk v1.30.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect + go.opentelemetry.io/otel/trace v1.30.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.24.0 // indirect + golang.org/x/sys v0.25.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.65.0 // indirect + google.golang.org/grpc v1.66.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) @@ -72,16 +72,10 @@ replace go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/configtelemetry -replace go.opentelemetry.io/collector => ../.. - -replace go.opentelemetry.io/collector/featuregate => ../../featuregate - replace go.opentelemetry.io/collector/pdata/pprofile => ../../pdata/pprofile replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../../consumer/consumerprofiles replace go.opentelemetry.io/collector/consumer/consumertest => ../../consumer/consumertest -replace go.opentelemetry.io/collector/component/componentstatus => ../../component/componentstatus - replace go.opentelemetry.io/collector/receiver/receiverprofiles => ../receiverprofiles diff --git a/receiver/nopreceiver/go.sum b/receiver/nopreceiver/go.sum index 916c7ef13dd..923e7d7ba7f 100644 --- a/receiver/nopreceiver/go.sum +++ b/receiver/nopreceiver/go.sum @@ -50,12 +50,12 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg= -github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= +github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.56.0 h1:UffReloqkBtvtQEYDg2s+uDPGRrJyC6vZWPGXf6OhPY= -github.com/prometheus/common v0.56.0/go.mod h1:7uRPFSUTbfZWsJ7MHY56sqt7hLQu3bxXHDnNhl8E9qI= +github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= +github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= @@ -66,18 +66,18 @@ 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.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= -go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0 h1:G7uexXb/K3T+T9fNLCCKncweEtNEBMTO+46hKX5EdKw= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0/go.mod h1:v0mFe5Kk7woIh938mrZBJBmENYquyA0IICrlYm4Y0t4= -go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= -go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= -go.opentelemetry.io/otel/sdk v1.29.0 h1:vkqKjk7gwhS8VaWb0POZKmIEDimRCMsopNYnriHyryo= -go.opentelemetry.io/otel/sdk v1.29.0/go.mod h1:pM8Dx5WKnvxLCb+8lG1PRNIDxu9g9b9g59Qr7hfAAok= -go.opentelemetry.io/otel/sdk/metric v1.29.0 h1:K2CfmJohnRgvZ9UAj2/FhIf/okdWcNdBwe1m8xFXiSY= -go.opentelemetry.io/otel/sdk/metric v1.29.0/go.mod h1:6zZLdCl2fkauYoZIOn/soQIDSWFmNSRcICarHfuhNJQ= -go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= -go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= +go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= +go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= +go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= +go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= +go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= +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.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= @@ -101,8 +101,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.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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= @@ -117,8 +117,8 @@ 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= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd h1:6TEm2ZxXoQmFWFlt1vNxvVOa1Q0dXFQD1m/rYjXmS0E= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= 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= diff --git a/receiver/otlpreceiver/config.md b/receiver/otlpreceiver/config.md index 11d6433ce41..b77b4bdae73 100644 --- a/receiver/otlpreceiver/config.md +++ b/receiver/otlpreceiver/config.md @@ -76,7 +76,7 @@ Config defines configuration for OTLP receiver. | endpoint | string | localhost:4318 | Endpoint configures the listening address for the server. | | tls | [configtls-TLSServerSetting](#configtls-tlsserversetting) | | TLSSetting struct exposes TLS client configuration. | | cors | [confighttp-CORSConfig](#confighttp-corsconfig) | | CORSConfig configures a receiver for HTTP cross-origin resource sharing (CORS). | -| max_request_body_size | int | 0 | MaxRequestBodySize configures the maximum allowed body size in bytes for a single request. The default `0` means there's no restriction | +| max_request_body_size | int | 20971520 | MaxRequestBodySize configures the maximum allowed body size in bytes for a single request. The default `20971520` means 20MiB | ### confighttp-CORSConfig diff --git a/receiver/otlpreceiver/factory.go b/receiver/otlpreceiver/factory.go index 22181929879..8ba2e6d9092 100644 --- a/receiver/otlpreceiver/factory.go +++ b/receiver/otlpreceiver/factory.go @@ -5,13 +5,14 @@ package otlpreceiver // import "go.opentelemetry.io/collector/receiver/otlprecei import ( "context" + "fmt" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config/configgrpc" "go.opentelemetry.io/collector/config/confighttp" "go.opentelemetry.io/collector/config/confignet" "go.opentelemetry.io/collector/consumer" - "go.opentelemetry.io/collector/internal/localhostgate" + "go.opentelemetry.io/collector/internal/globalgates" "go.opentelemetry.io/collector/internal/sharedcomponent" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/otlpreceiver/internal/metadata" @@ -43,7 +44,7 @@ func createDefaultConfig() component.Config { Protocols: Protocols{ GRPC: &configgrpc.ServerConfig{ NetAddr: confignet.AddrConfig{ - Endpoint: localhostgate.EndpointForPort(grpcPort), + Endpoint: endpointForPort(globalgates.UseLocalHostAsDefaultHostfeatureGate.IsEnabled(), grpcPort), Transport: confignet.TransportTypeTCP, }, // We almost write 0 bytes, so no need to tune WriteBufferSize. @@ -51,7 +52,7 @@ func createDefaultConfig() component.Config { }, HTTP: &HTTPConfig{ ServerConfig: &confighttp.ServerConfig{ - Endpoint: localhostgate.EndpointForPort(httpPort), + Endpoint: endpointForPort(globalgates.UseLocalHostAsDefaultHostfeatureGate.IsEnabled(), httpPort), }, TracesURLPath: defaultTracesURLPath, MetricsURLPath: defaultMetricsURLPath, @@ -137,3 +138,12 @@ func createLog( // When the receiver is shutdown it should be removed from this map so the same configuration // can be recreated successfully. var receivers = sharedcomponent.NewMap[*Config, *otlpReceiver]() + +// endpointForPort gets the endpoint for a given port using localhost or 0.0.0.0 depending on the feature gate. +func endpointForPort(useLocalHostAsDefault bool, port int) string { + host := "localhost" + if !useLocalHostAsDefault { + host = "0.0.0.0" + } + return fmt.Sprintf("%s:%d", host, port) +} diff --git a/receiver/otlpreceiver/factory_test.go b/receiver/otlpreceiver/factory_test.go index 02a6bf63a76..530c61548c3 100644 --- a/receiver/otlpreceiver/factory_test.go +++ b/receiver/otlpreceiver/factory_test.go @@ -331,3 +331,38 @@ func TestCreateLogReceiver(t *testing.T) { }) } } + +func TestEndpointForPort(t *testing.T) { + tests := []struct { + port int + enabled bool + endpoint string + }{ + { + port: 4317, + enabled: false, + endpoint: "0.0.0.0:4317", + }, + { + port: 4317, + enabled: true, + endpoint: "localhost:4317", + }, + { + port: 0, + enabled: false, + endpoint: "0.0.0.0:0", + }, + { + port: 0, + enabled: true, + endpoint: "localhost:0", + }, + } + + for _, tt := range tests { + t.Run(tt.endpoint, func(t *testing.T) { + assert.Equal(t, endpointForPort(tt.enabled, tt.port), tt.endpoint) + }) + } +} diff --git a/receiver/otlpreceiver/go.mod b/receiver/otlpreceiver/go.mod index ccbe970870f..40182efcd8a 100644 --- a/receiver/otlpreceiver/go.mod +++ b/receiver/otlpreceiver/go.mod @@ -6,30 +6,30 @@ require ( github.com/gogo/protobuf v1.3.2 github.com/klauspost/compress v1.17.9 github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector v0.108.1 - go.opentelemetry.io/collector/component v0.108.1 - go.opentelemetry.io/collector/component/componentstatus v0.108.1 - go.opentelemetry.io/collector/config/configauth v0.108.1 - go.opentelemetry.io/collector/config/configgrpc v0.108.1 - go.opentelemetry.io/collector/config/confighttp v0.108.1 - go.opentelemetry.io/collector/config/confignet v0.108.1 - go.opentelemetry.io/collector/config/configtls v1.14.1 - go.opentelemetry.io/collector/confmap v1.14.1 - go.opentelemetry.io/collector/consumer v0.108.1 - go.opentelemetry.io/collector/consumer/consumertest v0.108.1 - go.opentelemetry.io/collector/pdata v1.14.1 - go.opentelemetry.io/collector/pdata/testdata v0.108.1 - go.opentelemetry.io/collector/receiver v0.108.1 + go.opentelemetry.io/collector v0.109.0 + go.opentelemetry.io/collector/component v0.109.0 + go.opentelemetry.io/collector/component/componentstatus v0.109.0 + go.opentelemetry.io/collector/config/configauth v0.109.0 + go.opentelemetry.io/collector/config/configgrpc v0.109.0 + go.opentelemetry.io/collector/config/confighttp v0.109.0 + go.opentelemetry.io/collector/config/confignet v0.109.0 + go.opentelemetry.io/collector/config/configtls v1.15.0 + go.opentelemetry.io/collector/confmap v1.15.0 + go.opentelemetry.io/collector/consumer v0.109.0 + go.opentelemetry.io/collector/consumer/consumertest v0.109.0 + go.opentelemetry.io/collector/internal/globalgates v0.109.0 + go.opentelemetry.io/collector/pdata v1.15.0 + go.opentelemetry.io/collector/pdata/testdata v0.109.0 + go.opentelemetry.io/collector/receiver v0.109.0 go.uber.org/goleak v1.3.0 go.uber.org/zap v1.27.0 google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd - google.golang.org/grpc v1.65.0 + google.golang.org/grpc v1.66.0 google.golang.org/protobuf v1.34.2 ) require ( github.com/beorn7/perks v1.0.1 // indirect - github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect @@ -39,7 +39,6 @@ require ( github.com/go-viper/mapstructure/v2 v2.1.0 // 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/knadh/koanf/maps v0.1.1 // indirect @@ -52,48 +51,34 @@ require ( github.com/mostynb/go-grpc-compression v1.2.3 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.20.2 // indirect + github.com/prometheus/client_golang v1.20.3 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.56.0 // indirect + github.com/prometheus/common v0.59.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect - github.com/rs/cors v1.11.0 // indirect - go.opentelemetry.io/collector/client v1.14.1 // indirect - go.opentelemetry.io/collector/config/configcompression v1.14.1 // indirect - go.opentelemetry.io/collector/config/configopaque v1.14.1 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.108.1 // indirect - go.opentelemetry.io/collector/config/internal v0.108.1 // indirect - go.opentelemetry.io/collector/consumer/consumerprofiles v0.108.1 // indirect - go.opentelemetry.io/collector/extension v0.108.1 // indirect - go.opentelemetry.io/collector/extension/auth v0.108.1 // indirect - go.opentelemetry.io/collector/featuregate v1.14.1 // indirect - go.opentelemetry.io/collector/pdata/pprofile v0.108.1 // indirect - go.opentelemetry.io/collector/receiver/receiverprofiles v0.108.1 // indirect - go.opentelemetry.io/contrib/config v0.9.0 // indirect + github.com/rs/cors v1.11.1 // indirect + go.opentelemetry.io/collector/client v1.15.0 // indirect + go.opentelemetry.io/collector/config/configcompression v1.15.0 // indirect + go.opentelemetry.io/collector/config/configopaque v1.15.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.109.0 // indirect + go.opentelemetry.io/collector/config/internal v0.109.0 // indirect + go.opentelemetry.io/collector/consumer/consumerprofiles v0.109.0 // indirect + go.opentelemetry.io/collector/extension v0.109.0 // indirect + go.opentelemetry.io/collector/extension/auth v0.109.0 // indirect + go.opentelemetry.io/collector/featuregate v1.15.0 // indirect + go.opentelemetry.io/collector/pdata/pprofile v0.109.0 // indirect + go.opentelemetry.io/collector/receiver/receiverprofiles v0.109.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect - go.opentelemetry.io/otel v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.5.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.51.0 // indirect - go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.5.0 // indirect - go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0 // indirect - go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.29.0 // indirect - go.opentelemetry.io/otel/log v0.5.0 // indirect - go.opentelemetry.io/otel/metric v1.29.0 // indirect - go.opentelemetry.io/otel/sdk v1.29.0 // indirect - go.opentelemetry.io/otel/sdk/log v0.5.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.29.0 // indirect - go.opentelemetry.io/otel/trace v1.29.0 // indirect - go.opentelemetry.io/proto/otlp v1.3.1 // indirect + go.opentelemetry.io/otel v1.30.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect + go.opentelemetry.io/otel/metric v1.30.0 // indirect + go.opentelemetry.io/otel/sdk v1.30.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect + go.opentelemetry.io/otel/trace v1.30.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.24.0 // indirect - golang.org/x/text v0.17.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd // indirect + golang.org/x/net v0.29.0 // indirect + golang.org/x/sys v0.25.0 // indirect + golang.org/x/text v0.18.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) @@ -127,6 +112,8 @@ replace go.opentelemetry.io/collector/extension/auth => ../../extension/auth replace go.opentelemetry.io/collector/featuregate => ../../featuregate +replace go.opentelemetry.io/collector/internal/globalgates => ../../internal/globalgates + replace go.opentelemetry.io/collector/pdata => ../../pdata replace go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata @@ -135,11 +122,6 @@ replace go.opentelemetry.io/collector/receiver => ../ replace go.opentelemetry.io/collector/consumer => ../../consumer -retract ( - v0.76.0 // Depends on retracted pdata v1.0.0-rc10 module, use v0.76.1 - v0.69.0 // Release failed, use v0.69.1 -) - replace go.opentelemetry.io/collector/pdata/pprofile => ../../pdata/pprofile replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../../consumer/consumerprofiles @@ -151,3 +133,8 @@ replace go.opentelemetry.io/collector/client => ../../client replace go.opentelemetry.io/collector/component/componentstatus => ../../component/componentstatus replace go.opentelemetry.io/collector/receiver/receiverprofiles => ../receiverprofiles + +retract ( + v0.76.0 // Depends on retracted pdata v1.0.0-rc10 module, use v0.76.1 + v0.69.0 // Release failed, use v0.69.1 +) diff --git a/receiver/otlpreceiver/go.sum b/receiver/otlpreceiver/go.sum index f927ca8bfb9..89ec05c98f8 100644 --- a/receiver/otlpreceiver/go.sum +++ b/receiver/otlpreceiver/go.sum @@ -1,7 +1,5 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= -github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -27,8 +25,6 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 h1:asbCHRVmodnJTuQ3qamDwqVOIjwqUPTYmYuemVOx+Ys= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0/go.mod h1:ggCgvZ2r7uOoQjOyu2Y1NhHmEPPzzuhWgcza5M1Ji1I= 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/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= @@ -64,66 +60,40 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg= -github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= +github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.56.0 h1:UffReloqkBtvtQEYDg2s+uDPGRrJyC6vZWPGXf6OhPY= -github.com/prometheus/common v0.56.0/go.mod h1:7uRPFSUTbfZWsJ7MHY56sqt7hLQu3bxXHDnNhl8E9qI= +github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= +github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= -github.com/rs/cors v1.11.0 h1:0B9GE/r9Bc2UxRMMtymBkHTenPkHDv0CW4Y98GBY+po= -github.com/rs/cors v1.11.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= +github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 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= 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/contrib/config v0.9.0 h1:AJ1c6+vJ6SxvqBBhsi2RhLFMlc6SnJOg81Jp4toFyNw= -go.opentelemetry.io/contrib/config v0.9.0/go.mod h1:u/u2L6y/c8GKrq/AP51sfXV4Eu24btVlC3A5f867xwg= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 h1:r6I7RJCN86bpD/FQwedZ0vSixDpwuWREjW9oRMsmqDc= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0/go.mod h1:B9yO6b04uB80CzjedvewuqDhxJxi11s7/GtiGa8bAjI= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 h1:TT4fX+nBOA/+LUkobKGW1ydGcn+G3vRw9+g5HwCphpk= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0/go.mod h1:L7UH0GbB0p47T4Rri3uHjbpCFYrVrwc1I25QhNPiGK8= -go.opentelemetry.io/otel v1.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= -go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= -go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.5.0 h1:4d++HQ+Ihdl+53zSjtsCUFDmNMju2FC9qFkUlTxPLqo= -go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.5.0/go.mod h1:mQX5dTO3Mh5ZF7bPKDkt5c/7C41u/SiDr9XgTpzXXn8= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.29.0 h1:k6fQVDQexDE+3jG2SfCQjnHS7OamcP73YMoxEVq5B6k= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.29.0/go.mod h1:t4BrYLHU450Zo9fnydWlIuswB1bm7rM8havDpWOJeDo= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.29.0 h1:xvhQxJ/C9+RTnAj5DpTg7LSM1vbbMTiXt7e9hsfqHNw= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.29.0/go.mod h1:Fcvs2Bz1jkDM+Wf5/ozBGmi3tQ/c9zPKLnsipnfhGAo= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0 h1:dIIDULZJpgdiHz5tXrTgKIMLkus6jEFa7x5SOKcyR7E= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0/go.mod h1:jlRVBe7+Z1wyxFSUs48L6OBQZ5JwH2Hg/Vbl+t9rAgI= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0 h1:nSiV3s7wiCam610XcLbYOmMfJxB9gO4uK3Xgv5gmTgg= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0/go.mod h1:hKn/e/Nmd19/x1gvIHwtOwVWM+VhuITSWip3JUDghj0= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0 h1:JAv0Jwtl01UFiyWZEMiJZBiTlv5A50zNs8lsthXqIio= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0/go.mod h1:QNKLmUEAq2QUbPQUfvw4fmv0bgbK7UlOSFCnXyfvSNc= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0 h1:G7uexXb/K3T+T9fNLCCKncweEtNEBMTO+46hKX5EdKw= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0/go.mod h1:v0mFe5Kk7woIh938mrZBJBmENYquyA0IICrlYm4Y0t4= -go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.5.0 h1:ThVXnEsdwNcxdBO+r96ci1xbF+PgNjwlk457VNuJODo= -go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.5.0/go.mod h1:rHWcSmC4q2h3gje/yOq6sAOaq8+UHxN/Ru3BbmDXOfY= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0 h1:WDdP9acbMYjbKIyJUhTvtzj601sVJOqgWdUxSdR/Ysc= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0/go.mod h1:BLbf7zbNIONBLPwvFnwNHGj4zge8uTCM/UPIVW1Mq2I= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.29.0 h1:X3ZjNp36/WlkSYx0ul2jw4PtbNEDDeLskw3VPsrpYM0= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.29.0/go.mod h1:2uL/xnOXh0CHOBFCWXz5u1A4GXLiW+0IQIzVbeOEQ0U= -go.opentelemetry.io/otel/log v0.5.0 h1:x1Pr6Y3gnXgl1iFBwtGy1W/mnzENoK0w0ZoaeOI3i30= -go.opentelemetry.io/otel/log v0.5.0/go.mod h1:NU/ozXeGuOR5/mjCRXYbTC00NFJ3NYuraV/7O78F0rE= -go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= -go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= -go.opentelemetry.io/otel/sdk v1.29.0 h1:vkqKjk7gwhS8VaWb0POZKmIEDimRCMsopNYnriHyryo= -go.opentelemetry.io/otel/sdk v1.29.0/go.mod h1:pM8Dx5WKnvxLCb+8lG1PRNIDxu9g9b9g59Qr7hfAAok= -go.opentelemetry.io/otel/sdk/log v0.5.0 h1:A+9lSjlZGxkQOr7QSBJcuyyYBw79CufQ69saiJLey7o= -go.opentelemetry.io/otel/sdk/log v0.5.0/go.mod h1:zjxIW7sw1IHolZL2KlSAtrUi8JHttoeiQy43Yl3WuVQ= -go.opentelemetry.io/otel/sdk/metric v1.29.0 h1:K2CfmJohnRgvZ9UAj2/FhIf/okdWcNdBwe1m8xFXiSY= -go.opentelemetry.io/otel/sdk/metric v1.29.0/go.mod h1:6zZLdCl2fkauYoZIOn/soQIDSWFmNSRcICarHfuhNJQ= -go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= -go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= -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.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= +go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= +go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= +go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= +go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= +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.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= @@ -139,20 +109,20 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= -golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= +golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= +golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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= -golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -161,12 +131,10 @@ 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/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd h1:BBOTEWLuuEGQy9n1y9MhVJ9Qt0BDu21X8qZs71/uPZo= -google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:fO8wJzT2zbQbAjbIoos1285VfEIYKDDY+Dt+WpTkh6g= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd h1:6TEm2ZxXoQmFWFlt1vNxvVOa1Q0dXFQD1m/rYjXmS0E= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= 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= diff --git a/receiver/otlpreceiver/otlp_test.go b/receiver/otlpreceiver/otlp_test.go index 5cca94b0926..0b475771074 100644 --- a/receiver/otlpreceiver/otlp_test.go +++ b/receiver/otlpreceiver/otlp_test.go @@ -589,7 +589,7 @@ func TestOTLPReceiverGRPCTracesIngestTest(t *testing.T) { assert.Equal(t, ingestionState.expectedCode, errStatus.Code()) } - require.Equal(t, expectedReceivedBatches, len(sink.AllTraces())) + require.Len(t, sink.AllTraces(), expectedReceivedBatches) require.NoError(t, tt.CheckReceiverTraces("grpc", int64(expectedReceivedBatches), int64(expectedIngestionBlockedRPCs))) } @@ -677,7 +677,7 @@ func TestOTLPReceiverHTTPTracesIngestTest(t *testing.T) { } } - require.Equal(t, expectedReceivedBatches, len(sink.AllTraces())) + require.Len(t, sink.AllTraces(), expectedReceivedBatches) require.NoError(t, tt.CheckReceiverTraces("http", int64(expectedReceivedBatches), int64(expectedIngestionBlockedRPCs))) } diff --git a/receiver/receiverhelper/internal/metadata/generated_telemetry.go b/receiver/receiverhelper/internal/metadata/generated_telemetry.go index 766735f943c..86c263792cb 100644 --- a/receiver/receiverhelper/internal/metadata/generated_telemetry.go +++ b/receiver/receiverhelper/internal/metadata/generated_telemetry.go @@ -38,15 +38,23 @@ type TelemetryBuilder struct { meters map[configtelemetry.Level]metric.Meter } -// telemetryBuilderOption applies changes to default builder. -type telemetryBuilderOption func(*TelemetryBuilder) +// TelemetryBuilderOption applies changes to default builder. +type TelemetryBuilderOption interface { + apply(*TelemetryBuilder) +} + +type telemetryBuilderOptionFunc func(mb *TelemetryBuilder) + +func (tbof telemetryBuilderOptionFunc) apply(mb *TelemetryBuilder) { + tbof(mb) +} // NewTelemetryBuilder provides a struct with methods to update all internal telemetry // for a component -func NewTelemetryBuilder(settings component.TelemetrySettings, options ...telemetryBuilderOption) (*TelemetryBuilder, error) { +func NewTelemetryBuilder(settings component.TelemetrySettings, options ...TelemetryBuilderOption) (*TelemetryBuilder, error) { builder := TelemetryBuilder{meters: map[configtelemetry.Level]metric.Meter{}} for _, op := range options { - op(&builder) + op.apply(&builder) } builder.meters[configtelemetry.LevelBasic] = LeveledMeter(settings, configtelemetry.LevelBasic) var err, errs error diff --git a/receiver/receiverhelper/internal/metadata/generated_telemetry_test.go b/receiver/receiverhelper/internal/metadata/generated_telemetry_test.go index c96d8509125..b8162a38f07 100644 --- a/receiver/receiverhelper/internal/metadata/generated_telemetry_test.go +++ b/receiver/receiverhelper/internal/metadata/generated_telemetry_test.go @@ -75,9 +75,9 @@ func TestNewTelemetryBuilder(t *testing.T) { TracerProvider: mockTracerProvider{}, } applied := false - _, err := NewTelemetryBuilder(set, func(b *TelemetryBuilder) { + _, err := NewTelemetryBuilder(set, telemetryBuilderOptionFunc(func(b *TelemetryBuilder) { applied = true - }) + })) require.NoError(t, err) require.True(t, applied) } diff --git a/receiver/receiverhelper/obsreport.go b/receiver/receiverhelper/obsreport.go index b998a315062..790adb60f4c 100644 --- a/receiver/receiverhelper/obsreport.go +++ b/receiver/receiverhelper/obsreport.go @@ -14,8 +14,8 @@ import ( "go.opentelemetry.io/otel/trace" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/internal/obsreportconfig/obsmetrics" "go.opentelemetry.io/collector/receiver" + "go.opentelemetry.io/collector/receiver/internal" "go.opentelemetry.io/collector/receiver/receiverhelper/internal/metadata" ) @@ -54,14 +54,14 @@ func newReceiver(cfg ObsReportSettings) (*ObsReport, error) { return nil, err } return &ObsReport{ - spanNamePrefix: obsmetrics.ReceiverPrefix + cfg.ReceiverID.String(), + spanNamePrefix: internal.ReceiverPrefix + cfg.ReceiverID.String(), transport: cfg.Transport, longLivedCtx: cfg.LongLivedCtx, tracer: cfg.ReceiverCreateSettings.TracerProvider.Tracer(cfg.ReceiverID.String()), otelAttrs: []attribute.KeyValue{ - attribute.String(obsmetrics.ReceiverKey, cfg.ReceiverID.String()), - attribute.String(obsmetrics.TransportKey, cfg.Transport), + attribute.String(internal.ReceiverKey, cfg.ReceiverID.String()), + attribute.String(internal.TransportKey, cfg.Transport), }, telemetryBuilder: telemetryBuilder, }, nil @@ -71,7 +71,7 @@ func newReceiver(cfg ObsReportSettings) (*ObsReport, error) { // The returned context should be used in other calls to the obsreport functions // dealing with the same receive operation. func (rec *ObsReport) StartTracesOp(operationCtx context.Context) context.Context { - return rec.startOp(operationCtx, obsmetrics.ReceiveTraceDataOperationSuffix) + return rec.startOp(operationCtx, internal.ReceiveTraceDataOperationSuffix) } // EndTracesOp completes the receive operation that was started with @@ -89,7 +89,7 @@ func (rec *ObsReport) EndTracesOp( // The returned context should be used in other calls to the obsreport functions // dealing with the same receive operation. func (rec *ObsReport) StartLogsOp(operationCtx context.Context) context.Context { - return rec.startOp(operationCtx, obsmetrics.ReceiverLogsOperationSuffix) + return rec.startOp(operationCtx, internal.ReceiverLogsOperationSuffix) } // EndLogsOp completes the receive operation that was started with @@ -107,7 +107,7 @@ func (rec *ObsReport) EndLogsOp( // The returned context should be used in other calls to the obsreport functions // dealing with the same receive operation. func (rec *ObsReport) StartMetricsOp(operationCtx context.Context) context.Context { - return rec.startOp(operationCtx, obsmetrics.ReceiverMetricsOperationSuffix) + return rec.startOp(operationCtx, internal.ReceiverMetricsOperationSuffix) } // EndMetricsOp completes the receive operation that was started with @@ -141,7 +141,7 @@ func (rec *ObsReport) startOp(receiverCtx context.Context, operationSuffix strin } if rec.transport != "" { - span.SetAttributes(attribute.String(obsmetrics.TransportKey, rec.transport)) + span.SetAttributes(attribute.String(internal.TransportKey, rec.transport)) } return ctx } @@ -170,18 +170,18 @@ func (rec *ObsReport) endOp( var acceptedItemsKey, refusedItemsKey string switch dataType { case component.DataTypeTraces: - acceptedItemsKey = obsmetrics.AcceptedSpansKey - refusedItemsKey = obsmetrics.RefusedSpansKey + acceptedItemsKey = internal.AcceptedSpansKey + refusedItemsKey = internal.RefusedSpansKey case component.DataTypeMetrics: - acceptedItemsKey = obsmetrics.AcceptedMetricPointsKey - refusedItemsKey = obsmetrics.RefusedMetricPointsKey + acceptedItemsKey = internal.AcceptedMetricPointsKey + refusedItemsKey = internal.RefusedMetricPointsKey case component.DataTypeLogs: - acceptedItemsKey = obsmetrics.AcceptedLogRecordsKey - refusedItemsKey = obsmetrics.RefusedLogRecordsKey + acceptedItemsKey = internal.AcceptedLogRecordsKey + refusedItemsKey = internal.RefusedLogRecordsKey } span.SetAttributes( - attribute.String(obsmetrics.FormatKey, format), + attribute.String(internal.FormatKey, format), attribute.Int64(acceptedItemsKey, int64(numAccepted)), attribute.Int64(refusedItemsKey, int64(numRefused)), ) diff --git a/receiver/receiverhelper/obsreport_test.go b/receiver/receiverhelper/obsreport_test.go index 2400d02672a..105dcfe91c2 100644 --- a/receiver/receiverhelper/obsreport_test.go +++ b/receiver/receiverhelper/obsreport_test.go @@ -15,8 +15,8 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - "go.opentelemetry.io/collector/internal/obsreportconfig/obsmetrics" "go.opentelemetry.io/collector/receiver" + "go.opentelemetry.io/collector/receiver/internal" ) const ( @@ -65,13 +65,13 @@ func TestReceiveTraceDataOp(t *testing.T) { switch { case params[i].err == nil: acceptedSpans += params[i].items - require.Contains(t, span.Attributes(), attribute.KeyValue{Key: obsmetrics.AcceptedSpansKey, Value: attribute.Int64Value(int64(params[i].items))}) - require.Contains(t, span.Attributes(), attribute.KeyValue{Key: obsmetrics.RefusedSpansKey, Value: attribute.Int64Value(0)}) + require.Contains(t, span.Attributes(), attribute.KeyValue{Key: internal.AcceptedSpansKey, Value: attribute.Int64Value(int64(params[i].items))}) + require.Contains(t, span.Attributes(), attribute.KeyValue{Key: internal.RefusedSpansKey, Value: attribute.Int64Value(0)}) assert.Equal(t, codes.Unset, span.Status().Code) case errors.Is(params[i].err, errFake): refusedSpans += params[i].items - require.Contains(t, span.Attributes(), attribute.KeyValue{Key: obsmetrics.AcceptedSpansKey, Value: attribute.Int64Value(0)}) - require.Contains(t, span.Attributes(), attribute.KeyValue{Key: obsmetrics.RefusedSpansKey, Value: attribute.Int64Value(int64(params[i].items))}) + require.Contains(t, span.Attributes(), attribute.KeyValue{Key: internal.AcceptedSpansKey, Value: attribute.Int64Value(0)}) + require.Contains(t, span.Attributes(), attribute.KeyValue{Key: internal.RefusedSpansKey, Value: attribute.Int64Value(int64(params[i].items))}) assert.Equal(t, codes.Error, span.Status().Code) assert.Equal(t, params[i].err.Error(), span.Status().Description) default: @@ -113,13 +113,13 @@ func TestReceiveLogsOp(t *testing.T) { switch { case params[i].err == nil: acceptedLogRecords += params[i].items - require.Contains(t, span.Attributes(), attribute.KeyValue{Key: obsmetrics.AcceptedLogRecordsKey, Value: attribute.Int64Value(int64(params[i].items))}) - require.Contains(t, span.Attributes(), attribute.KeyValue{Key: obsmetrics.RefusedLogRecordsKey, Value: attribute.Int64Value(0)}) + require.Contains(t, span.Attributes(), attribute.KeyValue{Key: internal.AcceptedLogRecordsKey, Value: attribute.Int64Value(int64(params[i].items))}) + require.Contains(t, span.Attributes(), attribute.KeyValue{Key: internal.RefusedLogRecordsKey, Value: attribute.Int64Value(0)}) assert.Equal(t, codes.Unset, span.Status().Code) case errors.Is(params[i].err, errFake): refusedLogRecords += params[i].items - require.Contains(t, span.Attributes(), attribute.KeyValue{Key: obsmetrics.AcceptedLogRecordsKey, Value: attribute.Int64Value(0)}) - require.Contains(t, span.Attributes(), attribute.KeyValue{Key: obsmetrics.RefusedLogRecordsKey, Value: attribute.Int64Value(int64(params[i].items))}) + require.Contains(t, span.Attributes(), attribute.KeyValue{Key: internal.AcceptedLogRecordsKey, Value: attribute.Int64Value(0)}) + require.Contains(t, span.Attributes(), attribute.KeyValue{Key: internal.RefusedLogRecordsKey, Value: attribute.Int64Value(int64(params[i].items))}) assert.Equal(t, codes.Error, span.Status().Code) assert.Equal(t, params[i].err.Error(), span.Status().Description) default: @@ -161,13 +161,13 @@ func TestReceiveMetricsOp(t *testing.T) { switch { case params[i].err == nil: acceptedMetricPoints += params[i].items - require.Contains(t, span.Attributes(), attribute.KeyValue{Key: obsmetrics.AcceptedMetricPointsKey, Value: attribute.Int64Value(int64(params[i].items))}) - require.Contains(t, span.Attributes(), attribute.KeyValue{Key: obsmetrics.RefusedMetricPointsKey, Value: attribute.Int64Value(0)}) + require.Contains(t, span.Attributes(), attribute.KeyValue{Key: internal.AcceptedMetricPointsKey, Value: attribute.Int64Value(int64(params[i].items))}) + require.Contains(t, span.Attributes(), attribute.KeyValue{Key: internal.RefusedMetricPointsKey, Value: attribute.Int64Value(0)}) assert.Equal(t, codes.Unset, span.Status().Code) case errors.Is(params[i].err, errFake): refusedMetricPoints += params[i].items - require.Contains(t, span.Attributes(), attribute.KeyValue{Key: obsmetrics.AcceptedMetricPointsKey, Value: attribute.Int64Value(0)}) - require.Contains(t, span.Attributes(), attribute.KeyValue{Key: obsmetrics.RefusedMetricPointsKey, Value: attribute.Int64Value(int64(params[i].items))}) + require.Contains(t, span.Attributes(), attribute.KeyValue{Key: internal.AcceptedMetricPointsKey, Value: attribute.Int64Value(0)}) + require.Contains(t, span.Attributes(), attribute.KeyValue{Key: internal.RefusedMetricPointsKey, Value: attribute.Int64Value(int64(params[i].items))}) assert.Equal(t, codes.Error, span.Status().Code) assert.Equal(t, params[i].err.Error(), span.Status().Description) default: @@ -211,20 +211,20 @@ func TestReceiveWithLongLivedCtx(t *testing.T) { for i, span := range spans { assert.False(t, span.Parent().IsValid()) - require.Equal(t, 1, len(span.Links())) + require.Len(t, span.Links(), 1) link := span.Links()[0] assert.Equal(t, parentSpan.SpanContext().TraceID(), link.SpanContext.TraceID()) assert.Equal(t, parentSpan.SpanContext().SpanID(), link.SpanContext.SpanID()) assert.Equal(t, "receiver/"+receiverID.String()+"/TraceDataReceived", span.Name()) - require.Contains(t, span.Attributes(), attribute.KeyValue{Key: obsmetrics.TransportKey, Value: attribute.StringValue(transport)}) + require.Contains(t, span.Attributes(), attribute.KeyValue{Key: internal.TransportKey, Value: attribute.StringValue(transport)}) switch { case params[i].err == nil: - require.Contains(t, span.Attributes(), attribute.KeyValue{Key: obsmetrics.AcceptedSpansKey, Value: attribute.Int64Value(int64(params[i].items))}) - require.Contains(t, span.Attributes(), attribute.KeyValue{Key: obsmetrics.RefusedSpansKey, Value: attribute.Int64Value(0)}) + require.Contains(t, span.Attributes(), attribute.KeyValue{Key: internal.AcceptedSpansKey, Value: attribute.Int64Value(int64(params[i].items))}) + require.Contains(t, span.Attributes(), attribute.KeyValue{Key: internal.RefusedSpansKey, Value: attribute.Int64Value(0)}) assert.Equal(t, codes.Unset, span.Status().Code) case errors.Is(params[i].err, errFake): - require.Contains(t, span.Attributes(), attribute.KeyValue{Key: obsmetrics.AcceptedSpansKey, Value: attribute.Int64Value(0)}) - require.Contains(t, span.Attributes(), attribute.KeyValue{Key: obsmetrics.RefusedSpansKey, Value: attribute.Int64Value(int64(params[i].items))}) + require.Contains(t, span.Attributes(), attribute.KeyValue{Key: internal.AcceptedSpansKey, Value: attribute.Int64Value(0)}) + require.Contains(t, span.Attributes(), attribute.KeyValue{Key: internal.RefusedSpansKey, Value: attribute.Int64Value(int64(params[i].items))}) assert.Equal(t, codes.Error, span.Status().Code) assert.Equal(t, params[i].err.Error(), span.Status().Description) default: diff --git a/receiver/receiverprofiles/go.mod b/receiver/receiverprofiles/go.mod index 70d6f46d193..b6568bdc841 100644 --- a/receiver/receiverprofiles/go.mod +++ b/receiver/receiverprofiles/go.mod @@ -4,10 +4,10 @@ go 1.22.0 require ( github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector/component v0.108.1 - go.opentelemetry.io/collector/consumer/consumerprofiles v0.108.1 - go.opentelemetry.io/collector/consumer/consumertest v0.108.1 - go.opentelemetry.io/collector/receiver v0.108.1 + go.opentelemetry.io/collector/component v0.109.0 + go.opentelemetry.io/collector/consumer/consumerprofiles v0.109.0 + go.opentelemetry.io/collector/consumer/consumertest v0.109.0 + go.opentelemetry.io/collector/receiver v0.109.0 ) require ( @@ -17,28 +17,26 @@ 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/config/configtelemetry v0.108.1 // indirect - go.opentelemetry.io/collector/consumer v0.108.1 // indirect - go.opentelemetry.io/collector/pdata v1.14.1 // indirect - go.opentelemetry.io/collector/pdata/pprofile v0.108.1 // indirect - go.opentelemetry.io/otel v1.29.0 // indirect - go.opentelemetry.io/otel/metric v1.29.0 // indirect - go.opentelemetry.io/otel/trace v1.29.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.109.0 // indirect + go.opentelemetry.io/collector/consumer v0.109.0 // indirect + go.opentelemetry.io/collector/pdata v1.15.0 // indirect + go.opentelemetry.io/collector/pdata/pprofile v0.109.0 // indirect + go.opentelemetry.io/otel v1.30.0 // indirect + go.opentelemetry.io/otel/metric v1.30.0 // indirect + go.opentelemetry.io/otel/trace v1.30.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.24.0 // indirect + golang.org/x/sys v0.25.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.65.0 // indirect + google.golang.org/grpc v1.66.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) replace go.opentelemetry.io/collector/receiver => ../ -replace go.opentelemetry.io/collector/confmap => ../../confmap - replace go.opentelemetry.io/collector/consumer => ../../consumer replace go.opentelemetry.io/collector/component => ../../component @@ -47,16 +45,10 @@ replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../../consume replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/configtelemetry -replace go.opentelemetry.io/collector => ../.. - replace go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata -replace go.opentelemetry.io/collector/featuregate => ../../featuregate - replace go.opentelemetry.io/collector/pdata/pprofile => ../../pdata/pprofile replace go.opentelemetry.io/collector/pdata => ../../pdata replace go.opentelemetry.io/collector/consumer/consumertest => ../../consumer/consumertest - -replace go.opentelemetry.io/collector/component/componentstatus => ../../component/componentstatus diff --git a/receiver/receiverprofiles/go.sum b/receiver/receiverprofiles/go.sum index 3d0d9cc3299..577d2b128fc 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.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= -go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= -go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= -go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= -go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= -go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= +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.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.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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= @@ -78,8 +78,8 @@ 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= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd h1:6TEm2ZxXoQmFWFlt1vNxvVOa1Q0dXFQD1m/rYjXmS0E= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= 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= diff --git a/receiver/receivertest/contract_checker.go b/receiver/receivertest/contract_checker.go index 32e5681bfdc..c3378747b71 100644 --- a/receiver/receivertest/contract_checker.go +++ b/receiver/receivertest/contract_checker.go @@ -148,7 +148,7 @@ func checkConsumeContractScenario(params CheckConsumeContractParams, decisionFun defer wg.Done() for atomic.AddInt64(&generatedIndex, 1) <= int64(params.GenerateCount) { ids := params.Generator.Generate() - require.Greater(params.T, len(ids), 0) + require.NotEmpty(params.T, ids) mux.Lock() duplicates := generatedIDs.mergeSlice(ids) diff --git a/receiver/scraperhelper/internal/metadata/generated_telemetry.go b/receiver/scraperhelper/internal/metadata/generated_telemetry.go index 498746b0e87..5bcbf186364 100644 --- a/receiver/scraperhelper/internal/metadata/generated_telemetry.go +++ b/receiver/scraperhelper/internal/metadata/generated_telemetry.go @@ -34,15 +34,23 @@ type TelemetryBuilder struct { meters map[configtelemetry.Level]metric.Meter } -// telemetryBuilderOption applies changes to default builder. -type telemetryBuilderOption func(*TelemetryBuilder) +// TelemetryBuilderOption applies changes to default builder. +type TelemetryBuilderOption interface { + apply(*TelemetryBuilder) +} + +type telemetryBuilderOptionFunc func(mb *TelemetryBuilder) + +func (tbof telemetryBuilderOptionFunc) apply(mb *TelemetryBuilder) { + tbof(mb) +} // NewTelemetryBuilder provides a struct with methods to update all internal telemetry // for a component -func NewTelemetryBuilder(settings component.TelemetrySettings, options ...telemetryBuilderOption) (*TelemetryBuilder, error) { +func NewTelemetryBuilder(settings component.TelemetrySettings, options ...TelemetryBuilderOption) (*TelemetryBuilder, error) { builder := TelemetryBuilder{meters: map[configtelemetry.Level]metric.Meter{}} for _, op := range options { - op(&builder) + op.apply(&builder) } builder.meters[configtelemetry.LevelBasic] = LeveledMeter(settings, configtelemetry.LevelBasic) var err, errs error diff --git a/receiver/scraperhelper/internal/metadata/generated_telemetry_test.go b/receiver/scraperhelper/internal/metadata/generated_telemetry_test.go index d2d189e7643..ad6bc072985 100644 --- a/receiver/scraperhelper/internal/metadata/generated_telemetry_test.go +++ b/receiver/scraperhelper/internal/metadata/generated_telemetry_test.go @@ -75,9 +75,9 @@ func TestNewTelemetryBuilder(t *testing.T) { TracerProvider: mockTracerProvider{}, } applied := false - _, err := NewTelemetryBuilder(set, func(b *TelemetryBuilder) { + _, err := NewTelemetryBuilder(set, telemetryBuilderOptionFunc(func(b *TelemetryBuilder) { applied = true - }) + })) require.NoError(t, err) require.True(t, applied) } diff --git a/receiver/scraperhelper/obsreport.go b/receiver/scraperhelper/obsreport.go index 271551c80db..6c950a21711 100644 --- a/receiver/scraperhelper/obsreport.go +++ b/receiver/scraperhelper/obsreport.go @@ -13,16 +13,14 @@ import ( "go.opentelemetry.io/otel/trace" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/internal/obsreportconfig/obsmetrics" "go.opentelemetry.io/collector/receiver" + "go.opentelemetry.io/collector/receiver/internal" "go.opentelemetry.io/collector/receiver/scrapererror" "go.opentelemetry.io/collector/receiver/scraperhelper/internal/metadata" ) -// ObsReport is a helper to add observability to a scraper. -// -// Deprecated: [v0.108.0] will be removed. -type ObsReport struct { +// obsReport is a helper to add observability to a scraper. +type obsReport struct { receiverID component.ID scraper component.ID tracer trace.Tracer @@ -31,35 +29,26 @@ type ObsReport struct { telemetryBuilder *metadata.TelemetryBuilder } -// ObsReportSettings are settings for creating an ObsReport. -// -// Deprecated: [v0.108.0] will be removed. -type ObsReportSettings struct { +// obsReportSettings are settings for creating an ObsReport. +type obsReportSettings struct { ReceiverID component.ID Scraper component.ID ReceiverCreateSettings receiver.Settings } -// NewObsReport creates a new ObsReport. -// -// Deprecated: [v0.108.0] will be removed, scrapers should use NewScraperControllerReceiver instead. -func NewObsReport(cfg ObsReportSettings) (*ObsReport, error) { - return newScraper(cfg) -} - -func newScraper(cfg ObsReportSettings) (*ObsReport, error) { +func newScraper(cfg obsReportSettings) (*obsReport, error) { telemetryBuilder, err := metadata.NewTelemetryBuilder(cfg.ReceiverCreateSettings.TelemetrySettings) if err != nil { return nil, err } - return &ObsReport{ + return &obsReport{ receiverID: cfg.ReceiverID, scraper: cfg.Scraper, tracer: cfg.ReceiverCreateSettings.TracerProvider.Tracer(cfg.Scraper.String()), otelAttrs: []attribute.KeyValue{ - attribute.String(obsmetrics.ReceiverKey, cfg.ReceiverID.String()), - attribute.String(obsmetrics.ScraperKey, cfg.Scraper.String()), + attribute.String(internal.ReceiverKey, cfg.ReceiverID.String()), + attribute.String(internal.ScraperKey, cfg.Scraper.String()), }, telemetryBuilder: telemetryBuilder, }, nil @@ -68,15 +57,15 @@ func newScraper(cfg ObsReportSettings) (*ObsReport, error) { // StartMetricsOp is called when a scrape operation is started. The // returned context should be used in other calls to the obsreport functions // dealing with the same scrape operation. -func (s *ObsReport) StartMetricsOp(ctx context.Context) context.Context { - spanName := obsmetrics.ScraperPrefix + s.receiverID.String() + obsmetrics.SpanNameSep + s.scraper.String() + obsmetrics.ScraperMetricsOperationSuffix +func (s *obsReport) StartMetricsOp(ctx context.Context) context.Context { + spanName := internal.ScraperPrefix + s.receiverID.String() + internal.SpanNameSep + s.scraper.String() + internal.ScraperMetricsOperationSuffix ctx, _ = s.tracer.Start(ctx, spanName) return ctx } // EndMetricsOp completes the scrape operation that was started with // StartMetricsOp. -func (s *ObsReport) EndMetricsOp( +func (s *obsReport) EndMetricsOp( scraperCtx context.Context, numScrapedMetrics int, err error, @@ -99,9 +88,9 @@ func (s *ObsReport) EndMetricsOp( // end span according to errors if span.IsRecording() { span.SetAttributes( - attribute.String(obsmetrics.FormatKey, component.DataTypeMetrics.String()), - attribute.Int64(obsmetrics.ScrapedMetricPointsKey, int64(numScrapedMetrics)), - attribute.Int64(obsmetrics.ErroredMetricPointsKey, int64(numErroredMetrics)), + attribute.String(internal.FormatKey, component.DataTypeMetrics.String()), + attribute.Int64(internal.ScrapedMetricPointsKey, int64(numScrapedMetrics)), + attribute.Int64(internal.ErroredMetricPointsKey, int64(numErroredMetrics)), ) if err != nil { @@ -112,7 +101,7 @@ func (s *ObsReport) EndMetricsOp( span.End() } -func (s *ObsReport) recordMetrics(scraperCtx context.Context, numScrapedMetrics, numErroredMetrics int) { +func (s *obsReport) recordMetrics(scraperCtx context.Context, numScrapedMetrics, numErroredMetrics int) { s.telemetryBuilder.ScraperScrapedMetricPoints.Add(scraperCtx, int64(numScrapedMetrics), metric.WithAttributes(s.otelAttrs...)) s.telemetryBuilder.ScraperErroredMetricPoints.Add(scraperCtx, int64(numErroredMetrics), metric.WithAttributes(s.otelAttrs...)) } diff --git a/receiver/scraperhelper/obsreport_test.go b/receiver/scraperhelper/obsreport_test.go index 88445e57fa8..e5927a1165e 100644 --- a/receiver/scraperhelper/obsreport_test.go +++ b/receiver/scraperhelper/obsreport_test.go @@ -15,8 +15,8 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - "go.opentelemetry.io/collector/internal/obsreportconfig/obsmetrics" "go.opentelemetry.io/collector/receiver" + "go.opentelemetry.io/collector/receiver/internal" "go.opentelemetry.io/collector/receiver/scrapererror" ) @@ -44,7 +44,7 @@ func TestScrapeMetricsDataOp(t *testing.T) { {items: 15, err: nil}, } for i := range params { - scrp, err := newScraper(ObsReportSettings{ + scrp, err := newScraper(obsReportSettings{ ReceiverID: receiverID, Scraper: scraperID, ReceiverCreateSettings: receiver.Settings{ID: receiverID, TelemetrySettings: tt.TelemetrySettings(), BuildInfo: component.NewDefaultBuildInfo()}, @@ -64,21 +64,21 @@ func TestScrapeMetricsDataOp(t *testing.T) { switch { case params[i].err == nil: scrapedMetricPoints += params[i].items - require.Contains(t, span.Attributes(), attribute.KeyValue{Key: obsmetrics.ScrapedMetricPointsKey, Value: attribute.Int64Value(int64(params[i].items))}) - require.Contains(t, span.Attributes(), attribute.KeyValue{Key: obsmetrics.ErroredMetricPointsKey, Value: attribute.Int64Value(0)}) + require.Contains(t, span.Attributes(), attribute.KeyValue{Key: internal.ScrapedMetricPointsKey, Value: attribute.Int64Value(int64(params[i].items))}) + require.Contains(t, span.Attributes(), attribute.KeyValue{Key: internal.ErroredMetricPointsKey, Value: attribute.Int64Value(0)}) assert.Equal(t, codes.Unset, span.Status().Code) case errors.Is(params[i].err, errFake): erroredMetricPoints += params[i].items - require.Contains(t, span.Attributes(), attribute.KeyValue{Key: obsmetrics.ScrapedMetricPointsKey, Value: attribute.Int64Value(0)}) - require.Contains(t, span.Attributes(), attribute.KeyValue{Key: obsmetrics.ErroredMetricPointsKey, Value: attribute.Int64Value(int64(params[i].items))}) + require.Contains(t, span.Attributes(), attribute.KeyValue{Key: internal.ScrapedMetricPointsKey, Value: attribute.Int64Value(0)}) + require.Contains(t, span.Attributes(), attribute.KeyValue{Key: internal.ErroredMetricPointsKey, Value: attribute.Int64Value(int64(params[i].items))}) assert.Equal(t, codes.Error, span.Status().Code) assert.Equal(t, params[i].err.Error(), span.Status().Description) case errors.Is(params[i].err, partialErrFake): scrapedMetricPoints += params[i].items erroredMetricPoints++ - require.Contains(t, span.Attributes(), attribute.KeyValue{Key: obsmetrics.ScrapedMetricPointsKey, Value: attribute.Int64Value(int64(params[i].items))}) - require.Contains(t, span.Attributes(), attribute.KeyValue{Key: obsmetrics.ErroredMetricPointsKey, Value: attribute.Int64Value(1)}) + require.Contains(t, span.Attributes(), attribute.KeyValue{Key: internal.ScrapedMetricPointsKey, Value: attribute.Int64Value(int64(params[i].items))}) + require.Contains(t, span.Attributes(), attribute.KeyValue{Key: internal.ErroredMetricPointsKey, Value: attribute.Int64Value(1)}) assert.Equal(t, codes.Error, span.Status().Code) assert.Equal(t, params[i].err.Error(), span.Status().Description) default: @@ -95,7 +95,7 @@ func TestCheckScraperMetricsViews(t *testing.T) { require.NoError(t, err) t.Cleanup(func() { require.NoError(t, tt.Shutdown(context.Background())) }) - s, err := newScraper(ObsReportSettings{ + s, err := newScraper(obsReportSettings{ ReceiverID: receiverID, Scraper: scraperID, ReceiverCreateSettings: receiver.Settings{ID: receiverID, TelemetrySettings: tt.TelemetrySettings(), BuildInfo: component.NewDefaultBuildInfo()}, diff --git a/receiver/scraperhelper/scraper.go b/receiver/scraperhelper/scraper.go index f97eb65a403..b222f0bc339 100644 --- a/receiver/scraperhelper/scraper.go +++ b/receiver/scraperhelper/scraper.go @@ -61,13 +61,13 @@ func (b *baseScraper) ID() component.ID { // NewScraper creates a Scraper that calls Scrape at the specified collection interval, // reports observability information, and passes the scraped metrics to the next consumer. -func NewScraper(name string, scrape ScrapeFunc, options ...ScraperOption) (Scraper, error) { +func NewScraper(t component.Type, scrape ScrapeFunc, options ...ScraperOption) (Scraper, error) { if scrape == nil { return nil, errNilFunc } bs := &baseScraper{ ScrapeFunc: scrape, - id: component.NewID(component.MustNewType(name)), + id: component.NewID(t), } for _, op := range options { op(bs) @@ -75,3 +75,11 @@ func NewScraper(name string, scrape ScrapeFunc, options ...ScraperOption) (Scrap return bs, nil } + +// NewScraperWithComponentType creates a Scraper that calls Scrape at the specified collection interval, +// reports observability information, and passes the scraped metrics to the next consumer. +// +// Deprecated: [v0.110.0] use NewScraper instead. +func NewScraperWithComponentType(t component.Type, scrape ScrapeFunc, options ...ScraperOption) (Scraper, error) { + return NewScraper(t, scrape, options...) +} diff --git a/receiver/scraperhelper/scrapercontroller.go b/receiver/scraperhelper/scrapercontroller.go index 7ed92497e3f..4b94ced6623 100644 --- a/receiver/scraperhelper/scrapercontroller.go +++ b/receiver/scraperhelper/scrapercontroller.go @@ -51,7 +51,7 @@ type controller struct { nextConsumer consumer.Metrics scrapers []Scraper - obsScrapers []*ObsReport + obsScrapers []*obsReport tickerCh <-chan time.Time @@ -101,9 +101,9 @@ func NewScraperControllerReceiver( op(sc) } - sc.obsScrapers = make([]*ObsReport, len(sc.scrapers)) + sc.obsScrapers = make([]*obsReport, len(sc.scrapers)) for i, scraper := range sc.scrapers { - scrp, err := newScraper(ObsReportSettings{ + scrp, err := newScraper(obsReportSettings{ ReceiverID: sc.id, Scraper: scraper.ID(), ReceiverCreateSettings: sc.recvSettings, diff --git a/receiver/scraperhelper/scrapercontroller_test.go b/receiver/scraperhelper/scrapercontroller_test.go index f056a7eb8d2..eb8c37bb16c 100644 --- a/receiver/scraperhelper/scrapercontroller_test.go +++ b/receiver/scraperhelper/scrapercontroller_test.go @@ -223,7 +223,7 @@ func configureMetricOptions(t *testing.T, test metricsTestCase, initializeChs [] scrapeMetricsChs[i] = make(chan int) tsm := &testScrapeMetrics{ch: scrapeMetricsChs[i], err: test.scrapeErr} - scp, err := NewScraper("scraper", tsm.scrape, scraperOptions...) + scp, err := NewScraper(component.MustNewType("scraper"), tsm.scrape, scraperOptions...) assert.NoError(t, err) metricOptions = append(metricOptions, AddScraper(scp)) @@ -325,7 +325,7 @@ func TestSingleScrapePerInterval(t *testing.T) { tickerCh := make(chan time.Time) - scp, err := NewScraper("scaper", tsm.scrape) + scp, err := NewScraper(component.MustNewType("scaper"), tsm.scrape) assert.NoError(t, err) receiver, err := NewScraperControllerReceiver( @@ -367,7 +367,7 @@ func TestScrapeControllerStartsOnInit(t *testing.T) { ch: make(chan int, 1), } - scp, err := NewScraper("scraper", tsm.scrape) + scp, err := NewScraper(component.MustNewType("scraper"), tsm.scrape) require.NoError(t, err, "Must not error when creating scraper") r, err := NewScraperControllerReceiver( @@ -384,7 +384,7 @@ func TestScrapeControllerStartsOnInit(t *testing.T) { assert.NoError(t, r.Start(context.Background(), componenttest.NewNopHost()), "Must not error on start") <-time.After(500 * time.Nanosecond) assert.NoError(t, r.Shutdown(context.Background()), "Must not have errored on shutdown") - assert.Equal(t, tsm.timesScrapeCalled, 1, "Must have been called as soon as the controller started") + assert.Equal(t, 1, tsm.timesScrapeCalled, "Must have been called as soon as the controller started") } func TestScrapeControllerInitialDelay(t *testing.T) { @@ -403,7 +403,7 @@ func TestScrapeControllerInitialDelay(t *testing.T) { } ) - scp, err := NewScraper("timed", func(context.Context) (pmetric.Metrics, error) { + scp, err := NewScraper(component.MustNewType("timed"), func(context.Context) (pmetric.Metrics, error) { elapsed <- time.Now() return pmetric.NewMetrics(), nil }) diff --git a/service/extensions/extensions.go b/service/extensions/extensions.go index c3a83192158..7cf4aaed6c6 100644 --- a/service/extensions/extensions.go +++ b/service/extensions/extensions.go @@ -16,6 +16,7 @@ import ( "go.opentelemetry.io/collector/component/componentstatus" "go.opentelemetry.io/collector/confmap" "go.opentelemetry.io/collector/extension" + "go.opentelemetry.io/collector/extension/extensioncapabilities" "go.opentelemetry.io/collector/service/internal/builders" "go.opentelemetry.io/collector/service/internal/components" "go.opentelemetry.io/collector/service/internal/status" @@ -92,7 +93,7 @@ func (bes *Extensions) Shutdown(ctx context.Context) error { func (bes *Extensions) NotifyPipelineReady() error { for _, extID := range bes.extensionIDs { ext := bes.extMap[extID] - if pw, ok := ext.(extension.PipelineWatcher); ok { + if pw, ok := ext.(extensioncapabilities.PipelineWatcher); ok { if err := pw.Ready(); err != nil { return fmt.Errorf("failed to notify extension %q: %w", extID, err) } @@ -105,7 +106,7 @@ func (bes *Extensions) NotifyPipelineNotReady() error { var errs error for _, extID := range bes.extensionIDs { ext := bes.extMap[extID] - if pw, ok := ext.(extension.PipelineWatcher); ok { + if pw, ok := ext.(extensioncapabilities.PipelineWatcher); ok { errs = multierr.Append(errs, pw.NotReady()) } } @@ -116,7 +117,7 @@ func (bes *Extensions) NotifyConfig(ctx context.Context, conf *confmap.Conf) err var errs error for _, extID := range bes.extensionIDs { ext := bes.extMap[extID] - if cw, ok := ext.(extension.ConfigWatcher); ok { + if cw, ok := ext.(extensioncapabilities.ConfigWatcher); ok { clonedConf := confmap.NewFromStringMap(conf.ToStringMap()) errs = multierr.Append(errs, cw.NotifyConfig(ctx, clonedConf)) } diff --git a/service/extensions/extensions_test.go b/service/extensions/extensions_test.go index 96bfa36071d..1dd86596def 100644 --- a/service/extensions/extensions_test.go +++ b/service/extensions/extensions_test.go @@ -17,6 +17,7 @@ import ( "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/confmap" "go.opentelemetry.io/collector/extension" + "go.opentelemetry.io/collector/extension/extensioncapabilities" "go.opentelemetry.io/collector/extension/extensiontest" "go.opentelemetry.io/collector/service/internal/builders" "go.opentelemetry.io/collector/service/internal/status" @@ -508,7 +509,7 @@ type recordingExtension struct { createSettings extension.Settings } -var _ extension.Dependent = (*recordingExtension)(nil) +var _ extensioncapabilities.Dependent = (*recordingExtension)(nil) func (ext *recordingExtension) Dependencies() []component.ID { if len(ext.config.dependencies) == 0 { diff --git a/service/extensions/graph.go b/service/extensions/graph.go index 7099d018a1f..f8bdde04889 100644 --- a/service/extensions/graph.go +++ b/service/extensions/graph.go @@ -13,7 +13,7 @@ import ( "gonum.org/v1/gonum/graph/topo" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/extension" + "go.opentelemetry.io/collector/extension/extensioncapabilities" ) type node struct { @@ -38,7 +38,7 @@ func computeOrder(exts *Extensions) ([]component.ID, error) { } for extID, ext := range exts.extMap { n := nodes[extID] - if dep, ok := ext.(extension.Dependent); ok { + if dep, ok := ext.(extensioncapabilities.Dependent); ok { for _, depID := range dep.Dependencies() { if d, ok := nodes[depID]; ok { graph.SetEdge(graph.NewEdge(d, n)) diff --git a/service/go.mod b/service/go.mod index c894ea3f012..14591fba060 100644 --- a/service/go.mod +++ b/service/go.mod @@ -4,47 +4,49 @@ go 1.22.0 require ( github.com/google/uuid v1.6.0 - github.com/prometheus/client_golang v1.20.2 + github.com/prometheus/client_golang v1.20.3 github.com/prometheus/client_model v0.6.1 - github.com/prometheus/common v0.56.0 - github.com/shirou/gopsutil/v4 v4.24.7 + github.com/prometheus/common v0.59.1 + github.com/shirou/gopsutil/v4 v4.24.8 github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector v0.108.1 - go.opentelemetry.io/collector/component v0.108.1 - go.opentelemetry.io/collector/component/componentprofiles v0.108.1 - go.opentelemetry.io/collector/component/componentstatus v0.108.1 - go.opentelemetry.io/collector/config/confighttp v0.108.1 - go.opentelemetry.io/collector/config/configtelemetry v0.108.1 - go.opentelemetry.io/collector/confmap v1.14.1 - go.opentelemetry.io/collector/connector v0.108.1 - go.opentelemetry.io/collector/connector/connectorprofiles v0.108.1 - go.opentelemetry.io/collector/consumer v0.108.1 - go.opentelemetry.io/collector/consumer/consumerprofiles v0.108.1 - go.opentelemetry.io/collector/consumer/consumertest v0.108.1 - go.opentelemetry.io/collector/exporter v0.108.1 - go.opentelemetry.io/collector/exporter/exporterprofiles v0.108.1 - go.opentelemetry.io/collector/extension v0.108.1 - go.opentelemetry.io/collector/extension/zpagesextension v0.108.1 - go.opentelemetry.io/collector/featuregate v1.14.1 - go.opentelemetry.io/collector/internal/globalgates v0.108.1 - go.opentelemetry.io/collector/pdata v1.14.1 - go.opentelemetry.io/collector/pdata/testdata v0.108.1 - go.opentelemetry.io/collector/processor v0.108.1 - go.opentelemetry.io/collector/processor/processorprofiles v0.108.1 - go.opentelemetry.io/collector/receiver v0.108.1 - go.opentelemetry.io/collector/receiver/receiverprofiles v0.108.1 - go.opentelemetry.io/collector/semconv v0.108.1 + go.opentelemetry.io/collector v0.109.0 + go.opentelemetry.io/collector/component v0.109.0 + go.opentelemetry.io/collector/component/componentprofiles v0.109.0 + go.opentelemetry.io/collector/component/componentstatus v0.109.0 + go.opentelemetry.io/collector/config/confighttp v0.109.0 + go.opentelemetry.io/collector/config/configtelemetry v0.109.0 + go.opentelemetry.io/collector/confmap v1.15.0 + go.opentelemetry.io/collector/connector v0.109.0 + go.opentelemetry.io/collector/connector/connectorprofiles v0.109.0 + go.opentelemetry.io/collector/consumer v0.109.0 + go.opentelemetry.io/collector/consumer/consumerprofiles v0.109.0 + go.opentelemetry.io/collector/consumer/consumertest v0.109.0 + go.opentelemetry.io/collector/exporter v0.109.0 + go.opentelemetry.io/collector/exporter/exporterprofiles v0.109.0 + go.opentelemetry.io/collector/extension v0.109.0 + go.opentelemetry.io/collector/extension/extensioncapabilities v0.109.0 + go.opentelemetry.io/collector/extension/zpagesextension v0.109.0 + go.opentelemetry.io/collector/featuregate v1.15.0 + go.opentelemetry.io/collector/internal/globalgates v0.109.0 + go.opentelemetry.io/collector/pdata v1.15.0 + go.opentelemetry.io/collector/pdata/pprofile v0.109.0 + go.opentelemetry.io/collector/pdata/testdata v0.109.0 + go.opentelemetry.io/collector/processor v0.109.0 + go.opentelemetry.io/collector/processor/processorprofiles v0.109.0 + go.opentelemetry.io/collector/receiver v0.109.0 + go.opentelemetry.io/collector/receiver/receiverprofiles v0.109.0 + go.opentelemetry.io/collector/semconv v0.109.0 go.opentelemetry.io/contrib/config v0.9.0 go.opentelemetry.io/contrib/propagators/b3 v1.29.0 - go.opentelemetry.io/otel v1.29.0 - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.29.0 - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.29.0 - go.opentelemetry.io/otel/exporters/prometheus v0.51.0 - go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0 - go.opentelemetry.io/otel/metric v1.29.0 - go.opentelemetry.io/otel/sdk v1.29.0 - go.opentelemetry.io/otel/sdk/metric v1.29.0 - go.opentelemetry.io/otel/trace v1.29.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.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.27.0 @@ -80,19 +82,18 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect github.com/prometheus/procfs v0.15.1 // indirect - github.com/rs/cors v1.11.0 // indirect + github.com/rs/cors v1.11.1 // indirect github.com/shoenig/go-m1cpu v0.1.6 // indirect github.com/tklauser/go-sysconf v0.3.12 // indirect github.com/tklauser/numcpus v0.6.1 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect - go.opentelemetry.io/collector/client v1.14.1 // indirect - go.opentelemetry.io/collector/config/configauth v0.108.1 // indirect - go.opentelemetry.io/collector/config/configcompression v1.14.1 // indirect - go.opentelemetry.io/collector/config/configopaque v1.14.1 // indirect - go.opentelemetry.io/collector/config/configtls v1.14.1 // indirect - go.opentelemetry.io/collector/config/internal v0.108.1 // indirect - go.opentelemetry.io/collector/extension/auth v0.108.1 // indirect - go.opentelemetry.io/collector/pdata/pprofile v0.108.1 // indirect + go.opentelemetry.io/collector/client v1.15.0 // indirect + go.opentelemetry.io/collector/config/configauth v0.109.0 // indirect + go.opentelemetry.io/collector/config/configcompression v1.15.0 // indirect + go.opentelemetry.io/collector/config/configopaque v1.15.0 // indirect + go.opentelemetry.io/collector/config/configtls v1.15.0 // indirect + go.opentelemetry.io/collector/config/internal v0.109.0 // indirect + go.opentelemetry.io/collector/extension/auth v0.109.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect go.opentelemetry.io/contrib/zpages v0.54.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.5.0 // indirect @@ -104,12 +105,12 @@ require ( go.opentelemetry.io/otel/log v0.5.0 // indirect go.opentelemetry.io/otel/sdk/log v0.5.0 // indirect go.opentelemetry.io/proto/otlp v1.3.1 // indirect - golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.24.0 // indirect - golang.org/x/text v0.17.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd // indirect - google.golang.org/grpc v1.65.0 // indirect + golang.org/x/net v0.29.0 // indirect + golang.org/x/sys v0.25.0 // indirect + golang.org/x/text v0.18.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/grpc v1.66.1 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) @@ -152,6 +153,8 @@ 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/extension/extensioncapabilities => ../extension/extensioncapabilities + replace go.opentelemetry.io/collector/config/configopaque => ../config/configopaque replace go.opentelemetry.io/collector/config/confighttp => ../config/confighttp diff --git a/service/go.sum b/service/go.sum index 71bf9f2c5bd..270360b2cfd 100644 --- a/service/go.sum +++ b/service/go.sum @@ -69,20 +69,20 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= -github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg= -github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= +github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.56.0 h1:UffReloqkBtvtQEYDg2s+uDPGRrJyC6vZWPGXf6OhPY= -github.com/prometheus/common v0.56.0/go.mod h1:7uRPFSUTbfZWsJ7MHY56sqt7hLQu3bxXHDnNhl8E9qI= +github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= +github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= -github.com/rs/cors v1.11.0 h1:0B9GE/r9Bc2UxRMMtymBkHTenPkHDv0CW4Y98GBY+po= -github.com/rs/cors v1.11.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= -github.com/shirou/gopsutil/v4 v4.24.7 h1:V9UGTK4gQ8HvcnPKf6Zt3XHyQq/peaekfxpJ2HSocJk= -github.com/shirou/gopsutil/v4 v4.24.7/go.mod h1:0uW/073rP7FYLOkvxolUQM5rMOLTNmRXnFKafpb71rw= +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.8 h1:pVQjIenQkIhqO81mwTaXjTzOMT7d3TZkf43PlVFHENI= +github.com/shirou/gopsutil/v4 v4.24.8/go.mod h1:wE0OrJtj4dG+hYkxqDH3QiBICdKSf04/npcvLLc/oRg= github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= @@ -107,40 +107,40 @@ go.opentelemetry.io/contrib/propagators/b3 v1.29.0 h1:hNjyoRsAACnhoOLWupItUjABze go.opentelemetry.io/contrib/propagators/b3 v1.29.0/go.mod h1:E76MTitU1Niwo5NSN+mVxkyLu4h4h7Dp/yh38F2WuIU= go.opentelemetry.io/contrib/zpages v0.54.0 h1:tSfm/LEK5E46sd5qx/Y9o4iQ65ipLubV0Una7veXFlA= go.opentelemetry.io/contrib/zpages v0.54.0/go.mod h1:sbe4/RH3CFKkdM5zuGwfziKjvkqUOK9hSgLFckiVZUI= -go.opentelemetry.io/otel v1.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= -go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= +go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= +go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.5.0 h1:4d++HQ+Ihdl+53zSjtsCUFDmNMju2FC9qFkUlTxPLqo= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.5.0/go.mod h1:mQX5dTO3Mh5ZF7bPKDkt5c/7C41u/SiDr9XgTpzXXn8= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.29.0 h1:k6fQVDQexDE+3jG2SfCQjnHS7OamcP73YMoxEVq5B6k= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.29.0/go.mod h1:t4BrYLHU450Zo9fnydWlIuswB1bm7rM8havDpWOJeDo= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.29.0 h1:xvhQxJ/C9+RTnAj5DpTg7LSM1vbbMTiXt7e9hsfqHNw= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.29.0/go.mod h1:Fcvs2Bz1jkDM+Wf5/ozBGmi3tQ/c9zPKLnsipnfhGAo= +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/otlptrace v1.29.0 h1:dIIDULZJpgdiHz5tXrTgKIMLkus6jEFa7x5SOKcyR7E= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0/go.mod h1:jlRVBe7+Z1wyxFSUs48L6OBQZ5JwH2Hg/Vbl+t9rAgI= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0 h1:nSiV3s7wiCam610XcLbYOmMfJxB9gO4uK3Xgv5gmTgg= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0/go.mod h1:hKn/e/Nmd19/x1gvIHwtOwVWM+VhuITSWip3JUDghj0= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0 h1:JAv0Jwtl01UFiyWZEMiJZBiTlv5A50zNs8lsthXqIio= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0/go.mod h1:QNKLmUEAq2QUbPQUfvw4fmv0bgbK7UlOSFCnXyfvSNc= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0 h1:G7uexXb/K3T+T9fNLCCKncweEtNEBMTO+46hKX5EdKw= -go.opentelemetry.io/otel/exporters/prometheus v0.51.0/go.mod h1:v0mFe5Kk7woIh938mrZBJBmENYquyA0IICrlYm4Y0t4= +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/stdout/stdoutlog v0.5.0 h1:ThVXnEsdwNcxdBO+r96ci1xbF+PgNjwlk457VNuJODo= go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.5.0/go.mod h1:rHWcSmC4q2h3gje/yOq6sAOaq8+UHxN/Ru3BbmDXOfY= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0 h1:WDdP9acbMYjbKIyJUhTvtzj601sVJOqgWdUxSdR/Ysc= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0/go.mod h1:BLbf7zbNIONBLPwvFnwNHGj4zge8uTCM/UPIVW1Mq2I= +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/stdouttrace v1.29.0 h1:X3ZjNp36/WlkSYx0ul2jw4PtbNEDDeLskw3VPsrpYM0= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.29.0/go.mod h1:2uL/xnOXh0CHOBFCWXz5u1A4GXLiW+0IQIzVbeOEQ0U= go.opentelemetry.io/otel/log v0.5.0 h1:x1Pr6Y3gnXgl1iFBwtGy1W/mnzENoK0w0ZoaeOI3i30= go.opentelemetry.io/otel/log v0.5.0/go.mod h1:NU/ozXeGuOR5/mjCRXYbTC00NFJ3NYuraV/7O78F0rE= -go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= -go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= -go.opentelemetry.io/otel/sdk v1.29.0 h1:vkqKjk7gwhS8VaWb0POZKmIEDimRCMsopNYnriHyryo= -go.opentelemetry.io/otel/sdk v1.29.0/go.mod h1:pM8Dx5WKnvxLCb+8lG1PRNIDxu9g9b9g59Qr7hfAAok= +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/log v0.5.0 h1:A+9lSjlZGxkQOr7QSBJcuyyYBw79CufQ69saiJLey7o= go.opentelemetry.io/otel/sdk/log v0.5.0/go.mod h1:zjxIW7sw1IHolZL2KlSAtrUi8JHttoeiQy43Yl3WuVQ= -go.opentelemetry.io/otel/sdk/metric v1.29.0 h1:K2CfmJohnRgvZ9UAj2/FhIf/okdWcNdBwe1m8xFXiSY= -go.opentelemetry.io/otel/sdk/metric v1.29.0/go.mod h1:6zZLdCl2fkauYoZIOn/soQIDSWFmNSRcICarHfuhNJQ= -go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= -go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= +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/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= @@ -160,8 +160,8 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= -golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= +golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= +golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -172,12 +172,12 @@ 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.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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= -golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -188,12 +188,12 @@ 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-20240822170219-fc7c04adadcd h1:BBOTEWLuuEGQy9n1y9MhVJ9Qt0BDu21X8qZs71/uPZo= -google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:fO8wJzT2zbQbAjbIoos1285VfEIYKDDY+Dt+WpTkh6g= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd h1:6TEm2ZxXoQmFWFlt1vNxvVOa1Q0dXFQD1m/rYjXmS0E= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +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/grpc v1.66.1 h1:hO5qAXR19+/Z44hmvIM4dQFMSYX9XcWsByfoxutBpAM= +google.golang.org/grpc v1.66.1/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= 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= diff --git a/service/internal/builders/connector.go b/service/internal/builders/connector.go index edca251de15..cc5b52ecf5a 100644 --- a/service/internal/builders/connector.go +++ b/service/internal/builders/connector.go @@ -15,25 +15,6 @@ import ( "go.opentelemetry.io/collector/consumer/consumerprofiles" ) -// Connector is an interface that allows using implementations of the builder -// from different packages. -type Connector interface { - CreateTracesToTraces(context.Context, connector.Settings, consumer.Traces) (connector.Traces, error) - CreateTracesToMetrics(context.Context, connector.Settings, consumer.Metrics) (connector.Traces, error) - CreateTracesToLogs(context.Context, connector.Settings, consumer.Logs) (connector.Traces, error) - - CreateMetricsToTraces(context.Context, connector.Settings, consumer.Traces) (connector.Metrics, error) - CreateMetricsToMetrics(context.Context, connector.Settings, consumer.Metrics) (connector.Metrics, error) - CreateMetricsToLogs(context.Context, connector.Settings, consumer.Logs) (connector.Metrics, error) - - CreateLogsToTraces(context.Context, connector.Settings, consumer.Traces) (connector.Logs, error) - CreateLogsToMetrics(context.Context, connector.Settings, consumer.Metrics) (connector.Logs, error) - CreateLogsToLogs(context.Context, connector.Settings, consumer.Logs) (connector.Logs, error) - - IsConfigured(component.ID) bool - Factory(component.Type) component.Factory -} - // ConnectorBuilder is a helper struct that given a set of Configs and Factories helps with creating connectors. type ConnectorBuilder struct { cfgs map[component.ID]component.Config diff --git a/service/internal/builders/exporter.go b/service/internal/builders/exporter.go index 385311e8e6d..61ec2a45d1b 100644 --- a/service/internal/builders/exporter.go +++ b/service/internal/builders/exporter.go @@ -13,15 +13,6 @@ import ( "go.opentelemetry.io/collector/exporter/exportertest" ) -// Exporter is an interface that allows using implementations of the builder -// from different packages. -type Exporter interface { - CreateTraces(context.Context, exporter.Settings) (exporter.Traces, error) - CreateMetrics(context.Context, exporter.Settings) (exporter.Metrics, error) - CreateLogs(context.Context, exporter.Settings) (exporter.Logs, error) - Factory(component.Type) component.Factory -} - // ExporterBuilder is a helper struct that given a set of Configs and Factories helps with creating exporters. type ExporterBuilder struct { cfgs map[component.ID]component.Config diff --git a/service/internal/builders/extension_test.go b/service/internal/builders/extension_test.go index 4baa3a8d193..153c094c29b 100644 --- a/service/internal/builders/extension_test.go +++ b/service/internal/builders/extension_test.go @@ -43,7 +43,7 @@ func TestExtensionBuilder(t *testing.T) { // Check that the extension has access to the resource attributes. nop, ok := e.(nopExtension) assert.True(t, ok) - assert.Equal(t, nop.Settings.Resource.Attributes().Len(), 0) + assert.Equal(t, 0, nop.Settings.Resource.Attributes().Len()) missingType, err := b.Create(context.Background(), createExtensionSettings(unknownID)) assert.EqualError(t, err, "extension factory not available for: \"unknown\"") diff --git a/service/internal/builders/processor.go b/service/internal/builders/processor.go index 35b327c3e9c..57dbff9e5ba 100644 --- a/service/internal/builders/processor.go +++ b/service/internal/builders/processor.go @@ -15,15 +15,6 @@ import ( "go.opentelemetry.io/collector/processor/processortest" ) -// Processor is an interface that allows using implementations of the builder -// from different packages. -type Processor interface { - CreateTraces(context.Context, processor.Settings, consumer.Traces) (processor.Traces, error) - CreateMetrics(context.Context, processor.Settings, consumer.Metrics) (processor.Metrics, error) - CreateLogs(context.Context, processor.Settings, consumer.Logs) (processor.Logs, error) - Factory(component.Type) component.Factory -} - // ProcessorBuilder processor is a helper struct that given a set of Configs // and Factories helps with creating processors. type ProcessorBuilder struct { diff --git a/service/internal/builders/receiver.go b/service/internal/builders/receiver.go index 69bff68b460..6f0caf7045c 100644 --- a/service/internal/builders/receiver.go +++ b/service/internal/builders/receiver.go @@ -15,15 +15,6 @@ import ( "go.opentelemetry.io/collector/receiver/receivertest" ) -// Receiver is an interface that allows using implementations of the builder -// from different packages. -type Receiver interface { - CreateTraces(context.Context, receiver.Settings, consumer.Traces) (receiver.Traces, error) - CreateMetrics(context.Context, receiver.Settings, consumer.Metrics) (receiver.Metrics, error) - CreateLogs(context.Context, receiver.Settings, consumer.Logs) (receiver.Logs, error) - Factory(component.Type) component.Factory -} - // ReceiverBuilder receiver is a helper struct that given a set of Configs and // Factories helps with creating receivers. type ReceiverBuilder struct { diff --git a/service/internal/capabilityconsumer/capabilities.go b/service/internal/capabilityconsumer/capabilities.go index 0b700a45e54..14927fbfcd9 100644 --- a/service/internal/capabilityconsumer/capabilities.go +++ b/service/internal/capabilityconsumer/capabilities.go @@ -5,6 +5,7 @@ package capabilityconsumer // import "go.opentelemetry.io/collector/service/inte import ( "go.opentelemetry.io/collector/consumer" + "go.opentelemetry.io/collector/consumer/consumerprofiles" ) func NewLogs(logs consumer.Logs, cap consumer.Capabilities) consumer.Logs { @@ -54,3 +55,19 @@ type capTraces struct { func (mts capTraces) Capabilities() consumer.Capabilities { return mts.cap } + +func NewProfiles(profiles consumerprofiles.Profiles, cap consumer.Capabilities) consumerprofiles.Profiles { + if profiles.Capabilities() == cap { + return profiles + } + return capProfiles{Profiles: profiles, cap: cap} +} + +type capProfiles struct { + consumerprofiles.Profiles + cap consumer.Capabilities +} + +func (mts capProfiles) Capabilities() consumer.Capabilities { + return mts.cap +} diff --git a/service/internal/capabilityconsumer/capabilities_test.go b/service/internal/capabilityconsumer/capabilities_test.go index 69e9f17249f..83468f97000 100644 --- a/service/internal/capabilityconsumer/capabilities_test.go +++ b/service/internal/capabilityconsumer/capabilities_test.go @@ -59,3 +59,18 @@ func TestTraces(t *testing.T) { assert.Len(t, sink.AllTraces(), 1) assert.Equal(t, testdata.GenerateTraces(1), sink.AllTraces()[0]) } + +func TestProfiles(t *testing.T) { + sink := &consumertest.ProfilesSink{} + require.Equal(t, consumer.Capabilities{MutatesData: false}, sink.Capabilities()) + + same := NewProfiles(sink, consumer.Capabilities{MutatesData: false}) + assert.Same(t, sink, same) + + wrap := NewProfiles(sink, consumer.Capabilities{MutatesData: true}) + assert.Equal(t, consumer.Capabilities{MutatesData: true}, wrap.Capabilities()) + + assert.NoError(t, wrap.ConsumeProfiles(context.Background(), testdata.GenerateProfiles(1))) + assert.Len(t, sink.AllProfiles(), 1) + assert.Equal(t, testdata.GenerateProfiles(1), sink.AllProfiles()[0]) +} diff --git a/service/internal/graph/graph.go b/service/internal/graph/graph.go index 5f242cbe5f5..3adc1c568a2 100644 --- a/service/internal/graph/graph.go +++ b/service/internal/graph/graph.go @@ -25,9 +25,11 @@ 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/consumer" + "go.opentelemetry.io/collector/consumer/consumerprofiles" "go.opentelemetry.io/collector/internal/fanoutconsumer" "go.opentelemetry.io/collector/service/internal/builders" "go.opentelemetry.io/collector/service/internal/capabilityconsumer" @@ -40,10 +42,10 @@ type Settings struct { Telemetry component.TelemetrySettings BuildInfo component.BuildInfo - ReceiverBuilder builders.Receiver - ProcessorBuilder builders.Processor - ExporterBuilder builders.Exporter - ConnectorBuilder builders.Connector + ReceiverBuilder *builders.ReceiverBuilder + ProcessorBuilder *builders.ProcessorBuilder + ExporterBuilder *builders.ExporterBuilder + ConnectorBuilder *builders.ConnectorBuilder // PipelineConfigs is a map of component.ID to PipelineConfig. PipelineConfigs pipelines.Config @@ -314,6 +316,10 @@ 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.DataTypeProfiles: + cc := capabilityconsumer.NewProfiles(next.(consumerprofiles.Profiles), capability) + n.baseConsumer = cc + n.ConsumeProfilesFunc = cc.ConsumeProfiles } case *fanOutNode: nexts := g.nextConsumers(n.ID()) @@ -336,6 +342,12 @@ func (g *Graph) buildComponents(ctx context.Context, set Settings) error { consumers = append(consumers, next.(consumer.Logs)) } n.baseConsumer = fanoutconsumer.NewLogs(consumers) + case componentprofiles.DataTypeProfiles: + consumers := make([]consumerprofiles.Profiles, 0, len(nexts)) + for _, next := range nexts { + consumers = append(consumers, next.(consumerprofiles.Profiles)) + } + n.baseConsumer = fanoutconsumer.NewProfiles(consumers) } } if err != nil { @@ -476,6 +488,7 @@ func (g *Graph) GetExporters() map[component.DataType]map[component.ID]component exportersMap[component.DataTypeTraces] = make(map[component.ID]component.Component) exportersMap[component.DataTypeMetrics] = make(map[component.ID]component.Component) exportersMap[component.DataTypeLogs] = make(map[component.ID]component.Component) + exportersMap[componentprofiles.DataTypeProfiles] = make(map[component.ID]component.Component) for _, pg := range g.pipelines { for _, expNode := range pg.exporters { @@ -538,6 +551,8 @@ func connectorStability(f connector.Factory, expType, recType component.Type) co return f.TracesToMetricsStability() case component.DataTypeLogs: return f.TracesToLogsStability() + case componentprofiles.DataTypeProfiles: + return f.TracesToProfilesStability() } case component.DataTypeMetrics: switch recType { @@ -547,6 +562,8 @@ func connectorStability(f connector.Factory, expType, recType component.Type) co return f.MetricsToMetricsStability() case component.DataTypeLogs: return f.MetricsToLogsStability() + case componentprofiles.DataTypeProfiles: + return f.MetricsToProfilesStability() } case component.DataTypeLogs: switch recType { @@ -556,6 +573,19 @@ func connectorStability(f connector.Factory, expType, recType component.Type) co return f.LogsToMetricsStability() case component.DataTypeLogs: return f.LogsToLogsStability() + case componentprofiles.DataTypeProfiles: + return f.LogsToProfilesStability() + } + case componentprofiles.DataTypeProfiles: + switch recType { + case component.DataTypeTraces: + return f.ProfilesToTracesStability() + case component.DataTypeMetrics: + return f.ProfilesToMetricsStability() + case component.DataTypeLogs: + return f.ProfilesToLogsStability() + case componentprofiles.DataTypeProfiles: + return f.ProfilesToProfilesStability() } } return component.StabilityLevelUndefined diff --git a/service/internal/graph/graph_test.go b/service/internal/graph/graph_test.go index 4256088328a..460f2a86bb6 100644 --- a/service/internal/graph/graph_test.go +++ b/service/internal/graph/graph_test.go @@ -16,18 +16,24 @@ import ( "gonum.org/v1/gonum/graph/simple" "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" + "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/consumer/consumertest" "go.opentelemetry.io/collector/exporter" + "go.opentelemetry.io/collector/exporter/exporterprofiles" "go.opentelemetry.io/collector/exporter/exportertest" "go.opentelemetry.io/collector/pdata/testdata" "go.opentelemetry.io/collector/processor" + "go.opentelemetry.io/collector/processor/processorprofiles" "go.opentelemetry.io/collector/processor/processortest" "go.opentelemetry.io/collector/receiver" + "go.opentelemetry.io/collector/receiver/receiverprofiles" "go.opentelemetry.io/collector/receiver/receivertest" "go.opentelemetry.io/collector/service/internal/builders" "go.opentelemetry.io/collector/service/internal/status" @@ -246,6 +252,11 @@ func TestConnectorPipelinesGraph(t *testing.T) { Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, + component.MustNewID("profiles"): { + Receivers: []component.ID{component.MustNewID("examplereceiver")}, + Processors: []component.ID{component.MustNewID("exampleprocessor")}, + Exporters: []component.ID{component.MustNewID("exampleexporter")}, + }, }, expectedPerExporter: 1, }, @@ -267,6 +278,11 @@ func TestConnectorPipelinesGraph(t *testing.T) { Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, + component.MustNewID("profiles"): { + Receivers: []component.ID{component.MustNewID("examplereceiver")}, + Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, + Exporters: []component.ID{component.MustNewID("exampleexporter")}, + }, }, expectedPerExporter: 1, }, @@ -288,6 +304,11 @@ func TestConnectorPipelinesGraph(t *testing.T) { Processors: []component.ID{component.MustNewID("exampleprocessor"), component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, + component.MustNewID("profiles"): { + Receivers: []component.ID{component.MustNewID("examplereceiver")}, + Processors: []component.ID{component.MustNewID("exampleprocessor"), component.MustNewIDWithName("exampleprocessor", "mutate")}, + Exporters: []component.ID{component.MustNewID("exampleexporter")}, + }, }, expectedPerExporter: 1, }, @@ -306,6 +327,10 @@ func TestConnectorPipelinesGraph(t *testing.T) { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, + component.MustNewID("profiles"): { + Receivers: []component.ID{component.MustNewID("examplereceiver")}, + Exporters: []component.ID{component.MustNewID("exampleexporter")}, + }, }, expectedPerExporter: 1, }, @@ -327,6 +352,11 @@ func TestConnectorPipelinesGraph(t *testing.T) { Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate"), component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter"), component.MustNewIDWithName("exampleexporter", "1")}, }, + component.MustNewID("profiles"): { + 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")}, + }, }, expectedPerExporter: 2, }, @@ -345,6 +375,10 @@ func TestConnectorPipelinesGraph(t *testing.T) { Receivers: []component.ID{component.MustNewID("examplereceiver"), component.MustNewIDWithName("examplereceiver", "1")}, Exporters: []component.ID{component.MustNewID("exampleexporter"), component.MustNewIDWithName("exampleexporter", "1")}, }, + component.MustNewID("profiles"): { + Receivers: []component.ID{component.MustNewID("examplereceiver"), component.MustNewIDWithName("examplereceiver", "1")}, + Exporters: []component.ID{component.MustNewID("exampleexporter"), component.MustNewIDWithName("exampleexporter", "1")}, + }, }, expectedPerExporter: 2, }, @@ -378,6 +412,15 @@ func TestConnectorPipelinesGraph(t *testing.T) { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, + component.MustNewID("profiles"): { + Receivers: []component.ID{component.MustNewID("examplereceiver")}, + Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, + Exporters: []component.ID{component.MustNewID("exampleexporter")}, + }, + component.MustNewIDWithName("profiles", "1"): { + Receivers: []component.ID{component.MustNewID("examplereceiver")}, + Exporters: []component.ID{component.MustNewID("exampleexporter")}, + }, }, expectedPerExporter: 2, }, @@ -429,6 +472,22 @@ func TestConnectorPipelinesGraph(t *testing.T) { }, expectedPerExporter: 1, }, + { + name: "pipelines_conn_simple_profiles.yaml", + pipelineConfigs: pipelines.Config{ + component.MustNewIDWithName("profiles", "in"): { + Receivers: []component.ID{component.MustNewID("examplereceiver")}, + Processors: []component.ID{component.MustNewID("exampleprocessor")}, + Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, + }, + component.MustNewIDWithName("profiles", "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")}, + }, + }, + expectedPerExporter: 1, + }, { name: "pipelines_conn_fork_merge_traces.yaml", pipelineConfigs: pipelines.Config{ @@ -507,6 +566,32 @@ func TestConnectorPipelinesGraph(t *testing.T) { }, expectedPerExporter: 2, }, + { + name: "pipelines_conn_fork_merge_profiles.yaml", + pipelineConfigs: pipelines.Config{ + component.MustNewIDWithName("profiles", "in"): { + Receivers: []component.ID{component.MustNewID("examplereceiver")}, + Processors: []component.ID{component.MustNewID("exampleprocessor")}, + Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, + }, + component.MustNewIDWithName("profiles", "type0"): { + Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, + Processors: []component.ID{component.MustNewID("exampleprocessor")}, + Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "merge")}, + }, + component.MustNewIDWithName("profiles", "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")}, + }, + component.MustNewIDWithName("profiles", "out"): { + Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "merge")}, + Processors: []component.ID{component.MustNewID("exampleprocessor")}, + Exporters: []component.ID{component.MustNewID("exampleexporter")}, + }, + }, + expectedPerExporter: 2, + }, { name: "pipelines_conn_translate_from_traces.yaml", pipelineConfigs: pipelines.Config{ @@ -525,6 +610,11 @@ func TestConnectorPipelinesGraph(t *testing.T) { Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, + component.MustNewID("profiles"): { + Receivers: []component.ID{component.MustNewID("exampleconnector")}, + Processors: []component.ID{component.MustNewID("exampleprocessor")}, + Exporters: []component.ID{component.MustNewID("exampleexporter")}, + }, }, expectedPerExporter: 1, }, @@ -546,6 +636,11 @@ func TestConnectorPipelinesGraph(t *testing.T) { Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, + component.MustNewID("profiles"): { + Receivers: []component.ID{component.MustNewID("exampleconnector")}, + Processors: []component.ID{component.MustNewID("exampleprocessor")}, + Exporters: []component.ID{component.MustNewID("exampleexporter")}, + }, }, expectedPerExporter: 1, }, @@ -567,6 +662,37 @@ func TestConnectorPipelinesGraph(t *testing.T) { Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, + component.MustNewID("profiles"): { + Receivers: []component.ID{component.MustNewID("exampleconnector")}, + Processors: []component.ID{component.MustNewID("exampleprocessor")}, + Exporters: []component.ID{component.MustNewID("exampleexporter")}, + }, + }, + expectedPerExporter: 1, + }, + { + name: "pipelines_conn_translate_from_profiles.yaml", + pipelineConfigs: pipelines.Config{ + component.MustNewID("traces"): { + Receivers: []component.ID{component.MustNewID("examplereceiver")}, + Processors: []component.ID{component.MustNewID("exampleprocessor")}, + Exporters: []component.ID{component.MustNewID("exampleconnector")}, + }, + component.MustNewID("metrics"): { + Receivers: []component.ID{component.MustNewID("exampleconnector")}, + Processors: []component.ID{component.MustNewID("exampleprocessor")}, + Exporters: []component.ID{component.MustNewID("exampleexporter")}, + }, + component.MustNewID("logs"): { + Receivers: []component.ID{component.MustNewID("exampleconnector")}, + Processors: []component.ID{component.MustNewID("exampleprocessor")}, + Exporters: []component.ID{component.MustNewID("exampleexporter")}, + }, + component.MustNewID("profiles"): { + Receivers: []component.ID{component.MustNewID("exampleconnector")}, + Processors: []component.ID{component.MustNewID("exampleprocessor")}, + Exporters: []component.ID{component.MustNewID("exampleexporter")}, + }, }, expectedPerExporter: 1, }, @@ -588,6 +714,11 @@ func TestConnectorPipelinesGraph(t *testing.T) { Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleconnector")}, }, + component.MustNewIDWithName("profiles", "in"): { + Receivers: []component.ID{component.MustNewID("examplereceiver")}, + Processors: []component.ID{component.MustNewID("exampleprocessor")}, + Exporters: []component.ID{component.MustNewID("exampleconnector")}, + }, component.MustNewIDWithName("traces", "out"): { Receivers: []component.ID{component.MustNewID("exampleconnector")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, @@ -603,8 +734,13 @@ func TestConnectorPipelinesGraph(t *testing.T) { Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, + component.MustNewIDWithName("profiles", "out"): { + Receivers: []component.ID{component.MustNewID("exampleconnector")}, + Processors: []component.ID{component.MustNewID("exampleprocessor")}, + Exporters: []component.ID{component.MustNewID("exampleexporter")}, + }, }, - expectedPerExporter: 3, + expectedPerExporter: 4, }, { name: "pipelines_conn_matrix_mutable.yaml", @@ -624,6 +760,11 @@ func TestConnectorPipelinesGraph(t *testing.T) { Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, + component.MustNewIDWithName("profiles", "in"): { + Receivers: []component.ID{component.MustNewID("examplereceiver")}, + Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, + Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, + }, component.MustNewIDWithName("traces", "out"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, // mutate propagates upstream to connector @@ -639,8 +780,13 @@ func TestConnectorPipelinesGraph(t *testing.T) { Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, // mutate propagates upstream to connector Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, + component.MustNewIDWithName("profiles", "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")}, + }, }, - expectedPerExporter: 3, + expectedPerExporter: 4, }, { name: "pipelines_conn_lanes.yaml", @@ -669,6 +815,14 @@ func TestConnectorPipelinesGraph(t *testing.T) { Receivers: []component.ID{component.MustNewID("mockforward")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, + component.MustNewIDWithName("profiles", "in"): { + Receivers: []component.ID{component.MustNewID("examplereceiver")}, + Exporters: []component.ID{component.MustNewID("mockforward")}, + }, + component.MustNewIDWithName("profiles", "out"): { + Receivers: []component.ID{component.MustNewID("mockforward")}, + Exporters: []component.ID{component.MustNewID("exampleexporter")}, + }, }, expectedPerExporter: 1, }, @@ -750,6 +904,32 @@ func TestConnectorPipelinesGraph(t *testing.T) { }, expectedPerExporter: 2, }, + { + name: "pipelines_conn_mutate_profiles.yaml", + pipelineConfigs: pipelines.Config{ + component.MustNewIDWithName("profiles", "in"): { + Receivers: []component.ID{component.MustNewID("examplereceiver")}, + Processors: []component.ID{component.MustNewID("exampleprocessor")}, + Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, + }, + component.MustNewIDWithName("profiles", "out0"): { + Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, + Processors: []component.ID{component.MustNewID("exampleprocessor")}, + Exporters: []component.ID{component.MustNewID("exampleexporter")}, + }, + component.MustNewIDWithName("profiles", "middle"): { + Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, + Processors: []component.ID{component.MustNewID("exampleprocessor")}, + Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "mutate")}, + }, + component.MustNewIDWithName("profiles", "out1"): { + Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "mutate")}, + Processors: []component.ID{component.MustNewID("exampleprocessor")}, + Exporters: []component.ID{component.MustNewID("exampleexporter")}, + }, + }, + expectedPerExporter: 2, + }, } for _, test := range tests { @@ -832,18 +1012,19 @@ func TestConnectorPipelinesGraph(t *testing.T) { mutatingPipelines[pipelineID] = expectMutatesData expectedReceivers, expectedExporters := expectedInstances(test.pipelineConfigs, pipelineID) - require.Equal(t, expectedReceivers, len(pipeline.receivers)) + require.Len(t, pipeline.receivers, expectedReceivers) require.Equal(t, len(pipelineCfg.Processors), len(pipeline.processors)) - require.Equal(t, expectedExporters, len(pipeline.exporters)) + require.Len(t, pipeline.exporters, expectedExporters) for _, n := range pipeline.exporters { switch c := n.(type) { case *exporterNode: e := c.Component.(*testcomponents.ExampleExporter) require.True(t, e.Started()) - require.Equal(t, 0, len(e.Traces)) - require.Equal(t, 0, len(e.Metrics)) - require.Equal(t, 0, len(e.Logs)) + require.Empty(t, e.Traces) + require.Empty(t, e.Metrics) + require.Empty(t, e.Logs) + require.Empty(t, e.Profiles) case *connectorNode: // connector needs to be unwrapped to access component as ExampleConnector switch ct := c.Component.(type) { @@ -853,6 +1034,8 @@ func TestConnectorPipelinesGraph(t *testing.T) { require.True(t, ct.(*testcomponents.ExampleConnector).Started()) case connector.Logs: require.True(t, ct.(*testcomponents.ExampleConnector).Started()) + case connectorprofiles.Profiles: + require.True(t, ct.(*testcomponents.ExampleConnector).Started()) } default: require.Fail(t, fmt.Sprintf("unexpected type %T", c)) @@ -876,6 +1059,8 @@ func TestConnectorPipelinesGraph(t *testing.T) { require.True(t, ct.(*testcomponents.ExampleConnector).Started()) case connector.Logs: require.True(t, ct.(*testcomponents.ExampleConnector).Started()) + case connectorprofiles.Profiles: + require.True(t, ct.(*testcomponents.ExampleConnector).Started()) } default: require.Fail(t, fmt.Sprintf("unexpected type %T", c)) @@ -928,6 +1113,10 @@ func TestConnectorPipelinesGraph(t *testing.T) { logsReceiver := c.(*testcomponents.ExampleReceiver) assert.NoError(t, logsReceiver.ConsumeLogs(context.Background(), testdata.GenerateLogs(1))) } + for _, c := range allReceivers[componentprofiles.DataTypeProfiles] { + profilesReceiver := c.(*testcomponents.ExampleReceiver) + assert.NoError(t, profilesReceiver.ConsumeProfiles(context.Background(), testdata.GenerateProfiles(1))) + } // Shut down the entire component graph assert.NoError(t, pg.ShutdownAll(context.Background(), statustest.NewNopStatusReporter())) @@ -950,6 +1139,8 @@ func TestConnectorPipelinesGraph(t *testing.T) { require.True(t, ct.(*testcomponents.ExampleConnector).Stopped()) case connector.Logs: require.True(t, ct.(*testcomponents.ExampleConnector).Stopped()) + case connectorprofiles.Profiles: + require.True(t, ct.(*testcomponents.ExampleConnector).Stopped()) } default: require.Fail(t, fmt.Sprintf("unexpected type %T", c)) @@ -974,6 +1165,8 @@ func TestConnectorPipelinesGraph(t *testing.T) { require.True(t, ct.(*testcomponents.ExampleConnector).Stopped()) case connector.Logs: require.True(t, ct.(*testcomponents.ExampleConnector).Stopped()) + case connectorprofiles.Profiles: + require.True(t, ct.(*testcomponents.ExampleConnector).Stopped()) } default: require.Fail(t, fmt.Sprintf("unexpected type %T", c)) @@ -986,7 +1179,7 @@ func TestConnectorPipelinesGraph(t *testing.T) { allExporters := pg.GetExporters() for _, e := range allExporters[component.DataTypeTraces] { tracesExporter := e.(*testcomponents.ExampleExporter) - assert.Equal(t, test.expectedPerExporter, len(tracesExporter.Traces)) + assert.Len(t, tracesExporter.Traces, test.expectedPerExporter) expectedMutable := testdata.GenerateTraces(1) expectedReadOnly := testdata.GenerateTraces(1) expectedReadOnly.MarkReadOnly() @@ -1000,7 +1193,7 @@ func TestConnectorPipelinesGraph(t *testing.T) { } for _, e := range allExporters[component.DataTypeMetrics] { metricsExporter := e.(*testcomponents.ExampleExporter) - assert.Equal(t, test.expectedPerExporter, len(metricsExporter.Metrics)) + assert.Len(t, metricsExporter.Metrics, test.expectedPerExporter) expectedMutable := testdata.GenerateMetrics(1) expectedReadOnly := testdata.GenerateMetrics(1) expectedReadOnly.MarkReadOnly() @@ -1014,7 +1207,7 @@ func TestConnectorPipelinesGraph(t *testing.T) { } for _, e := range allExporters[component.DataTypeLogs] { logsExporter := e.(*testcomponents.ExampleExporter) - assert.Equal(t, test.expectedPerExporter, len(logsExporter.Logs)) + assert.Len(t, logsExporter.Logs, test.expectedPerExporter) expectedMutable := testdata.GenerateLogs(1) expectedReadOnly := testdata.GenerateLogs(1) expectedReadOnly.MarkReadOnly() @@ -1026,6 +1219,20 @@ func TestConnectorPipelinesGraph(t *testing.T) { } } } + for _, e := range allExporters[componentprofiles.DataTypeProfiles] { + profilesExporter := e.(*testcomponents.ExampleExporter) + assert.Len(t, profilesExporter.Profiles, test.expectedPerExporter) + expectedMutable := testdata.GenerateProfiles(1) + expectedReadOnly := testdata.GenerateProfiles(1) + expectedReadOnly.MarkReadOnly() + for i := 0; i < test.expectedPerExporter; i++ { + if profilesExporter.Profiles[i].IsReadOnly() { + assert.EqualValues(t, expectedReadOnly, profilesExporter.Profiles[i]) + } else { + assert.EqualValues(t, expectedMutable, profilesExporter.Profiles[i]) + } + } + } }) } } @@ -1035,6 +1242,7 @@ func TestConnectorRouter(t *testing.T) { routeTracesID := component.MustNewIDWithName("examplerouter", "traces") routeMetricsID := component.MustNewIDWithName("examplerouter", "metrics") routeLogsID := component.MustNewIDWithName("examplerouter", "logs") + routeProfilesID := component.MustNewIDWithName("examplerouter", "profiles") expRightID := component.MustNewIDWithName("exampleexporter", "right") expLeftID := component.MustNewIDWithName("exampleexporter", "left") @@ -1050,6 +1258,10 @@ func TestConnectorRouter(t *testing.T) { logsRightID := component.MustNewIDWithName("logs", "right") logsLeftID := component.MustNewIDWithName("logs", "left") + profilesInID := component.MustNewIDWithName("profiles", "in") + profilesRightID := component.MustNewIDWithName("profiles", "right") + profilesLeftID := component.MustNewIDWithName("profiles", "left") + ctx := context.Background() set := Settings{ Telemetry: componenttest.NewNopTelemetrySettings(), @@ -1091,6 +1303,12 @@ func TestConnectorRouter(t *testing.T) { Left: logsLeftID, }, }, + routeProfilesID: testcomponents.ExampleRouterConfig{ + Profiles: &testcomponents.LeftRightConfig{ + Right: profilesRightID, + Left: profilesLeftID, + }, + }, }, map[component.Type]connector.Factory{ testcomponents.ExampleRouterFactory.Type(): testcomponents.ExampleRouterFactory, @@ -1133,6 +1351,18 @@ func TestConnectorRouter(t *testing.T) { Receivers: []component.ID{routeLogsID}, Exporters: []component.ID{expLeftID}, }, + profilesInID: { + Receivers: []component.ID{rcvrID}, + Exporters: []component.ID{routeProfilesID}, + }, + profilesRightID: { + Receivers: []component.ID{routeProfilesID}, + Exporters: []component.ID{expRightID}, + }, + profilesLeftID: { + Receivers: []component.ID{routeProfilesID}, + Exporters: []component.ID{expLeftID}, + }, }, } @@ -1151,20 +1381,20 @@ func TestConnectorRouter(t *testing.T) { // Consume 1, validate it went right assert.NoError(t, tracesReceiver.ConsumeTraces(ctx, testdata.GenerateTraces(1))) - assert.Equal(t, 1, len(tracesRight.Traces)) - assert.Equal(t, 0, len(tracesLeft.Traces)) + assert.Len(t, tracesRight.Traces, 1) + assert.Empty(t, tracesLeft.Traces) // Consume 1, validate it went left assert.NoError(t, tracesReceiver.ConsumeTraces(ctx, testdata.GenerateTraces(1))) - assert.Equal(t, 1, len(tracesRight.Traces)) - assert.Equal(t, 1, len(tracesLeft.Traces)) + assert.Len(t, tracesRight.Traces, 1) + assert.Len(t, tracesLeft.Traces, 1) // Consume 3, validate 2 went right, 1 went left assert.NoError(t, tracesReceiver.ConsumeTraces(ctx, testdata.GenerateTraces(1))) assert.NoError(t, tracesReceiver.ConsumeTraces(ctx, testdata.GenerateTraces(1))) assert.NoError(t, tracesReceiver.ConsumeTraces(ctx, testdata.GenerateTraces(1))) - assert.Equal(t, 3, len(tracesRight.Traces)) - assert.Equal(t, 2, len(tracesLeft.Traces)) + assert.Len(t, tracesRight.Traces, 3) + assert.Len(t, tracesLeft.Traces, 2) // Get a handle for the metrics receiver and both Exporters metricsReceiver := allReceivers[component.DataTypeMetrics][rcvrID].(*testcomponents.ExampleReceiver) @@ -1173,20 +1403,20 @@ func TestConnectorRouter(t *testing.T) { // Consume 1, validate it went right assert.NoError(t, metricsReceiver.ConsumeMetrics(ctx, testdata.GenerateMetrics(1))) - assert.Equal(t, 1, len(metricsRight.Metrics)) - assert.Equal(t, 0, len(metricsLeft.Metrics)) + assert.Len(t, metricsRight.Metrics, 1) + assert.Empty(t, metricsLeft.Metrics) // Consume 1, validate it went left assert.NoError(t, metricsReceiver.ConsumeMetrics(ctx, testdata.GenerateMetrics(1))) - assert.Equal(t, 1, len(metricsRight.Metrics)) - assert.Equal(t, 1, len(metricsLeft.Metrics)) + assert.Len(t, metricsRight.Metrics, 1) + assert.Len(t, metricsLeft.Metrics, 1) // Consume 3, validate 2 went right, 1 went left assert.NoError(t, metricsReceiver.ConsumeMetrics(ctx, testdata.GenerateMetrics(1))) assert.NoError(t, metricsReceiver.ConsumeMetrics(ctx, testdata.GenerateMetrics(1))) assert.NoError(t, metricsReceiver.ConsumeMetrics(ctx, testdata.GenerateMetrics(1))) - assert.Equal(t, 3, len(metricsRight.Metrics)) - assert.Equal(t, 2, len(metricsLeft.Metrics)) + assert.Len(t, metricsRight.Metrics, 3) + assert.Len(t, metricsLeft.Metrics, 2) // Get a handle for the logs receiver and both Exporters logsReceiver := allReceivers[component.DataTypeLogs][rcvrID].(*testcomponents.ExampleReceiver) @@ -1195,20 +1425,42 @@ func TestConnectorRouter(t *testing.T) { // Consume 1, validate it went right assert.NoError(t, logsReceiver.ConsumeLogs(ctx, testdata.GenerateLogs(1))) - assert.Equal(t, 1, len(logsRight.Logs)) - assert.Equal(t, 0, len(logsLeft.Logs)) + assert.Len(t, logsRight.Logs, 1) + assert.Empty(t, logsLeft.Logs) // Consume 1, validate it went left assert.NoError(t, logsReceiver.ConsumeLogs(ctx, testdata.GenerateLogs(1))) - assert.Equal(t, 1, len(logsRight.Logs)) - assert.Equal(t, 1, len(logsLeft.Logs)) + assert.Len(t, logsRight.Logs, 1) + assert.Len(t, logsLeft.Logs, 1) // Consume 3, validate 2 went right, 1 went left assert.NoError(t, logsReceiver.ConsumeLogs(ctx, testdata.GenerateLogs(1))) assert.NoError(t, logsReceiver.ConsumeLogs(ctx, testdata.GenerateLogs(1))) assert.NoError(t, logsReceiver.ConsumeLogs(ctx, testdata.GenerateLogs(1))) - assert.Equal(t, 3, len(logsRight.Logs)) - assert.Equal(t, 2, len(logsLeft.Logs)) + assert.Len(t, logsRight.Logs, 3) + assert.Len(t, logsLeft.Logs, 2) + + // Get a handle for the profiles receiver and both Exporters + profilesReceiver := allReceivers[componentprofiles.DataTypeProfiles][rcvrID].(*testcomponents.ExampleReceiver) + profilesRight := allExporters[componentprofiles.DataTypeProfiles][expRightID].(*testcomponents.ExampleExporter) + profilesLeft := allExporters[componentprofiles.DataTypeProfiles][expLeftID].(*testcomponents.ExampleExporter) + + // Consume 1, validate it went right + assert.NoError(t, profilesReceiver.ConsumeProfiles(ctx, testdata.GenerateProfiles(1))) + assert.Len(t, profilesRight.Profiles, 1) + assert.Empty(t, profilesLeft.Profiles) + + // Consume 1, validate it went left + assert.NoError(t, profilesReceiver.ConsumeProfiles(ctx, testdata.GenerateProfiles(1))) + assert.Len(t, profilesRight.Profiles, 1) + assert.Len(t, profilesLeft.Profiles, 1) + + // Consume 3, validate 2 went right, 1 went left + assert.NoError(t, profilesReceiver.ConsumeProfiles(ctx, testdata.GenerateProfiles(1))) + assert.NoError(t, profilesReceiver.ConsumeProfiles(ctx, testdata.GenerateProfiles(1))) + assert.NoError(t, profilesReceiver.ConsumeProfiles(ctx, testdata.GenerateProfiles(1))) + assert.Len(t, profilesRight.Profiles, 3) + assert.Len(t, profilesLeft.Profiles, 2) } @@ -1280,6 +1532,22 @@ func TestGraphBuildErrors(t *testing.T) { }, expected: "failed to create \"bf\" exporter for data type \"traces\": telemetry type is not supported", }, + { + name: "not_supported_exporter_profiles", + receiverCfgs: map[component.ID]component.Config{ + component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), + }, + exporterCfgs: map[component.ID]component.Config{ + component.MustNewID("bf"): badExporterFactory.CreateDefaultConfig(), + }, + pipelineCfgs: pipelines.Config{ + component.MustNewID("profiles"): { + Receivers: []component.ID{component.MustNewID("nop")}, + Exporters: []component.ID{component.MustNewID("bf")}, + }, + }, + expected: "failed to create \"bf\" exporter for data type \"profiles\": telemetry type is not supported", + }, { name: "not_supported_processor_logs", receiverCfgs: map[component.ID]component.Config{ @@ -1340,6 +1608,26 @@ func TestGraphBuildErrors(t *testing.T) { }, expected: "failed to create \"bf\" processor, in pipeline \"traces\": telemetry type is not supported", }, + { + name: "not_supported_processor_profiles", + receiverCfgs: map[component.ID]component.Config{ + component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), + }, + processorCfgs: map[component.ID]component.Config{ + component.MustNewID("bf"): badProcessorFactory.CreateDefaultConfig(), + }, + exporterCfgs: map[component.ID]component.Config{ + component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), + }, + pipelineCfgs: pipelines.Config{ + component.MustNewID("profiles"): { + Receivers: []component.ID{component.MustNewID("nop")}, + Processors: []component.ID{component.MustNewID("bf")}, + Exporters: []component.ID{component.MustNewID("nop")}, + }, + }, + expected: "failed to create \"bf\" processor, in pipeline \"profiles\": telemetry type is not supported", + }, { name: "not_supported_receiver_logs", receiverCfgs: map[component.ID]component.Config{ @@ -1388,6 +1676,22 @@ func TestGraphBuildErrors(t *testing.T) { }, expected: "failed to create \"bf\" receiver for data type \"traces\": telemetry type is not supported", }, + { + name: "not_supported_receiver_profiles", + receiverCfgs: map[component.ID]component.Config{ + component.MustNewID("bf"): badReceiverFactory.CreateDefaultConfig(), + }, + exporterCfgs: map[component.ID]component.Config{ + component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), + }, + pipelineCfgs: pipelines.Config{ + component.MustNewID("profiles"): { + Receivers: []component.ID{component.MustNewID("bf")}, + Exporters: []component.ID{component.MustNewID("nop")}, + }, + }, + expected: "failed to create \"bf\" receiver for data type \"profiles\": telemetry type is not supported", + }, { name: "not_supported_connector_traces_traces.yaml", receiverCfgs: map[component.ID]component.Config{ @@ -1457,6 +1761,29 @@ func TestGraphBuildErrors(t *testing.T) { }, expected: "connector \"bf\" used as exporter in traces pipeline but not used in any supported receiver pipeline", }, + { + name: "not_supported_connector_traces_profiles.yaml", + receiverCfgs: map[component.ID]component.Config{ + component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), + }, + exporterCfgs: map[component.ID]component.Config{ + component.MustNewID("nop"): nopExporterFactory.CreateDefaultConfig(), + }, + connectorCfgs: map[component.ID]component.Config{ + component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), + }, + pipelineCfgs: pipelines.Config{ + component.MustNewIDWithName("traces", "in"): { + Receivers: []component.ID{component.MustNewID("nop")}, + Exporters: []component.ID{component.MustNewID("bf")}, + }, + component.MustNewIDWithName("profiles", "out"): { + Receivers: []component.ID{component.MustNewID("bf")}, + Exporters: []component.ID{component.MustNewID("nop")}, + }, + }, + expected: "connector \"bf\" used as exporter in traces pipeline but not used in any supported receiver pipeline", + }, { name: "not_supported_connector_metrics_traces.yaml", receiverCfgs: map[component.ID]component.Config{ @@ -1526,6 +1853,29 @@ func TestGraphBuildErrors(t *testing.T) { }, expected: "connector \"bf\" used as exporter in metrics pipeline but not used in any supported receiver pipeline", }, + { + name: "not_supported_connector_metrics_profiles.yaml", + receiverCfgs: map[component.ID]component.Config{ + component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), + }, + exporterCfgs: map[component.ID]component.Config{ + component.MustNewID("nop"): nopExporterFactory.CreateDefaultConfig(), + }, + connectorCfgs: map[component.ID]component.Config{ + component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), + }, + pipelineCfgs: pipelines.Config{ + component.MustNewIDWithName("metrics", "in"): { + Receivers: []component.ID{component.MustNewID("nop")}, + Exporters: []component.ID{component.MustNewID("bf")}, + }, + component.MustNewIDWithName("profiles", "out"): { + Receivers: []component.ID{component.MustNewID("bf")}, + Exporters: []component.ID{component.MustNewID("nop")}, + }, + }, + expected: "connector \"bf\" used as exporter in metrics pipeline but not used in any supported receiver pipeline", + }, { name: "not_supported_connector_logs_traces.yaml", receiverCfgs: map[component.ID]component.Config{ @@ -1595,6 +1945,121 @@ func TestGraphBuildErrors(t *testing.T) { }, expected: "connector \"bf\" used as exporter in logs pipeline but not used in any supported receiver pipeline", }, + { + name: "not_supported_connector_logs_profiles.yaml", + receiverCfgs: map[component.ID]component.Config{ + component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), + }, + exporterCfgs: map[component.ID]component.Config{ + component.MustNewID("nop"): nopExporterFactory.CreateDefaultConfig(), + }, + connectorCfgs: map[component.ID]component.Config{ + component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), + }, + pipelineCfgs: pipelines.Config{ + component.MustNewIDWithName("logs", "in"): { + Receivers: []component.ID{component.MustNewID("nop")}, + Exporters: []component.ID{component.MustNewID("bf")}, + }, + component.MustNewIDWithName("profiles", "out"): { + Receivers: []component.ID{component.MustNewID("bf")}, + Exporters: []component.ID{component.MustNewID("nop")}, + }, + }, + expected: "connector \"bf\" used as exporter in logs pipeline but not used in any supported receiver pipeline", + }, + { + name: "not_supported_connector_profiles_traces.yaml", + receiverCfgs: map[component.ID]component.Config{ + component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), + }, + exporterCfgs: map[component.ID]component.Config{ + component.MustNewID("nop"): nopExporterFactory.CreateDefaultConfig(), + }, + connectorCfgs: map[component.ID]component.Config{ + component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), + }, + pipelineCfgs: pipelines.Config{ + component.MustNewIDWithName("profiles", "in"): { + Receivers: []component.ID{component.MustNewID("nop")}, + Exporters: []component.ID{component.MustNewID("bf")}, + }, + component.MustNewIDWithName("traces", "out"): { + Receivers: []component.ID{component.MustNewID("bf")}, + Exporters: []component.ID{component.MustNewID("nop")}, + }, + }, + expected: "connector \"bf\" used as exporter in profiles pipeline but not used in any supported receiver pipeline", + }, + { + name: "not_supported_connector_profiles_metrics.yaml", + receiverCfgs: map[component.ID]component.Config{ + component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), + }, + exporterCfgs: map[component.ID]component.Config{ + component.MustNewID("nop"): nopExporterFactory.CreateDefaultConfig(), + }, + connectorCfgs: map[component.ID]component.Config{ + component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), + }, + pipelineCfgs: pipelines.Config{ + component.MustNewIDWithName("profiles", "in"): { + Receivers: []component.ID{component.MustNewID("nop")}, + Exporters: []component.ID{component.MustNewID("bf")}, + }, + component.MustNewIDWithName("metrics", "out"): { + Receivers: []component.ID{component.MustNewID("bf")}, + Exporters: []component.ID{component.MustNewID("nop")}, + }, + }, + expected: "connector \"bf\" used as exporter in profiles pipeline but not used in any supported receiver pipeline", + }, + { + name: "not_supported_connector_profiles_logs.yaml", + receiverCfgs: map[component.ID]component.Config{ + component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), + }, + exporterCfgs: map[component.ID]component.Config{ + component.MustNewID("nop"): nopExporterFactory.CreateDefaultConfig(), + }, + connectorCfgs: map[component.ID]component.Config{ + component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), + }, + pipelineCfgs: pipelines.Config{ + component.MustNewIDWithName("profiles", "in"): { + Receivers: []component.ID{component.MustNewID("nop")}, + Exporters: []component.ID{component.MustNewID("bf")}, + }, + component.MustNewIDWithName("logs", "out"): { + Receivers: []component.ID{component.MustNewID("bf")}, + Exporters: []component.ID{component.MustNewID("nop")}, + }, + }, + expected: "connector \"bf\" used as exporter in profiles pipeline but not used in any supported receiver pipeline", + }, + { + name: "not_supported_connector_profiles_profiles.yaml", + receiverCfgs: map[component.ID]component.Config{ + component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), + }, + exporterCfgs: map[component.ID]component.Config{ + component.MustNewID("nop"): nopExporterFactory.CreateDefaultConfig(), + }, + connectorCfgs: map[component.ID]component.Config{ + component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), + }, + pipelineCfgs: pipelines.Config{ + component.MustNewIDWithName("profiles", "in"): { + Receivers: []component.ID{component.MustNewID("nop")}, + Exporters: []component.ID{component.MustNewID("bf")}, + }, + component.MustNewIDWithName("profiles", "out"): { + Receivers: []component.ID{component.MustNewID("bf")}, + Exporters: []component.ID{component.MustNewID("nop")}, + }, + }, + expected: "connector \"bf\" used as exporter in profiles pipeline but not used in any supported receiver pipeline", + }, { name: "orphaned-connector-use-as-exporter", receiverCfgs: map[component.ID]component.Config{ @@ -1765,6 +2230,32 @@ func TestGraphBuildErrors(t *testing.T) { `processor "nop" in pipeline "logs" -> ` + `connector "nop/conn" (logs to logs)`, }, + { + name: "not_allowed_simple_cycle_profiles.yaml", + receiverCfgs: map[component.ID]component.Config{ + component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), + }, + processorCfgs: map[component.ID]component.Config{ + component.MustNewID("nop"): nopProcessorFactory.CreateDefaultConfig(), + }, + exporterCfgs: map[component.ID]component.Config{ + component.MustNewID("nop"): nopExporterFactory.CreateDefaultConfig(), + }, + connectorCfgs: map[component.ID]component.Config{ + component.MustNewIDWithName("nop", "conn"): nopConnectorFactory.CreateDefaultConfig(), + }, + pipelineCfgs: pipelines.Config{ + component.MustNewID("profiles"): { + Receivers: []component.ID{component.MustNewIDWithName("nop", "conn")}, + Processors: []component.ID{component.MustNewID("nop")}, + Exporters: []component.ID{component.MustNewIDWithName("nop", "conn")}, + }, + }, + expected: `cycle detected: ` + + `connector "nop/conn" (profiles to profiles) -> ` + + `processor "nop" in pipeline "profiles" -> ` + + `connector "nop/conn" (profiles to profiles)`, + }, { name: "not_allowed_deep_cycle_traces.yaml", receiverCfgs: map[component.ID]component.Config{ @@ -1900,6 +2391,51 @@ func TestGraphBuildErrors(t *testing.T) { `processor "nop" in pipeline "logs/1" -> ` + `connector "nop/conn1" (logs to logs)`, }, + { + name: "not_allowed_deep_cycle_profiles.yaml", + receiverCfgs: map[component.ID]component.Config{ + component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), + }, + processorCfgs: map[component.ID]component.Config{ + component.MustNewID("nop"): nopProcessorFactory.CreateDefaultConfig(), + }, + exporterCfgs: map[component.ID]component.Config{ + component.MustNewID("nop"): nopExporterFactory.CreateDefaultConfig(), + }, + connectorCfgs: map[component.ID]component.Config{ + component.MustNewIDWithName("nop", "conn"): nopConnectorFactory.CreateDefaultConfig(), + component.MustNewIDWithName("nop", "conn1"): nopConnectorFactory.CreateDefaultConfig(), + component.MustNewIDWithName("nop", "conn2"): nopConnectorFactory.CreateDefaultConfig(), + }, + pipelineCfgs: pipelines.Config{ + component.MustNewIDWithName("profiles", "in"): { + Receivers: []component.ID{component.MustNewID("nop")}, + Processors: []component.ID{component.MustNewID("nop")}, + Exporters: []component.ID{component.MustNewIDWithName("nop", "conn")}, + }, + component.MustNewIDWithName("profiles", "1"): { + Receivers: []component.ID{component.MustNewIDWithName("nop", "conn")}, + Processors: []component.ID{component.MustNewID("nop")}, + Exporters: []component.ID{component.MustNewIDWithName("nop", "conn1")}, + }, + component.MustNewIDWithName("profiles", "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")}, + }, + component.MustNewIDWithName("profiles", "out"): { + Receivers: []component.ID{component.MustNewIDWithName("nop", "conn2")}, + Processors: []component.ID{component.MustNewID("nop")}, + Exporters: []component.ID{component.MustNewID("nop")}, + }, + }, + expected: `cycle detected: ` + + `connector "nop/conn1" (profiles to profiles) -> ` + + `processor "nop" in pipeline "profiles/2" -> ` + + `connector "nop/conn" (profiles to profiles) -> ` + + `processor "nop" in pipeline "profiles/1" -> ` + + `connector "nop/conn1" (profiles to profiles)`, + }, { name: "not_allowed_deep_cycle_multi_signal.yaml", receiverCfgs: map[component.ID]component.Config{ @@ -2408,6 +2944,7 @@ func (g *Graph) getReceivers() map[component.DataType]map[component.ID]component receiversMap[component.DataTypeTraces] = make(map[component.ID]component.Component) receiversMap[component.DataTypeMetrics] = make(map[component.ID]component.Component) receiversMap[component.DataTypeLogs] = make(map[component.ID]component.Component) + receiversMap[componentprofiles.DataTypeProfiles] = make(map[component.ID]component.Component) for _, pg := range g.pipelines { for _, rcvrNode := range pg.receivers { @@ -2511,6 +3048,9 @@ func newErrReceiverFactory() receiver.Factory { receiver.WithMetrics(func(context.Context, receiver.Settings, component.Config, consumer.Metrics) (receiver.Metrics, error) { return &errComponent{}, nil }, component.StabilityLevelUndefined), + receiverprofiles.WithProfiles(func(context.Context, receiver.Settings, component.Config, consumerprofiles.Profiles) (receiverprofiles.Profiles, error) { + return &errComponent{}, nil + }, component.StabilityLevelUndefined), ) } @@ -2526,6 +3066,9 @@ func newErrProcessorFactory() processor.Factory { processor.WithMetrics(func(context.Context, processor.Settings, component.Config, consumer.Metrics) (processor.Metrics, error) { return &errComponent{}, nil }, component.StabilityLevelUndefined), + processorprofiles.WithProfiles(func(context.Context, processor.Settings, component.Config, consumerprofiles.Profiles) (processorprofiles.Profiles, error) { + return &errComponent{}, nil + }, component.StabilityLevelUndefined), ) } @@ -2541,6 +3084,9 @@ func newErrExporterFactory() exporter.Factory { exporter.WithMetrics(func(context.Context, exporter.Settings, component.Config) (exporter.Metrics, error) { return &errComponent{}, nil }, component.StabilityLevelUndefined), + exporterprofiles.WithProfiles(func(context.Context, exporter.Settings, component.Config) (exporterprofiles.Profiles, error) { + return &errComponent{}, nil + }, component.StabilityLevelUndefined), ) } @@ -2557,6 +3103,9 @@ func newErrConnectorFactory() connector.Factory { connector.WithTracesToLogs(func(context.Context, connector.Settings, component.Config, consumer.Logs) (connector.Traces, error) { return &errComponent{}, nil }, component.StabilityLevelUnmaintained), + connectorprofiles.WithTracesToProfiles(func(context.Context, connector.Settings, component.Config, consumerprofiles.Profiles) (connector.Traces, error) { + return &errComponent{}, nil + }, component.StabilityLevelUnmaintained), connector.WithMetricsToTraces(func(context.Context, connector.Settings, component.Config, consumer.Traces) (connector.Metrics, error) { return &errComponent{}, nil @@ -2567,6 +3116,9 @@ func newErrConnectorFactory() connector.Factory { connector.WithMetricsToLogs(func(context.Context, connector.Settings, component.Config, consumer.Logs) (connector.Metrics, error) { return &errComponent{}, nil }, component.StabilityLevelUnmaintained), + connectorprofiles.WithMetricsToProfiles(func(context.Context, connector.Settings, component.Config, consumerprofiles.Profiles) (connector.Metrics, error) { + return &errComponent{}, nil + }, component.StabilityLevelUnmaintained), connector.WithLogsToTraces(func(context.Context, connector.Settings, component.Config, consumer.Traces) (connector.Logs, error) { return &errComponent{}, nil @@ -2577,6 +3129,22 @@ func newErrConnectorFactory() connector.Factory { connector.WithLogsToLogs(func(context.Context, connector.Settings, component.Config, consumer.Logs) (connector.Logs, error) { return &errComponent{}, nil }, component.StabilityLevelUnmaintained), + connectorprofiles.WithLogsToProfiles(func(context.Context, connector.Settings, component.Config, consumerprofiles.Profiles) (connector.Logs, error) { + return &errComponent{}, nil + }, component.StabilityLevelUnmaintained), + + connectorprofiles.WithProfilesToTraces(func(context.Context, connector.Settings, component.Config, consumer.Traces) (connectorprofiles.Profiles, error) { + return &errComponent{}, nil + }, component.StabilityLevelUnmaintained), + connectorprofiles.WithProfilesToMetrics(func(context.Context, connector.Settings, component.Config, consumer.Metrics) (connectorprofiles.Profiles, error) { + return &errComponent{}, nil + }, component.StabilityLevelUnmaintained), + connectorprofiles.WithProfilesToLogs(func(context.Context, connector.Settings, component.Config, consumer.Logs) (connectorprofiles.Profiles, error) { + return &errComponent{}, nil + }, component.StabilityLevelUnmaintained), + connectorprofiles.WithProfilesToProfiles(func(context.Context, connector.Settings, component.Config, consumerprofiles.Profiles) (connectorprofiles.Profiles, error) { + return &errComponent{}, nil + }, component.StabilityLevelUnmaintained), ) } diff --git a/service/internal/graph/host.go b/service/internal/graph/host.go index 7cc85be6665..abadca4b4af 100644 --- a/service/internal/graph/host.go +++ b/service/internal/graph/host.go @@ -29,11 +29,11 @@ var _ component.Host = (*Host)(nil) type Host struct { AsyncErrorChannel chan error - Receivers builders.Receiver - Processors builders.Processor - Exporters builders.Exporter - Connectors builders.Connector - Extensions builders.Extension + Receivers *builders.ReceiverBuilder + Processors *builders.ProcessorBuilder + Exporters *builders.ExporterBuilder + Connectors *builders.ConnectorBuilder + Extensions *builders.ExtensionBuilder ModuleInfo extension.ModuleInfo BuildInfo component.BuildInfo diff --git a/service/internal/graph/nodes.go b/service/internal/graph/nodes.go index 0a4e9ce4064..f9cc3e6fa7a 100644 --- a/service/internal/graph/nodes.go +++ b/service/internal/graph/nodes.go @@ -10,8 +10,11 @@ import ( "strings" "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/exporter" "go.opentelemetry.io/collector/internal/fanoutconsumer" "go.opentelemetry.io/collector/processor" @@ -71,7 +74,7 @@ func newReceiverNode(pipelineType component.DataType, recvID component.ID) *rece func (n *receiverNode) buildComponent(ctx context.Context, tel component.TelemetrySettings, info component.BuildInfo, - builder builders.Receiver, + builder *builders.ReceiverBuilder, nexts []baseConsumer, ) error { tel.Logger = components.ReceiverLogger(tel.Logger, n.componentID, n.pipelineType) @@ -96,6 +99,12 @@ 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.DataTypeProfiles: + var consumers []consumerprofiles.Profiles + for _, next := range nexts { + consumers = append(consumers, next.(consumerprofiles.Profiles)) + } + n.Component, err = builder.CreateProfiles(ctx, set, fanoutconsumer.NewProfiles(consumers)) default: return fmt.Errorf("error creating receiver %q for data type %q is not supported", set.ID, n.pipelineType) } @@ -131,7 +140,7 @@ func (n *processorNode) getConsumer() baseConsumer { func (n *processorNode) buildComponent(ctx context.Context, tel component.TelemetrySettings, info component.BuildInfo, - builder builders.Processor, + builder *builders.ProcessorBuilder, next baseConsumer, ) error { tel.Logger = components.ProcessorLogger(tel.Logger, n.componentID, n.pipelineID) @@ -144,6 +153,8 @@ func (n *processorNode) buildComponent(ctx context.Context, n.Component, err = builder.CreateMetrics(ctx, set, next.(consumer.Metrics)) case component.DataTypeLogs: n.Component, err = builder.CreateLogs(ctx, set, next.(consumer.Logs)) + case componentprofiles.DataTypeProfiles: + 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, n.pipelineID.Type()) } @@ -180,7 +191,7 @@ func (n *exporterNode) buildComponent( ctx context.Context, tel component.TelemetrySettings, info component.BuildInfo, - builder builders.Exporter, + builder *builders.ExporterBuilder, ) error { tel.Logger = components.ExporterLogger(tel.Logger, n.componentID, n.pipelineType) set := exporter.Settings{ID: n.componentID, TelemetrySettings: tel, BuildInfo: info} @@ -192,6 +203,8 @@ func (n *exporterNode) buildComponent( n.Component, err = builder.CreateMetrics(ctx, set) case component.DataTypeLogs: n.Component, err = builder.CreateLogs(ctx, set) + case componentprofiles.DataTypeProfiles: + 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) } @@ -231,7 +244,7 @@ func (n *connectorNode) buildComponent( ctx context.Context, tel component.TelemetrySettings, info component.BuildInfo, - builder builders.Connector, + builder *builders.ConnectorBuilder, nexts []baseConsumer, ) error { tel.Logger = components.ConnectorLogger(tel.Logger, n.componentID, n.exprPipelineType, n.rcvrPipelineType) @@ -272,6 +285,12 @@ func (n *connectorNode) buildComponent( return err } n.Component, n.baseConsumer = conn, conn + case componentprofiles.DataTypeProfiles: + conn, err := builder.CreateProfilesToTraces(ctx, set, next) + if err != nil { + return err + } + n.Component, n.baseConsumer = conn, conn } case component.DataTypeMetrics: @@ -308,6 +327,12 @@ func (n *connectorNode) buildComponent( return err } n.Component, n.baseConsumer = conn, conn + case componentprofiles.DataTypeProfiles: + conn, err := builder.CreateProfilesToMetrics(ctx, set, next) + if err != nil { + return err + } + n.Component, n.baseConsumer = conn, conn } case component.DataTypeLogs: capability := consumer.Capabilities{MutatesData: false} @@ -343,6 +368,53 @@ func (n *connectorNode) buildComponent( // that the connector itself may MutatesData. capability.MutatesData = capability.MutatesData || conn.Capabilities().MutatesData n.baseConsumer = capabilityconsumer.NewLogs(conn, capability) + case componentprofiles.DataTypeProfiles: + conn, err := builder.CreateProfilesToLogs(ctx, set, next) + if err != nil { + return err + } + n.Component, n.baseConsumer = conn, conn + } + case componentprofiles.DataTypeProfiles: + capability := consumer.Capabilities{MutatesData: false} + consumers := make(map[component.ID]consumerprofiles.Profiles, len(nexts)) + for _, next := range nexts { + consumers[next.(*capabilitiesNode).pipelineID] = next.(consumerprofiles.Profiles) + capability.MutatesData = capability.MutatesData || next.Capabilities().MutatesData + } + next := connectorprofiles.NewProfilesRouter(consumers) + + switch n.exprPipelineType { + case component.DataTypeTraces: + conn, err := builder.CreateTracesToProfiles(ctx, set, next) + if err != nil { + return err + } + n.Component, n.baseConsumer = conn, conn + case component.DataTypeMetrics: + conn, err := builder.CreateMetricsToProfiles(ctx, set, next) + if err != nil { + return err + } + n.Component, n.baseConsumer = conn, conn + case component.DataTypeLogs: + conn, err := builder.CreateLogsToProfiles(ctx, set, next) + if err != nil { + return err + } + n.Component, n.baseConsumer = conn, conn + case componentprofiles.DataTypeProfiles: + conn, err := builder.CreateProfilesToProfiles(ctx, set, next) + if err != nil { + return err + } + n.Component = conn + // When connecting pipelines of the same data type, the connector must + // inherit the capabilities of pipelines in which it is acting as a receiver. + // Since the incoming and outgoing data types are the same, we must also consider + // that the connector itself may MutatesData. + capability.MutatesData = capability.MutatesData || conn.Capabilities().MutatesData + n.baseConsumer = capabilityconsumer.NewProfiles(conn, capability) } } return nil @@ -362,6 +434,7 @@ type capabilitiesNode struct { consumer.ConsumeTracesFunc consumer.ConsumeMetricsFunc consumer.ConsumeLogsFunc + consumerprofiles.ConsumeProfilesFunc } func newCapabilitiesNode(pipelineID component.ID) *capabilitiesNode { diff --git a/service/internal/metadata/generated_telemetry.go b/service/internal/metadata/generated_telemetry.go index c08e6cd7cd3..5c60998cb83 100644 --- a/service/internal/metadata/generated_telemetry.go +++ b/service/internal/metadata/generated_telemetry.go @@ -45,75 +45,83 @@ type TelemetryBuilder struct { meters map[configtelemetry.Level]metric.Meter } -// telemetryBuilderOption applies changes to default builder. -type telemetryBuilderOption func(*TelemetryBuilder) +// TelemetryBuilderOption applies changes to default builder. +type TelemetryBuilderOption interface { + apply(*TelemetryBuilder) +} + +type telemetryBuilderOptionFunc func(mb *TelemetryBuilder) + +func (tbof telemetryBuilderOptionFunc) apply(mb *TelemetryBuilder) { + tbof(mb) +} // WithProcessCPUSecondsCallback sets callback for observable ProcessCPUSeconds metric. -func WithProcessCPUSecondsCallback(cb func() float64, opts ...metric.ObserveOption) telemetryBuilderOption { - return func(builder *TelemetryBuilder) { +func WithProcessCPUSecondsCallback(cb func() float64, opts ...metric.ObserveOption) TelemetryBuilderOption { + return telemetryBuilderOptionFunc(func(builder *TelemetryBuilder) { builder.observeProcessCPUSeconds = func(_ context.Context, o metric.Observer) error { o.ObserveFloat64(builder.ProcessCPUSeconds, cb(), opts...) return nil } - } + }) } // WithProcessMemoryRssCallback sets callback for observable ProcessMemoryRss metric. -func WithProcessMemoryRssCallback(cb func() int64, opts ...metric.ObserveOption) telemetryBuilderOption { - return func(builder *TelemetryBuilder) { +func WithProcessMemoryRssCallback(cb func() int64, opts ...metric.ObserveOption) TelemetryBuilderOption { + return telemetryBuilderOptionFunc(func(builder *TelemetryBuilder) { builder.observeProcessMemoryRss = func(_ context.Context, o metric.Observer) error { o.ObserveInt64(builder.ProcessMemoryRss, cb(), opts...) return nil } - } + }) } // WithProcessRuntimeHeapAllocBytesCallback sets callback for observable ProcessRuntimeHeapAllocBytes metric. -func WithProcessRuntimeHeapAllocBytesCallback(cb func() int64, opts ...metric.ObserveOption) telemetryBuilderOption { - return func(builder *TelemetryBuilder) { +func WithProcessRuntimeHeapAllocBytesCallback(cb func() int64, opts ...metric.ObserveOption) TelemetryBuilderOption { + return telemetryBuilderOptionFunc(func(builder *TelemetryBuilder) { builder.observeProcessRuntimeHeapAllocBytes = func(_ context.Context, o metric.Observer) error { o.ObserveInt64(builder.ProcessRuntimeHeapAllocBytes, cb(), opts...) return nil } - } + }) } // WithProcessRuntimeTotalAllocBytesCallback sets callback for observable ProcessRuntimeTotalAllocBytes metric. -func WithProcessRuntimeTotalAllocBytesCallback(cb func() int64, opts ...metric.ObserveOption) telemetryBuilderOption { - return func(builder *TelemetryBuilder) { +func WithProcessRuntimeTotalAllocBytesCallback(cb func() int64, opts ...metric.ObserveOption) TelemetryBuilderOption { + return telemetryBuilderOptionFunc(func(builder *TelemetryBuilder) { builder.observeProcessRuntimeTotalAllocBytes = func(_ context.Context, o metric.Observer) error { o.ObserveInt64(builder.ProcessRuntimeTotalAllocBytes, cb(), opts...) return nil } - } + }) } // WithProcessRuntimeTotalSysMemoryBytesCallback sets callback for observable ProcessRuntimeTotalSysMemoryBytes metric. -func WithProcessRuntimeTotalSysMemoryBytesCallback(cb func() int64, opts ...metric.ObserveOption) telemetryBuilderOption { - return func(builder *TelemetryBuilder) { +func WithProcessRuntimeTotalSysMemoryBytesCallback(cb func() int64, opts ...metric.ObserveOption) TelemetryBuilderOption { + return telemetryBuilderOptionFunc(func(builder *TelemetryBuilder) { builder.observeProcessRuntimeTotalSysMemoryBytes = func(_ context.Context, o metric.Observer) error { o.ObserveInt64(builder.ProcessRuntimeTotalSysMemoryBytes, cb(), opts...) return nil } - } + }) } // WithProcessUptimeCallback sets callback for observable ProcessUptime metric. -func WithProcessUptimeCallback(cb func() float64, opts ...metric.ObserveOption) telemetryBuilderOption { - return func(builder *TelemetryBuilder) { +func WithProcessUptimeCallback(cb func() float64, opts ...metric.ObserveOption) TelemetryBuilderOption { + return telemetryBuilderOptionFunc(func(builder *TelemetryBuilder) { builder.observeProcessUptime = func(_ context.Context, o metric.Observer) error { o.ObserveFloat64(builder.ProcessUptime, cb(), opts...) return nil } - } + }) } // NewTelemetryBuilder provides a struct with methods to update all internal telemetry // for a component -func NewTelemetryBuilder(settings component.TelemetrySettings, options ...telemetryBuilderOption) (*TelemetryBuilder, error) { +func NewTelemetryBuilder(settings component.TelemetrySettings, options ...TelemetryBuilderOption) (*TelemetryBuilder, error) { builder := TelemetryBuilder{meters: map[configtelemetry.Level]metric.Meter{}} for _, op := range options { - op(&builder) + op.apply(&builder) } builder.meters[configtelemetry.LevelBasic] = LeveledMeter(settings, configtelemetry.LevelBasic) var err, errs error diff --git a/service/internal/metadata/generated_telemetry_test.go b/service/internal/metadata/generated_telemetry_test.go index c8f5f6fb6e7..6e64350d4c5 100644 --- a/service/internal/metadata/generated_telemetry_test.go +++ b/service/internal/metadata/generated_telemetry_test.go @@ -75,9 +75,9 @@ func TestNewTelemetryBuilder(t *testing.T) { TracerProvider: mockTracerProvider{}, } applied := false - _, err := NewTelemetryBuilder(set, func(b *TelemetryBuilder) { + _, err := NewTelemetryBuilder(set, telemetryBuilderOptionFunc(func(b *TelemetryBuilder) { applied = true - }) + })) require.NoError(t, err) require.True(t, applied) } diff --git a/service/internal/proctelemetry/process_telemetry_linux_test.go b/service/internal/proctelemetry/process_telemetry_linux_test.go index 99471b4eca2..2b848ad792d 100644 --- a/service/internal/proctelemetry/process_telemetry_linux_test.go +++ b/service/internal/proctelemetry/process_telemetry_linux_test.go @@ -32,7 +32,7 @@ func TestProcessTelemetryWithHostProc(t *testing.T) { for _, metricName := range expectedMetrics { metric, ok := mp[metricName] require.True(t, ok) - require.True(t, len(metric.Metric) == 1) + require.Len(t, metric.Metric, 1) var metricValue float64 if metric.GetType() == io_prometheus_client.MetricType_COUNTER { metricValue = metric.Metric[0].GetCounter().GetValue() diff --git a/service/internal/proctelemetry/process_telemetry_test.go b/service/internal/proctelemetry/process_telemetry_test.go index 466605ce8a4..9411e7bb398 100644 --- a/service/internal/proctelemetry/process_telemetry_test.go +++ b/service/internal/proctelemetry/process_telemetry_test.go @@ -93,7 +93,7 @@ func TestProcessTelemetry(t *testing.T) { for _, metricName := range expectedMetrics { metric, ok := mp[metricName] require.True(t, ok) - require.True(t, len(metric.Metric) == 1) + require.Len(t, metric.Metric, 1) var metricValue float64 if metric.GetType() == io_prometheus_client.MetricType_COUNTER { metricValue = metric.Metric[0].GetCounter().GetValue() diff --git a/service/internal/resource/config_test.go b/service/internal/resource/config_test.go index 38fcba1a139..950054132fa 100644 --- a/service/internal/resource/config_test.go +++ b/service/internal/resource/config_test.go @@ -124,7 +124,7 @@ func TestBuildResource(t *testing.T) { otelRes := New(buildInfo, resMap) res := pdataFromSdk(otelRes) - assert.Equal(t, res.Attributes().Len(), 3) + assert.Equal(t, 3, res.Attributes().Len()) value, ok := res.Attributes().Get(semconv.AttributeServiceName) assert.True(t, ok) assert.Equal(t, buildInfo.Command, value.AsString()) @@ -145,7 +145,7 @@ func TestBuildResource(t *testing.T) { res = pdataFromSdk(otelRes) // Attributes should not exist since we nil-ified all. - assert.Equal(t, res.Attributes().Len(), 0) + assert.Equal(t, 0, res.Attributes().Len()) // Check override values strPtr := func(v string) *string { return &v } @@ -157,7 +157,7 @@ func TestBuildResource(t *testing.T) { otelRes = New(buildInfo, resMap) res = pdataFromSdk(otelRes) - assert.Equal(t, res.Attributes().Len(), 3) + assert.Equal(t, 3, res.Attributes().Len()) value, ok = res.Attributes().Get(semconv.AttributeServiceName) assert.True(t, ok) assert.Equal(t, "a", value.AsString()) diff --git a/service/internal/testcomponents/example_connector.go b/service/internal/testcomponents/example_connector.go index 8514159dedf..b20444a7476 100644 --- a/service/internal/testcomponents/example_connector.go +++ b/service/internal/testcomponents/example_connector.go @@ -8,9 +8,12 @@ import ( "go.opentelemetry.io/collector/component" "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/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/pprofile" "go.opentelemetry.io/collector/pdata/ptrace" "go.opentelemetry.io/collector/pdata/testdata" ) @@ -25,14 +28,22 @@ var ExampleConnectorFactory = connector.NewFactory( connector.WithTracesToTraces(createExampleTracesToTraces, component.StabilityLevelDevelopment), connector.WithTracesToMetrics(createExampleTracesToMetrics, component.StabilityLevelDevelopment), connector.WithTracesToLogs(createExampleTracesToLogs, component.StabilityLevelDevelopment), + connectorprofiles.WithTracesToProfiles(createExampleTracesToProfiles, component.StabilityLevelDevelopment), connector.WithMetricsToTraces(createExampleMetricsToTraces, component.StabilityLevelDevelopment), connector.WithMetricsToMetrics(createExampleMetricsToMetrics, component.StabilityLevelDevelopment), connector.WithMetricsToLogs(createExampleMetricsToLogs, component.StabilityLevelDevelopment), + connectorprofiles.WithMetricsToProfiles(createExampleMetricsToProfiles, component.StabilityLevelDevelopment), connector.WithLogsToTraces(createExampleLogsToTraces, component.StabilityLevelDevelopment), connector.WithLogsToMetrics(createExampleLogsToMetrics, component.StabilityLevelDevelopment), connector.WithLogsToLogs(createExampleLogsToLogs, component.StabilityLevelDevelopment), + connectorprofiles.WithLogsToProfiles(createExampleLogsToProfiles, component.StabilityLevelDevelopment), + + connectorprofiles.WithProfilesToTraces(createExampleProfilesToTraces, component.StabilityLevelDevelopment), + connectorprofiles.WithProfilesToMetrics(createExampleProfilesToMetrics, component.StabilityLevelDevelopment), + connectorprofiles.WithProfilesToLogs(createExampleProfilesToLogs, component.StabilityLevelDevelopment), + connectorprofiles.WithProfilesToProfiles(createExampleProfilesToProfiles, component.StabilityLevelDevelopment), ) var MockForwardConnectorFactory = connector.NewFactory( @@ -41,6 +52,7 @@ var MockForwardConnectorFactory = connector.NewFactory( connector.WithTracesToTraces(createExampleTracesToTraces, component.StabilityLevelDevelopment), connector.WithMetricsToMetrics(createExampleMetricsToMetrics, component.StabilityLevelDevelopment), connector.WithLogsToLogs(createExampleLogsToLogs, component.StabilityLevelDevelopment), + connectorprofiles.WithProfilesToProfiles(createExampleProfilesToProfiles, component.StabilityLevelDevelopment), ) func createExampleConnectorDefaultConfig() component.Config { @@ -72,6 +84,15 @@ func createExampleTracesToLogs(_ context.Context, set connector.Settings, _ comp }, nil } +func createExampleTracesToProfiles(_ context.Context, set connector.Settings, _ component.Config, profiles consumerprofiles.Profiles) (connector.Traces, error) { + return &ExampleConnector{ + ConsumeTracesFunc: func(ctx context.Context, td ptrace.Traces) error { + return profiles.ConsumeProfiles(ctx, testdata.GenerateProfiles(td.SpanCount())) + }, + mutatesData: set.ID.Name() == "mutate", + }, nil +} + func createExampleMetricsToTraces(_ context.Context, set connector.Settings, _ component.Config, traces consumer.Traces) (connector.Metrics, error) { return &ExampleConnector{ ConsumeMetricsFunc: func(ctx context.Context, md pmetric.Metrics) error { @@ -97,6 +118,15 @@ func createExampleMetricsToLogs(_ context.Context, set connector.Settings, _ com }, nil } +func createExampleMetricsToProfiles(_ context.Context, set connector.Settings, _ component.Config, profiles consumerprofiles.Profiles) (connector.Metrics, error) { + return &ExampleConnector{ + ConsumeMetricsFunc: func(ctx context.Context, md pmetric.Metrics) error { + return profiles.ConsumeProfiles(ctx, testdata.GenerateProfiles(md.MetricCount())) + }, + mutatesData: set.ID.Name() == "mutate", + }, nil +} + func createExampleLogsToTraces(_ context.Context, set connector.Settings, _ component.Config, traces consumer.Traces) (connector.Logs, error) { return &ExampleConnector{ ConsumeLogsFunc: func(ctx context.Context, ld plog.Logs) error { @@ -122,11 +152,54 @@ func createExampleLogsToLogs(_ context.Context, set connector.Settings, _ compon }, nil } +func createExampleLogsToProfiles(_ context.Context, set connector.Settings, _ component.Config, profiles consumerprofiles.Profiles) (connector.Logs, error) { + return &ExampleConnector{ + ConsumeLogsFunc: func(ctx context.Context, ld plog.Logs) error { + return profiles.ConsumeProfiles(ctx, testdata.GenerateProfiles(ld.LogRecordCount())) + }, + mutatesData: set.ID.Name() == "mutate", + }, nil +} + +func createExampleProfilesToTraces(_ context.Context, set connector.Settings, _ component.Config, traces consumer.Traces) (connectorprofiles.Profiles, error) { + return &ExampleConnector{ + ConsumeProfilesFunc: func(ctx context.Context, _ pprofile.Profiles) error { + return traces.ConsumeTraces(ctx, testdata.GenerateTraces(1)) + }, + mutatesData: set.ID.Name() == "mutate", + }, nil +} + +func createExampleProfilesToMetrics(_ context.Context, set connector.Settings, _ component.Config, metrics consumer.Metrics) (connectorprofiles.Profiles, error) { + return &ExampleConnector{ + ConsumeProfilesFunc: func(ctx context.Context, _ pprofile.Profiles) error { + return metrics.ConsumeMetrics(ctx, testdata.GenerateMetrics(1)) + }, + mutatesData: set.ID.Name() == "mutate", + }, nil +} + +func createExampleProfilesToLogs(_ context.Context, set connector.Settings, _ component.Config, logs consumer.Logs) (connectorprofiles.Profiles, error) { + return &ExampleConnector{ + ConsumeProfilesFunc: func(ctx context.Context, _ pprofile.Profiles) error { + return logs.ConsumeLogs(ctx, testdata.GenerateLogs(1)) + }, + mutatesData: set.ID.Name() == "mutate", + }, nil +} +func createExampleProfilesToProfiles(_ context.Context, set connector.Settings, _ component.Config, profiles consumerprofiles.Profiles) (connectorprofiles.Profiles, error) { + return &ExampleConnector{ + ConsumeProfilesFunc: profiles.ConsumeProfiles, + mutatesData: set.ID.Name() == "mutate", + }, nil +} + type ExampleConnector struct { componentState consumer.ConsumeTracesFunc consumer.ConsumeMetricsFunc consumer.ConsumeLogsFunc + consumerprofiles.ConsumeProfilesFunc mutatesData bool } diff --git a/service/internal/testcomponents/example_exporter.go b/service/internal/testcomponents/example_exporter.go index 388ee81b106..0c17ea0036c 100644 --- a/service/internal/testcomponents/example_exporter.go +++ b/service/internal/testcomponents/example_exporter.go @@ -9,8 +9,10 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/exporter" + "go.opentelemetry.io/collector/exporter/exporterprofiles" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/pprofile" "go.opentelemetry.io/collector/pdata/ptrace" ) @@ -25,6 +27,7 @@ var ExampleExporterFactory = exporter.NewFactory( exporter.WithTraces(createTracesExporter, stability), exporter.WithMetrics(createMetricsExporter, stability), exporter.WithLogs(createLogsExporter, stability), + exporterprofiles.WithProfiles(createProfilesExporter, stability), ) func createExporterDefaultConfig() component.Config { @@ -42,13 +45,17 @@ func createMetricsExporter(context.Context, exporter.Settings, component.Config) func createLogsExporter(context.Context, exporter.Settings, component.Config) (exporter.Logs, error) { return &ExampleExporter{}, nil } +func createProfilesExporter(context.Context, exporter.Settings, component.Config) (exporterprofiles.Profiles, error) { + return &ExampleExporter{}, nil +} -// ExampleExporter stores consumed traces and metrics for testing purposes. +// ExampleExporter stores consumed traces, metrics, logs and profiles for testing purposes. type ExampleExporter struct { componentState - Traces []ptrace.Traces - Metrics []pmetric.Metrics - Logs []plog.Logs + Traces []ptrace.Traces + Metrics []pmetric.Metrics + Logs []plog.Logs + Profiles []pprofile.Profiles } // ConsumeTraces receives ptrace.Traces for processing by the consumer.Traces. @@ -69,6 +76,12 @@ func (exp *ExampleExporter) ConsumeLogs(_ context.Context, ld plog.Logs) error { return nil } +// ConsumeProfiles receives pprofile.Profiles for processing by the consumerprofiles.Profiles. +func (exp *ExampleExporter) ConsumeProfiles(_ context.Context, td pprofile.Profiles) error { + exp.Profiles = append(exp.Profiles, td) + return nil +} + func (exp *ExampleExporter) Capabilities() consumer.Capabilities { return consumer.Capabilities{MutatesData: false} } diff --git a/service/internal/testcomponents/example_exporter_test.go b/service/internal/testcomponents/example_exporter_test.go index d70113c8f5a..cc911f2301f 100644 --- a/service/internal/testcomponents/example_exporter_test.go +++ b/service/internal/testcomponents/example_exporter_test.go @@ -12,6 +12,7 @@ import ( "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/pprofile" "go.opentelemetry.io/collector/pdata/ptrace" ) @@ -22,17 +23,21 @@ func TestExampleExporter(t *testing.T) { assert.NoError(t, exp.Start(context.Background(), host)) assert.True(t, exp.Started()) - assert.Equal(t, 0, len(exp.Traces)) + assert.Empty(t, exp.Traces) assert.NoError(t, exp.ConsumeTraces(context.Background(), ptrace.Traces{})) - assert.Equal(t, 1, len(exp.Traces)) + assert.Len(t, exp.Traces, 1) - assert.Equal(t, 0, len(exp.Metrics)) + assert.Empty(t, exp.Metrics) assert.NoError(t, exp.ConsumeMetrics(context.Background(), pmetric.Metrics{})) - assert.Equal(t, 1, len(exp.Metrics)) + assert.Len(t, exp.Metrics, 1) - assert.Equal(t, 0, len(exp.Logs)) + assert.Empty(t, exp.Logs) assert.NoError(t, exp.ConsumeLogs(context.Background(), plog.Logs{})) - assert.Equal(t, 1, len(exp.Logs)) + assert.Len(t, exp.Logs, 1) + + assert.Empty(t, exp.Profiles) + assert.NoError(t, exp.ConsumeProfiles(context.Background(), pprofile.Profiles{})) + assert.Len(t, exp.Profiles, 1) assert.False(t, exp.Stopped()) assert.NoError(t, exp.Shutdown(context.Background())) diff --git a/service/internal/testcomponents/example_processor.go b/service/internal/testcomponents/example_processor.go index 1d8f2d35a12..2634d6474b6 100644 --- a/service/internal/testcomponents/example_processor.go +++ b/service/internal/testcomponents/example_processor.go @@ -8,7 +8,9 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/consumer" + "go.opentelemetry.io/collector/consumer/consumerprofiles" "go.opentelemetry.io/collector/processor" + "go.opentelemetry.io/collector/processor/processorprofiles" ) var procType = component.MustNewType("exampleprocessor") @@ -19,7 +21,9 @@ var ExampleProcessorFactory = processor.NewFactory( createDefaultConfig, processor.WithTraces(createTracesProcessor, component.StabilityLevelDevelopment), processor.WithMetrics(createMetricsProcessor, component.StabilityLevelDevelopment), - processor.WithLogs(createLogsProcessor, component.StabilityLevelDevelopment)) + processor.WithLogs(createLogsProcessor, component.StabilityLevelDevelopment), + processorprofiles.WithProfiles(createProfilesProcessor, component.StabilityLevelDevelopment), +) // CreateDefaultConfig creates the default configuration for the Processor. func createDefaultConfig() component.Config { @@ -47,11 +51,19 @@ func createLogsProcessor(_ context.Context, set processor.Settings, _ component. }, nil } +func createProfilesProcessor(_ context.Context, set processor.Settings, _ component.Config, nextConsumer consumerprofiles.Profiles) (processorprofiles.Profiles, error) { + return &ExampleProcessor{ + ConsumeProfilesFunc: nextConsumer.ConsumeProfiles, + mutatesData: set.ID.Name() == "mutate", + }, nil +} + type ExampleProcessor struct { componentState consumer.ConsumeTracesFunc consumer.ConsumeMetricsFunc consumer.ConsumeLogsFunc + consumerprofiles.ConsumeProfilesFunc mutatesData bool } diff --git a/service/internal/testcomponents/example_receiver.go b/service/internal/testcomponents/example_receiver.go index b1287babc58..2309c9837ec 100644 --- a/service/internal/testcomponents/example_receiver.go +++ b/service/internal/testcomponents/example_receiver.go @@ -8,7 +8,9 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/consumer" + "go.opentelemetry.io/collector/consumer/consumerprofiles" "go.opentelemetry.io/collector/receiver" + "go.opentelemetry.io/collector/receiver/receiverprofiles" ) var receiverType = component.MustNewType("examplereceiver") @@ -19,7 +21,9 @@ var ExampleReceiverFactory = receiver.NewFactory( createReceiverDefaultConfig, receiver.WithTraces(createTracesReceiver, component.StabilityLevelDevelopment), receiver.WithMetrics(createMetricsReceiver, component.StabilityLevelDevelopment), - receiver.WithLogs(createLogsReceiver, component.StabilityLevelDevelopment)) + receiver.WithLogs(createLogsReceiver, component.StabilityLevelDevelopment), + receiverprofiles.WithProfiles(createProfilesReceiver, component.StabilityLevelDevelopment), +) func createReceiverDefaultConfig() component.Config { return &struct{}{} @@ -60,6 +64,18 @@ func createLogsReceiver( return lr, nil } +// createProfilesReceiver creates a trace receiver based on this config. +func createProfilesReceiver( + _ context.Context, + _ receiver.Settings, + cfg component.Config, + nextConsumer consumerprofiles.Profiles, +) (receiverprofiles.Profiles, error) { + tr := createReceiver(cfg) + tr.ConsumeProfilesFunc = nextConsumer.ConsumeProfiles + return tr, nil +} + func createReceiver(cfg component.Config) *ExampleReceiver { // There must be one receiver for all data types. We maintain a map of // receivers per config. @@ -75,12 +91,13 @@ func createReceiver(cfg component.Config) *ExampleReceiver { return er } -// ExampleReceiver allows producing traces and metrics for testing purposes. +// ExampleReceiver allows producing traces, metrics, logs and profiles for testing purposes. type ExampleReceiver struct { componentState consumer.ConsumeTracesFunc consumer.ConsumeMetricsFunc consumer.ConsumeLogsFunc + consumerprofiles.ConsumeProfilesFunc } // This is the map of already created example receivers for particular configurations. diff --git a/service/internal/testcomponents/example_router.go b/service/internal/testcomponents/example_router.go index 6d7211c89e8..c8fd28f48e1 100644 --- a/service/internal/testcomponents/example_router.go +++ b/service/internal/testcomponents/example_router.go @@ -8,9 +8,12 @@ import ( "go.opentelemetry.io/collector/component" "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/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/pprofile" "go.opentelemetry.io/collector/pdata/ptrace" ) @@ -23,6 +26,7 @@ var ExampleRouterFactory = connector.NewFactory( connector.WithTracesToTraces(createExampleTracesRouter, component.StabilityLevelDevelopment), connector.WithMetricsToMetrics(createExampleMetricsRouter, component.StabilityLevelDevelopment), connector.WithLogsToLogs(createExampleLogsRouter, component.StabilityLevelDevelopment), + connectorprofiles.WithProfilesToProfiles(createExampleProfilesRouter, component.StabilityLevelDevelopment), ) type LeftRightConfig struct { @@ -31,9 +35,10 @@ type LeftRightConfig struct { } type ExampleRouterConfig struct { - Traces *LeftRightConfig `mapstructure:"traces"` - Metrics *LeftRightConfig `mapstructure:"metrics"` - Logs *LeftRightConfig `mapstructure:"logs"` + Traces *LeftRightConfig `mapstructure:"traces"` + Metrics *LeftRightConfig `mapstructure:"metrics"` + Logs *LeftRightConfig `mapstructure:"logs"` + Profiles *LeftRightConfig `mapstructure:"profiles"` } func createExampleRouterDefaultConfig() component.Config { @@ -73,6 +78,17 @@ func createExampleLogsRouter(_ context.Context, _ connector.Settings, cfg compon }, nil } +func createExampleProfilesRouter(_ context.Context, _ connector.Settings, cfg component.Config, profiles consumerprofiles.Profiles) (connectorprofiles.Profiles, error) { + c := cfg.(ExampleRouterConfig) + r := profiles.(connectorprofiles.ProfilesRouterAndConsumer) + left, _ := r.Consumer(c.Profiles.Left) + right, _ := r.Consumer(c.Profiles.Right) + return &ExampleRouter{ + profilesRight: right, + profilesLeft: left, + }, nil +} + type ExampleRouter struct { componentState @@ -87,6 +103,10 @@ type ExampleRouter struct { logsRight consumer.Logs logsLeft consumer.Logs logsNum int + + profilesRight consumerprofiles.Profiles + profilesLeft consumerprofiles.Profiles + profilesNum int } func (r *ExampleRouter) ConsumeTraces(ctx context.Context, td ptrace.Traces) error { @@ -113,6 +133,14 @@ func (r *ExampleRouter) ConsumeLogs(ctx context.Context, ld plog.Logs) error { return r.logsRight.ConsumeLogs(ctx, ld) } +func (r *ExampleRouter) ConsumeProfiles(ctx context.Context, td pprofile.Profiles) error { + r.profilesNum++ + if r.profilesNum%2 == 0 { + return r.profilesLeft.ConsumeProfiles(ctx, td) + } + return r.profilesRight.ConsumeProfiles(ctx, td) +} + func (r *ExampleRouter) Capabilities() consumer.Capabilities { return consumer.Capabilities{MutatesData: false} } diff --git a/service/internal/testcomponents/example_router_test.go b/service/internal/testcomponents/example_router_test.go index f868b99543b..8d89efff744 100644 --- a/service/internal/testcomponents/example_router_test.go +++ b/service/internal/testcomponents/example_router_test.go @@ -12,8 +12,10 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" "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/consumer/consumertest" "go.opentelemetry.io/collector/pdata/testdata" ) @@ -56,7 +58,7 @@ func TestTracesRouter(t *testing.T) { assert.NoError(t, tr.ConsumeTraces(context.Background(), td)) assert.Len(t, sinkRight.AllTraces(), 1) - assert.Len(t, sinkLeft.AllTraces(), 0) + assert.Empty(t, sinkLeft.AllTraces()) assert.NoError(t, tr.ConsumeTraces(context.Background(), td)) assert.Len(t, sinkRight.AllTraces(), 1) @@ -95,7 +97,7 @@ func TestMetricsRouter(t *testing.T) { assert.NoError(t, mr.ConsumeMetrics(context.Background(), md)) assert.Len(t, sinkRight.AllMetrics(), 1) - assert.Len(t, sinkLeft.AllMetrics(), 0) + assert.Empty(t, sinkLeft.AllMetrics()) assert.NoError(t, mr.ConsumeMetrics(context.Background(), md)) assert.Len(t, sinkRight.AllMetrics(), 1) @@ -134,7 +136,7 @@ func TestLogsRouter(t *testing.T) { assert.NoError(t, lr.ConsumeLogs(context.Background(), ld)) assert.Len(t, sinkRight.AllLogs(), 1) - assert.Len(t, sinkLeft.AllLogs(), 0) + assert.Empty(t, sinkLeft.AllLogs()) assert.NoError(t, lr.ConsumeLogs(context.Background(), ld)) assert.Len(t, sinkRight.AllLogs(), 1) @@ -146,3 +148,42 @@ func TestLogsRouter(t *testing.T) { assert.Len(t, sinkRight.AllLogs(), 3) assert.Len(t, sinkLeft.AllLogs(), 2) } + +func TestProfilesRouter(t *testing.T) { + leftID := component.MustNewIDWithName("sink", "left") + rightID := component.MustNewIDWithName("sink", "right") + + sinkLeft := new(consumertest.ProfilesSink) + sinkRight := new(consumertest.ProfilesSink) + + // The service will build a router to give to every connector. + // Many connectors will just call router.ConsumeProfiles, + // but some implementation will call RouteProfiles instead. + router := connectorprofiles.NewProfilesRouter( + map[component.ID]consumerprofiles.Profiles{ + leftID: sinkLeft, + rightID: sinkRight, + }) + + cfg := ExampleRouterConfig{Profiles: &LeftRightConfig{Left: leftID, Right: rightID}} + tr, err := ExampleRouterFactory.CreateProfilesToProfiles( + context.Background(), connectortest.NewNopSettings(), cfg, router) + assert.NoError(t, err) + assert.False(t, tr.Capabilities().MutatesData) + + td := testdata.GenerateProfiles(1) + + assert.NoError(t, tr.ConsumeProfiles(context.Background(), td)) + assert.Len(t, sinkRight.AllProfiles(), 1) + assert.Empty(t, sinkLeft.AllProfiles()) + + assert.NoError(t, tr.ConsumeProfiles(context.Background(), td)) + assert.Len(t, sinkRight.AllProfiles(), 1) + assert.Len(t, sinkLeft.AllProfiles(), 1) + + assert.NoError(t, tr.ConsumeProfiles(context.Background(), td)) + assert.NoError(t, tr.ConsumeProfiles(context.Background(), td)) + assert.NoError(t, tr.ConsumeProfiles(context.Background(), td)) + assert.Len(t, sinkRight.AllProfiles(), 3) + assert.Len(t, sinkLeft.AllProfiles(), 2) +} diff --git a/service/pipelines/config.go b/service/pipelines/config.go index ed8c77a31c0..66698539d5b 100644 --- a/service/pipelines/config.go +++ b/service/pipelines/config.go @@ -8,6 +8,7 @@ import ( "fmt" "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/component/componentprofiles" ) var ( @@ -28,7 +29,10 @@ func (cfg Config) Validate() error { // Check that all pipelines have at least one receiver and one exporter, and they reference // only configured components. for pipelineID, pipeline := range cfg { - if pipelineID.Type() != component.DataTypeTraces && pipelineID.Type() != component.DataTypeMetrics && pipelineID.Type() != component.DataTypeLogs { + switch pipelineID.Type() { + case component.DataTypeTraces, component.DataTypeMetrics, component.DataTypeLogs, componentprofiles.DataTypeProfiles: + // Continue + default: return fmt.Errorf("pipeline %q: unknown datatype %q", pipelineID, pipelineID.Type()) } diff --git a/service/service.go b/service/service.go index 063b7f45ab9..29bd3d57e92 100644 --- a/service/service.go +++ b/service/service.go @@ -23,8 +23,8 @@ import ( "go.opentelemetry.io/collector/connector" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/extension" - "go.opentelemetry.io/collector/internal/localhostgate" - "go.opentelemetry.io/collector/internal/obsreportconfig" + "go.opentelemetry.io/collector/featuregate" + "go.opentelemetry.io/collector/internal/globalgates" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/processor" "go.opentelemetry.io/collector/receiver" @@ -37,6 +37,22 @@ import ( "go.opentelemetry.io/collector/service/telemetry" ) +// useOtelWithSDKConfigurationForInternalTelemetryFeatureGate is the feature gate that controls whether the collector +// supports configuring the OpenTelemetry SDK via configuration +var useOtelWithSDKConfigurationForInternalTelemetryFeatureGate = featuregate.GlobalRegistry().MustRegister( + "telemetry.useOtelWithSDKConfigurationForInternalTelemetry", + featuregate.StageBeta, + featuregate.WithRegisterDescription("controls whether the collector supports extended OpenTelemetry"+ + "configuration for internal telemetry")) + +// disableHighCardinalityMetricsfeatureGate is the feature gate that controls whether the collector should enable +// potentially high cardinality metrics. The gate will be removed when the collector allows for view configuration. +var disableHighCardinalityMetricsfeatureGate = featuregate.GlobalRegistry().MustRegister( + "telemetry.disableHighCardinalityMetrics", + featuregate.StageAlpha, + featuregate.WithRegisterDescription("controls whether the collector should enable potentially high"+ + "cardinality metrics. The gate will be removed when the collector allows for view configuration.")) + // Settings holds configuration for building a new Service. type Settings struct { // BuildInfo provides collector start information. @@ -88,8 +104,7 @@ type Service struct { // New creates a new Service, its telemetry, and Components. func New(ctx context.Context, set Settings, cfg Config) (*Service, error) { - disableHighCard := obsreportconfig.DisableHighCardinalityMetricsfeatureGate.IsEnabled() - extendedConfig := obsreportconfig.UseOtelWithSDKConfigurationForInternalTelemetryFeatureGate.IsEnabled() + disableHighCard := disableHighCardinalityMetricsfeatureGate.IsEnabled() srv := &Service{ buildInfo: set.BuildInfo, @@ -141,7 +156,7 @@ func New(ctx context.Context, set Settings, cfg Config) (*Service, error) { return nil, fmt.Errorf("failed to create metric provider: %w", err) } - logsAboutMeterProvider(logger, cfg.Telemetry.Metrics, mp, extendedConfig) + logsAboutMeterProvider(logger, cfg.Telemetry.Metrics, mp) srv.telemetrySettings = component.TelemetrySettings{ LeveledMeterProvider: func(level configtelemetry.Level) metric.MeterProvider { if level <= cfg.Telemetry.Metrics.Level { @@ -174,17 +189,14 @@ func New(ctx context.Context, set Settings, cfg Config) (*Service, error) { return nil, err } - if cfg.Telemetry.Metrics.Level != configtelemetry.LevelNone && cfg.Telemetry.Metrics.Address != "" { - // The process telemetry initialization requires the ballast size, which is available after the extensions are initialized. - if err = proctelemetry.RegisterProcessMetrics(srv.telemetrySettings); err != nil { - return nil, fmt.Errorf("failed to register process metrics: %w", err) - } + if err = proctelemetry.RegisterProcessMetrics(srv.telemetrySettings); err != nil { + return nil, fmt.Errorf("failed to register process metrics: %w", err) } return srv, nil } -func logsAboutMeterProvider(logger *zap.Logger, cfg telemetry.MetricsConfig, mp metric.MeterProvider, extendedConfig bool) { +func logsAboutMeterProvider(logger *zap.Logger, cfg telemetry.MetricsConfig, mp metric.MeterProvider) { if cfg.Level == configtelemetry.LevelNone || (cfg.Address == "" && len(cfg.Readers) == 0) { logger.Info( "Skipped telemetry setup.", @@ -194,7 +206,7 @@ func logsAboutMeterProvider(logger *zap.Logger, cfg telemetry.MetricsConfig, mp return } - if len(cfg.Address) != 0 && extendedConfig { + if len(cfg.Address) != 0 && useOtelWithSDKConfigurationForInternalTelemetryFeatureGate.IsEnabled() { logger.Warn("service::telemetry::metrics::address is being deprecated in favor of service::telemetry::metrics::readers") } @@ -239,7 +251,7 @@ func (srv *Service) Start(ctx context.Context) error { } srv.telemetrySettings.Logger.Info("Everything is ready. Begin running and processing data.") - localhostgate.LogAboutUseLocalHostAsDefault(srv.telemetrySettings.Logger) + logAboutUseLocalHostAsDefault(srv.telemetrySettings.Logger) return nil } @@ -345,3 +357,13 @@ func pdataFromSdk(res *sdkresource.Resource) pcommon.Resource { } return pcommonRes } + +// logAboutUseLocalHostAsDefault logs about the upcoming change from 0.0.0.0 to localhost on server-like components. +func logAboutUseLocalHostAsDefault(logger *zap.Logger) { + if globalgates.UseLocalHostAsDefaultHostfeatureGate.IsEnabled() { + logger.Info( + "The default endpoints for all servers in components have changed to use localhost instead of 0.0.0.0. Disable the feature gate to temporarily revert to the previous default.", + zap.String("feature gate ID", globalgates.UseLocalHostAsDefaultHostID), + ) + } +} diff --git a/service/service_test.go b/service/service_test.go index 325a6aa5899..8ca370b00da 100644 --- a/service/service_test.go +++ b/service/service_test.go @@ -8,7 +8,9 @@ import ( "context" "errors" "fmt" + "net" "net/http" + "strconv" "strings" "sync" "testing" @@ -17,10 +19,12 @@ import ( "github.com/prometheus/common/expfmt" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.opentelemetry.io/contrib/config" "go.uber.org/zap" "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" @@ -226,13 +230,15 @@ func TestServiceGetExporters(t *testing.T) { // nolint expMap := srv.host.GetExporters() - assert.Len(t, expMap, 3) + assert.Len(t, expMap, 4) assert.Len(t, expMap[component.DataTypeTraces], 1) assert.Contains(t, expMap[component.DataTypeTraces], component.NewID(nopType)) assert.Len(t, expMap[component.DataTypeMetrics], 1) assert.Contains(t, expMap[component.DataTypeMetrics], component.NewID(nopType)) assert.Len(t, expMap[component.DataTypeLogs], 1) assert.Contains(t, expMap[component.DataTypeLogs], component.NewID(nopType)) + assert.Len(t, expMap[componentprofiles.DataTypeProfiles], 1) + assert.Contains(t, expMap[componentprofiles.DataTypeProfiles], component.NewID(nopType)) } // TestServiceTelemetryCleanupOnError tests that if newService errors due to an invalid config telemetry is cleaned up @@ -322,6 +328,87 @@ func testCollectorStartHelper(t *testing.T, tc ownMetricsTestCase, network strin } } +func TestServiceTelemetryWithReaders(t *testing.T) { + for _, tc := range ownMetricsTestCases() { + t.Run(fmt.Sprintf("ipv4_%s", tc.name), func(t *testing.T) { + testCollectorStartHelperWithReaders(t, tc, "tcp4") + }) + t.Run(fmt.Sprintf("ipv6_%s", tc.name), func(t *testing.T) { + testCollectorStartHelperWithReaders(t, tc, "tcp6") + }) + } +} + +func testCollectorStartHelperWithReaders(t *testing.T, tc ownMetricsTestCase, network string) { + var once sync.Once + loggingHookCalled := false + hook := func(zapcore.Entry) error { + once.Do(func() { + loggingHookCalled = true + }) + return nil + } + + var ( + metricsAddr *config.Prometheus + zpagesAddr string + ) + switch network { + case "tcp", "tcp4": + metricsAddr = getAvailableLocalAddressPrometheus(t) + zpagesAddr = testutil.GetAvailableLocalAddress(t) + case "tcp6": + metricsAddr = getAvailableLocalIPv6AddressPrometheus(t) + zpagesAddr = testutil.GetAvailableLocalIPv6Address(t) + } + require.NotZero(t, metricsAddr, "network must be either of tcp, tcp4 or tcp6") + require.NotZero(t, zpagesAddr, "network must be either of tcp, tcp4 or tcp6") + + set := newNopSettings() + set.BuildInfo = component.BuildInfo{Version: "test version", Command: otelCommand} + set.ExtensionsConfigs = map[component.ID]component.Config{ + component.MustNewID("zpages"): &zpagesextension.Config{ + ServerConfig: confighttp.ServerConfig{Endpoint: zpagesAddr}, + }, + } + set.ExtensionsFactories = map[component.Type]extension.Factory{component.MustNewType("zpages"): zpagesextension.NewFactory()} + set.LoggingOptions = []zap.Option{zap.Hooks(hook)} + + cfg := newNopConfig() + cfg.Extensions = []component.ID{component.MustNewID("zpages")} + cfg.Telemetry.Metrics.Address = "" + cfg.Telemetry.Metrics.Readers = []config.MetricReader{ + { + Pull: &config.PullMetricReader{ + Exporter: config.MetricExporter{ + Prometheus: metricsAddr, + }, + }, + }, + } + cfg.Telemetry.Resource = make(map[string]*string) + // Include resource attributes under the service::telemetry::resource key. + for k, v := range tc.userDefinedResource { + cfg.Telemetry.Resource[k] = v + } + + // Create a service, check for metrics, shutdown and repeat to ensure that telemetry can be started/shutdown and started again. + for i := 0; i < 2; i++ { + srv, err := New(context.Background(), set, cfg) + require.NoError(t, err) + + require.NoError(t, srv.Start(context.Background())) + // Sleep for 1 second to ensure the http server is started. + time.Sleep(1 * time.Second) + assert.True(t, loggingHookCalled) + + assertResourceLabels(t, srv.telemetrySettings.Resource, tc.expectedLabels) + assertMetrics(t, fmt.Sprintf("%s:%d", *metricsAddr.Host, *metricsAddr.Port), tc.expectedLabels) + assertZPages(t, zpagesAddr) + require.NoError(t, srv.Shutdown(context.Background())) + } +} + // TestServiceTelemetryRestart tests that the service correctly restarts the telemetry server. func TestServiceTelemetryRestart(t *testing.T) { // Create a service @@ -483,7 +570,20 @@ func assertMetrics(t *testing.T, metricsAddr string, expectedLabels map[string]l require.NoError(t, err) prefix := "otelcol" + expectedMetrics := map[string]bool{ + "target_info": false, + "otelcol_process_memory_rss": false, + "otelcol_process_cpu_seconds": false, + "otelcol_process_runtime_total_sys_memory_bytes": false, + "otelcol_process_runtime_heap_alloc_bytes": false, + "otelcol_process_runtime_total_alloc_bytes": false, + "otelcol_process_uptime": false, + } for metricName, metricFamily := range parsed { + if _, ok := expectedMetrics[metricName]; !ok { + require.True(t, ok, "unexpected metric: %s", metricName) + } + expectedMetrics[metricName] = true if metricName != "target_info" { // require is used here so test fails with a single message. require.True( @@ -513,6 +613,9 @@ func assertMetrics(t *testing.T, metricsAddr string, expectedLabels map[string]l } } } + for k, val := range expectedMetrics { + require.True(t, val, "missing metric: %s", k) + } } func assertZPages(t *testing.T, zpagesAddr string) { @@ -579,6 +682,11 @@ func newNopConfig() Config { Processors: []component.ID{component.NewID(nopType)}, Exporters: []component.ID{component.NewID(nopType)}, }, + component.MustNewID("profiles"): { + Receivers: []component.ID{component.NewID(nopType)}, + Processors: []component.ID{component.NewID(nopType)}, + Exporters: []component.ID{component.NewID(nopType)}, + }, }) } @@ -637,3 +745,26 @@ func newConfigWatcherExtensionFactory(name component.Type) extension.Factory { component.StabilityLevelDevelopment, ) } + +func getAvailableLocalIPv6AddressPrometheus(t testing.TB) *config.Prometheus { + return addrToPrometheus(testutil.GetAvailableLocalIPv6Address(t)) +} + +func getAvailableLocalAddressPrometheus(t testing.TB) *config.Prometheus { + return addrToPrometheus(testutil.GetAvailableLocalAddress(t)) +} + +func addrToPrometheus(address string) *config.Prometheus { + host, port, err := net.SplitHostPort(address) + if err != nil { + return nil + } + portInt, err := strconv.Atoi(port) + if err != nil { + return nil + } + return &config.Prometheus{ + Host: &host, + Port: &portInt, + } +} diff --git a/service/telemetry/attributes.go b/service/telemetry/attributes.go new file mode 100644 index 00000000000..7b1b3b4ed99 --- /dev/null +++ b/service/telemetry/attributes.go @@ -0,0 +1,24 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package telemetry // import "go.opentelemetry.io/collector/service/telemetry" + +import semconv "go.opentelemetry.io/otel/semconv/v1.4.0" + +func attributes(set Settings, cfg Config) map[string]interface{} { + attrs := map[string]interface{}{ + string(semconv.ServiceNameKey): set.BuildInfo.Command, + string(semconv.ServiceVersionKey): set.BuildInfo.Version, + } + for k, v := range cfg.Resource { + if v != nil { + attrs[k] = *v + } + + // the new value is nil, delete the existing key + if _, ok := attrs[k]; ok && v == nil { + delete(attrs, k) + } + } + return attrs +} diff --git a/service/telemetry/attributes_test.go b/service/telemetry/attributes_test.go new file mode 100644 index 00000000000..6ace1a887af --- /dev/null +++ b/service/telemetry/attributes_test.go @@ -0,0 +1,57 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package telemetry // import "go.opentelemetry.io/collector/service/telemetry" + +import ( + "testing" + + "github.com/stretchr/testify/require" + + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/service/telemetry/internal" +) + +func TestAttributes(t *testing.T) { + tests := []struct { + name string + cfg Config + buildInfo component.BuildInfo + wantAttributes map[string]interface{} + }{ + { + name: "no build info and no resource config", + cfg: Config{}, + wantAttributes: map[string]interface{}{"service.name": "", "service.version": ""}, + }, + { + name: "build info and no resource config", + cfg: Config{}, + buildInfo: component.BuildInfo{Command: "otelcoltest", Version: "0.0.0-test"}, + wantAttributes: map[string]interface{}{"service.name": "otelcoltest", "service.version": "0.0.0-test"}, + }, + { + name: "no build info and resource config", + cfg: Config{Resource: map[string]*string{"service.name": ptr("resource.name"), "service.version": ptr("resource.version"), "test": ptr("test")}}, + wantAttributes: map[string]interface{}{"service.name": "resource.name", "service.version": "resource.version", "test": "test"}, + }, + { + name: "build info and resource config", + buildInfo: component.BuildInfo{Command: "otelcoltest", Version: "0.0.0-test"}, + cfg: Config{Resource: map[string]*string{"service.name": ptr("resource.name"), "service.version": ptr("resource.version"), "test": ptr("test")}}, + wantAttributes: map[string]interface{}{"service.name": "resource.name", "service.version": "resource.version", "test": "test"}, + }, + { + name: "deleting a nil value", + buildInfo: component.BuildInfo{Command: "otelcoltest", Version: "0.0.0-test"}, + cfg: Config{Resource: map[string]*string{"service.name": nil, "service.version": ptr("resource.version"), "test": ptr("test")}}, + wantAttributes: map[string]interface{}{"service.version": "resource.version", "test": "test"}, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + attrs := attributes(internal.Settings{BuildInfo: tt.buildInfo}, tt.cfg) + require.Equal(t, tt.wantAttributes, attrs) + }) + } +} diff --git a/service/telemetry/tracer.go b/service/telemetry/tracer.go index c5c242bcf85..ff17f296865 100644 --- a/service/telemetry/tracer.go +++ b/service/telemetry/tracer.go @@ -13,6 +13,7 @@ import ( "go.opentelemetry.io/otel/propagation" semconv "go.opentelemetry.io/otel/semconv/v1.26.0" "go.opentelemetry.io/otel/trace" + "go.opentelemetry.io/otel/trace/embedded" "go.opentelemetry.io/otel/trace/noop" "go.opentelemetry.io/collector/config/configtelemetry" @@ -29,28 +30,28 @@ var ( errUnsupportedPropagator = errors.New("unsupported trace propagator") ) -func attributes(set Settings, cfg Config) map[string]interface{} { - attrs := map[string]interface{}{ - string(semconv.ServiceNameKey): set.BuildInfo.Command, - string(semconv.ServiceVersionKey): set.BuildInfo.Version, - } - for k, v := range cfg.Resource { - if v != nil { - attrs[k] = *v - } +type noopNoContextTracer struct { + embedded.Tracer +} - // the new value is nil, delete the existing key - if _, ok := attrs[k]; ok && v == nil { - delete(attrs, k) - } - } - return attrs +var noopSpan = noop.Span{} + +func (n *noopNoContextTracer) Start(ctx context.Context, _ string, _ ...trace.SpanStartOption) (context.Context, trace.Span) { + return ctx, noopSpan +} + +type noopNoContextTracerProvider struct { + embedded.TracerProvider +} + +func (n *noopNoContextTracerProvider) Tracer(_ string, _ ...trace.TracerOption) trace.Tracer { + return &noopNoContextTracer{} } // 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 { - return noop.NewTracerProvider(), nil + return &noopNoContextTracerProvider{}, nil } sch := semconv.SchemaURL diff --git a/service/telemetry/tracer_test.go b/service/telemetry/tracer_test.go index b9503276e0c..6c365351549 100644 --- a/service/telemetry/tracer_test.go +++ b/service/telemetry/tracer_test.go @@ -9,59 +9,13 @@ import ( "github.com/stretchr/testify/require" sdktrace "go.opentelemetry.io/otel/sdk/trace" - "go.opentelemetry.io/otel/trace/noop" - "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config/configtelemetry" "go.opentelemetry.io/collector/featuregate" "go.opentelemetry.io/collector/internal/globalgates" "go.opentelemetry.io/collector/service/telemetry/internal" ) -func TestAttributes(t *testing.T) { - tests := []struct { - name string - cfg Config - buildInfo component.BuildInfo - wantAttributes map[string]interface{} - }{ - { - name: "no build info and no resource config", - cfg: Config{}, - wantAttributes: map[string]interface{}{"service.name": "", "service.version": ""}, - }, - { - name: "build info and no resource config", - cfg: Config{}, - buildInfo: component.BuildInfo{Command: "otelcoltest", Version: "0.0.0-test"}, - wantAttributes: map[string]interface{}{"service.name": "otelcoltest", "service.version": "0.0.0-test"}, - }, - { - name: "no build info and resource config", - cfg: Config{Resource: map[string]*string{"service.name": ptr("resource.name"), "service.version": ptr("resource.version"), "test": ptr("test")}}, - wantAttributes: map[string]interface{}{"service.name": "resource.name", "service.version": "resource.version", "test": "test"}, - }, - { - name: "build info and resource config", - buildInfo: component.BuildInfo{Command: "otelcoltest", Version: "0.0.0-test"}, - cfg: Config{Resource: map[string]*string{"service.name": ptr("resource.name"), "service.version": ptr("resource.version"), "test": ptr("test")}}, - wantAttributes: map[string]interface{}{"service.name": "resource.name", "service.version": "resource.version", "test": "test"}, - }, - { - name: "deleting a nil value", - buildInfo: component.BuildInfo{Command: "otelcoltest", Version: "0.0.0-test"}, - cfg: Config{Resource: map[string]*string{"service.name": nil, "service.version": ptr("resource.version"), "test": ptr("test")}}, - wantAttributes: map[string]interface{}{"service.version": "resource.version", "test": "test"}, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - attrs := attributes(internal.Settings{BuildInfo: tt.buildInfo}, tt.cfg) - require.Equal(t, tt.wantAttributes, attrs) - }) - } -} - func TestNewTracerProvider(t *testing.T) { tests := []struct { name string @@ -76,13 +30,13 @@ func TestNewTracerProvider(t *testing.T) { Level: configtelemetry.LevelNone, }, }, - wantTracerProvider: noop.TracerProvider{}, + wantTracerProvider: &noopNoContextTracerProvider{}, }, { name: "noop tracer feature gate", cfg: Config{}, noopTracerGate: true, - wantTracerProvider: noop.TracerProvider{}, + wantTracerProvider: &noopNoContextTracerProvider{}, }, { name: "tracer provider", diff --git a/service/telemetry_test.go b/service/telemetry_test.go index a8a382c62ec..7c2cb6541d7 100644 --- a/service/telemetry_test.go +++ b/service/telemetry_test.go @@ -194,7 +194,7 @@ func TestTelemetryInit(t *testing.T) { { Pull: &config.PullMetricReader{ Exporter: config.MetricExporter{ - Prometheus: testutil.GetAvailableLocalAddressPrometheus(t), + Prometheus: getAvailableLocalAddressPrometheus(t), }, }, }, diff --git a/versions.yaml b/versions.yaml index 9735f54902c..2d1969ae6dd 100644 --- a/versions.yaml +++ b/versions.yaml @@ -3,19 +3,21 @@ module-sets: stable: - version: v1.14.1 + version: v1.15.0 modules: - go.opentelemetry.io/collector/client - go.opentelemetry.io/collector/featuregate - go.opentelemetry.io/collector/pdata - go.opentelemetry.io/collector/confmap + - go.opentelemetry.io/collector/confmap/provider/envprovider + - go.opentelemetry.io/collector/confmap/provider/fileprovider - go.opentelemetry.io/collector/config/configopaque - go.opentelemetry.io/collector/config/configcompression - go.opentelemetry.io/collector/config/configretry - go.opentelemetry.io/collector/config/configtls - - go.opentelemetry.io/collector/config/configtelemetry + - go.opentelemetry.io/collector/config/confignet beta: - version: v0.108.1 + version: v0.109.0 modules: - go.opentelemetry.io/collector - go.opentelemetry.io/collector/internal/globalgates @@ -25,15 +27,13 @@ module-sets: - go.opentelemetry.io/collector/component/componentstatus - go.opentelemetry.io/collector/component/componentprofiles - go.opentelemetry.io/collector/confmap/converter/expandconverter - - go.opentelemetry.io/collector/confmap/provider/envprovider - - go.opentelemetry.io/collector/confmap/provider/fileprovider - go.opentelemetry.io/collector/confmap/provider/httpprovider - go.opentelemetry.io/collector/confmap/provider/httpsprovider - go.opentelemetry.io/collector/confmap/provider/yamlprovider - go.opentelemetry.io/collector/config/configauth - go.opentelemetry.io/collector/config/configgrpc - go.opentelemetry.io/collector/config/confighttp - - go.opentelemetry.io/collector/config/confignet + - go.opentelemetry.io/collector/config/configtelemetry - go.opentelemetry.io/collector/config/internal - go.opentelemetry.io/collector/connector - go.opentelemetry.io/collector/connector/connectorprofiles @@ -49,9 +49,9 @@ module-sets: - go.opentelemetry.io/collector/exporter/otlpexporter - go.opentelemetry.io/collector/exporter/otlphttpexporter - go.opentelemetry.io/collector/extension + - go.opentelemetry.io/collector/extension/extensioncapabilities - go.opentelemetry.io/collector/extension/auth - go.opentelemetry.io/collector/extension/experimental/storage - - go.opentelemetry.io/collector/extension/ballastextension - go.opentelemetry.io/collector/extension/zpagesextension - go.opentelemetry.io/collector/extension/memorylimiterextension - go.opentelemetry.io/collector/otelcol