diff --git a/.chloggen/add-interval-processor-to-dist.yaml b/.chloggen/add-interval-processor-to-dist.yaml new file mode 100644 index 000000000000..20b41db25065 --- /dev/null +++ b/.chloggen/add-interval-processor-to-dist.yaml @@ -0,0 +1,27 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: "new_component" + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: intervalprocessor + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Interval Processor is now Alpha stability and is added to the `contrib` and `k8s` distributions + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [36514] + +# (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: + +# If your change doesn't affect end users or the exported elements of any package, +# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. +# 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/add-nanosecond-converter.yaml b/.chloggen/add-nanosecond-converter.yaml new file mode 100644 index 000000000000..03925caa8667 --- /dev/null +++ b/.chloggen/add-nanosecond-converter.yaml @@ -0,0 +1,27 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: enhancement + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: pkg/ottl + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Add the `Nanosecond` converter to return the nanosecond component from the specified time.Time + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [37042] + +# (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: + +# If your change doesn't affect end users or the exported elements of any package, +# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. +# 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: [] \ No newline at end of file diff --git a/.chloggen/add-second-converter.yaml b/.chloggen/add-second-converter.yaml new file mode 100644 index 000000000000..bdacd0984847 --- /dev/null +++ b/.chloggen/add-second-converter.yaml @@ -0,0 +1,27 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: enhancement + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: pkg/ottl + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Add the `Second` converter to return the second component from the specified time.Time + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [37042] + +# (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: + +# If your change doesn't affect end users or the exported elements of any package, +# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. +# 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: [] \ No newline at end of file diff --git a/.chloggen/cesreceiver_alpha.yaml b/.chloggen/cesreceiver_alpha.yaml new file mode 100644 index 000000000000..0258ecd232f2 --- /dev/null +++ b/.chloggen/cesreceiver_alpha.yaml @@ -0,0 +1,27 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: enhancement + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: huaweicloudces + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Move huaweicloudces receiver to alpha + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [34953] + +# (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: + +# If your change doesn't affect end users or the exported elements of any package, +# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. +# 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: [] \ No newline at end of file diff --git a/.chloggen/elasticsearchexporter_event-name.yaml b/.chloggen/elasticsearchexporter_event-name.yaml new file mode 100644 index 000000000000..8887665616e8 --- /dev/null +++ b/.chloggen/elasticsearchexporter_event-name.yaml @@ -0,0 +1,27 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: enhancement + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: elasticsearchexporter + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Handle `EventName` for log records in OTel mode + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [37011] + +# (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: + +# If your change doesn't affect end users or the exported elements of any package, +# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. +# 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/indexing-pkg-ottl.yaml b/.chloggen/indexing-pkg-ottl.yaml new file mode 100644 index 000000000000..678525bfac99 --- /dev/null +++ b/.chloggen/indexing-pkg-ottl.yaml @@ -0,0 +1,27 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: breaking + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: pkg/ottl + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: "Support dynamic indexing of maps and slices." + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [36644] + +# (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: + +# If your change doesn't affect end users or the exported elements of any package, +# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. +# 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/k8sattributes-deployment-name.yaml b/.chloggen/k8sattributes-deployment-name.yaml new file mode 100644 index 000000000000..7492b491faf1 --- /dev/null +++ b/.chloggen/k8sattributes-deployment-name.yaml @@ -0,0 +1,27 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: bug_fix + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: k8sattributesprocessor + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Ensure the pods gathered by the processor contain the information about their related replica sets and deployments after the initial sync + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [37056] + +# (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: + +# If your change doesn't affect end users or the exported elements of any package, +# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. +# 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/renovate_github.com-grpc-ecosystem-go-grpc-middleware-2.x.yaml b/.chloggen/renovate_github.com-grpc-ecosystem-go-grpc-middleware-2.x.yaml new file mode 100644 index 000000000000..603900c6e5c6 --- /dev/null +++ b/.chloggen/renovate_github.com-grpc-ecosystem-go-grpc-middleware-2.x.yaml @@ -0,0 +1,27 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: enhancement + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: telemetrygen + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Remove go-grpc-middleware dependency + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [37103] + +# (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: + +# If your change doesn't affect end users or the exported elements of any package, +# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. +# 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/routing-disconnect-matchonce-api.yaml b/.chloggen/routing-disconnect-matchonce-api.yaml new file mode 100644 index 000000000000..74cc12e4925e --- /dev/null +++ b/.chloggen/routing-disconnect-matchonce-api.yaml @@ -0,0 +1,29 @@ +# 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. filelogreceiver) +component: routingconnector + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Change `match_once` parameter from `bool` to `*bool`. + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [29882] + +# (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: | + Boolean values should still unmarshal successfully, but direct instantiation in code will fail. + The change allows us to check for usage and warn of the upcoming removal in v0.120.0. + +# If your change doesn't affect end users or the exported elements of any package, +# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. +# 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/routing-disconnect-matchonce.yaml b/.chloggen/routing-disconnect-matchonce.yaml new file mode 100644 index 000000000000..9b72477bcbdd --- /dev/null +++ b/.chloggen/routing-disconnect-matchonce.yaml @@ -0,0 +1,28 @@ +# 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. filelogreceiver) +component: routingconnector + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Disconnect `match_once` parameter from functionality. + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [29882] + +# (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 parameter will be ignored, except to trigger a warning log about its upcoming removal in v0.120.0. + +# If your change doesn't affect end users or the exported elements of any package, +# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. +# 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/signaltometrics-corelogic.yaml b/.chloggen/signaltometrics-corelogic.yaml new file mode 100644 index 000000000000..6c82c01d5ed0 --- /dev/null +++ b/.chloggen/signaltometrics-corelogic.yaml @@ -0,0 +1,27 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: enhancement + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: signaltometricsconnector + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Add core logic for the signal to metrics connector to make it functional. + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [35930] + +# (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: + +# If your change doesn't affect end users or the exported elements of any package, +# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Include 'api' if there is a change to a library API. +# Default: '[user]' +change_logs: [user] diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 406af6b5a225..9956b99e4795 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -19,7 +19,7 @@ cmd/githubgen/ @open-telemetry/collector-cont cmd/opampsupervisor/ @open-telemetry/collector-contrib-approvers @evan-bradley @atoulme @tigrannajaryan cmd/otelcontribcol/ @open-telemetry/collector-contrib-approvers cmd/oteltestbedcol/ @open-telemetry/collector-contrib-approvers -cmd/telemetrygen/ @open-telemetry/collector-contrib-approvers @mx-psi @codeboten +cmd/telemetrygen/ @open-telemetry/collector-contrib-approvers @mx-psi @codeboten @Erog38 confmap/provider/aesprovider/ @open-telemetry/collector-contrib-approvers @djaglowski @shazlehu confmap/provider/s3provider/ @open-telemetry/collector-contrib-approvers @Aneurysm9 @@ -149,7 +149,7 @@ pkg/datadog/ @open-telemetry/collector-cont pkg/experimentalmetricmetadata/ @open-telemetry/collector-contrib-approvers @dmitryax pkg/golden/ @open-telemetry/collector-contrib-approvers @djaglowski @atoulme pkg/kafka/topic/ @open-telemetry/collector-contrib-approvers @pavolloffay @MovieStoreGuy -pkg/ottl/ @open-telemetry/collector-contrib-approvers @TylerHelmuth @kentquirk @bogdandrutu @evan-bradley +pkg/ottl/ @open-telemetry/collector-contrib-approvers @TylerHelmuth @kentquirk @bogdandrutu @evan-bradley @edmocosta pkg/pdatatest/ @open-telemetry/collector-contrib-approvers @djaglowski @fatsheep9146 pkg/pdatautil/ @open-telemetry/collector-contrib-approvers @dmitryax pkg/resourcetotelemetry/ @open-telemetry/collector-contrib-approvers @mx-psi @@ -194,7 +194,7 @@ processor/schemaprocessor/ @open-telemetry/collector-cont processor/spanprocessor/ @open-telemetry/collector-contrib-approvers @boostchicken processor/sumologicprocessor/ @open-telemetry/collector-contrib-approvers @rnishtala-sumo @chan-tim-sumo processor/tailsamplingprocessor/ @open-telemetry/collector-contrib-approvers @jpkrohling -processor/transformprocessor/ @open-telemetry/collector-contrib-approvers @TylerHelmuth @kentquirk @bogdandrutu @evan-bradley +processor/transformprocessor/ @open-telemetry/collector-contrib-approvers @TylerHelmuth @kentquirk @bogdandrutu @evan-bradley @edmocosta receiver/activedirectorydsreceiver/ @open-telemetry/collector-contrib-approvers @pjanotti receiver/aerospikereceiver/ @open-telemetry/collector-contrib-approvers @antonblock diff --git a/.github/lychee.toml b/.github/lychee.toml new file mode 100644 index 000000000000..a228cd084361 --- /dev/null +++ b/.github/lychee.toml @@ -0,0 +1,11 @@ +include-fragments = true + +accept = ["200..=299", "429"] + +exclude = [ + "^http(s)?://localhost", + "^http(s)?://example.com" +] + +# better to be safe and avoid failures +max-retries = 6 diff --git a/.github/workflows/build-and-test-windows.yml b/.github/workflows/build-and-test-windows.yml index dafbfe3838a8..b4d56ec35f48 100644 --- a/.github/workflows/build-and-test-windows.yml +++ b/.github/workflows/build-and-test-windows.yml @@ -45,7 +45,8 @@ jobs: - cmd-0 - cmd-1 - other - runs-on: windows-latest + os: [windows-2022, windows-2025] + runs-on: ${{ matrix.os }} if: ${{ github.actor != 'dependabot[bot]' && (contains(github.event.pull_request.labels.*.name, 'Run Windows') || github.event_name == 'push' || github.event_name == 'merge_group') }} env: # Limit memory usage via GC environment variables to avoid OOM on GH runners, especially for `cmd/otelcontribcol`, diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index f2966c9065ff..50efb4040a6d 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -84,14 +84,10 @@ jobs: - name: Render .chloggen changelog entries if: ${{ !contains(github.event.pull_request.labels.*.name, 'dependencies') && !contains(github.event.pull_request.labels.*.name, 'Skip Changelog') && !contains(github.event.pull_request.title, '[chore]')}} run: make chlog-preview > changelog_preview.md - - name: Install markdown-link-check + - name: Link Checker if: ${{ !contains(github.event.pull_request.labels.*.name, 'dependencies') && !contains(github.event.pull_request.labels.*.name, 'Skip Changelog') && !contains(github.event.pull_request.title, '[chore]')}} - run: npm install -g markdown-link-check@${{ env.MD_LINK_CHECK_VERSION }} - - name: Run markdown-link-check - if: ${{ !contains(github.event.pull_request.labels.*.name, 'dependencies') && !contains(github.event.pull_request.labels.*.name, 'Skip Changelog') && !contains(github.event.pull_request.title, '[chore]')}} - run: | - markdown-link-check \ - --verbose \ - --config .github/workflows/check_links_config.json \ - changelog_preview.md \ - || { echo "Check that anchor links are lowercase"; exit 1; } + id: lychee + uses: lycheeverse/lychee-action@f796c8b7d468feb9b8c0a46da3fac0af6874d374 + with: + args: "--verbose --no-progress ./changelog_preview.md --config .github/lychee.toml" + failIfEmpty: false diff --git a/.github/workflows/check-links.yaml b/.github/workflows/check-links.yaml index 69fe83dd18c6..e048c17d1f37 100644 --- a/.github/workflows/check-links.yaml +++ b/.github/workflows/check-links.yaml @@ -9,10 +9,6 @@ concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true -env: - # renovate: datasource=github-releases depName=tcort/markdown-link-check - MD_LINK_CHECK_VERSION: "3.12.2" - jobs: changedfiles: name: changed files @@ -43,18 +39,9 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Install markdown-link-check - run: npm install -g markdown-link-check@${{ env.MD_LINK_CHECK_VERSION }} - - name: Run markdown-link-check - run: | - if [ -n "${{ needs.changedfiles.outputs.yaml_files }}" ]; then - md=$(find . -type f -name "*.md") - else - md="${{ needs.changedfiles.outputs.md_files }}" - fi - markdown-link-check \ - --verbose \ - --config .github/workflows/check_links_config.json \ - $md \ - || { echo "Check that anchor links are lowercase"; exit 1; } + - name: Link Checker + id: lychee + uses: lycheeverse/lychee-action@f796c8b7d468feb9b8c0a46da3fac0af6874d374 + with: + args: "--verbose --no-progress ${{needs.changedfiles.outputs.md_files}} ${{needs.changedfiles.outputs.yaml_files}} --config .github/lychee.toml" diff --git a/.github/workflows/check_links_config.json b/.github/workflows/check_links_config.json deleted file mode 100644 index 299206c09254..000000000000 --- a/.github/workflows/check_links_config.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "ignorePatterns": [ - { - "pattern": "http(s)?://\\d+\\.\\d+\\.\\d+\\.\\d+" - }, - { - "pattern": "http(s)?://localhost" - }, - { - "pattern": "http(s)?://example.com" - }, - { - "pattern": "^#" - }, - { - "pattern": "https://blogs\\.oracle\\.com/developers/post/connecting-a-go-application-to-oracle-database" - } - ], - "aliveStatusCodes": [429, 200] -} diff --git a/.github/workflows/e2e-tests-windows.yml b/.github/workflows/e2e-tests-windows.yml index bcfb4f38d865..69b3f8ac8027 100644 --- a/.github/workflows/e2e-tests-windows.yml +++ b/.github/workflows/e2e-tests-windows.yml @@ -32,7 +32,11 @@ jobs: - run: echo $(./.github/workflows/scripts/is_changed_file_windows.sh ${{ github.event.pull_request.base.sha }} ${{ github.sha }} ) collector-build: - runs-on: windows-latest + strategy: + fail-fast: false + matrix: + os: [windows-latest] + runs-on: ${{ matrix.os }} needs: [windows-file-changed] if: ${{ github.actor != 'dependabot[bot]' && ((contains(github.event.pull_request.labels.*.name, 'Run Windows') || github.event_name == 'push' || github.event_name == 'merge_group') || needs.windows-file-changed.outputs.changed == 'true') }} steps: @@ -65,7 +69,11 @@ jobs: path: ./bin/* supervisor-test: - runs-on: windows-latest + strategy: + fail-fast: false + matrix: + os: [windows-2022, windows-2025] + runs-on: ${{ matrix.os }} if: ${{ github.actor != 'dependabot[bot]' && (contains(github.event.pull_request.labels.*.name, 'Run Windows') || github.event_name == 'push' || github.event_name == 'merge_group') }} needs: [collector-build] steps: @@ -97,7 +105,11 @@ jobs: go test -v --tags=e2e windows-supervisor-service-test: - runs-on: windows-latest + strategy: + fail-fast: false + matrix: + os: [windows-2022, windows-2025] + runs-on: ${{ matrix.os }} if: ${{ github.actor != 'dependabot[bot]' && (contains(github.event.pull_request.labels.*.name, 'Run Windows') || github.event_name == 'push' || github.event_name == 'merge_group') }} needs: [collector-build] steps: diff --git a/.github/workflows/scoped-test.yaml b/.github/workflows/scoped-test.yaml new file mode 100644 index 000000000000..d0139df299f8 --- /dev/null +++ b/.github/workflows/scoped-test.yaml @@ -0,0 +1,83 @@ +name: scoped-test + +on: + push: + branches: [ main ] + pull_request: + types: [opened, synchronize, reopened] + +jobs: + changedfiles: + runs-on: ubuntu-latest + if: ${{ github.actor != 'dependabot[bot]' }} + outputs: + go_sources: ${{ steps.changed-files.outputs.sources_all_changed_files }} + go_tests: ${{ steps.changed-files.outputs.tests_all_changed_files }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Get changed go files + id: changed-files + uses: tj-actions/changed-files@v45 + with: + files_yaml: | + sources: + - '**/*.go' + - '!**/*_test.go' + tests: + - '**/*_test.go' + + scoped-tests: + needs: changedfiles + if: needs.changedfiles.outputs.go_sources != '' || needs.changedfiles.outputs.go_tests != '' + strategy: + fail-fast: false + matrix: + os: [ windows-latest ] + runs-on: ${{ matrix.os }} + steps: + - name: Echo changed files + shell: bash + run: | + echo "go_sources: ${{ needs.changedfiles.outputs.go_sources }}" + echo "go_tests: ${{ needs.changedfiles.outputs.go_tests }}" + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: "1.22.8" + cache: false + + - name: Try to restore go-cache + id: go-cache + timeout-minutes: 25 + uses: actions/cache/restore@v4 + with: + path: | + ~/go/bin + ~/go/pkg/mod + ./.tools + key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }} + + - name: Build gotestsum on Windows + if: runner.os == 'Windows' + run: make "$(${PWD} -replace '\\', '/')/.tools/gotestsum" + + - name: Build gotestsum + if: runner.os != 'Windows' + run: make "$PWD/.tools/gotestsum" + + - name: Run changed tests + if: needs.changedfiles.outputs.go_tests + env: + CHANGED_GOLANG_TESTS: ${{ needs.changedfiles.outputs.go_tests }} + run: | + make run-changed-tests + + - name: Run tests on dependent components + if: needs.changedfiles.outputs.go_sources + env: + CHANGED_GOLANG_SOURCES: ${{ needs.changedfiles.outputs.go_sources }} + run: | + make for-affected-components CMD="make test" diff --git a/.github/workflows/update-otel.yaml b/.github/workflows/update-otel.yaml new file mode 100644 index 000000000000..5064d77500fb --- /dev/null +++ b/.github/workflows/update-otel.yaml @@ -0,0 +1,36 @@ +name: 'Update contrib to the latest core source' +on: + workflow_dispatch: + # TODO: Enable schedule once it's verified that the action works as expected. + # schedule: + # - cron: "27 21 * * *" # Run at an arbitrary time on weekdays. + +jobs: + update-otel: + runs-on: ubuntu-24.04 + if: ${{ github.repository_owner == 'open-telemetry' }} + steps: + - uses: actions/checkout@v4 + with: + path: opentelemetry-collector-contrib + - name: Pull the latest collector repo + uses: actions/checkout@v4 + with: + path: opentelemetry-collector + repository: open-telemetry/opentelemetry-collector + - name: Update to latest opentelemetry-collector release + run: | + cd opentelemetry-collector-contrib + git config user.name opentelemetrybot + git config user.email 107717825+opentelemetrybot@users.noreply.github.com + make genotelcontribcol + make update-otel + - name: Create pull request against main + uses: peter-evans/create-pull-request@v7 + with: + branch: opentelemetrybot/update-otel + token: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }} + commit-message: Update to latest opentelemetry-collector release. + title: "[chore] Update to latest opentelemetry-collector" + body: | + This PR updates the opentelemetry-collector dependency to the latest release. diff --git a/Makefile b/Makefile index 176ba2b07f85..341c909dbfc3 100644 --- a/Makefile +++ b/Makefile @@ -421,7 +421,8 @@ update-otel:$(MULTIMOD) $(call updatehelper,$(CORE_VERSIONS),$(GOMOD),./cmd/oteltestbedcol/builder-config.yaml) $(MAKE) genotelcontribcol $(MAKE) genoteltestbedcol - $(MAKE) oteltestbedcol + $(MAKE) generate + $(MAKE) crosslink $(MAKE) remove-toolchain git add . && git commit -s -m "[chore] mod and toolchain tidy" ; \ diff --git a/Makefile.Common b/Makefile.Common index 386dcf760dd7..ff753533d19f 100644 --- a/Makefile.Common +++ b/Makefile.Common @@ -40,6 +40,8 @@ GOOS=$(shell $(GOCMD) env GOOS) GOARCH=$(shell $(GOCMD) env GOARCH) GOTESTARCH?=$(GOARCH) +DOCKERCMD ?= docker + # In order to help reduce toil related to managing tooling for the open telemetry collector # this section of the makefile looks at only requiring command definitions to be defined # as part of $(TOOLS_MOD_DIR)/tools.go, following the existing practice. @@ -206,9 +208,15 @@ checklicense: $(ADDLICENSE) .PHONY: checklinks checklinks: - command -v $(MDLINKCHECK) >/dev/null 2>&1 || { echo >&2 "$(MDLINKCHECK) not installed. Run 'npm install -g markdown-link-check'"; exit 1; } - find . -name \*.md -print0 | xargs -0 -n1 \ - $(MDLINKCHECK) -q -c $(SRC_ROOT)/.github/workflows/check_links_config.json || true + command -v $(DOCKERCMD) >/dev/null 2>&1 || { echo >&2 "$(DOCKERCMD) not installed. Install before continuing"; exit 1; } + $(DOCKERCMD) run -w /home/repo --rm \ + --mount 'type=bind,source='$(PWD)',target=/home/repo' \ + --mount 'type=bind,source='$(SRC_ROOT)/.github/lychee.toml',target=/lychee.toml' \ + lycheeverse/lychee \ + --config /lychee.toml \ + --root-dir /home/repo \ + -v \ + --no-progress './**/*.md' .PHONY: fmt fmt: $(GOFUMPT) $(GOIMPORTS) @@ -258,3 +266,43 @@ testifylint-fix: gci: $(TOOLS_BIN_DIR)/gci @echo "running $(GCI)" @$(GCI) write -s standard -s default -s "prefix(github.com/open-telemetry/opentelemetry-collector-contrib)" $(ALL_SRC_AND_DOC) + +CHANGED_GOLANG_SOURCES?=$(shell git diff main --name-only | grep -E '.*\.go$$' | grep -v -E '.*_test\.go$$') +.PHONY: for-affected-components +for-affected-components: + @echo "Checking for affected components..." + @if [ -z '$(CHANGED_GOLANG_SOURCES)' ]; then \ + echo "No go source changes detected in shippable code."; \ + else \ + cd $(SRC_ROOT); \ + DEPENDENT_PKGS=$$(echo $(CHANGED_GOLANG_SOURCES) | xargs sed -n 's|^package .* // import "\(.*\)"$$|\1|p' | uniq); \ + if [ -z '$${DEPENDENT_PKGS}' ]; then \ + echo "No other package depends on the one being changed."; \ + else \ + DEPENDENT_PKG_DIRS=$$(echo $${DEPENDENT_PKGS} | tr ' ' '\n' | xargs -I {} grep --include=go.mod -rl {} | xargs -r dirname | uniq); \ + set -e; for dir in $$(echo $${DEPENDENT_PKG_DIRS}); do \ + (cd "$${dir}" && \ + echo "running $${CMD} in $${dir}" && \ + $${CMD} ); \ + done \ + fi \ + fi + +CHANGED_GOLANG_TESTS?=$(shell git diff main --name-only | grep -E '.*_test\.go$$') +.PHONY: run-changed-tests +run-changed-tests: + @echo "Checking for affected tests..." + @if [ -z '$(CHANGED_GOLANG_TESTS)' ]; then \ + echo "No go test changes detected."; \ + else \ + cd $(SRC_ROOT); \ + AFFECTED_TEST_DIRS=$$(echo $(CHANGED_GOLANG_TESTS) | tr ' ' '\n' | xargs dirname | uniq); \ + if [ -z '$${AFFECTED_TEST_DIRS}' ]; then \ + echo "Failed to find the affected test directories."; \ + else \ + set -e; for dir in $$(echo $${AFFECTED_TEST_DIRS}); do \ + (cd "$${dir}" && \ + $(GOTESTSUM) $(GOTESTSUM_OPT) --packages="./..." -- $(GOTEST_OPT) ); \ + done \ + fi \ + fi diff --git a/cmd/githubgen/codeowners.go b/cmd/githubgen/codeowners.go index 70f1b2f9450f..615429be9c57 100644 --- a/cmd/githubgen/codeowners.go +++ b/cmd/githubgen/codeowners.go @@ -10,7 +10,7 @@ import ( "sort" "strings" - "github.com/google/go-github/v67/github" + "github.com/google/go-github/v68/github" ) const allowlistHeader = `# Code generated by githubgen. DO NOT EDIT. diff --git a/cmd/githubgen/go.mod b/cmd/githubgen/go.mod index c187954e7d45..a11af8b5abcd 100644 --- a/cmd/githubgen/go.mod +++ b/cmd/githubgen/go.mod @@ -3,7 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/cmd/githubgen go 1.22.0 require ( - github.com/google/go-github/v67 v67.0.0 + github.com/google/go-github/v68 v68.0.0 go.opentelemetry.io/collector/confmap v1.23.0 go.opentelemetry.io/collector/confmap/provider/fileprovider v1.23.0 gopkg.in/yaml.v3 v3.0.1 diff --git a/cmd/githubgen/go.sum b/cmd/githubgen/go.sum index fece849f7acb..ebd3b35a30e8 100644 --- a/cmd/githubgen/go.sum +++ b/cmd/githubgen/go.sum @@ -5,8 +5,8 @@ github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlnd github.com/google/go-cmp v0.5.2/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/go-github/v67 v67.0.0 h1:g11NDAmfaBaCO8qYdI9fsmbaRipHNWRIU/2YGvlh4rg= -github.com/google/go-github/v67 v67.0.0/go.mod h1:zH3K7BxjFndr9QSeFibx4lTKkYS3K9nDanoI1NjaOtY= +github.com/google/go-github/v68 v68.0.0 h1:ZW57zeNZiXTdQ16qrDiZ0k6XucrxZ2CGmoTvcCyQG6s= +github.com/google/go-github/v68 v68.0.0/go.mod h1:K9HAUBovM2sLwM408A18h+wd9vqdLOEqTUCbnRIcx68= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= diff --git a/cmd/opampsupervisor/e2e_test.go b/cmd/opampsupervisor/e2e_test.go index 96935b4bd0d0..b4f80e9624c8 100644 --- a/cmd/opampsupervisor/e2e_test.go +++ b/cmd/opampsupervisor/e2e_test.go @@ -64,7 +64,7 @@ func (tl testLogger) Errorf(_ context.Context, format string, args ...any) { tl.t.Logf(format, args...) } -func defaultConnectingHandler(connectionCallbacks server.ConnectionCallbacksStruct) func(request *http.Request) types.ConnectionResponse { +func defaultConnectingHandler(connectionCallbacks types.ConnectionCallbacks) func(request *http.Request) types.ConnectionResponse { return func(_ *http.Request) types.ConnectionResponse { return types.ConnectionResponse{ Accept: true, @@ -73,11 +73,11 @@ func defaultConnectingHandler(connectionCallbacks server.ConnectionCallbacksStru } } -// onConnectingFuncFactory is a function that will be given to server.CallbacksStruct as +// onConnectingFuncFactory is a function that will be given to types.ConnectionCallbacks as // OnConnectingFunc. This allows changing the ConnectionCallbacks both from the newOpAMPServer // caller and inside of newOpAMP Server, and for custom implementations of the value for `Accept` // in types.ConnectionResponse. -type onConnectingFuncFactory func(connectionCallbacks server.ConnectionCallbacksStruct) func(request *http.Request) types.ConnectionResponse +type onConnectingFuncFactory func(connectionCallbacks types.ConnectionCallbacks) func(request *http.Request) types.ConnectionResponse type testingOpAMPServer struct { addr string @@ -87,20 +87,20 @@ type testingOpAMPServer struct { shutdown func() } -func newOpAMPServer(t *testing.T, connectingCallback onConnectingFuncFactory, callbacks server.ConnectionCallbacksStruct) *testingOpAMPServer { +func newOpAMPServer(t *testing.T, connectingCallback onConnectingFuncFactory, callbacks types.ConnectionCallbacks) *testingOpAMPServer { s := newUnstartedOpAMPServer(t, connectingCallback, callbacks) s.start() return s } -func newUnstartedOpAMPServer(t *testing.T, connectingCallback onConnectingFuncFactory, callbacks server.ConnectionCallbacksStruct) *testingOpAMPServer { +func newUnstartedOpAMPServer(t *testing.T, connectingCallback onConnectingFuncFactory, callbacks types.ConnectionCallbacks) *testingOpAMPServer { var agentConn atomic.Value var isAgentConnected atomic.Bool var didShutdown atomic.Bool connectedChan := make(chan bool) s := server.New(testLogger{t: t}) - onConnectedFunc := callbacks.OnConnectedFunc - callbacks.OnConnectedFunc = func(ctx context.Context, conn types.Connection) { + onConnectedFunc := callbacks.OnConnected + callbacks.OnConnected = func(ctx context.Context, conn types.Connection) { if onConnectedFunc != nil { onConnectedFunc(ctx, conn) } @@ -108,8 +108,8 @@ func newUnstartedOpAMPServer(t *testing.T, connectingCallback onConnectingFuncFa isAgentConnected.Store(true) connectedChan <- true } - onConnectionCloseFunc := callbacks.OnConnectionCloseFunc - callbacks.OnConnectionCloseFunc = func(conn types.Connection) { + onConnectionCloseFunc := callbacks.OnConnectionClose + callbacks.OnConnectionClose = func(conn types.Connection) { isAgentConnected.Store(false) connectedChan <- false if onConnectionCloseFunc != nil { @@ -117,8 +117,8 @@ func newUnstartedOpAMPServer(t *testing.T, connectingCallback onConnectingFuncFa } } handler, _, err := s.Attach(server.Settings{ - Callbacks: server.CallbacksStruct{ - OnConnectingFunc: connectingCallback(callbacks), + Callbacks: types.Callbacks{ + OnConnecting: connectingCallback(callbacks), }, }) require.NoError(t, err) @@ -211,8 +211,8 @@ func TestSupervisorStartsCollectorWithRemoteConfig(t *testing.T) { server := newOpAMPServer( t, defaultConnectingHandler, - server.ConnectionCallbacksStruct{ - OnMessageFunc: func(_ context.Context, _ types.Connection, message *protobufs.AgentToServer) *protobufs.ServerToAgent { + types.ConnectionCallbacks{ + OnMessage: func(_ context.Context, _ types.Connection, message *protobufs.AgentToServer) *protobufs.ServerToAgent { if message.EffectiveConfig != nil { config := message.EffectiveConfig.ConfigMap.ConfigMap[""] if config != nil { @@ -287,8 +287,8 @@ func TestSupervisorStartsCollectorWithNoOpAMPServer(t *testing.T) { require.NoError(t, os.WriteFile(remoteConfigFilePath, marshalledRemoteConfig, 0o600)) connected := atomic.Bool{} - server := newUnstartedOpAMPServer(t, defaultConnectingHandler, server.ConnectionCallbacksStruct{ - OnConnectedFunc: func(ctx context.Context, conn types.Connection) { + server := newUnstartedOpAMPServer(t, defaultConnectingHandler, types.ConnectionCallbacks{ + OnConnected: func(ctx context.Context, conn types.Connection) { connected.Store(true) }, }) @@ -331,19 +331,20 @@ func TestSupervisorStartsWithNoOpAMPServer(t *testing.T) { configuredChan := make(chan struct{}) connected := atomic.Bool{} - server := newUnstartedOpAMPServer(t, defaultConnectingHandler, server.ConnectionCallbacksStruct{ - OnConnectedFunc: func(ctx context.Context, conn types.Connection) { - connected.Store(true) - }, - OnMessageFunc: func(ctx context.Context, conn types.Connection, message *protobufs.AgentToServer) *protobufs.ServerToAgent { - lastCfgHash := message.GetRemoteConfigStatus().GetLastRemoteConfigHash() - if bytes.Equal(lastCfgHash, hash) { - close(configuredChan) - } + server := newUnstartedOpAMPServer(t, defaultConnectingHandler, + types.ConnectionCallbacks{ + OnConnected: func(ctx context.Context, conn types.Connection) { + connected.Store(true) + }, + OnMessage: func(ctx context.Context, conn types.Connection, message *protobufs.AgentToServer) *protobufs.ServerToAgent { + lastCfgHash := message.GetRemoteConfigStatus().GetLastRemoteConfigHash() + if bytes.Equal(lastCfgHash, hash) { + close(configuredChan) + } - return &protobufs.ServerToAgent{} - }, - }) + return &protobufs.ServerToAgent{} + }, + }) defer server.shutdown() // The supervisor is started without a running OpAMP server. @@ -415,8 +416,8 @@ func TestSupervisorRestartsCollectorAfterBadConfig(t *testing.T) { server := newOpAMPServer( t, defaultConnectingHandler, - server.ConnectionCallbacksStruct{ - OnMessageFunc: func(_ context.Context, _ types.Connection, message *protobufs.AgentToServer) *protobufs.ServerToAgent { + types.ConnectionCallbacks{ + OnMessage: func(_ context.Context, _ types.Connection, message *protobufs.AgentToServer) *protobufs.ServerToAgent { if message.Health != nil { healthReport.Store(message.Health) } @@ -501,8 +502,8 @@ func TestSupervisorConfiguresCapabilities(t *testing.T) { server := newOpAMPServer( t, defaultConnectingHandler, - server.ConnectionCallbacksStruct{ - OnMessageFunc: func(_ context.Context, _ types.Connection, message *protobufs.AgentToServer) *protobufs.ServerToAgent { + types.ConnectionCallbacks{ + OnMessage: func(_ context.Context, _ types.Connection, message *protobufs.AgentToServer) *protobufs.ServerToAgent { capabilities.Store(message.Capabilities) return &protobufs.ServerToAgent{} @@ -556,8 +557,8 @@ func TestSupervisorBootstrapsCollector(t *testing.T) { server := newOpAMPServer( t, defaultConnectingHandler, - server.ConnectionCallbacksStruct{ - OnMessageFunc: func(_ context.Context, _ types.Connection, message *protobufs.AgentToServer) *protobufs.ServerToAgent { + types.ConnectionCallbacks{ + OnMessage: func(_ context.Context, _ types.Connection, message *protobufs.AgentToServer) *protobufs.ServerToAgent { if message.AgentDescription != nil { agentDescription.Store(message.AgentDescription) } @@ -602,8 +603,8 @@ func TestSupervisorReportsEffectiveConfig(t *testing.T) { server := newOpAMPServer( t, defaultConnectingHandler, - server.ConnectionCallbacksStruct{ - OnMessageFunc: func(_ context.Context, _ types.Connection, message *protobufs.AgentToServer) *protobufs.ServerToAgent { + types.ConnectionCallbacks{ + OnMessage: func(_ context.Context, _ types.Connection, message *protobufs.AgentToServer) *protobufs.ServerToAgent { if message.EffectiveConfig != nil { config := message.EffectiveConfig.ConfigMap.ConfigMap[""] if config != nil { @@ -713,8 +714,8 @@ func TestSupervisorAgentDescriptionConfigApplies(t *testing.T) { server := newOpAMPServer( t, defaultConnectingHandler, - server.ConnectionCallbacksStruct{ - OnMessageFunc: func(_ context.Context, _ types.Connection, message *protobufs.AgentToServer) *protobufs.ServerToAgent { + types.ConnectionCallbacks{ + OnMessage: func(_ context.Context, _ types.Connection, message *protobufs.AgentToServer) *protobufs.ServerToAgent { if message.AgentDescription != nil { select { case agentDescMessageChan <- message: @@ -866,8 +867,8 @@ func TestSupervisorRestartCommand(t *testing.T) { server := newOpAMPServer( t, defaultConnectingHandler, - server.ConnectionCallbacksStruct{ - OnMessageFunc: func(_ context.Context, _ types.Connection, message *protobufs.AgentToServer) *protobufs.ServerToAgent { + types.ConnectionCallbacks{ + OnMessage: func(_ context.Context, _ types.Connection, message *protobufs.AgentToServer) *protobufs.ServerToAgent { if message.Health != nil { healthReport.Store(message.Health) } @@ -948,7 +949,7 @@ func TestSupervisorOpAMPConnectionSettings(t *testing.T) { initialServer := newOpAMPServer( t, defaultConnectingHandler, - server.ConnectionCallbacksStruct{}) + types.ConnectionCallbacks{}) s := newSupervisor(t, "accepts_conn", map[string]string{"url": initialServer.addr}) @@ -960,11 +961,11 @@ func TestSupervisorOpAMPConnectionSettings(t *testing.T) { newServer := newOpAMPServer( t, defaultConnectingHandler, - server.ConnectionCallbacksStruct{ - OnConnectedFunc: func(_ context.Context, _ types.Connection) { + types.ConnectionCallbacks{ + OnConnected: func(_ context.Context, _ types.Connection) { connectedToNewServer.Store(true) }, - OnMessageFunc: func(_ context.Context, _ types.Connection, _ *protobufs.AgentToServer) *protobufs.ServerToAgent { + OnMessage: func(_ context.Context, _ types.Connection, _ *protobufs.AgentToServer) *protobufs.ServerToAgent { return &protobufs.ServerToAgent{} }, }) @@ -999,8 +1000,8 @@ func TestSupervisorRestartsWithLastReceivedConfig(t *testing.T) { initialServer := newOpAMPServer( t, defaultConnectingHandler, - server.ConnectionCallbacksStruct{ - OnMessageFunc: func(_ context.Context, _ types.Connection, message *protobufs.AgentToServer) *protobufs.ServerToAgent { + types.ConnectionCallbacks{ + OnMessage: func(_ context.Context, _ types.Connection, message *protobufs.AgentToServer) *protobufs.ServerToAgent { if message.EffectiveConfig != nil { config := message.EffectiveConfig.ConfigMap.ConfigMap[""] if config != nil { @@ -1043,8 +1044,8 @@ func TestSupervisorRestartsWithLastReceivedConfig(t *testing.T) { newServer := newOpAMPServer( t, defaultConnectingHandler, - server.ConnectionCallbacksStruct{ - OnMessageFunc: func(_ context.Context, _ types.Connection, message *protobufs.AgentToServer) *protobufs.ServerToAgent { + types.ConnectionCallbacks{ + OnMessage: func(_ context.Context, _ types.Connection, message *protobufs.AgentToServer) *protobufs.ServerToAgent { if message.EffectiveConfig != nil { config := message.EffectiveConfig.ConfigMap.ConfigMap[""] if config != nil { @@ -1087,8 +1088,8 @@ func TestSupervisorPersistsInstanceID(t *testing.T) { server := newOpAMPServer( t, defaultConnectingHandler, - server.ConnectionCallbacksStruct{ - OnMessageFunc: func(_ context.Context, _ types.Connection, message *protobufs.AgentToServer) *protobufs.ServerToAgent { + types.ConnectionCallbacks{ + OnMessage: func(_ context.Context, _ types.Connection, message *protobufs.AgentToServer) *protobufs.ServerToAgent { select { case agentIDChan <- message.InstanceUid: default: @@ -1163,8 +1164,8 @@ func TestSupervisorPersistsNewInstanceID(t *testing.T) { server := newOpAMPServer( t, defaultConnectingHandler, - server.ConnectionCallbacksStruct{ - OnMessageFunc: func(_ context.Context, _ types.Connection, message *protobufs.AgentToServer) *protobufs.ServerToAgent { + types.ConnectionCallbacks{ + OnMessage: func(_ context.Context, _ types.Connection, message *protobufs.AgentToServer) *protobufs.ServerToAgent { select { case agentIDChan <- message.InstanceUid: default: @@ -1242,7 +1243,7 @@ func TestSupervisorWritesAgentFilesToStorageDir(t *testing.T) { server := newOpAMPServer( t, defaultConnectingHandler, - server.ConnectionCallbacksStruct{}, + types.ConnectionCallbacks{}, ) s := newSupervisor(t, "basic", map[string]string{ @@ -1270,8 +1271,8 @@ func TestSupervisorStopsAgentProcessWithEmptyConfigMap(t *testing.T) { server := newOpAMPServer( t, defaultConnectingHandler, - server.ConnectionCallbacksStruct{ - OnMessageFunc: func(_ context.Context, _ types.Connection, message *protobufs.AgentToServer) *protobufs.ServerToAgent { + types.ConnectionCallbacks{ + OnMessage: func(_ context.Context, _ types.Connection, message *protobufs.AgentToServer) *protobufs.ServerToAgent { if message.EffectiveConfig != nil { config := message.EffectiveConfig.ConfigMap.ConfigMap[""] if config != nil { @@ -1386,8 +1387,8 @@ func TestSupervisorLogging(t *testing.T) { require.NoError(t, os.WriteFile(remoteCfgFilePath, marshalledRemoteCfg, 0o600)) connected := atomic.Bool{} - server := newUnstartedOpAMPServer(t, defaultConnectingHandler, server.ConnectionCallbacksStruct{ - OnConnectedFunc: func(ctx context.Context, conn types.Connection) { + server := newUnstartedOpAMPServer(t, defaultConnectingHandler, types.ConnectionCallbacks{ + OnConnected: func(ctx context.Context, conn types.Connection) { connected.Store(true) }, }) @@ -1449,8 +1450,8 @@ func TestSupervisorRemoteConfigApplyStatus(t *testing.T) { server := newOpAMPServer( t, defaultConnectingHandler, - server.ConnectionCallbacksStruct{ - OnMessageFunc: func(_ context.Context, _ types.Connection, message *protobufs.AgentToServer) *protobufs.ServerToAgent { + types.ConnectionCallbacks{ + OnMessage: func(_ context.Context, _ types.Connection, message *protobufs.AgentToServer) *protobufs.ServerToAgent { if message.EffectiveConfig != nil { config := message.EffectiveConfig.ConfigMap.ConfigMap[""] if config != nil { @@ -1586,8 +1587,8 @@ func TestSupervisorOpAmpServerPort(t *testing.T) { server := newOpAMPServer( t, defaultConnectingHandler, - server.ConnectionCallbacksStruct{ - OnMessageFunc: func(_ context.Context, _ types.Connection, message *protobufs.AgentToServer) *protobufs.ServerToAgent { + types.ConnectionCallbacks{ + OnMessage: func(_ context.Context, _ types.Connection, message *protobufs.AgentToServer) *protobufs.ServerToAgent { if message.EffectiveConfig != nil { config := message.EffectiveConfig.ConfigMap.ConfigMap[""] if config != nil { diff --git a/cmd/opampsupervisor/go.mod b/cmd/opampsupervisor/go.mod index f3087d9a6513..01f95769086e 100644 --- a/cmd/opampsupervisor/go.mod +++ b/cmd/opampsupervisor/go.mod @@ -10,7 +10,7 @@ require ( github.com/knadh/koanf/providers/file v1.1.2 github.com/knadh/koanf/providers/rawbytes v0.1.0 github.com/knadh/koanf/v2 v2.1.2 - github.com/open-telemetry/opamp-go v0.17.0 + github.com/open-telemetry/opamp-go v0.18.0 github.com/stretchr/testify v1.10.0 go.opentelemetry.io/collector/config/configopaque v1.23.0 go.opentelemetry.io/collector/config/configtls v1.23.0 @@ -20,7 +20,7 @@ require ( go.opentelemetry.io/collector/semconv v0.117.0 go.uber.org/goleak v1.3.0 go.uber.org/zap v1.27.0 - golang.org/x/sys v0.28.0 + golang.org/x/sys v0.29.0 google.golang.org/protobuf v1.36.2 gopkg.in/yaml.v3 v3.0.1 ) @@ -29,7 +29,6 @@ require ( github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/go-viper/mapstructure/v2 v2.2.1 // indirect - github.com/google/go-cmp v0.6.0 // indirect github.com/gorilla/websocket v1.5.3 // indirect github.com/knadh/koanf/providers/confmap v0.1.0 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect diff --git a/cmd/opampsupervisor/go.sum b/cmd/opampsupervisor/go.sum index 876920945e24..df86d5e3bebd 100644 --- a/cmd/opampsupervisor/go.sum +++ b/cmd/opampsupervisor/go.sum @@ -32,12 +32,14 @@ github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa1 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/open-telemetry/opamp-go v0.17.0 h1:3R4+B/6Sy8mknLBbzO3gqloqwTT02rCSRcr4ac2B124= -github.com/open-telemetry/opamp-go v0.17.0/go.mod h1:SGDhUoAx7uGutO4ENNMQla/tiSujxgZmMPJXIOPGBdk= +github.com/open-telemetry/opamp-go v0.18.0 h1:sNHsrBvGU2CMxCB1TRJXncDARrmxDEebx8dsEIawqA4= +github.com/open-telemetry/opamp-go v0.18.0/go.mod h1:9/1G6T5dnJz4cJtoYSr6AX18kHdOxnxxETJPZSHyEUg= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/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.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= go.opentelemetry.io/collector/config/configopaque v1.23.0 h1:SEnEzOHufGc4KGOjQq8zKIQuDBmRFl9ncZ3qs1SRpJk= @@ -58,8 +60,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/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= google.golang.org/protobuf v1.36.2 h1:R8FeyR1/eLmkutZOM5CWghmo5itiG9z0ktFlTVLuTmU= google.golang.org/protobuf v1.36.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/cmd/opampsupervisor/supervisor/server.go b/cmd/opampsupervisor/supervisor/server.go index cd54f96336eb..4ecfd9afa617 100644 --- a/cmd/opampsupervisor/supervisor/server.go +++ b/cmd/opampsupervisor/supervisor/server.go @@ -13,24 +13,26 @@ import ( ) type flattenedSettings struct { - onMessageFunc func(conn serverTypes.Connection, message *protobufs.AgentToServer) - onConnectingFunc func(request *http.Request) (shouldConnect bool, rejectStatusCode int) - onConnectionCloseFunc func(conn serverTypes.Connection) - endpoint string + onMessage func(conn serverTypes.Connection, message *protobufs.AgentToServer) + onConnecting func(request *http.Request) (shouldConnect bool, rejectStatusCode int) + onConnectionClose func(conn serverTypes.Connection) + endpoint string } func (fs flattenedSettings) toServerSettings() server.StartSettings { return server.StartSettings{ Settings: server.Settings{ - Callbacks: fs, + Callbacks: serverTypes.Callbacks{ + OnConnecting: fs.OnConnecting, + }, }, ListenEndpoint: fs.endpoint, } } func (fs flattenedSettings) OnConnecting(request *http.Request) serverTypes.ConnectionResponse { - if fs.onConnectingFunc != nil { - shouldConnect, rejectStatusCode := fs.onConnectingFunc(request) + if fs.onConnecting != nil { + shouldConnect, rejectStatusCode := fs.onConnecting(request) if !shouldConnect { return serverTypes.ConnectionResponse{ Accept: false, @@ -40,23 +42,25 @@ func (fs flattenedSettings) OnConnecting(request *http.Request) serverTypes.Conn } return serverTypes.ConnectionResponse{ - Accept: true, - ConnectionCallbacks: fs, + Accept: true, + ConnectionCallbacks: serverTypes.ConnectionCallbacks{ + OnMessage: fs.OnMessage, + }, } } func (fs flattenedSettings) OnConnected(_ context.Context, _ serverTypes.Connection) {} func (fs flattenedSettings) OnMessage(_ context.Context, conn serverTypes.Connection, message *protobufs.AgentToServer) *protobufs.ServerToAgent { - if fs.onMessageFunc != nil { - fs.onMessageFunc(conn, message) + if fs.onMessage != nil { + fs.onMessage(conn, message) } return &protobufs.ServerToAgent{} } func (fs flattenedSettings) OnConnectionClose(conn serverTypes.Connection) { - if fs.onConnectionCloseFunc != nil { - fs.onConnectionCloseFunc(conn) + if fs.onConnectionClose != nil { + fs.onConnectionClose(conn) } } diff --git a/cmd/opampsupervisor/supervisor/server_test.go b/cmd/opampsupervisor/supervisor/server_test.go index e35c11ab186e..e4272270300a 100644 --- a/cmd/opampsupervisor/supervisor/server_test.go +++ b/cmd/opampsupervisor/supervisor/server_test.go @@ -28,7 +28,7 @@ func Test_flattenedSettings_OnConnecting(t *testing.T) { t.Run("accept connection", func(t *testing.T) { onConnectingFuncCalled := false fs := flattenedSettings{ - onConnectingFunc: func(_ *http.Request) (shouldConnect bool, rejectStatusCode int) { + onConnecting: func(_ *http.Request) (shouldConnect bool, rejectStatusCode int) { onConnectingFuncCalled = true return true, 0 }, @@ -43,7 +43,7 @@ func Test_flattenedSettings_OnConnecting(t *testing.T) { t.Run("do not accept connection", func(t *testing.T) { onConnectingFuncCalled := false fs := flattenedSettings{ - onConnectingFunc: func(_ *http.Request) (shouldConnect bool, rejectStatusCode int) { + onConnecting: func(_ *http.Request) (shouldConnect bool, rejectStatusCode int) { onConnectingFuncCalled = true return false, 500 }, @@ -60,7 +60,7 @@ func Test_flattenedSettings_OnConnecting(t *testing.T) { func Test_flattenedSettings_OnMessage(t *testing.T) { onMessageFuncCalled := false fs := flattenedSettings{ - onMessageFunc: func(_ serverTypes.Connection, _ *protobufs.AgentToServer) { + onMessage: func(_ serverTypes.Connection, _ *protobufs.AgentToServer) { onMessageFuncCalled = true }, } @@ -74,7 +74,7 @@ func Test_flattenedSettings_OnMessage(t *testing.T) { func Test_flattenedSettings_OnConnectionClose(t *testing.T) { onConnectionCloseFuncCalled := false fs := flattenedSettings{ - onConnectionCloseFunc: func(_ serverTypes.Connection) { + onConnectionClose: func(_ serverTypes.Connection) { onConnectionCloseFuncCalled = true }, } diff --git a/cmd/opampsupervisor/supervisor/supervisor.go b/cmd/opampsupervisor/supervisor/supervisor.go index 4607aa6d5958..894854273c6a 100644 --- a/cmd/opampsupervisor/supervisor/supervisor.go +++ b/cmd/opampsupervisor/supervisor/supervisor.go @@ -305,11 +305,11 @@ func (s *Supervisor) getBootstrapInfo() (err error) { // using the Collector's OpAMP extension. err = srv.Start(flattenedSettings{ endpoint: fmt.Sprintf("localhost:%d", s.opampServerPort), - onConnectingFunc: func(_ *http.Request) (bool, int) { + onConnecting: func(_ *http.Request) (bool, int) { connected.Store(true) return true, http.StatusOK }, - onMessageFunc: func(_ serverTypes.Connection, message *protobufs.AgentToServer) { + onMessage: func(_ serverTypes.Connection, message *protobufs.AgentToServer) { if message.AgentDescription != nil { instanceIDSeen := false s.setAgentDescription(message.AgentDescription) @@ -415,33 +415,33 @@ func (s *Supervisor) startOpAMPClient() error { Header: s.config.Server.Headers, TLSConfig: tlsConfig, InstanceUid: types.InstanceUid(s.persistentState.InstanceID), - Callbacks: types.CallbacksStruct{ - OnConnectFunc: func(_ context.Context) { + Callbacks: types.Callbacks{ + OnConnect: func(_ context.Context) { s.logger.Debug("Connected to the server.") }, - OnConnectFailedFunc: func(_ context.Context, err error) { + OnConnectFailed: func(_ context.Context, err error) { s.logger.Error("Failed to connect to the server", zap.Error(err)) }, - OnErrorFunc: func(_ context.Context, err *protobufs.ServerErrorResponse) { + OnError: func(_ context.Context, err *protobufs.ServerErrorResponse) { s.logger.Error("Server returned an error response", zap.String("message", err.ErrorMessage)) }, - OnMessageFunc: s.onMessage, - OnOpampConnectionSettingsFunc: func(ctx context.Context, settings *protobufs.OpAMPConnectionSettings) error { + OnMessage: s.onMessage, + OnOpampConnectionSettings: func(ctx context.Context, settings *protobufs.OpAMPConnectionSettings) error { //nolint:errcheck go s.onOpampConnectionSettings(ctx, settings) return nil }, - OnCommandFunc: func(_ context.Context, command *protobufs.ServerToAgentCommand) error { + OnCommand: func(_ context.Context, command *protobufs.ServerToAgentCommand) error { cmdType := command.GetType() if *cmdType.Enum() == protobufs.CommandType_CommandType_Restart { return s.handleRestartCommand() } return nil }, - SaveRemoteConfigStatusFunc: func(_ context.Context, _ *protobufs.RemoteConfigStatus) { + SaveRemoteConfigStatus: func(_ context.Context, _ *protobufs.RemoteConfigStatus) { // TODO: https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/21079 }, - GetEffectiveConfigFunc: func(_ context.Context) (*protobufs.EffectiveConfig, error) { + GetEffectiveConfig: func(_ context.Context) (*protobufs.EffectiveConfig, error) { return s.createEffectiveConfigMsg(), nil }, }, @@ -486,13 +486,13 @@ func (s *Supervisor) startOpAMPServer() error { err = s.opampServer.Start(flattenedSettings{ endpoint: fmt.Sprintf("localhost:%d", s.opampServerPort), - onConnectingFunc: func(_ *http.Request) (bool, int) { + onConnecting: func(_ *http.Request) (bool, int) { // Only allow one agent to be connected the this server at a time. alreadyConnected := connected.Swap(true) return !alreadyConnected, http.StatusConflict }, - onMessageFunc: s.handleAgentOpAMPMessage, - onConnectionCloseFunc: func(_ serverTypes.Connection) { + onMessage: s.handleAgentOpAMPMessage, + onConnectionClose: func(_ serverTypes.Connection) { connected.Store(false) }, }.toServerSettings()) diff --git a/cmd/otelcontribcol/builder-config.yaml b/cmd/otelcontribcol/builder-config.yaml index bb1d2929ab43..bff9f514f030 100644 --- a/cmd/otelcontribcol/builder-config.yaml +++ b/cmd/otelcontribcol/builder-config.yaml @@ -40,6 +40,7 @@ extensions: - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/solarwindsapmsettingsextension v0.117.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage/dbstorage v0.117.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage/filestorage v0.117.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage/redisstorageextension v0.117.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/sumologicextension v0.117.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension v0.117.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jaegerencodingextension v0.117.0 @@ -163,6 +164,7 @@ receivers: - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/haproxyreceiver v0.117.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver v0.117.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/httpcheckreceiver v0.117.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/huaweicloudcesreceiver v0.117.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/influxdbreceiver v0.117.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/iisreceiver v0.117.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver v0.117.0 diff --git a/cmd/telemetrygen/README.md b/cmd/telemetrygen/README.md index eeed5c0c0fa5..e72ebc833a27 100644 --- a/cmd/telemetrygen/README.md +++ b/cmd/telemetrygen/README.md @@ -6,7 +6,7 @@ | Stability | [development]: metrics, logs | | | [alpha]: traces | | Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Acmd%2Ftelemetrygen%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Acmd%2Ftelemetrygen) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Acmd%2Ftelemetrygen%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Acmd%2Ftelemetrygen) | -| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@mx-psi](https://www.github.com/mx-psi), [@codeboten](https://www.github.com/codeboten) | +| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@mx-psi](https://www.github.com/mx-psi), [@codeboten](https://www.github.com/codeboten), [@Erog38](https://www.github.com/Erog38) | [development]: https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/component-stability.md#development [alpha]: https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/component-stability.md#alpha diff --git a/cmd/telemetrygen/go.mod b/cmd/telemetrygen/go.mod index 269d56942ce4..e16b7fb5f072 100644 --- a/cmd/telemetrygen/go.mod +++ b/cmd/telemetrygen/go.mod @@ -3,7 +3,6 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/cmd/telemetryge go 1.22.7 require ( - github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 github.com/spf13/cobra v1.8.1 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.10.0 @@ -26,7 +25,7 @@ require ( go.opentelemetry.io/proto/otlp v1.5.0 go.uber.org/goleak v1.3.0 go.uber.org/zap v1.27.0 - golang.org/x/time v0.8.0 + golang.org/x/time v0.9.0 google.golang.org/grpc v1.69.2 ) @@ -36,7 +35,6 @@ require ( github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/protobuf v1.5.4 // indirect github.com/google/uuid v1.6.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect diff --git a/cmd/telemetrygen/go.sum b/cmd/telemetrygen/go.sum index 956032ca92a5..ea718c318965 100644 --- a/cmd/telemetrygen/go.sum +++ b/cmd/telemetrygen/go.sum @@ -1,44 +1,23 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= 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/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= 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/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= 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-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= 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/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/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= -github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1 h1:VNqngBF40hVlDloBruUehVYC3ArSgIyScOAyMRqBxRg= github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1/go.mod h1:RBRO7fro65R6tjKzYgLAFo0t1QEXY1Dp+i/bvpRiqiQ= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= @@ -47,12 +26,8 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= 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= @@ -60,25 +35,17 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 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_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -121,62 +88,38 @@ go.opentelemetry.io/otel/trace v1.32.0 h1:WIC9mYrXf8TmY/EXuULKc8hR17vE+Hjv2cssQD go.opentelemetry.io/otel/trace v1.32.0/go.mod h1:+i4rkvCraA+tG6AzwloGaCtkx53Fa+L+V8e9a7YvhT8= go.opentelemetry.io/proto/otlp v1.5.0 h1:xJvq7gMzB31/d406fB8U5CBdyQGw4P399D1aQWU/3i4= go.opentelemetry.io/proto/otlp v1.5.0/go.mod h1:keN8WnHxOy8PG0rQZjJJ5A2ebUoafqWp0eVQ4yIXvJ4= -go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= 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.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= 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.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= 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/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -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= 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.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 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-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= golang.org/x/sys v0.29.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.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= -golang.org/x/time v0.8.0 h1:9i3RxcPv3PZnitoVGMPDKZSq1xW1gK1Xy3ArNOGZfEg= -golang.org/x/time v0.8.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/time v0.9.0 h1:EsRrnYcQiGH+5FfbgvV4AP7qEZstoyrHB0DzarOQ4ZY= +golang.org/x/time v0.9.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 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= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= @@ -184,33 +127,16 @@ 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/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto/googleapis/api v0.0.0-20250102185135-69823020774d h1:H8tOf8XM88HvKqLTxe755haY6r1fqqzLbEnfrmLXlSA= google.golang.org/genproto/googleapis/api v0.0.0-20250102185135-69823020774d/go.mod h1:2v7Z7gP2ZUOGsaFyxATQSRoBnKygqVq2Cwnvom7QiqY= google.golang.org/genproto/googleapis/rpc v0.0.0-20250102185135-69823020774d h1:xJJRGY7TJcvIlpSrN3K6LAWgNFUILlO+OMAqtg9aqnw= google.golang.org/genproto/googleapis/rpc v0.0.0-20250102185135-69823020774d/go.mod h1:3ENsm/5D1mzDyhpzeRi1NR784I0BcofWBoSc5QqqMK4= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.69.2 h1:U3S9QEtbXC0bYNvRtcoklF3xGtLViumSYxWykJS+7AU= google.golang.org/grpc v1.69.2/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4= google.golang.org/protobuf v1.36.2 h1:R8FeyR1/eLmkutZOM5CWghmo5itiG9z0ktFlTVLuTmU= google.golang.org/protobuf v1.36.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/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.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/cmd/telemetrygen/internal/common/log.go b/cmd/telemetrygen/internal/common/log.go index a2fcd6e8c5b6..78eb20d2c817 100644 --- a/cmd/telemetrygen/internal/common/log.go +++ b/cmd/telemetrygen/internal/common/log.go @@ -6,8 +6,10 @@ package common import ( "fmt" - grpcZap "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap" "go.uber.org/zap" + "go.uber.org/zap/zapcore" + "go.uber.org/zap/zapgrpc" + "google.golang.org/grpc/grpclog" ) // CreateLogger creates a logger for use by telemetrygen @@ -16,10 +18,12 @@ func CreateLogger(skipSettingGRPCLogger bool) (*zap.Logger, error) { if err != nil { return nil, fmt.Errorf("failed to obtain logger: %w", err) } + if !skipSettingGRPCLogger { - grpcZap.ReplaceGrpcLoggerV2WithVerbosity(logger.WithOptions( - zap.AddCallerSkip(3), - ), 1) // set to warn verbosity to avoid copious logging from grpc framework + grpcLogger := zapgrpc.NewLogger(logger.WithOptions(zap.WrapCore(func(core zapcore.Core) zapcore.Core { + return core.With([]zapcore.Field{zap.Bool("grpc_log", true)}) + }), zap.AddCallerSkip(3))) + grpclog.SetLoggerV2(grpcLogger) } return logger, err } diff --git a/cmd/telemetrygen/internal/e2etest/go.mod b/cmd/telemetrygen/internal/e2etest/go.mod index 800423f214d8..c1b67290ef48 100644 --- a/cmd/telemetrygen/internal/e2etest/go.mod +++ b/cmd/telemetrygen/internal/e2etest/go.mod @@ -21,10 +21,8 @@ require ( github.com/go-logr/stdr v1.2.2 // indirect github.com/go-viper/mapstructure/v2 v2.2.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/protobuf v1.5.4 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/uuid v1.6.0 // indirect - github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1 // indirect github.com/hashicorp/go-version v1.7.0 // indirect github.com/json-iterator/go v1.1.12 // indirect @@ -82,7 +80,7 @@ require ( golang.org/x/net v0.34.0 // indirect golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect - golang.org/x/time v0.8.0 // indirect + golang.org/x/time v0.9.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20250102185135-69823020774d // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20250102185135-69823020774d // indirect google.golang.org/grpc v1.69.2 // indirect diff --git a/cmd/telemetrygen/internal/e2etest/go.sum b/cmd/telemetrygen/internal/e2etest/go.sum index 9039888c0ff4..349375e3f115 100644 --- a/cmd/telemetrygen/internal/e2etest/go.sum +++ b/cmd/telemetrygen/internal/e2etest/go.sum @@ -1,51 +1,30 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= 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/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= 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/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= -github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= 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-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= 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/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/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= -github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1 h1:VNqngBF40hVlDloBruUehVYC3ArSgIyScOAyMRqBxRg= github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1/go.mod h1:RBRO7fro65R6tjKzYgLAFo0t1QEXY1Dp+i/bvpRiqiQ= github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= @@ -62,12 +41,8 @@ github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPgh github.com/knadh/koanf/providers/confmap v0.1.0/go.mod h1:2uLhxQzJnyHKfxG927awZC7+fyHFdQkd697K4MdLnIU= github.com/knadh/koanf/v2 v2.1.2 h1:I2rtLRqXRy1p01m/utEtpZSSA6dcJbgGVuE27kW2PzQ= github.com/knadh/koanf/v2 v2.1.2/go.mod h1:Gphfaen0q1Fc1HTgJgSTC4oRX9R2R5ErYMZJy8fLJBo= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= 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= @@ -81,26 +56,18 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/mostynb/go-grpc-compression v1.2.3 h1:42/BKWMy0KEJGSdWvzqIyOZ95YcR9mLPqKctH7Uo//I= github.com/mostynb/go-grpc-compression v1.2.3/go.mod h1:AghIxF3P57umzqM9yz795+y1Vjs47Km/Y2FE6ouQ7Lg= -github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/pierrec/lz4/v4 v4.1.22 h1:cKFw6uJDK+/gfw5BcDL0JL5aBsAFdsIT18eRtLj7VIU= github.com/pierrec/lz4/v4 v4.1.22/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 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_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -189,62 +156,38 @@ go.opentelemetry.io/otel/trace v1.32.0 h1:WIC9mYrXf8TmY/EXuULKc8hR17vE+Hjv2cssQD go.opentelemetry.io/otel/trace v1.32.0/go.mod h1:+i4rkvCraA+tG6AzwloGaCtkx53Fa+L+V8e9a7YvhT8= go.opentelemetry.io/proto/otlp v1.5.0 h1:xJvq7gMzB31/d406fB8U5CBdyQGw4P399D1aQWU/3i4= go.opentelemetry.io/proto/otlp v1.5.0/go.mod h1:keN8WnHxOy8PG0rQZjJJ5A2ebUoafqWp0eVQ4yIXvJ4= -go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= 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.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= 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.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= 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/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -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= 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.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 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-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= golang.org/x/sys v0.29.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.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= -golang.org/x/time v0.8.0 h1:9i3RxcPv3PZnitoVGMPDKZSq1xW1gK1Xy3ArNOGZfEg= -golang.org/x/time v0.8.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/time v0.9.0 h1:EsRrnYcQiGH+5FfbgvV4AP7qEZstoyrHB0DzarOQ4ZY= +golang.org/x/time v0.9.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 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= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= @@ -252,33 +195,16 @@ 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/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto/googleapis/api v0.0.0-20250102185135-69823020774d h1:H8tOf8XM88HvKqLTxe755haY6r1fqqzLbEnfrmLXlSA= google.golang.org/genproto/googleapis/api v0.0.0-20250102185135-69823020774d/go.mod h1:2v7Z7gP2ZUOGsaFyxATQSRoBnKygqVq2Cwnvom7QiqY= google.golang.org/genproto/googleapis/rpc v0.0.0-20250102185135-69823020774d h1:xJJRGY7TJcvIlpSrN3K6LAWgNFUILlO+OMAqtg9aqnw= google.golang.org/genproto/googleapis/rpc v0.0.0-20250102185135-69823020774d/go.mod h1:3ENsm/5D1mzDyhpzeRi1NR784I0BcofWBoSc5QqqMK4= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.69.2 h1:U3S9QEtbXC0bYNvRtcoklF3xGtLViumSYxWykJS+7AU= google.golang.org/grpc v1.69.2/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4= google.golang.org/protobuf v1.36.2 h1:R8FeyR1/eLmkutZOM5CWghmo5itiG9z0ktFlTVLuTmU= google.golang.org/protobuf v1.36.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/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.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/cmd/telemetrygen/metadata.yaml b/cmd/telemetrygen/metadata.yaml index 505e1fab6978..8f13c06c5000 100644 --- a/cmd/telemetrygen/metadata.yaml +++ b/cmd/telemetrygen/metadata.yaml @@ -6,4 +6,4 @@ status: alpha: [traces] development: [metrics, logs] codeowners: - active: [mx-psi, codeboten] + active: [mx-psi, codeboten, Erog38] diff --git a/confmap/provider/s3provider/go.mod b/confmap/provider/s3provider/go.mod index b75d7346892c..7b9def757579 100644 --- a/confmap/provider/s3provider/go.mod +++ b/confmap/provider/s3provider/go.mod @@ -5,7 +5,7 @@ go 1.22.0 require ( github.com/aws/aws-sdk-go-v2 v1.32.7 github.com/aws/aws-sdk-go-v2/config v1.28.7 - github.com/aws/aws-sdk-go-v2/service/s3 v1.71.1 + github.com/aws/aws-sdk-go-v2/service/s3 v1.72.0 github.com/stretchr/testify v1.10.0 go.opentelemetry.io/collector/confmap v1.23.0 go.uber.org/goleak v1.3.0 diff --git a/confmap/provider/s3provider/go.sum b/confmap/provider/s3provider/go.sum index 4eb7a00da5a3..78bf157db2f1 100644 --- a/confmap/provider/s3provider/go.sum +++ b/confmap/provider/s3provider/go.sum @@ -24,8 +24,8 @@ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.7 h1:8eUsivBQz github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.7/go.mod h1:kLPQvGUmxn/fqiCrDeohwG33bq2pQpGeY62yRO6Nrh0= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.7 h1:Hi0KGbrnr57bEHWM0bJ1QcBzxLrL/k2DHvGYhb8+W1w= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.7/go.mod h1:wKNgWgExdjjrm4qvfbTorkvocEstaoDl4WCvGfeCy9c= -github.com/aws/aws-sdk-go-v2/service/s3 v1.71.1 h1:aOVVZJgWbaH+EJYPvEgkNhCEbXXvH7+oML36oaPK3zE= -github.com/aws/aws-sdk-go-v2/service/s3 v1.71.1/go.mod h1:r+xl5yzMk9083rMR+sJ5TYj9Tihvf/l1oxzZXDgGj2Q= +github.com/aws/aws-sdk-go-v2/service/s3 v1.72.0 h1:SAfh4pNx5LuTafKKWR02Y+hL3A+3TX8cTKG1OIAJaBk= +github.com/aws/aws-sdk-go-v2/service/s3 v1.72.0/go.mod h1:r+xl5yzMk9083rMR+sJ5TYj9Tihvf/l1oxzZXDgGj2Q= github.com/aws/aws-sdk-go-v2/service/sso v1.24.8 h1:CvuUmnXI7ebaUAhbJcDy9YQx8wHR69eZ9I7q5hszt/g= github.com/aws/aws-sdk-go-v2/service/sso v1.24.8/go.mod h1:XDeGv1opzwm8ubxddF0cgqkZWsyOtw4lr6dxwmb6YQg= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.7 h1:F2rBfNAL5UyswqoeWv9zs74N/NanhK16ydHW1pahX6E= diff --git a/connector/countconnector/go.mod b/connector/countconnector/go.mod index 597652a6d4b5..51e94a1ffb47 100644 --- a/connector/countconnector/go.mod +++ b/connector/countconnector/go.mod @@ -67,8 +67,8 @@ require ( go.opentelemetry.io/otel/trace v1.32.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect - golang.org/x/net v0.33.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/net v0.34.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.69.2 // indirect diff --git a/connector/countconnector/go.sum b/connector/countconnector/go.sum index 569b3b3512c1..496b83b85ff2 100644 --- a/connector/countconnector/go.sum +++ b/connector/countconnector/go.sum @@ -163,8 +163,9 @@ golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= -golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= 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= @@ -186,8 +187,9 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= diff --git a/connector/datadogconnector/go.mod b/connector/datadogconnector/go.mod index 178a8882096b..0df4593fb291 100644 --- a/connector/datadogconnector/go.mod +++ b/connector/datadogconnector/go.mod @@ -115,7 +115,20 @@ require ( github.com/alecthomas/participle/v2 v2.1.1 // indirect github.com/antchfx/xmlquery v1.4.3 // indirect github.com/antchfx/xpath v1.3.3 // indirect - github.com/aws/aws-sdk-go v1.55.5 // indirect + github.com/aws/aws-sdk-go-v2 v1.32.7 // indirect + github.com/aws/aws-sdk-go-v2/config v1.28.6 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.17.47 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.22 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.25 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.25 // indirect + github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect + github.com/aws/aws-sdk-go-v2/service/ec2 v1.196.0 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.6 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.24.7 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.6 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.33.2 // indirect + github.com/aws/smithy-go v1.22.1 // indirect github.com/benbjohnson/clock v1.3.5 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/briandowns/spinner v1.23.0 // indirect @@ -165,7 +178,6 @@ require ( github.com/iancoleman/strcase v0.3.0 // indirect github.com/imdario/mergo v0.3.16 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect diff --git a/connector/datadogconnector/go.sum b/connector/datadogconnector/go.sum index acca33e4b1eb..3db167430df3 100644 --- a/connector/datadogconnector/go.sum +++ b/connector/datadogconnector/go.sum @@ -253,6 +253,34 @@ github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+ github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/aws/aws-sdk-go v1.55.5 h1:KKUZBfBoyqy5d3swXyiC7Q76ic40rYcbqH7qjh59kzU= github.com/aws/aws-sdk-go v1.55.5/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU= +github.com/aws/aws-sdk-go-v2 v1.32.7 h1:ky5o35oENWi0JYWUZkB7WYvVPP+bcRF5/Iq7JWSb5Rw= +github.com/aws/aws-sdk-go-v2 v1.32.7/go.mod h1:P5WJBrYqqbWVaOxgH0X/FYYD47/nooaPOZPlQdmiN2U= +github.com/aws/aws-sdk-go-v2/config v1.28.6 h1:D89IKtGrs/I3QXOLNTH93NJYtDhm8SYa9Q5CsPShmyo= +github.com/aws/aws-sdk-go-v2/config v1.28.6/go.mod h1:GDzxJ5wyyFSCoLkS+UhGB0dArhb9mI+Co4dHtoTxbko= +github.com/aws/aws-sdk-go-v2/credentials v1.17.47 h1:48bA+3/fCdi2yAwVt+3COvmatZ6jUDNkDTIsqDiMUdw= +github.com/aws/aws-sdk-go-v2/credentials v1.17.47/go.mod h1:+KdckOejLW3Ks3b0E3b5rHsr2f9yuORBum0WPnE5o5w= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.22 h1:kqOrpojG71DxJm/KDPO+Z/y1phm1JlC8/iT+5XRmAn8= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.22/go.mod h1:NtSFajXVVL8TA2QNngagVZmUtXciyrHOt7xgz4faS/M= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.25 h1:s/fF4+yDQDoElYhfIVvSNyeCydfbuTKzhxSXDXCPasU= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.25/go.mod h1:IgPfDv5jqFIzQSNbUEMoitNooSMXjRSDkhXv8jiROvU= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.25 h1:ZntTCl5EsYnhN/IygQEUugpdwbhdkom9uHcbCftiGgA= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.25/go.mod h1:DBdPrgeocww+CSl1C8cEV8PN1mHMBhuCDLpXezyvWkE= +github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 h1:VaRN3TlFdd6KxX1x3ILT5ynH6HvKgqdiXoTxAF4HQcQ= +github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1/go.mod h1:FbtygfRFze9usAadmnGJNc8KsP346kEe+y2/oyhGAGc= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.196.0 h1:ZBtoihAqfT+5b1FwGHOubq8k10KwaIyKZd2/CRTucAU= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.196.0/go.mod h1:00zqVNJFK6UASrTnuvjJHJuaqUdkVz5tW8Ip+VhzuNg= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1 h1:iXtILhvDxB6kPvEXgsDhGaZCSC6LQET5ZHSdJozeI0Y= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1/go.mod h1:9nu0fVANtYiAePIBh2/pFUSwtJ402hLnp854CNoDOeE= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.6 h1:50+XsN70RS7dwJ2CkVNXzj7U2L1HKP8nqTd3XWEXBN4= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.6/go.mod h1:WqgLmwY7so32kG01zD8CPTJWVWM+TzJoOVHwTg4aPug= +github.com/aws/aws-sdk-go-v2/service/sso v1.24.7 h1:rLnYAfXQ3YAccocshIH5mzNNwZBkBo+bP6EhIxak6Hw= +github.com/aws/aws-sdk-go-v2/service/sso v1.24.7/go.mod h1:ZHtuQJ6t9A/+YDuxOLnbryAmITtr8UysSny3qcyvJTc= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.6 h1:JnhTZR3PiYDNKlXy50/pNeix9aGMo6lLpXwJ1mw8MD4= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.6/go.mod h1:URronUEGfXZN1VpdktPSD1EkAL9mfrV+2F4sjH38qOY= +github.com/aws/aws-sdk-go-v2/service/sts v1.33.2 h1:s4074ZO1Hk8qv65GqNXqDjmkf4HSQqJukaLuuW0TpDA= +github.com/aws/aws-sdk-go-v2/service/sts v1.33.2/go.mod h1:mVggCnIWoM09jP71Wh+ea7+5gAp53q+49wDFs1SW5z8= +github.com/aws/smithy-go v1.22.1 h1:/HPHZQ0g7f4eUeK6HKglFz8uwVfZKgoI25rb/J+dnro= +github.com/aws/smithy-go v1.22.1/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= github.com/benbjohnson/clock v1.3.5 h1:VvXlSJBzZpA/zum6Sj74hxwYI2DIxRWuNIoXAzHZz5o= github.com/benbjohnson/clock v1.3.5/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -555,8 +583,6 @@ github.com/ionos-cloud/sdk-go/v6 v6.1.11 h1:J/uRN4UWO3wCyGOeDdMKv8LWRzKu6UIkLEae github.com/ionos-cloud/sdk-go/v6 v6.1.11/go.mod h1:EzEgRIDxBELvfoa/uBN0kOQaqovLjUWEB7iW4/Q+t4k= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= -github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= -github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jonboulle/clockwork v0.4.0 h1:p4Cf1aMWXnXAUh8lVfewRBx1zaTSYKrKMF2g3ST4RZ4= github.com/jonboulle/clockwork v0.4.0/go.mod h1:xgRqUGwRcjKCO1vbZUEtSLrqKoPSsUpK7fnezOII0kc= diff --git a/connector/routingconnector/config.go b/connector/routingconnector/config.go index b3d5add7160e..916a9d267e95 100644 --- a/connector/routingconnector/config.go +++ b/connector/routingconnector/config.go @@ -43,8 +43,8 @@ type Config struct { Table []RoutingTableItem `mapstructure:"table"` // MatchOnce determines whether the connector matches multiple statements. - // Optional. - MatchOnce bool `mapstructure:"match_once"` + // Unused. Deprecated in v0.116.0. Will be removed in v0.120.0. + MatchOnce *bool `mapstructure:"match_once"` } // Validate checks if the processor configuration is valid. @@ -77,10 +77,6 @@ func (c *Config) Validate() error { return err } fallthrough - case "span", "metric", "datapoint", "log": // ok - if !c.MatchOnce { - return fmt.Errorf(`%q context is not supported with "match_once: false"`, item.Context) - } default: return errors.New("invalid context: " + item.Context) } diff --git a/connector/routingconnector/config_test.go b/connector/routingconnector/config_test.go index 4e001ed6bd7f..0e4e54d19d22 100644 --- a/connector/routingconnector/config_test.go +++ b/connector/routingconnector/config_test.go @@ -27,7 +27,6 @@ func TestLoadConfig(t *testing.T) { configPath: filepath.Join("testdata", "config", "traces.yaml"), id: component.NewIDWithName(metadata.Type, ""), expected: &Config{ - MatchOnce: true, DefaultPipelines: []pipeline.ID{ pipeline.NewIDWithName(pipeline.SignalTraces, "otlp-all"), }, @@ -53,7 +52,6 @@ func TestLoadConfig(t *testing.T) { configPath: filepath.Join("testdata", "config", "metrics.yaml"), id: component.NewIDWithName(metadata.Type, ""), expected: &Config{ - MatchOnce: true, DefaultPipelines: []pipeline.ID{ pipeline.NewIDWithName(pipeline.SignalMetrics, "otlp-all"), }, @@ -79,7 +77,6 @@ func TestLoadConfig(t *testing.T) { configPath: filepath.Join("testdata", "config", "logs.yaml"), id: component.NewIDWithName(metadata.Type, ""), expected: &Config{ - MatchOnce: true, DefaultPipelines: []pipeline.ID{ pipeline.NewIDWithName(pipeline.SignalLogs, "otlp-all"), }, @@ -221,70 +218,6 @@ func TestValidateConfig(t *testing.T) { }, error: "invalid context: invalid", }, - { - name: "span context with match_once false", - config: &Config{ - MatchOnce: false, - Table: []RoutingTableItem{ - { - Context: "span", - Statement: `route() where attributes["attr"] == "acme"`, - Pipelines: []pipeline.ID{ - pipeline.NewIDWithName(pipeline.SignalTraces, "otlp"), - }, - }, - }, - }, - error: `"span" context is not supported with "match_once: false"`, - }, - { - name: "metric context with match_once false", - config: &Config{ - MatchOnce: false, - Table: []RoutingTableItem{ - { - Context: "metric", - Statement: `route() where attributes["attr"] == "acme"`, - Pipelines: []pipeline.ID{ - pipeline.NewIDWithName(pipeline.SignalTraces, "otlp"), - }, - }, - }, - }, - error: `"metric" context is not supported with "match_once: false"`, - }, - { - name: "datapoint context with match_once false", - config: &Config{ - MatchOnce: false, - Table: []RoutingTableItem{ - { - Context: "datapoint", - Statement: `route() where attributes["attr"] == "acme"`, - Pipelines: []pipeline.ID{ - pipeline.NewIDWithName(pipeline.SignalTraces, "otlp"), - }, - }, - }, - }, - error: `"datapoint" context is not supported with "match_once: false"`, - }, - { - name: "log context with match_once false", - config: &Config{ - MatchOnce: false, - Table: []RoutingTableItem{ - { - Context: "log", - Statement: `route() where attributes["attr"] == "acme"`, - Pipelines: []pipeline.ID{ - pipeline.NewIDWithName(pipeline.SignalTraces, "otlp"), - }, - }, - }, - }, - error: `"log" context is not supported with "match_once: false"`, - }, { name: "request context with statement", config: &Config{ @@ -349,7 +282,6 @@ func withDefault(pipelines ...pipeline.ID) testConfigOption { func testConfig(opts ...testConfigOption) *Config { cfg := createDefaultConfig().(*Config) - cfg.MatchOnce = true for _, opt := range opts { opt(cfg) } diff --git a/connector/routingconnector/factory.go b/connector/routingconnector/factory.go index aaa569cb72b9..ad4bc4a23fb4 100644 --- a/connector/routingconnector/factory.go +++ b/connector/routingconnector/factory.go @@ -31,7 +31,6 @@ func NewFactory() connector.Factory { func createDefaultConfig() component.Config { return &Config{ ErrorMode: ottl.PropagateError, - MatchOnce: true, } } diff --git a/connector/routingconnector/go.mod b/connector/routingconnector/go.mod index 1a32a8626dc8..0ede4e26bcda 100644 --- a/connector/routingconnector/go.mod +++ b/connector/routingconnector/go.mod @@ -66,8 +66,8 @@ require ( go.opentelemetry.io/otel/trace v1.32.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect - golang.org/x/net v0.33.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/net v0.34.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/protobuf v1.36.2 // indirect diff --git a/connector/routingconnector/go.sum b/connector/routingconnector/go.sum index fc322c0e9c29..8038b1ab9722 100644 --- a/connector/routingconnector/go.sum +++ b/connector/routingconnector/go.sum @@ -165,8 +165,9 @@ golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= -golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= 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= @@ -188,8 +189,9 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= diff --git a/connector/routingconnector/logs.go b/connector/routingconnector/logs.go index 1c8d1923247a..040bcd145312 100644 --- a/connector/routingconnector/logs.go +++ b/connector/routingconnector/logs.go @@ -35,8 +35,8 @@ func newLogsConnector( ) (*logsConnector, error) { cfg := config.(*Config) - if !cfg.MatchOnce { - set.Logger.Error("The 'match_once' field has been deprecated and will be removed in v0.120.0. Remove usage of the parameter to suppress this warning.") + if cfg.MatchOnce != nil { + set.Logger.Error("The 'match_once' field has been deprecated and no longer has any effect. It will be removed in v0.120.0.") } lr, ok := logs.(connector.LogsRouterAndConsumer) @@ -65,15 +65,6 @@ func (c *logsConnector) Capabilities() consumer.Capabilities { } func (c *logsConnector) ConsumeLogs(ctx context.Context, ld plog.Logs) error { - if c.config.MatchOnce { - return c.switchLogs(ctx, ld) - } - return c.matchAllLogs(ctx, ld) -} - -// switchLogs removes items from the original plog.Logs as they are matched, -// and sends them to the appropriate consumer. -func (c *logsConnector) switchLogs(ctx context.Context, ld plog.Logs) error { groups := make(map[consumer.Logs]plog.Logs) var errs error for i := 0; i < len(c.router.routeSlice) && ld.ResourceLogs().Len() > 0; i++ { @@ -120,42 +111,6 @@ func (c *logsConnector) switchLogs(ctx context.Context, ld plog.Logs) error { return errs } -func (c *logsConnector) matchAllLogs(ctx context.Context, ld plog.Logs) error { - // routingEntry is used to group plog.ResourceLogs that are routed to - // the same set of exporters. - // This way we're not ending up with all the logs split up which would cause - // higher CPU usage. - groups := make(map[consumer.Logs]plog.Logs) - var errs error - for i := 0; i < ld.ResourceLogs().Len(); i++ { - rlogs := ld.ResourceLogs().At(i) - rtx := ottlresource.NewTransformContext(rlogs.Resource(), rlogs) - noRoutesMatch := true - for _, route := range c.router.routeSlice { - _, isMatch, err := route.resourceStatement.Execute(ctx, rtx) - if err != nil { - if c.config.ErrorMode == ottl.PropagateError { - return err - } - groupLogs(groups, c.router.defaultConsumer, rlogs) - continue - } - if isMatch { - noRoutesMatch = false - groupLogs(groups, route.consumer, rlogs) - } - } - if noRoutesMatch { - // no route conditions are matched, add resource logs to default exporters group - groupLogs(groups, c.router.defaultConsumer, rlogs) - } - } - for consumer, group := range groups { - errs = errors.Join(errs, consumer.ConsumeLogs(ctx, group)) - } - return errs -} - func groupAllLogs( groups map[consumer.Logs]plog.Logs, cons consumer.Logs, diff --git a/connector/routingconnector/logs_test.go b/connector/routingconnector/logs_test.go index 3cf9ca03321a..19e6e6947a81 100644 --- a/connector/routingconnector/logs_test.go +++ b/connector/routingconnector/logs_test.go @@ -160,57 +160,6 @@ func TestLogsAreCorrectlySplitPerResourceAttributeWithOTTL(t *testing.T) { assert.Empty(t, sink1.AllLogs()) }) - t.Run("logs matched by two expressions", func(t *testing.T) { - resetSinks() - - l := plog.NewLogs() - - rl := l.ResourceLogs().AppendEmpty() - rl.Resource().Attributes().PutStr("X-Tenant", "x_acme") - rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() - - rl = l.ResourceLogs().AppendEmpty() - rl.Resource().Attributes().PutStr("X-Tenant", "_acme") - rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() - - require.NoError(t, conn.ConsumeLogs(context.Background(), l)) - - assert.Empty(t, defaultSink.AllLogs()) - assert.Len(t, sink0.AllLogs(), 1) - assert.Len(t, sink1.AllLogs(), 1) - - assert.Equal(t, 2, sink0.AllLogs()[0].LogRecordCount()) - assert.Equal(t, 2, sink1.AllLogs()[0].LogRecordCount()) - assert.Equal(t, sink0.AllLogs(), sink1.AllLogs()) - }) - - t.Run("one log matched by multiple expressions, other matched none", func(t *testing.T) { - resetSinks() - - l := plog.NewLogs() - - rl := l.ResourceLogs().AppendEmpty() - rl.Resource().Attributes().PutStr("X-Tenant", "_acme") - rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() - - rl = l.ResourceLogs().AppendEmpty() - rl.Resource().Attributes().PutStr("X-Tenant", "something-else") - rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() - - require.NoError(t, conn.ConsumeLogs(context.Background(), l)) - - assert.Len(t, defaultSink.AllLogs(), 1) - assert.Len(t, sink0.AllLogs(), 1) - assert.Len(t, sink1.AllLogs(), 1) - - assert.Equal(t, sink0.AllLogs(), sink1.AllLogs()) - - rlog := defaultSink.AllLogs()[0].ResourceLogs().At(0) - attr, ok := rlog.Resource().Attributes().Get("X-Tenant") - assert.True(t, ok, "routing attribute must exists") - assert.Equal(t, "something-else", attr.AsString()) - }) - t.Run("logs matched by one expression, multiple pipelines", func(t *testing.T) { resetSinks() @@ -253,7 +202,6 @@ func TestLogsAreCorrectlyMatchOnceWithOTTL(t *testing.T) { Pipelines: []pipeline.ID{logsDefault, logs0}, }, }, - MatchOnce: true, } var defaultSink, sink0, sink1 consumertest.LogsSink diff --git a/connector/routingconnector/metrics.go b/connector/routingconnector/metrics.go index 51f08f5ff2d4..9141e264703b 100644 --- a/connector/routingconnector/metrics.go +++ b/connector/routingconnector/metrics.go @@ -36,8 +36,8 @@ func newMetricsConnector( ) (*metricsConnector, error) { cfg := config.(*Config) - if !cfg.MatchOnce { - set.Logger.Error("The 'match_once' field has been deprecated and will be removed in v0.120.0. Remove usage of the parameter to suppress this warning.") + if cfg.MatchOnce != nil { + set.Logger.Error("The 'match_once' field has been deprecated and no longer has any effect. It will be removed in v0.120.0.") } mr, ok := metrics.(connector.MetricsRouterAndConsumer) @@ -66,13 +66,6 @@ func (c *metricsConnector) Capabilities() consumer.Capabilities { } func (c *metricsConnector) ConsumeMetrics(ctx context.Context, md pmetric.Metrics) error { - if c.config.MatchOnce { - return c.switchMetrics(ctx, md) - } - return c.matchAllMetrics(ctx, md) -} - -func (c *metricsConnector) switchMetrics(ctx context.Context, md pmetric.Metrics) error { groups := make(map[consumer.Metrics]pmetric.Metrics) var errs error for i := 0; i < len(c.router.routeSlice) && md.ResourceMetrics().Len() > 0; i++ { @@ -128,43 +121,6 @@ func (c *metricsConnector) switchMetrics(ctx context.Context, md pmetric.Metrics return errs } -func (c *metricsConnector) matchAllMetrics(ctx context.Context, md pmetric.Metrics) error { - // groups is used to group pmetric.ResourceMetrics that are routed to - // the same set of exporters. This way we're not ending up with all the - // metrics split up which would cause higher CPU usage. - groups := make(map[consumer.Metrics]pmetric.Metrics) - - var errs error - for i := 0; i < md.ResourceMetrics().Len(); i++ { - rmetrics := md.ResourceMetrics().At(i) - rtx := ottlresource.NewTransformContext(rmetrics.Resource(), rmetrics) - - noRoutesMatch := true - for _, route := range c.router.routeSlice { - _, isMatch, err := route.resourceStatement.Execute(ctx, rtx) - if err != nil { - if c.config.ErrorMode == ottl.PropagateError { - return err - } - groupMetrics(groups, c.router.defaultConsumer, rmetrics) - continue - } - if isMatch { - noRoutesMatch = false - groupMetrics(groups, route.consumer, rmetrics) - } - } - if noRoutesMatch { - // no route conditions are matched, add resource metrics to default exporters group - groupMetrics(groups, c.router.defaultConsumer, rmetrics) - } - } - for consumer, group := range groups { - errs = errors.Join(errs, consumer.ConsumeMetrics(ctx, group)) - } - return errs -} - func groupAllMetrics( groups map[consumer.Metrics]pmetric.Metrics, cons consumer.Metrics, diff --git a/connector/routingconnector/metrics_test.go b/connector/routingconnector/metrics_test.go index 2f8335980940..a0fb90467d7f 100644 --- a/connector/routingconnector/metrics_test.go +++ b/connector/routingconnector/metrics_test.go @@ -165,65 +165,6 @@ func TestMetricsAreCorrectlySplitPerResourceAttributeWithOTTL(t *testing.T) { assert.Empty(t, sink1.AllMetrics()) }) - t.Run("metric matched by two expressions", func(t *testing.T) { - resetSinks() - - m := pmetric.NewMetrics() - - rm := m.ResourceMetrics().AppendEmpty() - rm.Resource().Attributes().PutDouble("value", 5.0) - metric := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() - metric.SetEmptyGauge() - metric.SetName("cpu") - - rm = m.ResourceMetrics().AppendEmpty() - rm.Resource().Attributes().PutDouble("value", 3.1) - metric = rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() - metric.SetEmptyGauge() - metric.SetName("cpu1") - - require.NoError(t, conn.ConsumeMetrics(context.Background(), m)) - - assert.Empty(t, defaultSink.AllMetrics()) - assert.Len(t, sink0.AllMetrics(), 1) - assert.Len(t, sink1.AllMetrics(), 1) - - assert.Equal(t, 2, sink0.AllMetrics()[0].MetricCount()) - assert.Equal(t, 2, sink1.AllMetrics()[0].MetricCount()) - assert.Equal(t, sink0.AllMetrics(), sink1.AllMetrics()) - }) - - t.Run("one metric matched by 2 expressions, others matched by none", func(t *testing.T) { - resetSinks() - - m := pmetric.NewMetrics() - - rm := m.ResourceMetrics().AppendEmpty() - rm.Resource().Attributes().PutDouble("value", 5.0) - metric := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() - metric.SetEmptyGauge() - metric.SetName("cpu") - - rm = m.ResourceMetrics().AppendEmpty() - rm.Resource().Attributes().PutDouble("value", -1.0) - metric = rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() - metric.SetEmptyGauge() - metric.SetName("cpu1") - - require.NoError(t, conn.ConsumeMetrics(context.Background(), m)) - - assert.Len(t, defaultSink.AllMetrics(), 1) - assert.Len(t, sink0.AllMetrics(), 1) - assert.Len(t, sink1.AllMetrics(), 1) - - assert.Equal(t, sink0.AllMetrics(), sink1.AllMetrics()) - - rmetric := defaultSink.AllMetrics()[0].ResourceMetrics().At(0) - attr, ok := rmetric.Resource().Attributes().Get("value") - assert.True(t, ok, "routing attribute must exist") - assert.Equal(t, attr.Double(), float64(-1.0)) - }) - t.Run("metric matched by one expression, multiple pipelines", func(t *testing.T) { resetSinks() @@ -268,7 +209,6 @@ func TestMetricsAreCorrectlyMatchOnceWithOTTL(t *testing.T) { Pipelines: []pipeline.ID{metricsDefault, metrics0}, }, }, - MatchOnce: true, } var defaultSink, sink0, sink1 consumertest.MetricsSink diff --git a/connector/routingconnector/traces.go b/connector/routingconnector/traces.go index a8824a16a491..fb9350e5abeb 100644 --- a/connector/routingconnector/traces.go +++ b/connector/routingconnector/traces.go @@ -35,8 +35,8 @@ func newTracesConnector( ) (*tracesConnector, error) { cfg := config.(*Config) - if !cfg.MatchOnce { - set.Logger.Error("The 'match_once' field has been deprecated and will be removed in v0.120.0. Remove usage of the parameter to suppress this warning.") + if cfg.MatchOnce != nil { + set.Logger.Error("The 'match_once' field has been deprecated and no longer has any effect. It will be removed in v0.120.0.") } tr, ok := traces.(connector.TracesRouterAndConsumer) @@ -65,13 +65,6 @@ func (*tracesConnector) Capabilities() consumer.Capabilities { } func (c *tracesConnector) ConsumeTraces(ctx context.Context, td ptrace.Traces) error { - if c.config.MatchOnce { - return c.switchTraces(ctx, td) - } - return c.matchAllTraces(ctx, td) -} - -func (c *tracesConnector) switchTraces(ctx context.Context, td ptrace.Traces) error { groups := make(map[consumer.Traces]ptrace.Traces) var errs error for i := 0; i < len(c.router.routeSlice) && td.ResourceSpans().Len() > 0; i++ { @@ -118,42 +111,6 @@ func (c *tracesConnector) switchTraces(ctx context.Context, td ptrace.Traces) er return errs } -func (c *tracesConnector) matchAllTraces(ctx context.Context, td ptrace.Traces) error { - // groups is used to group ptrace.ResourceSpans that are routed to - // the same set of pipelines. This way we're not ending up with all the - // spans split up which would cause higher CPU usage. - groups := make(map[consumer.Traces]ptrace.Traces) - - var errs error - for i := 0; i < td.ResourceSpans().Len(); i++ { - rspans := td.ResourceSpans().At(i) - rtx := ottlresource.NewTransformContext(rspans.Resource(), rspans) - noRoutesMatch := true - for _, route := range c.router.routeSlice { - _, isMatch, err := route.resourceStatement.Execute(ctx, rtx) - if err != nil { - if c.config.ErrorMode == ottl.PropagateError { - return err - } - groupTraces(groups, c.router.defaultConsumer, rspans) - continue - } - if isMatch { - noRoutesMatch = false - groupTraces(groups, route.consumer, rspans) - } - } - if noRoutesMatch { - // no route conditions are matched, add resource spans to default pipelines group - groupTraces(groups, c.router.defaultConsumer, rspans) - } - } - for consumer, group := range groups { - errs = errors.Join(errs, consumer.ConsumeTraces(ctx, group)) - } - return errs -} - func groupAllTraces( groups map[consumer.Traces]ptrace.Traces, cons consumer.Traces, diff --git a/connector/routingconnector/traces_test.go b/connector/routingconnector/traces_test.go index fb597e2a6968..dd70f958f167 100644 --- a/connector/routingconnector/traces_test.go +++ b/connector/routingconnector/traces_test.go @@ -161,31 +161,6 @@ func TestTracesCorrectlySplitPerResourceAttributeWithOTTL(t *testing.T) { assert.Empty(t, sink1.AllTraces()) }) - t.Run("span matched by all expressions", func(t *testing.T) { - resetSinks() - - tr := ptrace.NewTraces() - rl := tr.ResourceSpans().AppendEmpty() - rl.Resource().Attributes().PutInt("value", 2) - span := rl.ScopeSpans().AppendEmpty().Spans().AppendEmpty() - span.SetName("span") - - rl = tr.ResourceSpans().AppendEmpty() - rl.Resource().Attributes().PutInt("value", 3) - span = rl.ScopeSpans().AppendEmpty().Spans().AppendEmpty() - span.SetName("span1") - - require.NoError(t, conn.ConsumeTraces(context.Background(), tr)) - - assert.Empty(t, defaultSink.AllTraces()) - assert.Len(t, sink0.AllTraces(), 1) - assert.Len(t, sink1.AllTraces(), 1) - - assert.Equal(t, 2, sink0.AllTraces()[0].SpanCount()) - assert.Equal(t, 2, sink1.AllTraces()[0].SpanCount()) - assert.Equal(t, sink0.AllTraces(), sink1.AllTraces()) - }) - t.Run("span matched by one expression, multiple pipelines", func(t *testing.T) { resetSinks() @@ -214,7 +189,6 @@ func TestTracesCorrectlyMatchOnceWithOTTL(t *testing.T) { cfg := &Config{ DefaultPipelines: []pipeline.ID{tracesDefault}, - MatchOnce: true, Table: []RoutingTableItem{ { Statement: `route() where attributes["value"] > 0 and attributes["value"] < 4`, diff --git a/connector/signaltometricsconnector/connector.go b/connector/signaltometricsconnector/connector.go index d6f5f5b8283b..b1a9234fe2f5 100644 --- a/connector/signaltometricsconnector/connector.go +++ b/connector/signaltometricsconnector/connector.go @@ -5,46 +5,239 @@ package signaltometricsconnector // import "github.com/open-telemetry/openteleme import ( "context" + "fmt" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/connector" "go.opentelemetry.io/collector/consumer" + "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" "go.opentelemetry.io/collector/pdata/ptrace" "go.uber.org/zap" + + "github.com/open-telemetry/opentelemetry-collector-contrib/connector/signaltometricsconnector/internal/aggregator" + "github.com/open-telemetry/opentelemetry-collector-contrib/connector/signaltometricsconnector/internal/model" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/ottldatapoint" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/ottllog" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/ottlspan" ) type signalToMetrics struct { next consumer.Metrics logger *zap.Logger + spanMetricDefs []model.MetricDef[ottlspan.TransformContext] + dpMetricDefs []model.MetricDef[ottldatapoint.TransformContext] + logMetricDefs []model.MetricDef[ottllog.TransformContext] + component.StartFunc component.ShutdownFunc } -func newSignalToMetrics( - set connector.Settings, - next consumer.Metrics, -) *signalToMetrics { - return &signalToMetrics{ - logger: set.Logger, - next: next, - } -} - func (sm *signalToMetrics) Capabilities() consumer.Capabilities { return consumer.Capabilities{MutatesData: false} } -func (sm *signalToMetrics) ConsumeTraces(context.Context, ptrace.Traces) error { - return nil +func (sm *signalToMetrics) ConsumeTraces(ctx context.Context, td ptrace.Traces) error { + if len(sm.spanMetricDefs) == 0 { + return nil + } + + processedMetrics := pmetric.NewMetrics() + processedMetrics.ResourceMetrics().EnsureCapacity(td.ResourceSpans().Len()) + aggregator := aggregator.NewAggregator[ottlspan.TransformContext](processedMetrics) + + for i := 0; i < td.ResourceSpans().Len(); i++ { + resourceSpan := td.ResourceSpans().At(i) + resourceAttrs := resourceSpan.Resource().Attributes() + for j := 0; j < resourceSpan.ScopeSpans().Len(); j++ { + scopeSpan := resourceSpan.ScopeSpans().At(j) + for k := 0; k < scopeSpan.Spans().Len(); k++ { + span := scopeSpan.Spans().At(k) + spanAttrs := span.Attributes() + for _, md := range sm.spanMetricDefs { + filteredSpanAttrs, ok := md.FilterAttributes(spanAttrs) + if !ok { + continue + } + + // The transform context is created from original attributes so that the + // OTTL expressions are also applied on the original attributes. + tCtx := ottlspan.NewTransformContext(span, scopeSpan.Scope(), resourceSpan.Resource(), scopeSpan, resourceSpan) + if md.Conditions != nil { + match, err := md.Conditions.Eval(ctx, tCtx) + if err != nil { + return fmt.Errorf("failed to evaluate conditions: %w", err) + } + if !match { + sm.logger.Debug("condition not matched, skipping", zap.String("name", md.Key.Name)) + continue + } + } + + filteredResAttrs := md.FilterResourceAttributes(resourceAttrs) + if err := aggregator.Aggregate(ctx, tCtx, md, filteredResAttrs, filteredSpanAttrs, 1); err != nil { + return err + } + } + } + } + } + aggregator.Finalize(sm.spanMetricDefs) + return sm.next.ConsumeMetrics(ctx, processedMetrics) } -func (sm *signalToMetrics) ConsumeMetrics(context.Context, pmetric.Metrics) error { - return nil +func (sm *signalToMetrics) ConsumeMetrics(ctx context.Context, m pmetric.Metrics) error { + if len(sm.dpMetricDefs) == 0 { + return nil + } + + processedMetrics := pmetric.NewMetrics() + processedMetrics.ResourceMetrics().EnsureCapacity(m.ResourceMetrics().Len()) + aggregator := aggregator.NewAggregator[ottldatapoint.TransformContext](processedMetrics) + for i := 0; i < m.ResourceMetrics().Len(); i++ { + resourceMetric := m.ResourceMetrics().At(i) + resourceAttrs := resourceMetric.Resource().Attributes() + for j := 0; j < resourceMetric.ScopeMetrics().Len(); j++ { + scopeMetric := resourceMetric.ScopeMetrics().At(j) + for k := 0; k < scopeMetric.Metrics().Len(); k++ { + metrics := scopeMetric.Metrics() + metric := metrics.At(k) + for _, md := range sm.dpMetricDefs { + filteredResAttrs := md.FilterResourceAttributes(resourceAttrs) + aggregate := func(dp any, dpAttrs pcommon.Map) error { + // The transform context is created from original attributes so that the + // OTTL expressions are also applied on the original attributes. + tCtx := ottldatapoint.NewTransformContext(dp, metric, metrics, scopeMetric.Scope(), resourceMetric.Resource(), scopeMetric, resourceMetric) + if md.Conditions != nil { + match, err := md.Conditions.Eval(ctx, tCtx) + if err != nil { + return fmt.Errorf("failed to evaluate conditions: %w", err) + } + if !match { + sm.logger.Debug("condition not matched, skipping", zap.String("name", md.Key.Name)) + return nil + } + } + return aggregator.Aggregate(ctx, tCtx, md, filteredResAttrs, dpAttrs, 1) + } + + //exhaustive:enforce + switch metric.Type() { + case pmetric.MetricTypeGauge: + dps := metric.Gauge().DataPoints() + for l := 0; l < dps.Len(); l++ { + dp := dps.At(l) + filteredDPAttrs, ok := md.FilterAttributes(dp.Attributes()) + if !ok { + continue + } + if err := aggregate(dp, filteredDPAttrs); err != nil { + return err + } + } + case pmetric.MetricTypeSum: + dps := metric.Sum().DataPoints() + for l := 0; l < dps.Len(); l++ { + dp := dps.At(l) + filteredDPAttrs, ok := md.FilterAttributes(dp.Attributes()) + if !ok { + continue + } + if err := aggregate(dp, filteredDPAttrs); err != nil { + return err + } + } + case pmetric.MetricTypeSummary: + dps := metric.Summary().DataPoints() + for l := 0; l < dps.Len(); l++ { + dp := dps.At(l) + filteredDPAttrs, ok := md.FilterAttributes(dp.Attributes()) + if !ok { + continue + } + if err := aggregate(dp, filteredDPAttrs); err != nil { + return err + } + } + case pmetric.MetricTypeHistogram: + dps := metric.Histogram().DataPoints() + for l := 0; l < dps.Len(); l++ { + dp := dps.At(l) + filteredDPAttrs, ok := md.FilterAttributes(dp.Attributes()) + if !ok { + continue + } + if err := aggregate(dp, filteredDPAttrs); err != nil { + return err + } + } + case pmetric.MetricTypeExponentialHistogram: + dps := metric.ExponentialHistogram().DataPoints() + for l := 0; l < dps.Len(); l++ { + dp := dps.At(l) + filteredDPAttrs, ok := md.FilterAttributes(dp.Attributes()) + if !ok { + continue + } + if err := aggregate(dp, filteredDPAttrs); err != nil { + return err + } + } + case pmetric.MetricTypeEmpty: + continue + } + } + } + } + } + aggregator.Finalize(sm.dpMetricDefs) + return sm.next.ConsumeMetrics(ctx, processedMetrics) } -func (sm *signalToMetrics) ConsumeLogs(context.Context, plog.Logs) error { - return nil +func (sm *signalToMetrics) ConsumeLogs(ctx context.Context, logs plog.Logs) error { + if len(sm.logMetricDefs) == 0 { + return nil + } + + processedMetrics := pmetric.NewMetrics() + processedMetrics.ResourceMetrics().EnsureCapacity(logs.ResourceLogs().Len()) + aggregator := aggregator.NewAggregator[ottllog.TransformContext](processedMetrics) + for i := 0; i < logs.ResourceLogs().Len(); i++ { + resourceLog := logs.ResourceLogs().At(i) + resourceAttrs := resourceLog.Resource().Attributes() + for j := 0; j < resourceLog.ScopeLogs().Len(); j++ { + scopeLog := resourceLog.ScopeLogs().At(j) + for k := 0; k < scopeLog.LogRecords().Len(); k++ { + log := scopeLog.LogRecords().At(k) + logAttrs := log.Attributes() + for _, md := range sm.logMetricDefs { + filteredLogAttrs, ok := md.FilterAttributes(logAttrs) + if !ok { + continue + } + + // The transform context is created from original attributes so that the + // OTTL expressions are also applied on the original attributes. + tCtx := ottllog.NewTransformContext(log, scopeLog.Scope(), resourceLog.Resource(), scopeLog, resourceLog) + if md.Conditions != nil { + match, err := md.Conditions.Eval(ctx, tCtx) + if err != nil { + return fmt.Errorf("failed to evaluate conditions: %w", err) + } + if !match { + sm.logger.Debug("condition not matched, skipping", zap.String("name", md.Key.Name)) + continue + } + } + filteredResAttrs := md.FilterResourceAttributes(resourceAttrs) + if err := aggregator.Aggregate(ctx, tCtx, md, filteredResAttrs, filteredLogAttrs, 1); err != nil { + return err + } + } + } + } + } + aggregator.Finalize(sm.logMetricDefs) + return sm.next.ConsumeMetrics(ctx, processedMetrics) } diff --git a/connector/signaltometricsconnector/connector_test.go b/connector/signaltometricsconnector/connector_test.go new file mode 100644 index 000000000000..0464492f131f --- /dev/null +++ b/connector/signaltometricsconnector/connector_test.go @@ -0,0 +1,323 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package signaltometricsconnector + +import ( + "context" + "path/filepath" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/confmap" + "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/connector" + "go.opentelemetry.io/collector/connector/connectortest" + "go.opentelemetry.io/collector/consumer" + "go.opentelemetry.io/collector/consumer/consumertest" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/pmetric" + semconv "go.opentelemetry.io/collector/semconv/v1.26.0" + "go.uber.org/zap/zapcore" + "go.uber.org/zap/zaptest" + + "github.com/open-telemetry/opentelemetry-collector-contrib/connector/signaltometricsconnector/config" + "github.com/open-telemetry/opentelemetry-collector-contrib/connector/signaltometricsconnector/internal/metadata" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest/pmetrictest" +) + +const testDataDir = "testdata" + +func TestConnectorWithTraces(t *testing.T) { + testCases := []string{ + "sum", + "histograms", + "exponential_histograms", + } + + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + for _, tc := range testCases { + t.Run(tc, func(t *testing.T) { + traceTestDataDir := filepath.Join(testDataDir, "traces") + inputTraces, err := golden.ReadTraces(filepath.Join(traceTestDataDir, "traces.yaml")) + require.NoError(t, err) + + next := &consumertest.MetricsSink{} + tcTestDataDir := filepath.Join(traceTestDataDir, tc) + factory, settings, cfg := setupConnector(t, tcTestDataDir) + connector, err := factory.CreateTracesToMetrics(ctx, settings, cfg, next) + require.NoError(t, err) + require.IsType(t, &signalToMetrics{}, connector) + expectedMetrics, err := golden.ReadMetrics(filepath.Join(tcTestDataDir, "output.yaml")) + require.NoError(t, err) + + require.NoError(t, connector.ConsumeTraces(ctx, inputTraces)) + require.Len(t, next.AllMetrics(), 1) + assertAggregatedMetrics(t, expectedMetrics, next.AllMetrics()[0]) + }) + } +} + +func TestConnectorWithMetrics(t *testing.T) { + testCases := []string{ + "sum", + "histograms", + "exponential_histograms", + } + + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + for _, tc := range testCases { + t.Run(tc, func(t *testing.T) { + metricTestDataDir := filepath.Join(testDataDir, "metrics") + inputMetrics, err := golden.ReadMetrics(filepath.Join(metricTestDataDir, "metrics.yaml")) + require.NoError(t, err) + + next := &consumertest.MetricsSink{} + tcTestDataDir := filepath.Join(metricTestDataDir, tc) + factory, settings, cfg := setupConnector(t, tcTestDataDir) + connector, err := factory.CreateMetricsToMetrics(ctx, settings, cfg, next) + require.NoError(t, err) + require.IsType(t, &signalToMetrics{}, connector) + expectedMetrics, err := golden.ReadMetrics(filepath.Join(tcTestDataDir, "output.yaml")) + require.NoError(t, err) + + require.NoError(t, connector.ConsumeMetrics(ctx, inputMetrics)) + require.Len(t, next.AllMetrics(), 1) + assertAggregatedMetrics(t, expectedMetrics, next.AllMetrics()[0]) + }) + } +} + +func TestConnectorWithLogs(t *testing.T) { + testCases := []string{ + "sum", + "histograms", + "exponential_histograms", + } + + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + for _, tc := range testCases { + t.Run(tc, func(t *testing.T) { + logTestDataDir := filepath.Join(testDataDir, "logs") + inputLogs, err := golden.ReadLogs(filepath.Join(logTestDataDir, "logs.yaml")) + require.NoError(t, err) + + next := &consumertest.MetricsSink{} + tcTestDataDir := filepath.Join(logTestDataDir, tc) + factory, settings, cfg := setupConnector(t, tcTestDataDir) + connector, err := factory.CreateLogsToMetrics(ctx, settings, cfg, next) + require.NoError(t, err) + require.IsType(t, &signalToMetrics{}, connector) + expectedMetrics, err := golden.ReadMetrics(filepath.Join(tcTestDataDir, "output.yaml")) + require.NoError(t, err) + + require.NoError(t, connector.ConsumeLogs(ctx, inputLogs)) + require.Len(t, next.AllMetrics(), 1) + assertAggregatedMetrics(t, expectedMetrics, next.AllMetrics()[0]) + }) + } +} + +func BenchmarkConnectorWithTraces(b *testing.B) { + factory := NewFactory() + settings := connectortest.NewNopSettings() + settings.TelemetrySettings.Logger = zaptest.NewLogger(b, zaptest.Level(zapcore.DebugLevel)) + next, err := consumer.NewMetrics(func(context.Context, pmetric.Metrics) error { + return nil + }) + require.NoError(b, err) + + cfg := &config.Config{Spans: testMetricInfo(b)} + require.NoError(b, cfg.Unmarshal(confmap.New())) // set required fields to default + require.NoError(b, cfg.Validate()) + connector, err := factory.CreateTracesToMetrics(context.Background(), settings, cfg, next) + require.NoError(b, err) + inputTraces, err := golden.ReadTraces("testdata/traces/traces.yaml") + require.NoError(b, err) + + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + if err := connector.ConsumeTraces(context.Background(), inputTraces); err != nil { + b.Fatal(err) + } + } +} + +func BenchmarkConnectorWithMetrics(b *testing.B) { + factory := NewFactory() + settings := connectortest.NewNopSettings() + settings.TelemetrySettings.Logger = zaptest.NewLogger(b, zaptest.Level(zapcore.DebugLevel)) + next, err := consumer.NewMetrics(func(context.Context, pmetric.Metrics) error { + return nil + }) + require.NoError(b, err) + + cfg := &config.Config{Datapoints: testMetricInfo(b)} + require.NoError(b, cfg.Unmarshal(confmap.New())) // set required fields to default + require.NoError(b, cfg.Validate()) + connector, err := factory.CreateMetricsToMetrics(context.Background(), settings, cfg, next) + require.NoError(b, err) + inputMetrics, err := golden.ReadMetrics("testdata/metrics/metrics.yaml") + require.NoError(b, err) + + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + if err := connector.ConsumeMetrics(context.Background(), inputMetrics); err != nil { + b.Fatal(err) + } + } +} + +func BenchmarkConnectorWithLogs(b *testing.B) { + factory := NewFactory() + settings := connectortest.NewNopSettings() + settings.TelemetrySettings.Logger = zaptest.NewLogger(b, zaptest.Level(zapcore.DebugLevel)) + next, err := consumer.NewMetrics(func(context.Context, pmetric.Metrics) error { + return nil + }) + require.NoError(b, err) + + cfg := &config.Config{Logs: testMetricInfo(b)} + require.NoError(b, cfg.Unmarshal(confmap.New())) // set required fields to default + require.NoError(b, cfg.Validate()) + connector, err := factory.CreateLogsToMetrics(context.Background(), settings, cfg, next) + require.NoError(b, err) + inputLogs, err := golden.ReadLogs("testdata/logs/logs.yaml") + require.NoError(b, err) + + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + if err := connector.ConsumeLogs(context.Background(), inputLogs); err != nil { + b.Fatal(err) + } + } +} + +// testMetricInfo creates a metric info with all metric types that could be used +// for all the supported signals. To do this, it uses common OTTL funcs and literals. +func testMetricInfo(b *testing.B) []config.MetricInfo { + b.Helper() + + return []config.MetricInfo{ + { + Name: "test.histogram", + Description: "Test histogram", + Unit: "ms", + IncludeResourceAttributes: []config.Attribute{ + { + Key: "resource.foo", + }, + { + Key: "404.attribute", + DefaultValue: "test_404_attribute", + }, + }, + Attributes: []config.Attribute{ + { + Key: "http.response.status_code", + }, + }, + Histogram: &config.Histogram{ + Buckets: []float64{2, 4, 6, 8, 10, 50, 100, 200, 400, 800, 1000, 1400, 2000, 5000, 10_000, 15_000}, + Value: "1.4", + }, + }, + { + Name: "test.exphistogram", + Description: "Test exponential histogram", + Unit: "ms", + IncludeResourceAttributes: []config.Attribute{ + { + Key: "resource.foo", + }, + { + Key: "404.attribute", + DefaultValue: "test_404_attribute", + }, + }, + Attributes: []config.Attribute{ + { + Key: "http.response.status_code", + }, + }, + ExponentialHistogram: &config.ExponentialHistogram{ + Value: "2.4", + MaxSize: 160, + }, + }, + { + Name: "test.sum", + Description: "Test sum", + Unit: "ms", + IncludeResourceAttributes: []config.Attribute{ + { + Key: "resource.foo", + }, + { + Key: "404.attribute", + DefaultValue: "test_404_attribute", + }, + }, + Attributes: []config.Attribute{ + { + Key: "http.response.status_code", + }, + }, + Sum: &config.Sum{ + Value: "5.4", + }, + }, + } +} + +func setupConnector( + t *testing.T, testFilePath string, +) (connector.Factory, connector.Settings, component.Config) { + t.Helper() + factory := NewFactory() + settings := connectortest.NewNopSettings() + telemetryResource(t).CopyTo(settings.TelemetrySettings.Resource) + settings.TelemetrySettings.Logger = zaptest.NewLogger(t, zaptest.Level(zapcore.DebugLevel)) + + cfg := createDefaultConfig() + cm, err := confmaptest.LoadConf(filepath.Join(testFilePath, "config.yaml")) + require.NoError(t, err) + sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "").String()) + require.NoError(t, err) + require.NoError(t, sub.Unmarshal(&cfg)) + require.NoError(t, component.ValidateConfig(cfg)) + + return factory, settings, cfg +} + +func telemetryResource(t *testing.T) pcommon.Resource { + t.Helper() + + r := pcommon.NewResource() + r.Attributes().PutStr(semconv.AttributeServiceInstanceID, "627cc493-f310-47de-96bd-71410b7dec09") + r.Attributes().PutStr(semconv.AttributeServiceName, "signaltometrics") + r.Attributes().PutStr(semconv.AttributeServiceNamespace, "test") + return r +} + +func assertAggregatedMetrics(t *testing.T, expected, actual pmetric.Metrics) { + t.Helper() + assert.NoError(t, pmetrictest.CompareMetrics( + expected, actual, + pmetrictest.IgnoreMetricDataPointsOrder(), + pmetrictest.IgnoreMetricsOrder(), + pmetrictest.IgnoreTimestamp(), + )) +} diff --git a/connector/signaltometricsconnector/factory.go b/connector/signaltometricsconnector/factory.go index 4bf1fcb8d1a3..673722dd6ce0 100644 --- a/connector/signaltometricsconnector/factory.go +++ b/connector/signaltometricsconnector/factory.go @@ -5,13 +5,19 @@ package signaltometricsconnector // import "github.com/open-telemetry/openteleme import ( "context" + "fmt" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/connector" "go.opentelemetry.io/collector/consumer" "github.com/open-telemetry/opentelemetry-collector-contrib/connector/signaltometricsconnector/config" + "github.com/open-telemetry/opentelemetry-collector-contrib/connector/signaltometricsconnector/internal/customottl" "github.com/open-telemetry/opentelemetry-collector-contrib/connector/signaltometricsconnector/internal/metadata" + "github.com/open-telemetry/opentelemetry-collector-contrib/connector/signaltometricsconnector/internal/model" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/ottldatapoint" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/ottllog" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/ottlspan" ) // NewFactory returns a ConnectorFactory. @@ -32,26 +38,83 @@ func createDefaultConfig() component.Config { func createTracesToMetrics( _ context.Context, set connector.Settings, - _ component.Config, + cfg component.Config, nextConsumer consumer.Metrics, ) (connector.Traces, error) { - return newSignalToMetrics(set, nextConsumer), nil + c := cfg.(*config.Config) + parser, err := ottlspan.NewParser(customottl.SpanFuncs(), set.TelemetrySettings) + if err != nil { + return nil, fmt.Errorf("failed to create OTTL statement parser for spans: %w", err) + } + + metricDefs := make([]model.MetricDef[ottlspan.TransformContext], 0, len(c.Spans)) + for _, info := range c.Spans { + var md model.MetricDef[ottlspan.TransformContext] + if err := md.FromMetricInfo(info, parser, set.TelemetrySettings); err != nil { + return nil, fmt.Errorf("failed to parse provided metric information; %w", err) + } + metricDefs = append(metricDefs, md) + } + + return &signalToMetrics{ + logger: set.Logger, + next: nextConsumer, + spanMetricDefs: metricDefs, + }, nil } func createMetricsToMetrics( _ context.Context, set connector.Settings, - _ component.Config, + cfg component.Config, nextConsumer consumer.Metrics, ) (connector.Metrics, error) { - return newSignalToMetrics(set, nextConsumer), nil + c := cfg.(*config.Config) + parser, err := ottldatapoint.NewParser(customottl.DatapointFuncs(), set.TelemetrySettings) + if err != nil { + return nil, fmt.Errorf("failed to create OTTL statement parser for datapoints: %w", err) + } + + metricDefs := make([]model.MetricDef[ottldatapoint.TransformContext], 0, len(c.Datapoints)) + for _, info := range c.Datapoints { + var md model.MetricDef[ottldatapoint.TransformContext] + if err := md.FromMetricInfo(info, parser, set.TelemetrySettings); err != nil { + return nil, fmt.Errorf("failed to parse provided metric information; %w", err) + } + metricDefs = append(metricDefs, md) + } + + return &signalToMetrics{ + logger: set.Logger, + next: nextConsumer, + dpMetricDefs: metricDefs, + }, nil } func createLogsToMetrics( _ context.Context, set connector.Settings, - _ component.Config, + cfg component.Config, nextConsumer consumer.Metrics, ) (connector.Logs, error) { - return newSignalToMetrics(set, nextConsumer), nil + c := cfg.(*config.Config) + parser, err := ottllog.NewParser(customottl.LogFuncs(), set.TelemetrySettings) + if err != nil { + return nil, fmt.Errorf("failed to create OTTL statement parser for logs: %w", err) + } + + metricDefs := make([]model.MetricDef[ottllog.TransformContext], 0, len(c.Logs)) + for _, info := range c.Logs { + var md model.MetricDef[ottllog.TransformContext] + if err := md.FromMetricInfo(info, parser, set.TelemetrySettings); err != nil { + return nil, fmt.Errorf("failed to parse provided metric information; %w", err) + } + metricDefs = append(metricDefs, md) + } + + return &signalToMetrics{ + logger: set.Logger, + next: nextConsumer, + logMetricDefs: metricDefs, + }, nil } diff --git a/connector/signaltometricsconnector/go.mod b/connector/signaltometricsconnector/go.mod index 8b4b2ad74540..603311cd9447 100644 --- a/connector/signaltometricsconnector/go.mod +++ b/connector/signaltometricsconnector/go.mod @@ -4,7 +4,10 @@ go 1.22.0 require ( github.com/lightstep/go-expohisto v1.0.0 + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.117.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.117.0 + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.117.0 + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.117.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.117.0 github.com/stretchr/testify v1.10.0 go.opentelemetry.io/collector/component v0.117.0 @@ -16,6 +19,7 @@ require ( go.opentelemetry.io/collector/consumer/consumertest v0.117.0 go.opentelemetry.io/collector/pdata v1.23.0 go.opentelemetry.io/collector/pipeline v0.117.0 + go.opentelemetry.io/collector/semconv v0.117.0 go.uber.org/goleak v1.3.0 go.uber.org/zap v1.27.0 ) @@ -24,6 +28,7 @@ require ( github.com/alecthomas/participle/v2 v2.1.1 // indirect github.com/antchfx/xmlquery v1.4.3 // indirect github.com/antchfx/xpath v1.3.3 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/elastic/go-grok v0.3.1 // indirect github.com/elastic/lunes v0.1.0 // indirect @@ -55,7 +60,6 @@ require ( go.opentelemetry.io/collector/internal/fanoutconsumer v0.117.0 // indirect go.opentelemetry.io/collector/pdata/pprofile v0.117.0 // indirect go.opentelemetry.io/collector/pipeline/xpipeline v0.117.0 // indirect - go.opentelemetry.io/collector/semconv v0.117.0 // indirect go.opentelemetry.io/otel v1.32.0 // indirect go.opentelemetry.io/otel/metric v1.32.0 // indirect go.opentelemetry.io/otel/sdk v1.32.0 // indirect @@ -63,8 +67,8 @@ require ( go.opentelemetry.io/otel/trace v1.32.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect - golang.org/x/net v0.33.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/net v0.34.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.69.2 // indirect diff --git a/connector/signaltometricsconnector/go.sum b/connector/signaltometricsconnector/go.sum index 075d47f06959..978e1c3b09dd 100644 --- a/connector/signaltometricsconnector/go.sum +++ b/connector/signaltometricsconnector/go.sum @@ -8,6 +8,8 @@ github.com/antchfx/xmlquery v1.4.3 h1:f6jhxCzANrWfa93O+NmRWvieVyLs+R2Szfpy+YrZaw github.com/antchfx/xmlquery v1.4.3/go.mod h1:AEPEEPYE9GnA2mj5Ur2L5Q5/2PycJ0N9Fusrx9b12fc= github.com/antchfx/xpath v1.3.3 h1:tmuPQa1Uye0Ym1Zn65vxPgfltWb/Lxu2jeqIGteJSRs= github.com/antchfx/xpath v1.3.3/go.mod h1:i54GszH55fYfBmoZXapTHN8T8tkcHfRgLyVwwqzXNcs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -161,8 +163,9 @@ golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= -golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= 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,8 +187,9 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= diff --git a/connector/signaltometricsconnector/internal/aggregator/aggregator.go b/connector/signaltometricsconnector/internal/aggregator/aggregator.go new file mode 100644 index 000000000000..a633811ffb93 --- /dev/null +++ b/connector/signaltometricsconnector/internal/aggregator/aggregator.go @@ -0,0 +1,305 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package aggregator // import "github.com/open-telemetry/opentelemetry-collector-contrib/connector/signaltometricsconnector/internal/aggregator" + +import ( + "context" + "fmt" + "time" + + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/pmetric" + + "github.com/open-telemetry/opentelemetry-collector-contrib/connector/signaltometricsconnector/internal/metadata" + "github.com/open-telemetry/opentelemetry-collector-contrib/connector/signaltometricsconnector/internal/model" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil" +) + +// Aggregator provides a single interface to update all metrics +// datastructures. The required datastructure is selected using +// the metric definition. +type Aggregator[K any] struct { + result pmetric.Metrics + // smLookup maps resourceID against scope metrics since the aggregator + // always produces a single scope. + smLookup map[[16]byte]pmetric.ScopeMetrics + valueCounts map[model.MetricKey]map[[16]byte]map[[16]byte]*valueCountDP + sums map[model.MetricKey]map[[16]byte]map[[16]byte]*sumDP + timestamp time.Time +} + +// NewAggregator creates a new instance of aggregator. +func NewAggregator[K any](metrics pmetric.Metrics) *Aggregator[K] { + return &Aggregator[K]{ + result: metrics, + smLookup: make(map[[16]byte]pmetric.ScopeMetrics), + valueCounts: make(map[model.MetricKey]map[[16]byte]map[[16]byte]*valueCountDP), + sums: make(map[model.MetricKey]map[[16]byte]map[[16]byte]*sumDP), + timestamp: time.Now(), + } +} + +func (a *Aggregator[K]) Aggregate( + ctx context.Context, + tCtx K, + md model.MetricDef[K], + resAttrs, srcAttrs pcommon.Map, + defaultCount int64, +) error { + switch { + case md.ExponentialHistogram != nil: + val, count, err := getValueCount( + ctx, tCtx, + md.ExponentialHistogram.Value, + md.ExponentialHistogram.Count, + defaultCount, + ) + if err != nil { + return err + } + return a.aggregateValueCount(md, resAttrs, srcAttrs, val, count) + case md.ExplicitHistogram != nil: + val, count, err := getValueCount( + ctx, tCtx, + md.ExplicitHistogram.Value, + md.ExplicitHistogram.Count, + defaultCount, + ) + if err != nil { + return err + } + return a.aggregateValueCount(md, resAttrs, srcAttrs, val, count) + case md.Sum != nil: + raw, _, err := md.Sum.Value.Execute(ctx, tCtx) + if err != nil { + return fmt.Errorf("failed to execute OTTL value for sum: %w", err) + } + switch v := raw.(type) { + case int64: + return a.aggregateInt(md, resAttrs, srcAttrs, v) + case float64: + return a.aggregateDouble(md, resAttrs, srcAttrs, v) + default: + return fmt.Errorf( + "failed to parse sum OTTL value of type %T into int64 or float64: %v", + v, v, + ) + } + } + return nil +} + +// Finalize finalizes the aggregations performed by the aggregator so far into +// the pmetric.Metrics used to create this instance of the aggregator. Finalize +// should be called once per aggregator instance and the aggregator instance +// should not be used after Finalize is called. +func (a *Aggregator[K]) Finalize(mds []model.MetricDef[K]) { + for _, md := range mds { + for resID, dpMap := range a.valueCounts[md.Key] { + metrics := a.smLookup[resID].Metrics() + var ( + destExpHist pmetric.ExponentialHistogram + destExplicitHist pmetric.Histogram + ) + switch { + case md.ExponentialHistogram != nil: + destMetric := metrics.AppendEmpty() + destMetric.SetName(md.Key.Name) + destMetric.SetDescription(md.Key.Description) + destMetric.SetUnit(md.Unit) + destExpHist = destMetric.SetEmptyExponentialHistogram() + destExpHist.SetAggregationTemporality(pmetric.AggregationTemporalityDelta) + destExpHist.DataPoints().EnsureCapacity(len(dpMap)) + case md.ExplicitHistogram != nil: + destMetric := metrics.AppendEmpty() + destMetric.SetName(md.Key.Name) + destMetric.SetDescription(md.Key.Description) + destMetric.SetUnit(md.Unit) + destExplicitHist = destMetric.SetEmptyHistogram() + destExplicitHist.SetAggregationTemporality(pmetric.AggregationTemporalityDelta) + destExplicitHist.DataPoints().EnsureCapacity(len(dpMap)) + } + for _, dp := range dpMap { + dp.Copy( + a.timestamp, + destExpHist, + destExplicitHist, + ) + } + } + for resID, dpMap := range a.sums[md.Key] { + if md.Sum == nil { + continue + } + metrics := a.smLookup[resID].Metrics() + destMetric := metrics.AppendEmpty() + destMetric.SetName(md.Key.Name) + destMetric.SetDescription(md.Key.Description) + destMetric.SetUnit(md.Unit) + destCounter := destMetric.SetEmptySum() + destCounter.SetAggregationTemporality(pmetric.AggregationTemporalityDelta) + destCounter.DataPoints().EnsureCapacity(len(dpMap)) + for _, dp := range dpMap { + dp.Copy(a.timestamp, destCounter.DataPoints().AppendEmpty()) + } + } + // If there are two metric defined with the same key required by metricKey + // then they will be aggregated within the same metric and produced + // together. Deleting the key ensures this while preventing duplicates. + delete(a.valueCounts, md.Key) + delete(a.sums, md.Key) + } +} + +func (a *Aggregator[K]) aggregateInt( + md model.MetricDef[K], + resAttrs, srcAttrs pcommon.Map, + v int64, +) error { + resID := a.getResourceID(resAttrs) + attrID := pdatautil.MapHash(srcAttrs) + if _, ok := a.sums[md.Key]; !ok { + a.sums[md.Key] = make(map[[16]byte]map[[16]byte]*sumDP) + } + if _, ok := a.sums[md.Key][resID]; !ok { + a.sums[md.Key][resID] = make(map[[16]byte]*sumDP) + } + if _, ok := a.sums[md.Key][resID][attrID]; !ok { + a.sums[md.Key][resID][attrID] = newSumDP(srcAttrs, false) + } + a.sums[md.Key][resID][attrID].AggregateInt(v) + return nil +} + +func (a *Aggregator[K]) aggregateDouble( + md model.MetricDef[K], + resAttrs, srcAttrs pcommon.Map, + v float64, +) error { + resID := a.getResourceID(resAttrs) + attrID := pdatautil.MapHash(srcAttrs) + if _, ok := a.sums[md.Key]; !ok { + a.sums[md.Key] = make(map[[16]byte]map[[16]byte]*sumDP) + } + if _, ok := a.sums[md.Key][resID]; !ok { + a.sums[md.Key][resID] = make(map[[16]byte]*sumDP) + } + if _, ok := a.sums[md.Key][resID][attrID]; !ok { + a.sums[md.Key][resID][attrID] = newSumDP(srcAttrs, true) + } + a.sums[md.Key][resID][attrID].AggregateDouble(v) + return nil +} + +func (a *Aggregator[K]) aggregateValueCount( + md model.MetricDef[K], + resAttrs, srcAttrs pcommon.Map, + value float64, count int64, +) error { + if count == 0 { + // Nothing to record as count is zero + return nil + } + resID := a.getResourceID(resAttrs) + attrID := pdatautil.MapHash(srcAttrs) + if _, ok := a.valueCounts[md.Key]; !ok { + a.valueCounts[md.Key] = make(map[[16]byte]map[[16]byte]*valueCountDP) + } + if _, ok := a.valueCounts[md.Key][resID]; !ok { + a.valueCounts[md.Key][resID] = make(map[[16]byte]*valueCountDP) + } + if _, ok := a.valueCounts[md.Key][resID][attrID]; !ok { + a.valueCounts[md.Key][resID][attrID] = newValueCountDP(md, srcAttrs) + } + a.valueCounts[md.Key][resID][attrID].Aggregate(value, count) + return nil +} + +func (a *Aggregator[K]) getResourceID(resourceAttrs pcommon.Map) [16]byte { + resID := pdatautil.MapHash(resourceAttrs) + if _, ok := a.smLookup[resID]; !ok { + destResourceMetric := a.result.ResourceMetrics().AppendEmpty() + destResAttrs := destResourceMetric.Resource().Attributes() + destResAttrs.EnsureCapacity(resourceAttrs.Len() + 1) + resourceAttrs.CopyTo(destResAttrs) + destScopeMetric := destResourceMetric.ScopeMetrics().AppendEmpty() + destScopeMetric.Scope().SetName(metadata.ScopeName) + a.smLookup[resID] = destScopeMetric + } + return resID +} + +// getValueCount evaluates OTTL to get count and value respectively. Count is +// optional and defaults to the default count if the OTTL statement for count +// is missing. Value is required and returns an error if OTTL statement for +// value is missing. +func getValueCount[K any]( + ctx context.Context, tCtx K, + valueExpr, countExpr *ottl.Statement[K], + defaultCount int64, +) (float64, int64, error) { + val, err := getDoubleFromOTTL(ctx, tCtx, valueExpr) + if err != nil { + return 0, 0, fmt.Errorf("failed to get value from OTTL: %w", err) + } + count := defaultCount + if countExpr != nil { + count, err = getIntFromOTTL(ctx, tCtx, countExpr) + if err != nil { + return 0, 0, fmt.Errorf("failed to get count from OTTL: %w", err) + } + } + return val, count, nil +} + +func getIntFromOTTL[K any]( + ctx context.Context, + tCtx K, + s *ottl.Statement[K], +) (int64, error) { + if s == nil { + return 0, nil + } + raw, _, err := s.Execute(ctx, tCtx) + if err != nil { + return 0, err + } + switch v := raw.(type) { + case int64: + return v, nil + case float64: + return int64(v), nil + default: + return 0, fmt.Errorf( + "failed to parse int OTTL value, expression returned value of type %T: %v", + v, v, + ) + } +} + +func getDoubleFromOTTL[K any]( + ctx context.Context, + tCtx K, + s *ottl.Statement[K], +) (float64, error) { + if s == nil { + return 0, nil + } + raw, _, err := s.Execute(ctx, tCtx) + if err != nil { + return 0, err + } + switch v := raw.(type) { + case float64: + return v, nil + case int64: + return float64(v), nil + default: + return 0, fmt.Errorf( + "failed to parse double OTTL value, expression returned value of type %T: %v", + v, v, + ) + } +} diff --git a/connector/signaltometricsconnector/internal/aggregator/exphistogram.go b/connector/signaltometricsconnector/internal/aggregator/exphistogram.go new file mode 100644 index 000000000000..f1728ff20874 --- /dev/null +++ b/connector/signaltometricsconnector/internal/aggregator/exphistogram.go @@ -0,0 +1,63 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package aggregator // import "github.com/open-telemetry/opentelemetry-collector-contrib/connector/signaltometricsconnector/internal/aggregator" + +import ( + "time" + + "github.com/lightstep/go-expohisto/structure" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/pmetric" +) + +type exponentialHistogramDP struct { + attrs pcommon.Map + data *structure.Histogram[float64] +} + +func newExponentialHistogramDP(attrs pcommon.Map, maxSize int32) *exponentialHistogramDP { + return &exponentialHistogramDP{ + attrs: attrs, + data: structure.NewFloat64( + structure.NewConfig(structure.WithMaxSize(maxSize)), + ), + } +} + +func (dp *exponentialHistogramDP) Aggregate(value float64, count int64) { + dp.data.UpdateByIncr(value, uint64(count)) +} + +func (dp *exponentialHistogramDP) Copy( + timestamp time.Time, + dest pmetric.ExponentialHistogramDataPoint, +) { + dp.attrs.CopyTo(dest.Attributes()) + dest.SetZeroCount(dp.data.ZeroCount()) + dest.SetScale(dp.data.Scale()) + dest.SetCount(dp.data.Count()) + dest.SetSum(dp.data.Sum()) + if dp.data.Count() > 0 { + dest.SetMin(dp.data.Min()) + dest.SetMax(dp.data.Max()) + } + // TODO determine appropriate start time + dest.SetTimestamp(pcommon.NewTimestampFromTime(timestamp)) + + copyBucketRange(dp.data.Positive(), dest.Positive()) + copyBucketRange(dp.data.Negative(), dest.Negative()) +} + +// copyBucketRange copies a bucket range from exponential histogram +// datastructure to the OTel representation. +func copyBucketRange( + src *structure.Buckets, + dest pmetric.ExponentialHistogramDataPointBuckets, +) { + dest.SetOffset(src.Offset()) + dest.BucketCounts().EnsureCapacity(int(src.Len())) + for i := uint32(0); i < src.Len(); i++ { + dest.BucketCounts().Append(src.At(i)) + } +} diff --git a/connector/signaltometricsconnector/internal/aggregator/explicithistogram.go b/connector/signaltometricsconnector/internal/aggregator/explicithistogram.go new file mode 100644 index 000000000000..23ce09c5f6ca --- /dev/null +++ b/connector/signaltometricsconnector/internal/aggregator/explicithistogram.go @@ -0,0 +1,61 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package aggregator // import "github.com/open-telemetry/opentelemetry-collector-contrib/connector/signaltometricsconnector/internal/aggregator" + +import ( + "sort" + "time" + + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/pmetric" +) + +type explicitHistogramDP struct { + attrs pcommon.Map + + sum float64 + count uint64 + + // bounds represents the explicitly defined boundaries for the histogram + // bucket. The boundaries for a bucket at index i are: + // + // (-Inf, bounds[i]] for i == 0 + // (bounds[i-1], bounds[i]] for 0 < i < len(bounds) + // (bounds[i-1], +Inf) for i == len(bounds) + // + // Based on above representation, a bounds of length n represents n+1 buckets. + bounds []float64 + + // counts represents the count values of histogram for each bucket. The sum of + // counts across all buckets must be equal to the count variable. The length of + // counts must be one greather than the length of bounds slice. + counts []uint64 +} + +func newExplicitHistogramDP(attrs pcommon.Map, bounds []float64) *explicitHistogramDP { + return &explicitHistogramDP{ + attrs: attrs, + bounds: bounds, + counts: make([]uint64, len(bounds)+1), + } +} + +func (dp *explicitHistogramDP) Aggregate(value float64, count int64) { + dp.sum += value * float64(count) + dp.count += uint64(count) + dp.counts[sort.SearchFloat64s(dp.bounds, value)] += uint64(count) +} + +func (dp *explicitHistogramDP) Copy( + timestamp time.Time, + dest pmetric.HistogramDataPoint, +) { + dp.attrs.CopyTo(dest.Attributes()) + dest.ExplicitBounds().FromRaw(dp.bounds) + dest.BucketCounts().FromRaw(dp.counts) + dest.SetCount(dp.count) + dest.SetSum(dp.sum) + // TODO determine appropriate start time + dest.SetTimestamp(pcommon.NewTimestampFromTime(timestamp)) +} diff --git a/connector/signaltometricsconnector/internal/aggregator/sumdp.go b/connector/signaltometricsconnector/internal/aggregator/sumdp.go new file mode 100644 index 000000000000..332e5249bcc0 --- /dev/null +++ b/connector/signaltometricsconnector/internal/aggregator/sumdp.go @@ -0,0 +1,55 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package aggregator // import "github.com/open-telemetry/opentelemetry-collector-contrib/connector/signaltometricsconnector/internal/aggregator" + +import ( + "time" + + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/pmetric" +) + +// sumDP counts the number of events (supports all event types) +type sumDP struct { + attrs pcommon.Map + + isDbl bool + intVal int64 + dblVal float64 +} + +func newSumDP(attrs pcommon.Map, isDbl bool) *sumDP { + return &sumDP{ + isDbl: isDbl, + attrs: attrs, + } +} + +func (dp *sumDP) AggregateInt(v int64) { + if dp.isDbl { + panic("unexpected usage of sum datapoint, only integer value expected") + } + dp.intVal += v +} + +func (dp *sumDP) AggregateDouble(v float64) { + if !dp.isDbl { + panic("unexpected usage of sum datapoint, only double value expected") + } + dp.dblVal += v +} + +func (dp *sumDP) Copy( + timestamp time.Time, + dest pmetric.NumberDataPoint, +) { + dp.attrs.CopyTo(dest.Attributes()) + if dp.isDbl { + dest.SetDoubleValue(dp.dblVal) + } else { + dest.SetIntValue(dp.intVal) + } + // TODO determine appropriate start time + dest.SetTimestamp(pcommon.NewTimestampFromTime(timestamp)) +} diff --git a/connector/signaltometricsconnector/internal/aggregator/valuecountdp.go b/connector/signaltometricsconnector/internal/aggregator/valuecountdp.go new file mode 100644 index 000000000000..09a342390d92 --- /dev/null +++ b/connector/signaltometricsconnector/internal/aggregator/valuecountdp.go @@ -0,0 +1,59 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package aggregator // import "github.com/open-telemetry/opentelemetry-collector-contrib/connector/signaltometricsconnector/internal/aggregator" +import ( + "time" + + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/pmetric" + + "github.com/open-telemetry/opentelemetry-collector-contrib/connector/signaltometricsconnector/internal/model" +) + +// valueCountDP is a wrapper DP to aggregate all datapoints that record +// value and count. +type valueCountDP struct { + expHistogramDP *exponentialHistogramDP + explicitHistogramDP *explicitHistogramDP +} + +func newValueCountDP[K any]( + md model.MetricDef[K], + attrs pcommon.Map, +) *valueCountDP { + var dp valueCountDP + if md.ExponentialHistogram != nil { + dp.expHistogramDP = newExponentialHistogramDP( + attrs, md.ExponentialHistogram.MaxSize, + ) + } + if md.ExplicitHistogram != nil { + dp.explicitHistogramDP = newExplicitHistogramDP( + attrs, md.ExplicitHistogram.Buckets, + ) + } + return &dp +} + +func (dp *valueCountDP) Aggregate(value float64, count int64) { + if dp.expHistogramDP != nil { + dp.expHistogramDP.Aggregate(value, count) + } + if dp.explicitHistogramDP != nil { + dp.explicitHistogramDP.Aggregate(value, count) + } +} + +func (dp *valueCountDP) Copy( + timestamp time.Time, + destExpHist pmetric.ExponentialHistogram, + destExplicitHist pmetric.Histogram, +) { + if dp.expHistogramDP != nil { + dp.expHistogramDP.Copy(timestamp, destExpHist.DataPoints().AppendEmpty()) + } + if dp.explicitHistogramDP != nil { + dp.explicitHistogramDP.Copy(timestamp, destExplicitHist.DataPoints().AppendEmpty()) + } +} diff --git a/connector/signaltometricsconnector/internal/model/model.go b/connector/signaltometricsconnector/internal/model/model.go new file mode 100644 index 000000000000..16d05b129eb5 --- /dev/null +++ b/connector/signaltometricsconnector/internal/model/model.go @@ -0,0 +1,245 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package model // import "github.com/open-telemetry/opentelemetry-collector-contrib/connector/signaltometricsconnector/internal/model" + +import ( + "errors" + "fmt" + + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/pdata/pcommon" + + "github.com/open-telemetry/opentelemetry-collector-contrib/connector/signaltometricsconnector/config" + "github.com/open-telemetry/opentelemetry-collector-contrib/connector/signaltometricsconnector/internal/customottl" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" +) + +type AttributeKeyValue struct { + Key string + DefaultValue pcommon.Value +} + +type MetricKey struct { + Name string + Description string +} + +type ExplicitHistogram[K any] struct { + Buckets []float64 + Count *ottl.Statement[K] + Value *ottl.Statement[K] +} + +func (h *ExplicitHistogram[K]) fromConfig( + mi *config.Histogram, + parser ottl.Parser[K], +) error { + if mi == nil { + return nil + } + + var err error + h.Buckets = mi.Buckets + if mi.Count != "" { + h.Count, err = parser.ParseStatement(customottl.ConvertToStatement(mi.Count)) + if err != nil { + return fmt.Errorf("failed to parse count statement for explicit histogram: %w", err) + } + } + h.Value, err = parser.ParseStatement(customottl.ConvertToStatement(mi.Value)) + if err != nil { + return fmt.Errorf("failed to parse value statement for explicit histogram: %w", err) + } + return nil +} + +type ExponentialHistogram[K any] struct { + MaxSize int32 + Count *ottl.Statement[K] + Value *ottl.Statement[K] +} + +func (h *ExponentialHistogram[K]) fromConfig( + mi *config.ExponentialHistogram, + parser ottl.Parser[K], +) error { + if mi == nil { + return nil + } + + var err error + h.MaxSize = mi.MaxSize + if mi.Count != "" { + h.Count, err = parser.ParseStatement(customottl.ConvertToStatement(mi.Count)) + if err != nil { + return fmt.Errorf("failed to parse count statement for exponential histogram: %w", err) + } + } + h.Value, err = parser.ParseStatement(customottl.ConvertToStatement(mi.Value)) + if err != nil { + return fmt.Errorf("failed to parse value statement for exponential histogram: %w", err) + } + return nil +} + +type Sum[K any] struct { + Value *ottl.Statement[K] +} + +func (s *Sum[K]) fromConfig( + mi *config.Sum, + parser ottl.Parser[K], +) error { + if mi == nil { + return nil + } + + var err error + s.Value, err = parser.ParseStatement(customottl.ConvertToStatement(mi.Value)) + if err != nil { + return fmt.Errorf("failed to parse value statement for sum: %w", err) + } + return nil +} + +type MetricDef[K any] struct { + Key MetricKey + Unit string + IncludeResourceAttributes []AttributeKeyValue + Attributes []AttributeKeyValue + Conditions *ottl.ConditionSequence[K] + ExponentialHistogram *ExponentialHistogram[K] + ExplicitHistogram *ExplicitHistogram[K] + Sum *Sum[K] +} + +func (md *MetricDef[K]) FromMetricInfo( + mi config.MetricInfo, + parser ottl.Parser[K], + telemetrySettings component.TelemetrySettings, +) error { + md.Key.Name = mi.Name + md.Key.Description = mi.Description + md.Unit = mi.Unit + + var err error + md.IncludeResourceAttributes, err = parseAttributeConfigs(mi.IncludeResourceAttributes) + if err != nil { + return fmt.Errorf("failed to parse include resource attribute config: %w", err) + } + md.Attributes, err = parseAttributeConfigs(mi.Attributes) + if err != nil { + return fmt.Errorf("failed to parse attribute config: %w", err) + } + if len(mi.Conditions) > 0 { + conditions, err := parser.ParseConditions(mi.Conditions) + if err != nil { + return fmt.Errorf("failed to parse OTTL conditions: %w", err) + } + condSeq := ottl.NewConditionSequence( + conditions, + telemetrySettings, + ottl.WithLogicOperation[K](ottl.Or), + ) + md.Conditions = &condSeq + } + if mi.Histogram != nil { + md.ExplicitHistogram = new(ExplicitHistogram[K]) + if err := md.ExplicitHistogram.fromConfig(mi.Histogram, parser); err != nil { + return fmt.Errorf("failed to parse histogram config: %w", err) + } + } + if mi.ExponentialHistogram != nil { + md.ExponentialHistogram = new(ExponentialHistogram[K]) + if err := md.ExponentialHistogram.fromConfig(mi.ExponentialHistogram, parser); err != nil { + return fmt.Errorf("failed to parse histogram config: %w", err) + } + } + if mi.Sum != nil { + md.Sum = new(Sum[K]) + if err := md.Sum.fromConfig(mi.Sum, parser); err != nil { + return fmt.Errorf("failed to parse sum config: %w", err) + } + } + return nil +} + +// FilterResourceAttributes filters resource attributes based on the +// `IncludeResourceAttributes` list for the metric definition. Resource +// attributes are only filtered if the list is specified, otherwise all the +// resource attributes are used for creating the metrics from the metric +// definition. +func (md *MetricDef[K]) FilterResourceAttributes( + attrs pcommon.Map, +) pcommon.Map { + var filteredAttributes pcommon.Map + switch { + case len(md.IncludeResourceAttributes) == 0: + filteredAttributes = pcommon.NewMap() + filteredAttributes.EnsureCapacity(attrs.Len()) + attrs.CopyTo(filteredAttributes) + default: + expectedLen := len(md.IncludeResourceAttributes) + filteredAttributes = filterAttributes(attrs, md.IncludeResourceAttributes, expectedLen) + } + return filteredAttributes +} + +// FilterAttributes filters event attributes (datapoint, logrecord, spans) +// based on the `Attributes` selected for the metric definition. If no +// attributes are selected then an empty `pcommon.Map` is returned. Note +// that, this filtering differs from resource attribute filtering as +// in attribute filtering if any of the configured attributes is not present +// in the data being processed then that metric definition is not processed. +// The method returns a bool signaling if the filter was successful and metric +// should be processed. If the bool value is false then the returned map +// should not be used. +func (md *MetricDef[K]) FilterAttributes(attrs pcommon.Map) (pcommon.Map, bool) { + // Figure out if all the attributes are available, saves allocation + for _, filter := range md.Attributes { + if filter.DefaultValue.Type() != pcommon.ValueTypeEmpty { + // will always add an attribute + continue + } + if _, ok := attrs.Get(filter.Key); !ok { + return pcommon.Map{}, false + } + } + return filterAttributes(attrs, md.Attributes, len(md.Attributes)), true +} + +func filterAttributes(attrs pcommon.Map, filters []AttributeKeyValue, expectedLen int) pcommon.Map { + filteredAttrs := pcommon.NewMap() + filteredAttrs.EnsureCapacity(expectedLen) + for _, filter := range filters { + if attr, ok := attrs.Get(filter.Key); ok { + attr.CopyTo(filteredAttrs.PutEmpty(filter.Key)) + continue + } + if filter.DefaultValue.Type() != pcommon.ValueTypeEmpty { + filter.DefaultValue.CopyTo(filteredAttrs.PutEmpty(filter.Key)) + } + } + return filteredAttrs +} + +func parseAttributeConfigs(cfgs []config.Attribute) ([]AttributeKeyValue, error) { + var errs []error + kvs := make([]AttributeKeyValue, len(cfgs)) + for i, attr := range cfgs { + val := pcommon.NewValueEmpty() + if err := val.FromRaw(attr.DefaultValue); err != nil { + errs = append(errs, err) + } + kvs[i] = AttributeKeyValue{ + Key: attr.Key, + DefaultValue: val, + } + } + + if len(errs) > 0 { + return nil, errors.Join(errs...) + } + return kvs, nil +} diff --git a/connector/signaltometricsconnector/testdata/logs/exponential_histograms/config.yaml b/connector/signaltometricsconnector/testdata/logs/exponential_histograms/config.yaml new file mode 100644 index 000000000000..1dea4b6182a5 --- /dev/null +++ b/connector/signaltometricsconnector/testdata/logs/exponential_histograms/config.yaml @@ -0,0 +1,40 @@ +signaltometrics: + logs: + - name: total.logrecords.exphistogram + description: Logrecords as exponential histogram with log.duration from attributes + exponential_histogram: + count: "1" + value: attributes["log.duration"] + - name: total.logrecords.resource.foo.exphistogram + description: Logrecords with resource attribute foo as exponential histogram with log.duration from attributes + include_resource_attributes: + - key: resource.foo + exponential_histogram: + count: "1" + value: attributes["log.duration"] + - name: log.foo.exphistogram + description: Count total number of log records as per log.foo attribute as exponential histogram with log.duration from attributes + attributes: + - key: log.foo + exponential_histogram: + count: "1" + value: attributes["log.duration"] + - name: log.bar.exphistogram + description: Count total number of log records as per log.bar attribute as exponential histogram with log.duration from attributes + conditions: # Will evaluate to true + - resource.attributes["404.attribute"] != nil + - resource.attributes["resource.foo"] != nil + attributes: + - key: log.bar + exponential_histogram: + count: "1" + value: attributes["log.duration"] + - name: ignored.exphistogram + description: Will be ignored due to conditions evaluating to false + conditions: # Will evaluate to false + - resource.attributes["404.attribute"] != nil + attributes: + - key: log.bar + exponential_histogram: + count: "2" + value: attributes["log.duration"] diff --git a/connector/signaltometricsconnector/testdata/logs/exponential_histograms/output.yaml b/connector/signaltometricsconnector/testdata/logs/exponential_histograms/output.yaml new file mode 100644 index 000000000000..c0e6e450b560 --- /dev/null +++ b/connector/signaltometricsconnector/testdata/logs/exponential_histograms/output.yaml @@ -0,0 +1,473 @@ +resourceMetrics: + - resource: + attributes: + - key: resource.bar + value: + stringValue: bar + - key: resource.foo + value: + stringValue: foo + scopeMetrics: + - metrics: + - description: Logrecords as exponential histogram with log.duration from attributes + exponentialHistogram: + aggregationTemporality: 1 + dataPoints: + - count: "4" + max: 101.5 + min: 7 + negative: {} + positive: + bucketCounts: + - "1" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "1" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "1" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "1" + offset: 89 + scale: 5 + sum: 128 + timeUnixNano: "1000000" + name: total.logrecords.exphistogram + - description: Count total number of log records as per log.foo attribute as exponential histogram with log.duration from attributes + exponentialHistogram: + aggregationTemporality: 1 + dataPoints: + - attributes: + - key: log.foo + value: + stringValue: foo + count: "2" + max: 101.5 + min: 11.4 + negative: {} + positive: + bucketCounts: + - "1" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "1" + offset: 112 + scale: 5 + sum: 112.9 + timeUnixNano: "1000000" + - attributes: + - key: log.foo + value: + stringValue: notfoo + count: "1" + max: 8.1 + min: 8.1 + negative: {} + positive: + bucketCounts: + - "1" + offset: 3.16452e+06 + scale: 20 + sum: 8.1 + timeUnixNano: "1000000" + name: log.foo.exphistogram + - description: Count total number of log records as per log.bar attribute as exponential histogram with log.duration from attributes + exponentialHistogram: + aggregationTemporality: 1 + dataPoints: + - attributes: + - key: log.bar + value: + stringValue: bar + count: "1" + max: 101.5 + min: 101.5 + negative: {} + positive: + bucketCounts: + - "1" + offset: 6.989111e+06 + scale: 20 + sum: 101.5 + timeUnixNano: "1000000" + - attributes: + - key: log.bar + value: + stringValue: notbar + count: "1" + max: 11.4 + min: 11.4 + negative: {} + positive: + bucketCounts: + - "1" + offset: 3.68151e+06 + scale: 20 + sum: 11.4 + timeUnixNano: "1000000" + name: log.bar.exphistogram + scope: + name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/signaltometricsconnector + - resource: + attributes: + - key: resource.foo + value: + stringValue: foo + scopeMetrics: + - metrics: + - description: Logrecords with resource attribute foo as exponential histogram with log.duration from attributes + exponentialHistogram: + aggregationTemporality: 1 + dataPoints: + - count: "4" + max: 101.5 + min: 7 + negative: {} + positive: + bucketCounts: + - "1" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "1" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "1" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "1" + offset: 89 + scale: 5 + sum: 128 + timeUnixNano: "1000000" + name: total.logrecords.resource.foo.exphistogram + scope: + name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/signaltometricsconnector diff --git a/connector/signaltometricsconnector/testdata/logs/histograms/config.yaml b/connector/signaltometricsconnector/testdata/logs/histograms/config.yaml new file mode 100644 index 000000000000..60bb229d9bff --- /dev/null +++ b/connector/signaltometricsconnector/testdata/logs/histograms/config.yaml @@ -0,0 +1,45 @@ +signaltometrics: + logs: + - name: total.logrecords.histogram + description: Logrecords as histogram with log.duration from attributes + histogram: + count: "1" + value: attributes["log.duration"] + buckets: [1, 10, 50, 100, 200] + - name: total.logrecords.resource.foo.histogram + description: Logrecords with resource attribute foo as histogram with log.duration from attributes + include_resource_attributes: + - key: resource.foo + histogram: + count: "1" + value: attributes["log.duration"] + buckets: [1, 10, 50, 100, 200] + - name: log.foo.histogram + description: Count total number of log records as per log.foo attribute as histogram with log.duration from attributes + attributes: + - key: log.foo + histogram: + count: "1" + value: attributes["log.duration"] + buckets: [1, 10, 50, 100, 200] + - name: log.bar.histogram + description: Count total number of log records as per log.bar attribute as histogram with log.duration from attributes + conditions: # Will evaluate to true + - resource.attributes["404.attribute"] != nil + - resource.attributes["resource.foo"] != nil + attributes: + - key: log.bar + histogram: + count: "1" + value: attributes["log.duration"] + buckets: [1, 10, 50, 100, 200] + - name: ignored.histogram + description: Will be ignored due to conditions evaluating to false + conditions: # Will evaluate to false + - resource.attributes["404.attribute"] != nil + attributes: + - key: log.bar + histogram: + count: "2" + value: attributes["log.duration"] + buckets: [1, 50, 200] diff --git a/connector/signaltometricsconnector/testdata/logs/histograms/output.yaml b/connector/signaltometricsconnector/testdata/logs/histograms/output.yaml new file mode 100644 index 000000000000..45d0973f3eed --- /dev/null +++ b/connector/signaltometricsconnector/testdata/logs/histograms/output.yaml @@ -0,0 +1,154 @@ +resourceMetrics: + - resource: + attributes: + - key: resource.bar + value: + stringValue: bar + - key: resource.foo + value: + stringValue: foo + scopeMetrics: + - metrics: + - description: Logrecords as histogram with log.duration from attributes + histogram: + aggregationTemporality: 1 + dataPoints: + - bucketCounts: + - "0" + - "2" + - "1" + - "0" + - "1" + - "0" + count: "4" + explicitBounds: + - 1 + - 10 + - 50 + - 100 + - 200 + sum: 128 + timeUnixNano: "1000000" + name: total.logrecords.histogram + - description: Count total number of log records as per log.foo attribute as histogram with log.duration from attributes + histogram: + aggregationTemporality: 1 + dataPoints: + - attributes: + - key: log.foo + value: + stringValue: foo + bucketCounts: + - "0" + - "0" + - "1" + - "0" + - "1" + - "0" + count: "2" + explicitBounds: + - 1 + - 10 + - 50 + - 100 + - 200 + sum: 112.9 + timeUnixNano: "1000000" + - attributes: + - key: log.foo + value: + stringValue: notfoo + bucketCounts: + - "0" + - "1" + - "0" + - "0" + - "0" + - "0" + count: "1" + explicitBounds: + - 1 + - 10 + - 50 + - 100 + - 200 + sum: 8.1 + timeUnixNano: "1000000" + name: log.foo.histogram + - description: Count total number of log records as per log.bar attribute as histogram with log.duration from attributes + histogram: + aggregationTemporality: 1 + dataPoints: + - attributes: + - key: log.bar + value: + stringValue: bar + bucketCounts: + - "0" + - "0" + - "0" + - "0" + - "1" + - "0" + count: "1" + explicitBounds: + - 1 + - 10 + - 50 + - 100 + - 200 + sum: 101.5 + timeUnixNano: "1000000" + - attributes: + - key: log.bar + value: + stringValue: notbar + bucketCounts: + - "0" + - "0" + - "1" + - "0" + - "0" + - "0" + count: "1" + explicitBounds: + - 1 + - 10 + - 50 + - 100 + - 200 + sum: 11.4 + timeUnixNano: "1000000" + name: log.bar.histogram + scope: + name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/signaltometricsconnector + - resource: + attributes: + - key: resource.foo + value: + stringValue: foo + scopeMetrics: + - metrics: + - description: Logrecords with resource attribute foo as histogram with log.duration from attributes + histogram: + aggregationTemporality: 1 + dataPoints: + - bucketCounts: + - "0" + - "2" + - "1" + - "0" + - "1" + - "0" + count: "4" + explicitBounds: + - 1 + - 10 + - 50 + - 100 + - 200 + sum: 128 + timeUnixNano: "1000000" + name: total.logrecords.resource.foo.histogram + scope: + name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/signaltometricsconnector diff --git a/connector/signaltometricsconnector/testdata/logs/logs.yaml b/connector/signaltometricsconnector/testdata/logs/logs.yaml new file mode 100644 index 000000000000..2df08286fbee --- /dev/null +++ b/connector/signaltometricsconnector/testdata/logs/logs.yaml @@ -0,0 +1,63 @@ +resourceLogs: + - resource: + attributes: + - key: resource.foo + value: + stringValue: foo + - key: resource.bar + value: + stringValue: bar + scopeLogs: + - logRecords: + - attributes: + - key: log.foo + value: + stringValue: foo + - key: log.bar + value: + stringValue: bar + - key: log.duration + value: + doubleValue: 101.5 + body: + stringValue: This is a log message + spanId: "" + timeUnixNano: "1581452773000000789" + traceId: "" + - attributes: + - key: log.foo + value: + stringValue: foo + - key: log.bar + value: + stringValue: notbar + - key: log.duration + value: + doubleValue: 11.4 + body: + stringValue: This is a log message + spanId: "" + timeUnixNano: "1581452773000000789" + traceId: "" + - attributes: + - key: log.foo + value: + stringValue: notfoo + - key: log.duration + value: + doubleValue: 8.1 + body: + stringValue: This is a log message + spanId: "" + timeUnixNano: "1581452773000000789" + traceId: "" + - attributes: + - key: log.duration + value: + doubleValue: 7 + body: + stringValue: This is a log message + spanId: "" + timeUnixNano: "1581452773000000789" + traceId: "" + scope: {} diff --git a/connector/signaltometricsconnector/testdata/logs/sum/config.yaml b/connector/signaltometricsconnector/testdata/logs/sum/config.yaml new file mode 100644 index 000000000000..7b9e20403a14 --- /dev/null +++ b/connector/signaltometricsconnector/testdata/logs/sum/config.yaml @@ -0,0 +1,35 @@ +signaltometrics: + logs: + - name: total.logrecords.sum + description: Count total number of log records + sum: + value: "1" + - name: total.logrecords.resource.foo.sum + description: Count total number of log records with resource attribute foo + include_resource_attributes: + - key: resource.foo + sum: + value: "1" + - name: log.foo.sum + description: Count total number of log records as per log.foo attribute + attributes: + - key: log.foo + sum: + value: "1" + - name: log.bar.sum + description: Count total number of log records as per log.bar attribute + conditions: # Will evaluate to true + - resource.attributes["404.attribute"] != nil + - resource.attributes["resource.foo"] != nil + attributes: + - key: log.bar + sum: + value: "1" + - name: ignored.sum + description: Will be ignored due to conditions evaluating to false + conditions: # Will evaluate to false + - resource.attributes["404.attribute"] != nil + attributes: + - key: log.bar + sum: + value: "2" diff --git a/connector/signaltometricsconnector/testdata/logs/sum/output.yaml b/connector/signaltometricsconnector/testdata/logs/sum/output.yaml new file mode 100644 index 000000000000..f575a5231e79 --- /dev/null +++ b/connector/signaltometricsconnector/testdata/logs/sum/output.yaml @@ -0,0 +1,70 @@ +resourceMetrics: + - resource: + attributes: + - key: resource.bar + value: + stringValue: bar + - key: resource.foo + value: + stringValue: foo + scopeMetrics: + - metrics: + - description: Count total number of log records + name: total.logrecords.sum + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "4" + timeUnixNano: "1000000" + - description: Count total number of log records as per log.foo attribute + name: log.foo.sum + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "2" + attributes: + - key: log.foo + value: + stringValue: foo + timeUnixNano: "1000000" + - asInt: "1" + attributes: + - key: log.foo + value: + stringValue: notfoo + timeUnixNano: "1000000" + - description: Count total number of log records as per log.bar attribute + name: log.bar.sum + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "1" + attributes: + - key: log.bar + value: + stringValue: bar + timeUnixNano: "1000000" + - asInt: "1" + attributes: + - key: log.bar + value: + stringValue: notbar + timeUnixNano: "1000000" + scope: + name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/signaltometricsconnector + - resource: + attributes: + - key: resource.foo + value: + stringValue: foo + scopeMetrics: + - metrics: + - description: Count total number of log records with resource attribute foo + name: total.logrecords.resource.foo.sum + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "4" + timeUnixNano: "1000000" + scope: + name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/signaltometricsconnector diff --git a/connector/signaltometricsconnector/testdata/metrics/exponential_histograms/config.yaml b/connector/signaltometricsconnector/testdata/metrics/exponential_histograms/config.yaml new file mode 100644 index 000000000000..1b2e868fd80b --- /dev/null +++ b/connector/signaltometricsconnector/testdata/metrics/exponential_histograms/config.yaml @@ -0,0 +1,13 @@ +signaltometrics: + datapoints: + - name: gauge.to.exphistogram + description: An exponential histogram created from gague values + include_resource_attributes: + - key: resource.foo + attributes: + - key: datapoint.foo + conditions: + - metric.type == 1 # select all gauges + exponential_histogram: + count: "1" # 1 count for each datapoint + value: Double(value_int) + value_double # handle both int and double diff --git a/connector/signaltometricsconnector/testdata/metrics/exponential_histograms/output.yaml b/connector/signaltometricsconnector/testdata/metrics/exponential_histograms/output.yaml new file mode 100644 index 000000000000..42b210383c32 --- /dev/null +++ b/connector/signaltometricsconnector/testdata/metrics/exponential_histograms/output.yaml @@ -0,0 +1,288 @@ +resourceMetrics: + - resource: + attributes: + - key: resource.foo + value: + stringValue: foo + scopeMetrics: + - metrics: + - description: An exponential histogram created from gague values + exponentialHistogram: + aggregationTemporality: 1 + dataPoints: + - attributes: + - key: datapoint.foo + value: + stringValue: foo + count: "4" + max: 456 + min: 1.23 + negative: {} + positive: + bucketCounts: + - "1" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "1" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "1" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "1" + offset: 4 + scale: 4 + sum: 584.79 + timeUnixNano: "1000000" + - attributes: + - key: datapoint.foo + value: + stringValue: notfoo + count: "2" + max: 789 + min: 7.89 + negative: {} + positive: + bucketCounts: + - "1" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "1" + offset: 47 + scale: 4 + sum: 796.89 + timeUnixNano: "1000000" + name: gauge.to.exphistogram + scope: + name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/signaltometricsconnector diff --git a/connector/signaltometricsconnector/testdata/metrics/histograms/config.yaml b/connector/signaltometricsconnector/testdata/metrics/histograms/config.yaml new file mode 100644 index 000000000000..1b1932008d0b --- /dev/null +++ b/connector/signaltometricsconnector/testdata/metrics/histograms/config.yaml @@ -0,0 +1,15 @@ +signaltometrics: + datapoints: + - name: gauge.to.histogram + description: A histogram created from gague values + include_resource_attributes: + - key: resource.foo + attributes: + - key: datapoint.foo + conditions: + - metric.type == 1 # select all gauges + histogram: + buckets: [1, 4, 5, 8, 200, 500, 1000] + count: "1" # 1 count for each datapoint + value: Double(value_int) + value_double # handle both int and double + diff --git a/connector/signaltometricsconnector/testdata/metrics/histograms/output.yaml b/connector/signaltometricsconnector/testdata/metrics/histograms/output.yaml new file mode 100644 index 000000000000..2cda97a02d15 --- /dev/null +++ b/connector/signaltometricsconnector/testdata/metrics/histograms/output.yaml @@ -0,0 +1,63 @@ +resourceMetrics: + - resource: + attributes: + - key: resource.foo + value: + stringValue: foo + scopeMetrics: + - metrics: + - description: A histogram created from gague values + histogram: + aggregationTemporality: 1 + dataPoints: + - attributes: + - key: datapoint.foo + value: + stringValue: foo + bucketCounts: + - "0" + - "1" + - "1" + - "0" + - "1" + - "1" + - "0" + - "0" + count: "4" + explicitBounds: + - 1 + - 4 + - 5 + - 8 + - 200 + - 500 + - 1000 + sum: 584.79 + timeUnixNano: "1000000" + - attributes: + - key: datapoint.foo + value: + stringValue: notfoo + bucketCounts: + - "0" + - "0" + - "0" + - "1" + - "0" + - "0" + - "1" + - "0" + count: "2" + explicitBounds: + - 1 + - 4 + - 5 + - 8 + - 200 + - 500 + - 1000 + sum: 796.89 + timeUnixNano: "1000000" + name: gauge.to.histogram + scope: + name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/signaltometricsconnector diff --git a/connector/signaltometricsconnector/testdata/metrics/metrics.yaml b/connector/signaltometricsconnector/testdata/metrics/metrics.yaml new file mode 100644 index 000000000000..d51bda6edf7f --- /dev/null +++ b/connector/signaltometricsconnector/testdata/metrics/metrics.yaml @@ -0,0 +1,226 @@ +resourceMetrics: + - resource: + attributes: + - key: resource.foo + value: + stringValue: foo + - key: resource.bar + value: + stringValue: bar + scopeMetrics: + - metrics: + - gauge: + dataPoints: + - asInt: "123" + attributes: + - key: datapoint.foo + value: + stringValue: foo + - key: datapoint.bar + value: + stringValue: bar + startTimeUnixNano: "1581452772000000321" + timeUnixNano: "1581452773000000789" + - asInt: "456" + attributes: + - key: datapoint.foo + value: + stringValue: foo + - key: datapoint.bar + value: + stringValue: notbar + startTimeUnixNano: "1581452772000000321" + timeUnixNano: "1581452773000000789" + - asInt: "789" + attributes: + - key: datapoint.foo + value: + stringValue: notfoo + startTimeUnixNano: "1581452772000000321" + timeUnixNano: "1581452773000000789" + - asInt: "0" + startTimeUnixNano: "1581452772000000321" + timeUnixNano: "1581452773000000789" + name: gauge-int + unit: "1" + - gauge: + dataPoints: + - asDouble: 1.23 + attributes: + - key: datapoint.foo + value: + stringValue: foo + - key: datapoint.bar + value: + stringValue: bar + startTimeUnixNano: "1581452772000000321" + timeUnixNano: "1581452773000000789" + - asDouble: 4.56 + attributes: + - key: datapoint.foo + value: + stringValue: foo + - key: datapoint.bar + value: + stringValue: notbar + startTimeUnixNano: "1581452772000000321" + timeUnixNano: "1581452773000000789" + - asDouble: 7.89 + attributes: + - key: datapoint.foo + value: + stringValue: notfoo + startTimeUnixNano: "1581452772000000321" + timeUnixNano: "1581452773000000789" + - asDouble: 0 + startTimeUnixNano: "1581452772000000321" + timeUnixNano: "1581452773000000789" + name: gauge-double + unit: "1" + - name: counter-int + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "123" + attributes: + - key: datapoint.foo + value: + stringValue: foo + - key: datapoint.bar + value: + stringValue: bar + startTimeUnixNano: "1581452772000000321" + timeUnixNano: "1581452773000000789" + - asInt: "456" + attributes: + - key: datapoint.foo + value: + stringValue: foo + - key: datapoint.bar + value: + stringValue: notbar + startTimeUnixNano: "1581452772000000321" + timeUnixNano: "1581452773000000789" + - asInt: "789" + attributes: + - key: datapoint.foo + value: + stringValue: notfoo + startTimeUnixNano: "1581452772000000321" + timeUnixNano: "1581452773000000789" + - asInt: "0" + startTimeUnixNano: "1581452772000000321" + timeUnixNano: "1581452773000000789" + isMonotonic: true + unit: "1" + - name: counter-double + sum: + aggregationTemporality: 2 + dataPoints: + - asDouble: 1.23 + attributes: + - key: datapoint.foo + value: + stringValue: foo + - key: datapoint.bar + value: + stringValue: bar + startTimeUnixNano: "1581452772000000321" + timeUnixNano: "1581452773000000789" + - asDouble: 4.56 + attributes: + - key: datapoint.foo + value: + stringValue: foo + - key: datapoint.bar + value: + stringValue: notbar + startTimeUnixNano: "1581452772000000321" + timeUnixNano: "1581452773000000789" + - asDouble: 4.56 + attributes: + - key: datapoint.foo + value: + stringValue: notfoo + startTimeUnixNano: "1581452772000000321" + timeUnixNano: "1581452773000000789" + - asDouble: 0 + startTimeUnixNano: "1581452772000000321" + timeUnixNano: "1581452773000000789" + isMonotonic: true + unit: "1" + - histogram: + aggregationTemporality: 2 + dataPoints: + - attributes: + - key: datapoint.foo + value: + stringValue: foo + - key: datapoint.bar + value: + stringValue: bar + count: "1" + startTimeUnixNano: "1581452772000000321" + sum: 15 + timeUnixNano: "1581452773000000789" + - attributes: + - key: datapoint.foo + value: + stringValue: foo + - key: datapoint.bar + value: + stringValue: notbar + count: "2" + startTimeUnixNano: "1581452772000000321" + sum: 30 + timeUnixNano: "1581452773000000789" + - attributes: + - key: datapoint.foo + value: + stringValue: notfoo + count: "3" + startTimeUnixNano: "1581452772000000321" + sum: 45 + timeUnixNano: "1581452773000000789" + - startTimeUnixNano: "1581452772000000321" + sum: 0 + timeUnixNano: "1581452773000000789" + name: double-histogram + unit: "1" + - name: double-summary + summary: + dataPoints: + - attributes: + - key: datapoint.foo + value: + stringValue: foo + - key: datapoint.bar + value: + stringValue: bar + count: "1" + startTimeUnixNano: "1581452772000000321" + sum: 15 + timeUnixNano: "1581452773000000789" + - attributes: + - key: datapoint.foo + value: + stringValue: foo + - key: datapoint.bar + value: + stringValue: notbar + count: "2" + startTimeUnixNano: "1581452772000000321" + sum: 30 + timeUnixNano: "1581452773000000789" + - attributes: + - key: datapoint.foo + value: + stringValue: notfoo + count: "3" + startTimeUnixNano: "1581452772000000321" + sum: 45 + timeUnixNano: "1581452773000000789" + - startTimeUnixNano: "1581452772000000321" + timeUnixNano: "1581452773000000789" + unit: "1" + scope: {} diff --git a/connector/signaltometricsconnector/testdata/metrics/sum/config.yaml b/connector/signaltometricsconnector/testdata/metrics/sum/config.yaml new file mode 100644 index 000000000000..0cc9cfb1abf9 --- /dev/null +++ b/connector/signaltometricsconnector/testdata/metrics/sum/config.yaml @@ -0,0 +1,29 @@ +signaltometrics: + datapoints: + - name: total.datapoint.sum + description: Count total number of datapoints + sum: + value: "1" + - name: datapoint.foo.sum + description: Count total number of datapoints as per datapoint.foo attribute + attributes: + - key: datapoint.foo + sum: + value: "1" + - name: datapoint.bar.sum + description: Count total number of datapoints as per datapoint.bar attribute + conditions: # Will evaluate to true + - resource.attributes["404.attribute"] != nil + - resource.attributes["resource.foo"] != nil + attributes: + - key: datapoint.bar + sum: + value: "1" + - name: ignored.sum + description: Will be ignored due to conditions evaluating to false + conditions: # Will evaluate to false + - resource.attributes["404.attribute"] != nil + attributes: + - key: datapoint.bar + sum: + value: "2" diff --git a/connector/signaltometricsconnector/testdata/metrics/sum/output.yaml b/connector/signaltometricsconnector/testdata/metrics/sum/output.yaml new file mode 100644 index 000000000000..ba8e962693e5 --- /dev/null +++ b/connector/signaltometricsconnector/testdata/metrics/sum/output.yaml @@ -0,0 +1,54 @@ +resourceMetrics: + - resource: + attributes: + - key: resource.bar + value: + stringValue: bar + - key: resource.foo + value: + stringValue: foo + scopeMetrics: + - metrics: + - description: Count total number of datapoints + name: total.datapoint.sum + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "24" + timeUnixNano: "1000000" + - description: Count total number of datapoints as per datapoint.foo attribute + name: datapoint.foo.sum + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "12" + attributes: + - key: datapoint.foo + value: + stringValue: foo + timeUnixNano: "1000000" + - asInt: "6" + attributes: + - key: datapoint.foo + value: + stringValue: notfoo + timeUnixNano: "1000000" + - description: Count total number of datapoints as per datapoint.bar attribute + name: datapoint.bar.sum + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "6" + attributes: + - key: datapoint.bar + value: + stringValue: bar + timeUnixNano: "1000000" + - asInt: "6" + attributes: + - key: datapoint.bar + value: + stringValue: notbar + timeUnixNano: "1000000" + scope: + name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/signaltometricsconnector diff --git a/connector/signaltometricsconnector/testdata/traces/exponential_histograms/config.yaml b/connector/signaltometricsconnector/testdata/traces/exponential_histograms/config.yaml new file mode 100644 index 000000000000..641797fe0c62 --- /dev/null +++ b/connector/signaltometricsconnector/testdata/traces/exponential_histograms/config.yaml @@ -0,0 +1,54 @@ +signaltometrics: + spans: + - name: with_resource_foo_only + description: Spans with resource attribute including resource.foo as a exponential histogram metric + unit: ms + include_resource_attributes: + - key: resource.foo + exponential_histogram: + count: "Int(AdjustedCount())" + value: Milliseconds(end_time - start_time) + - name: with_custom_count + description: Spans with custom count OTTL expression as a exponential histogram metric + unit: ms + exponential_histogram: + count: "2" # count each span twice + value: Milliseconds(end_time - start_time) + - name: http.trace.span.duration + description: Span duration for HTTP spans as a exponential histogram metric + unit: ms + attributes: + - key: http.response.status_code + exponential_histogram: + count: "Int(AdjustedCount())" + value: Milliseconds(end_time - start_time) + - name: db.trace.span.duration + description: Span duration for DB spans as a exponential histogram metric + unit: ms + attributes: + - key: db.system + exponential_histogram: + count: "Int(AdjustedCount())" + value: Milliseconds(end_time - start_time) + - name: msg.trace.span.duration + description: Span duration for messaging spans as a exponential histogram metric + unit: ms + conditions: # Will evaluate to true + - resource.attributes["404.attribute"] != nil + - resource.attributes["resource.foo"] != nil + attributes: + - key: messaging.system + exponential_histogram: + count: "Int(AdjustedCount())" + value: Milliseconds(end_time - start_time) + - name: ignored.exphistogram + description: Will be ignored due to conditions evaluating to false + unit: ms + conditions: # Will evaluate to false + - resource.attributes["404.attribute"] != nil + attributes: + - key: messaging.system + exponential_histogram: + count: "Int(AdjustedCount())" + value: Milliseconds(end_time - start_time) + diff --git a/connector/signaltometricsconnector/testdata/traces/exponential_histograms/output.yaml b/connector/signaltometricsconnector/testdata/traces/exponential_histograms/output.yaml new file mode 100644 index 000000000000..7904d70e5f7c --- /dev/null +++ b/connector/signaltometricsconnector/testdata/traces/exponential_histograms/output.yaml @@ -0,0 +1,677 @@ +resourceMetrics: + - resource: + attributes: + - key: resource.foo + value: + stringValue: foo + scopeMetrics: + - metrics: + - description: Spans with resource attribute including resource.foo as a exponential histogram metric + exponentialHistogram: + aggregationTemporality: 1 + dataPoints: + - count: "8" + max: 17000 + min: 2 + negative: {} + positive: + bucketCounts: + - "1" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "3" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "1" + - "1" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "1" + - "0" + - "0" + - "0" + - "0" + - "1" + offset: 7 + scale: 3 + sum: 31402 + timeUnixNano: "1000000" + name: with_resource_foo_only + unit: ms + scope: + name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/signaltometricsconnector + - resource: + attributes: + - key: resource.bar + value: + stringValue: bar + - key: resource.foo + value: + stringValue: foo + scopeMetrics: + - metrics: + - description: Spans with custom count OTTL expression as a exponential histogram metric + exponentialHistogram: + aggregationTemporality: 1 + dataPoints: + - count: "14" + max: 17000 + min: 2 + negative: {} + positive: + bucketCounts: + - "2" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "4" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "2" + - "2" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "2" + - "0" + - "0" + - "0" + - "0" + - "2" + offset: 7 + scale: 3 + sum: 61804 + timeUnixNano: "1000000" + name: with_custom_count + unit: ms + - description: Span duration for HTTP spans as a exponential histogram metric + exponentialHistogram: + aggregationTemporality: 1 + dataPoints: + - attributes: + - key: http.response.status_code + value: + intValue: "201" + count: "2" + max: 11000 + min: 900 + negative: {} + positive: + bucketCounts: + - "1" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "1" + offset: 314 + scale: 5 + sum: 11900 + timeUnixNano: "1000000" + name: http.trace.span.duration + unit: ms + - description: Span duration for DB spans as a exponential histogram metric + exponentialHistogram: + aggregationTemporality: 1 + dataPoints: + - attributes: + - key: db.system + value: + stringValue: mysql + count: "4" + max: 1000 + min: 500 + negative: {} + positive: + bucketCounts: + - "3" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "1" + offset: 1147 + scale: 7 + sum: 2500 + timeUnixNano: "1000000" + name: db.trace.span.duration + unit: ms + - description: Span duration for messaging spans as a exponential histogram metric + exponentialHistogram: + aggregationTemporality: 1 + dataPoints: + - attributes: + - key: messaging.system + value: + stringValue: kafka + count: "2" + max: 17000 + min: 2 + negative: {} + positive: + bucketCounts: + - "1" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "1" + offset: 7 + scale: 3 + sum: 17002 + timeUnixNano: "1000000" + name: msg.trace.span.duration + unit: ms + scope: + name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/signaltometricsconnector diff --git a/connector/signaltometricsconnector/testdata/traces/histograms/config.yaml b/connector/signaltometricsconnector/testdata/traces/histograms/config.yaml new file mode 100644 index 000000000000..ec7cdee7bbc6 --- /dev/null +++ b/connector/signaltometricsconnector/testdata/traces/histograms/config.yaml @@ -0,0 +1,53 @@ +signaltometrics: + spans: + - name: with_resource_foo_only + description: Spans with resource attribute including resource.foo as a histogram metric + unit: ms + include_resource_attributes: + - key: resource.foo + histogram: + count: "Int(AdjustedCount())" + value: Milliseconds(end_time - start_time) + - name: with_custom_count + description: Spans with custom count OTTL expression as a histogram metric + unit: ms + histogram: + count: "2" # count each span twice + value: Milliseconds(end_time - start_time) + - name: http.trace.span.duration + description: Span duration for HTTP spans as a histogram metric + unit: ms + attributes: + - key: http.response.status_code + histogram: + count: "Int(AdjustedCount())" + value: Milliseconds(end_time - start_time) + - name: db.trace.span.duration + description: Span duration for DB spans as a histogram metric + unit: ms + attributes: + - key: db.system + histogram: + count: "Int(AdjustedCount())" + value: Milliseconds(end_time - start_time) + - name: msg.trace.span.duration + description: Span duration for messaging spans as a histogram metric + unit: ms + conditions: # Will evaluate to true + - resource.attributes["404.attribute"] != nil + - resource.attributes["resource.foo"] != nil + attributes: + - key: messaging.system + histogram: + count: "Int(AdjustedCount())" + value: Milliseconds(end_time - start_time) + - name: ignored.histogram + description: Will be ignored due to conditions evaluating to false + unit: ms + conditions: # Will evaluate to false + - resource.attributes["404.attribute"] != nil + attributes: + - key: messaging.system + histogram: + count: "Int(AdjustedCount())" + value: Milliseconds(end_time - start_time) diff --git a/connector/signaltometricsconnector/testdata/traces/histograms/output.yaml b/connector/signaltometricsconnector/testdata/traces/histograms/output.yaml new file mode 100644 index 000000000000..a25d144566c1 --- /dev/null +++ b/connector/signaltometricsconnector/testdata/traces/histograms/output.yaml @@ -0,0 +1,254 @@ +resourceMetrics: + - resource: + attributes: + - key: resource.foo + value: + stringValue: foo + scopeMetrics: + - metrics: + - description: Spans with resource attribute including resource.foo as a histogram metric + histogram: + aggregationTemporality: 1 + dataPoints: + - bucketCounts: + - "1" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "3" + - "2" + - "0" + - "0" + - "0" + - "0" + - "1" + - "1" + count: "8" + explicitBounds: + - 2 + - 4 + - 6 + - 8 + - 10 + - 50 + - 100 + - 200 + - 400 + - 800 + - 1000 + - 1400 + - 2000 + - 5000 + - 10000 + - 15000 + sum: 31402 + timeUnixNano: "1000000" + name: with_resource_foo_only + unit: ms + scope: + name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/signaltometricsconnector + - resource: + attributes: + - key: resource.bar + value: + stringValue: bar + - key: resource.foo + value: + stringValue: foo + scopeMetrics: + - metrics: + - description: Spans with custom count OTTL expression as a histogram metric + histogram: + aggregationTemporality: 1 + dataPoints: + - bucketCounts: + - "2" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "4" + - "4" + - "0" + - "0" + - "0" + - "0" + - "2" + - "2" + count: "14" + explicitBounds: + - 2 + - 4 + - 6 + - 8 + - 10 + - 50 + - 100 + - 200 + - 400 + - 800 + - 1000 + - 1400 + - 2000 + - 5000 + - 10000 + - 15000 + sum: 61804 + timeUnixNano: "1000000" + name: with_custom_count + unit: ms + - description: Span duration for HTTP spans as a histogram metric + histogram: + aggregationTemporality: 1 + dataPoints: + - attributes: + - key: http.response.status_code + value: + intValue: "201" + bucketCounts: + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "1" + - "0" + - "0" + - "0" + - "0" + - "1" + - "0" + count: "2" + explicitBounds: + - 2 + - 4 + - 6 + - 8 + - 10 + - 50 + - 100 + - 200 + - 400 + - 800 + - 1000 + - 1400 + - 2000 + - 5000 + - 10000 + - 15000 + sum: 11900 + timeUnixNano: "1000000" + name: http.trace.span.duration + unit: ms + - description: Span duration for DB spans as a histogram metric + histogram: + aggregationTemporality: 1 + dataPoints: + - attributes: + - key: db.system + value: + stringValue: mysql + bucketCounts: + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "3" + - "1" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + count: "4" + explicitBounds: + - 2 + - 4 + - 6 + - 8 + - 10 + - 50 + - 100 + - 200 + - 400 + - 800 + - 1000 + - 1400 + - 2000 + - 5000 + - 10000 + - 15000 + sum: 2500 + timeUnixNano: "1000000" + name: db.trace.span.duration + unit: ms + - description: Span duration for messaging spans as a histogram metric + histogram: + aggregationTemporality: 1 + dataPoints: + - attributes: + - key: messaging.system + value: + stringValue: kafka + bucketCounts: + - "1" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "0" + - "1" + count: "2" + explicitBounds: + - 2 + - 4 + - 6 + - 8 + - 10 + - 50 + - 100 + - 200 + - 400 + - 800 + - 1000 + - 1400 + - 2000 + - 5000 + - 10000 + - 15000 + sum: 17002 + timeUnixNano: "1000000" + name: msg.trace.span.duration + unit: ms + scope: + name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/signaltometricsconnector diff --git a/connector/signaltometricsconnector/testdata/traces/sum/config.yaml b/connector/signaltometricsconnector/testdata/traces/sum/config.yaml new file mode 100644 index 000000000000..fe1682e5baf6 --- /dev/null +++ b/connector/signaltometricsconnector/testdata/traces/sum/config.yaml @@ -0,0 +1,47 @@ +signaltometrics: + spans: + - name: with_resource_foo_only + description: Spans with resource attribute including resource.foo as a int sum metric + unit: s + include_resource_attributes: + - key: resource.foo + sum: + value: Int(Seconds(end_time - start_time)) + - name: span_adjusted_count + description: Adjusted count for the span as a sum metric + unit: s + sum: + value: Int(AdjustedCount()) + - name: http.trace.span.duration + description: Span duration for HTTP spans as a int sum metric + unit: s + attributes: + - key: http.response.status_code + sum: + value: Int(Seconds(end_time - start_time)) + - name: db.trace.span.duration + description: Span duration for DB spans as a int sum metric + unit: s + attributes: + - key: db.system + sum: + value: Int(Seconds(end_time - start_time)) + - name: msg.trace.span.duration + description: Span duration for messaging spans as a double sum metric + unit: s + conditions: # Will evaluate to true + - resource.attributes["404.attribute"] != nil + - resource.attributes["resource.foo"] != nil + attributes: + - key: messaging.system + sum: + value: Double(Seconds(end_time - start_time)) + - name: ignored.sum + description: Will be ignored due to conditions evaluating to false + unit: s + conditions: # Will evaluate to false + - resource.attributes["404.attribute"] != nil + attributes: + - key: messaging.system + sum: + value: Double(Seconds(end_time - start_time)) diff --git a/connector/signaltometricsconnector/testdata/traces/sum/output.yaml b/connector/signaltometricsconnector/testdata/traces/sum/output.yaml new file mode 100644 index 000000000000..5beb92e861f0 --- /dev/null +++ b/connector/signaltometricsconnector/testdata/traces/sum/output.yaml @@ -0,0 +1,74 @@ +resourceMetrics: + - resource: + attributes: + - key: resource.foo + value: + stringValue: foo + scopeMetrics: + - metrics: + - description: Spans with resource attribute including resource.foo as a int sum metric + name: with_resource_foo_only + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "29" + timeUnixNano: "1000000" + unit: s + scope: + name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/signaltometricsconnector + - resource: + attributes: + - key: resource.bar + value: + stringValue: bar + - key: resource.foo + value: + stringValue: foo + scopeMetrics: + - metrics: + - description: Adjusted count for the span as a sum metric + name: span_adjusted_count + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "8" + timeUnixNano: "1000000" + unit: s + - description: Span duration for HTTP spans as a int sum metric + name: http.trace.span.duration + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "11" + attributes: + - key: http.response.status_code + value: + intValue: "201" + timeUnixNano: "1000000" + unit: s + - description: Span duration for DB spans as a int sum metric + name: db.trace.span.duration + sum: + aggregationTemporality: 1 + dataPoints: + - asInt: "1" + attributes: + - key: db.system + value: + stringValue: mysql + timeUnixNano: "1000000" + unit: s + - description: Span duration for messaging spans as a double sum metric + name: msg.trace.span.duration + sum: + aggregationTemporality: 1 + dataPoints: + - asDouble: 17.002000935999998 + attributes: + - key: messaging.system + value: + stringValue: kafka + timeUnixNano: "1000000" + unit: s + scope: + name: github.com/open-telemetry/opentelemetry-collector-contrib/connector/signaltometricsconnector diff --git a/connector/sumconnector/go.mod b/connector/sumconnector/go.mod index da7c580f64c4..2463b24d1345 100644 --- a/connector/sumconnector/go.mod +++ b/connector/sumconnector/go.mod @@ -67,8 +67,8 @@ require ( go.opentelemetry.io/otel/trace v1.32.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect - golang.org/x/net v0.33.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/net v0.34.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.69.2 // indirect diff --git a/connector/sumconnector/go.sum b/connector/sumconnector/go.sum index 569b3b3512c1..496b83b85ff2 100644 --- a/connector/sumconnector/go.sum +++ b/connector/sumconnector/go.sum @@ -163,8 +163,9 @@ golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= -golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= 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= @@ -186,8 +187,9 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= diff --git a/examples/couchbase/docker-compose.yaml b/examples/couchbase/docker-compose.yaml index 97344bdc9e6c..68bae4af1bd7 100644 --- a/examples/couchbase/docker-compose.yaml +++ b/examples/couchbase/docker-compose.yaml @@ -10,14 +10,14 @@ services: cpus: "0.50" memory: 1512M opentelemetry-collector-contrib: - image: otel/opentelemetry-collector-contrib:0.116.1 + image: otel/opentelemetry-collector-contrib:0.117.0 command: ["--config=/etc/otel-collector-config.yml"] volumes: - ./otel-collector-config.yaml:/etc/otel-collector-config.yml depends_on: - couchbase prometheus: - image: prom/prometheus:v3.0.1 + image: prom/prometheus:v3.1.0 volumes: - ./prometheus-config.yaml:/etc/prometheus/prometheus.yml ports: diff --git a/examples/demo/.env b/examples/demo/.env deleted file mode 100644 index 4963b70d55a0..000000000000 --- a/examples/demo/.env +++ /dev/null @@ -1,2 +0,0 @@ -OTELCOL_IMG=otel/opentelemetry-collector:0.88.0 -OTELCOL_ARGS= diff --git a/examples/demo/docker-compose.yaml b/examples/demo/docker-compose.yaml index b23fbb3b823d..db514918576c 100644 --- a/examples/demo/docker-compose.yaml +++ b/examples/demo/docker-compose.yaml @@ -21,9 +21,9 @@ services: # Collector otel-collector: - image: ${OTELCOL_IMG} + image: otel/opentelemetry-collector:0.116.1 restart: always - command: ["--config=/etc/otel-collector-config.yaml", "${OTELCOL_ARGS}"] + command: ["--config=/etc/otel-collector-config.yaml"] volumes: - ./otel-collector-config.yaml:/etc/otel-collector-config.yaml ports: diff --git a/examples/demo/otel-collector-config.yaml b/examples/demo/otel-collector-config.yaml index 205a47e97c4a..3c241503b2f7 100644 --- a/examples/demo/otel-collector-config.yaml +++ b/examples/demo/otel-collector-config.yaml @@ -42,3 +42,11 @@ service: receivers: [otlp] processors: [batch] exporters: [debug, prometheus] + telemetry: + metrics: + readers: + - pull: + exporter: + prometheus: + host: '0.0.0.0' + port: 8888 diff --git a/examples/secure-tracing/docker-compose.yaml b/examples/secure-tracing/docker-compose.yaml index cd39353c1ca5..cca941be80a6 100644 --- a/examples/secure-tracing/docker-compose.yaml +++ b/examples/secure-tracing/docker-compose.yaml @@ -12,7 +12,7 @@ services: - ./certs/ca.crt:/etc/ca.crt - ./envoy-config.yaml:/etc/envoy-config.yaml otel-collector: - image: otel/opentelemetry-collector:0.116.1 + image: otel/opentelemetry-collector:0.117.0 command: ["--config=/etc/otel-collector-config.yaml"] volumes: - ./certs/otel-collector.crt:/etc/otel-collector.crt diff --git a/exporter/awscloudwatchlogsexporter/go.mod b/exporter/awscloudwatchlogsexporter/go.mod index 8a82ed5b919e..af836cf436f4 100644 --- a/exporter/awscloudwatchlogsexporter/go.mod +++ b/exporter/awscloudwatchlogsexporter/go.mod @@ -59,8 +59,8 @@ require ( go.opentelemetry.io/otel/sdk v1.32.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.32.0 // indirect go.opentelemetry.io/otel/trace v1.32.0 // indirect - golang.org/x/net v0.33.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/net v0.34.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.69.2 // indirect diff --git a/exporter/awscloudwatchlogsexporter/go.sum b/exporter/awscloudwatchlogsexporter/go.sum index 6947f95d2450..4bb10215c964 100644 --- a/exporter/awscloudwatchlogsexporter/go.sum +++ b/exporter/awscloudwatchlogsexporter/go.sum @@ -133,16 +133,16 @@ 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.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= -golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= 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.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.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.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= diff --git a/exporter/awsemfexporter/go.mod b/exporter/awsemfexporter/go.mod index 0542b4dc2284..15e6eb25f4d5 100644 --- a/exporter/awsemfexporter/go.mod +++ b/exporter/awsemfexporter/go.mod @@ -63,8 +63,8 @@ require ( go.opentelemetry.io/otel/sdk v1.32.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.32.0 // indirect go.opentelemetry.io/otel/trace v1.32.0 // indirect - golang.org/x/net v0.33.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/net v0.34.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.69.2 // indirect diff --git a/exporter/awsemfexporter/go.sum b/exporter/awsemfexporter/go.sum index 71a245706468..be531f6feeb1 100644 --- a/exporter/awsemfexporter/go.sum +++ b/exporter/awsemfexporter/go.sum @@ -137,16 +137,16 @@ 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.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= -golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= 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.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.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.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= diff --git a/exporter/awss3exporter/go.mod b/exporter/awss3exporter/go.mod index 7665e84c8f0c..7ad7ccd3f428 100644 --- a/exporter/awss3exporter/go.mod +++ b/exporter/awss3exporter/go.mod @@ -6,8 +6,8 @@ require ( github.com/aws/aws-sdk-go-v2 v1.32.7 github.com/aws/aws-sdk-go-v2/config v1.28.7 github.com/aws/aws-sdk-go-v2/credentials v1.17.48 - github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.44 - github.com/aws/aws-sdk-go-v2/service/s3 v1.71.1 + github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.45 + github.com/aws/aws-sdk-go-v2/service/s3 v1.72.0 github.com/aws/aws-sdk-go-v2/service/sts v1.33.3 github.com/stretchr/testify v1.10.0 github.com/tilinna/clock v1.1.0 diff --git a/exporter/awss3exporter/go.sum b/exporter/awss3exporter/go.sum index 5173df8bc227..27619431e719 100644 --- a/exporter/awss3exporter/go.sum +++ b/exporter/awss3exporter/go.sum @@ -8,8 +8,8 @@ github.com/aws/aws-sdk-go-v2/credentials v1.17.48 h1:IYdLD1qTJ0zanRavulofmqut4af github.com/aws/aws-sdk-go-v2/credentials v1.17.48/go.mod h1:tOscxHN3CGmuX9idQ3+qbkzrjVIx32lqDSU1/0d/qXs= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.22 h1:kqOrpojG71DxJm/KDPO+Z/y1phm1JlC8/iT+5XRmAn8= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.22/go.mod h1:NtSFajXVVL8TA2QNngagVZmUtXciyrHOt7xgz4faS/M= -github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.44 h1:2zxMLXLedpB4K1ilbJFxtMKsVKaexOqDttOhc0QGm3Q= -github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.44/go.mod h1:VuLHdqwjSvgftNC7yqPWyGVhEwPmJpeRi07gOgOfHF8= +github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.45 h1:ZxB8WFVYwolhDZxuZXoesHkl+L9cXLWy0K/G0QkNATc= +github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.45/go.mod h1:1krrbyoFFDqaNldmltPTP+mK3sAXLHPoaFtISOw2Hkk= github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.26 h1:I/5wmGMffY4happ8NOCuIUEWGUvvFp5NSeQcXl9RHcI= github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.26/go.mod h1:FR8f4turZtNy6baO0KJ5FJUmXH/cSkI9fOngs0yl6mA= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.26 h1:zXFLuEuMMUOvEARXFUVJdfqZ4bvvSgdGRq/ATcrQxzM= @@ -26,8 +26,8 @@ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.7 h1:8eUsivBQz github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.7/go.mod h1:kLPQvGUmxn/fqiCrDeohwG33bq2pQpGeY62yRO6Nrh0= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.7 h1:Hi0KGbrnr57bEHWM0bJ1QcBzxLrL/k2DHvGYhb8+W1w= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.7/go.mod h1:wKNgWgExdjjrm4qvfbTorkvocEstaoDl4WCvGfeCy9c= -github.com/aws/aws-sdk-go-v2/service/s3 v1.71.1 h1:aOVVZJgWbaH+EJYPvEgkNhCEbXXvH7+oML36oaPK3zE= -github.com/aws/aws-sdk-go-v2/service/s3 v1.71.1/go.mod h1:r+xl5yzMk9083rMR+sJ5TYj9Tihvf/l1oxzZXDgGj2Q= +github.com/aws/aws-sdk-go-v2/service/s3 v1.72.0 h1:SAfh4pNx5LuTafKKWR02Y+hL3A+3TX8cTKG1OIAJaBk= +github.com/aws/aws-sdk-go-v2/service/s3 v1.72.0/go.mod h1:r+xl5yzMk9083rMR+sJ5TYj9Tihvf/l1oxzZXDgGj2Q= github.com/aws/aws-sdk-go-v2/service/sso v1.24.8 h1:CvuUmnXI7ebaUAhbJcDy9YQx8wHR69eZ9I7q5hszt/g= github.com/aws/aws-sdk-go-v2/service/sso v1.24.8/go.mod h1:XDeGv1opzwm8ubxddF0cgqkZWsyOtw4lr6dxwmb6YQg= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.7 h1:F2rBfNAL5UyswqoeWv9zs74N/NanhK16ydHW1pahX6E= diff --git a/exporter/awsxrayexporter/go.mod b/exporter/awsxrayexporter/go.mod index bfe2e2a20051..8b22383bee86 100644 --- a/exporter/awsxrayexporter/go.mod +++ b/exporter/awsxrayexporter/go.mod @@ -60,8 +60,8 @@ require ( go.opentelemetry.io/otel/sdk/metric v1.32.0 // indirect go.opentelemetry.io/otel/trace v1.32.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/net v0.33.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/net v0.34.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.69.2 // indirect diff --git a/exporter/awsxrayexporter/go.sum b/exporter/awsxrayexporter/go.sum index ad9f6fd6010f..bb1b3a421556 100644 --- a/exporter/awsxrayexporter/go.sum +++ b/exporter/awsxrayexporter/go.sum @@ -135,16 +135,16 @@ 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.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= -golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= 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.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.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.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= diff --git a/exporter/azuremonitorexporter/go.mod b/exporter/azuremonitorexporter/go.mod index c892abddf786..39c98aa37730 100644 --- a/exporter/azuremonitorexporter/go.mod +++ b/exporter/azuremonitorexporter/go.mod @@ -16,7 +16,7 @@ require ( go.opentelemetry.io/collector/pdata v1.23.0 go.opentelemetry.io/collector/semconv v0.117.0 go.uber.org/zap v1.27.0 - golang.org/x/net v0.33.0 + golang.org/x/net v0.34.0 ) require ( @@ -61,7 +61,7 @@ require ( go.opentelemetry.io/otel/sdk/metric v1.32.0 // indirect go.opentelemetry.io/otel/trace v1.32.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.69.2 // indirect diff --git a/exporter/azuremonitorexporter/go.sum b/exporter/azuremonitorexporter/go.sum index b657c64aa12b..a28cf8fecc16 100644 --- a/exporter/azuremonitorexporter/go.sum +++ b/exporter/azuremonitorexporter/go.sum @@ -149,8 +149,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.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= -golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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= @@ -159,8 +159,8 @@ golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5h 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.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.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.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= diff --git a/exporter/datadogexporter/go.mod b/exporter/datadogexporter/go.mod index 182a985a9333..225d5d081a6b 100644 --- a/exporter/datadogexporter/go.mod +++ b/exporter/datadogexporter/go.mod @@ -38,7 +38,7 @@ require ( github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.22.0 github.com/DataDog/sketches-go v1.4.6 // indirect github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.25.0 - github.com/aws/aws-sdk-go v1.55.5 + github.com/aws/aws-sdk-go v1.55.5 // indirect github.com/cenkalti/backoff/v4 v4.3.0 github.com/google/go-cmp v0.6.0 github.com/open-telemetry/opentelemetry-collector-contrib/connector/datadogconnector v0.117.0 @@ -91,6 +91,10 @@ require ( ) require ( + github.com/aws/aws-sdk-go-v2 v1.32.7 + github.com/aws/aws-sdk-go-v2/config v1.28.6 + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.22 + github.com/aws/aws-sdk-go-v2/service/ec2 v1.196.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/datadog v0.117.0 go.opentelemetry.io/collector/component/componenttest v0.117.0 go.opentelemetry.io/collector/consumer/consumererror v0.117.0 @@ -157,6 +161,16 @@ require ( github.com/antchfx/xmlquery v1.4.3 // indirect github.com/antchfx/xpath v1.3.3 // indirect github.com/armon/go-metrics v0.4.1 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.17.47 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.25 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.25 // indirect + github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.6 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.24.7 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.6 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.33.2 // indirect + github.com/aws/smithy-go v1.22.1 // indirect github.com/benbjohnson/clock v1.3.5 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bmatcuk/doublestar/v4 v4.7.1 // indirect diff --git a/exporter/datadogexporter/go.sum b/exporter/datadogexporter/go.sum index 864db8782599..b0899e11f873 100644 --- a/exporter/datadogexporter/go.sum +++ b/exporter/datadogexporter/go.sum @@ -277,6 +277,34 @@ github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:l github.com/aws/aws-sdk-go v1.38.35/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go v1.55.5 h1:KKUZBfBoyqy5d3swXyiC7Q76ic40rYcbqH7qjh59kzU= github.com/aws/aws-sdk-go v1.55.5/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU= +github.com/aws/aws-sdk-go-v2 v1.32.7 h1:ky5o35oENWi0JYWUZkB7WYvVPP+bcRF5/Iq7JWSb5Rw= +github.com/aws/aws-sdk-go-v2 v1.32.7/go.mod h1:P5WJBrYqqbWVaOxgH0X/FYYD47/nooaPOZPlQdmiN2U= +github.com/aws/aws-sdk-go-v2/config v1.28.6 h1:D89IKtGrs/I3QXOLNTH93NJYtDhm8SYa9Q5CsPShmyo= +github.com/aws/aws-sdk-go-v2/config v1.28.6/go.mod h1:GDzxJ5wyyFSCoLkS+UhGB0dArhb9mI+Co4dHtoTxbko= +github.com/aws/aws-sdk-go-v2/credentials v1.17.47 h1:48bA+3/fCdi2yAwVt+3COvmatZ6jUDNkDTIsqDiMUdw= +github.com/aws/aws-sdk-go-v2/credentials v1.17.47/go.mod h1:+KdckOejLW3Ks3b0E3b5rHsr2f9yuORBum0WPnE5o5w= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.22 h1:kqOrpojG71DxJm/KDPO+Z/y1phm1JlC8/iT+5XRmAn8= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.22/go.mod h1:NtSFajXVVL8TA2QNngagVZmUtXciyrHOt7xgz4faS/M= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.25 h1:s/fF4+yDQDoElYhfIVvSNyeCydfbuTKzhxSXDXCPasU= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.25/go.mod h1:IgPfDv5jqFIzQSNbUEMoitNooSMXjRSDkhXv8jiROvU= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.25 h1:ZntTCl5EsYnhN/IygQEUugpdwbhdkom9uHcbCftiGgA= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.25/go.mod h1:DBdPrgeocww+CSl1C8cEV8PN1mHMBhuCDLpXezyvWkE= +github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 h1:VaRN3TlFdd6KxX1x3ILT5ynH6HvKgqdiXoTxAF4HQcQ= +github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1/go.mod h1:FbtygfRFze9usAadmnGJNc8KsP346kEe+y2/oyhGAGc= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.196.0 h1:ZBtoihAqfT+5b1FwGHOubq8k10KwaIyKZd2/CRTucAU= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.196.0/go.mod h1:00zqVNJFK6UASrTnuvjJHJuaqUdkVz5tW8Ip+VhzuNg= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1 h1:iXtILhvDxB6kPvEXgsDhGaZCSC6LQET5ZHSdJozeI0Y= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1/go.mod h1:9nu0fVANtYiAePIBh2/pFUSwtJ402hLnp854CNoDOeE= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.6 h1:50+XsN70RS7dwJ2CkVNXzj7U2L1HKP8nqTd3XWEXBN4= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.6/go.mod h1:WqgLmwY7so32kG01zD8CPTJWVWM+TzJoOVHwTg4aPug= +github.com/aws/aws-sdk-go-v2/service/sso v1.24.7 h1:rLnYAfXQ3YAccocshIH5mzNNwZBkBo+bP6EhIxak6Hw= +github.com/aws/aws-sdk-go-v2/service/sso v1.24.7/go.mod h1:ZHtuQJ6t9A/+YDuxOLnbryAmITtr8UysSny3qcyvJTc= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.6 h1:JnhTZR3PiYDNKlXy50/pNeix9aGMo6lLpXwJ1mw8MD4= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.6/go.mod h1:URronUEGfXZN1VpdktPSD1EkAL9mfrV+2F4sjH38qOY= +github.com/aws/aws-sdk-go-v2/service/sts v1.33.2 h1:s4074ZO1Hk8qv65GqNXqDjmkf4HSQqJukaLuuW0TpDA= +github.com/aws/aws-sdk-go-v2/service/sts v1.33.2/go.mod h1:mVggCnIWoM09jP71Wh+ea7+5gAp53q+49wDFs1SW5z8= +github.com/aws/smithy-go v1.22.1 h1:/HPHZQ0g7f4eUeK6HKglFz8uwVfZKgoI25rb/J+dnro= +github.com/aws/smithy-go v1.22.1/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= github.com/bboreham/go-loser v0.0.0-20230920113527-fcc2c21820a3 h1:6df1vn4bBlDDo4tARvBm7l6KA9iVMnE3NWizDeWSrps= github.com/bboreham/go-loser v0.0.0-20230920113527-fcc2c21820a3/go.mod h1:CIWtjkly68+yqLPbvwwR/fjNJA/idrtULjZWh2v1ys0= github.com/benbjohnson/clock v1.3.5 h1:VvXlSJBzZpA/zum6Sj74hxwYI2DIxRWuNIoXAzHZz5o= diff --git a/exporter/datadogexporter/integrationtest/go.mod b/exporter/datadogexporter/integrationtest/go.mod index d5e470ebd0b9..8ff77f7cbad3 100644 --- a/exporter/datadogexporter/integrationtest/go.mod +++ b/exporter/datadogexporter/integrationtest/go.mod @@ -127,6 +127,20 @@ require ( github.com/antchfx/xpath v1.3.3 // indirect github.com/armon/go-metrics v0.4.1 // indirect github.com/aws/aws-sdk-go v1.55.5 // indirect + github.com/aws/aws-sdk-go-v2 v1.32.7 // indirect + github.com/aws/aws-sdk-go-v2/config v1.28.6 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.17.47 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.22 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.25 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.25 // indirect + github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect + github.com/aws/aws-sdk-go-v2/service/ec2 v1.196.0 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.6 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.24.7 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.6 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.33.2 // indirect + github.com/aws/smithy-go v1.22.1 // indirect github.com/benbjohnson/clock v1.3.5 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/briandowns/spinner v1.23.0 // indirect diff --git a/exporter/datadogexporter/integrationtest/go.sum b/exporter/datadogexporter/integrationtest/go.sum index a049324b6807..8147453f645e 100644 --- a/exporter/datadogexporter/integrationtest/go.sum +++ b/exporter/datadogexporter/integrationtest/go.sum @@ -275,6 +275,34 @@ github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:l github.com/aws/aws-sdk-go v1.38.35/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go v1.55.5 h1:KKUZBfBoyqy5d3swXyiC7Q76ic40rYcbqH7qjh59kzU= github.com/aws/aws-sdk-go v1.55.5/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU= +github.com/aws/aws-sdk-go-v2 v1.32.7 h1:ky5o35oENWi0JYWUZkB7WYvVPP+bcRF5/Iq7JWSb5Rw= +github.com/aws/aws-sdk-go-v2 v1.32.7/go.mod h1:P5WJBrYqqbWVaOxgH0X/FYYD47/nooaPOZPlQdmiN2U= +github.com/aws/aws-sdk-go-v2/config v1.28.6 h1:D89IKtGrs/I3QXOLNTH93NJYtDhm8SYa9Q5CsPShmyo= +github.com/aws/aws-sdk-go-v2/config v1.28.6/go.mod h1:GDzxJ5wyyFSCoLkS+UhGB0dArhb9mI+Co4dHtoTxbko= +github.com/aws/aws-sdk-go-v2/credentials v1.17.47 h1:48bA+3/fCdi2yAwVt+3COvmatZ6jUDNkDTIsqDiMUdw= +github.com/aws/aws-sdk-go-v2/credentials v1.17.47/go.mod h1:+KdckOejLW3Ks3b0E3b5rHsr2f9yuORBum0WPnE5o5w= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.22 h1:kqOrpojG71DxJm/KDPO+Z/y1phm1JlC8/iT+5XRmAn8= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.22/go.mod h1:NtSFajXVVL8TA2QNngagVZmUtXciyrHOt7xgz4faS/M= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.25 h1:s/fF4+yDQDoElYhfIVvSNyeCydfbuTKzhxSXDXCPasU= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.25/go.mod h1:IgPfDv5jqFIzQSNbUEMoitNooSMXjRSDkhXv8jiROvU= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.25 h1:ZntTCl5EsYnhN/IygQEUugpdwbhdkom9uHcbCftiGgA= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.25/go.mod h1:DBdPrgeocww+CSl1C8cEV8PN1mHMBhuCDLpXezyvWkE= +github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 h1:VaRN3TlFdd6KxX1x3ILT5ynH6HvKgqdiXoTxAF4HQcQ= +github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1/go.mod h1:FbtygfRFze9usAadmnGJNc8KsP346kEe+y2/oyhGAGc= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.196.0 h1:ZBtoihAqfT+5b1FwGHOubq8k10KwaIyKZd2/CRTucAU= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.196.0/go.mod h1:00zqVNJFK6UASrTnuvjJHJuaqUdkVz5tW8Ip+VhzuNg= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1 h1:iXtILhvDxB6kPvEXgsDhGaZCSC6LQET5ZHSdJozeI0Y= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1/go.mod h1:9nu0fVANtYiAePIBh2/pFUSwtJ402hLnp854CNoDOeE= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.6 h1:50+XsN70RS7dwJ2CkVNXzj7U2L1HKP8nqTd3XWEXBN4= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.6/go.mod h1:WqgLmwY7so32kG01zD8CPTJWVWM+TzJoOVHwTg4aPug= +github.com/aws/aws-sdk-go-v2/service/sso v1.24.7 h1:rLnYAfXQ3YAccocshIH5mzNNwZBkBo+bP6EhIxak6Hw= +github.com/aws/aws-sdk-go-v2/service/sso v1.24.7/go.mod h1:ZHtuQJ6t9A/+YDuxOLnbryAmITtr8UysSny3qcyvJTc= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.6 h1:JnhTZR3PiYDNKlXy50/pNeix9aGMo6lLpXwJ1mw8MD4= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.6/go.mod h1:URronUEGfXZN1VpdktPSD1EkAL9mfrV+2F4sjH38qOY= +github.com/aws/aws-sdk-go-v2/service/sts v1.33.2 h1:s4074ZO1Hk8qv65GqNXqDjmkf4HSQqJukaLuuW0TpDA= +github.com/aws/aws-sdk-go-v2/service/sts v1.33.2/go.mod h1:mVggCnIWoM09jP71Wh+ea7+5gAp53q+49wDFs1SW5z8= +github.com/aws/smithy-go v1.22.1 h1:/HPHZQ0g7f4eUeK6HKglFz8uwVfZKgoI25rb/J+dnro= +github.com/aws/smithy-go v1.22.1/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= github.com/bboreham/go-loser v0.0.0-20230920113527-fcc2c21820a3 h1:6df1vn4bBlDDo4tARvBm7l6KA9iVMnE3NWizDeWSrps= github.com/bboreham/go-loser v0.0.0-20230920113527-fcc2c21820a3/go.mod h1:CIWtjkly68+yqLPbvwwR/fjNJA/idrtULjZWh2v1ys0= github.com/benbjohnson/clock v1.3.5 h1:VvXlSJBzZpA/zum6Sj74hxwYI2DIxRWuNIoXAzHZz5o= diff --git a/exporter/datadogexporter/internal/hostmetadata/internal/ec2/ec2.go b/exporter/datadogexporter/internal/hostmetadata/internal/ec2/ec2.go index ef20a5382106..a025fabda443 100644 --- a/exporter/datadogexporter/internal/hostmetadata/internal/ec2/ec2.go +++ b/exporter/datadogexporter/internal/hostmetadata/internal/ec2/ec2.go @@ -7,14 +7,16 @@ package ec2 // import "github.com/open-telemetry/opentelemetry-collector-contrib import ( "context" "fmt" + "io" "strings" "sync" "github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes/source" - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/ec2metadata" - "github.com/aws/aws-sdk-go/aws/session" - "github.com/aws/aws-sdk-go/service/ec2" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/config" + "github.com/aws/aws-sdk-go-v2/feature/ec2/imds" + "github.com/aws/aws-sdk-go-v2/service/ec2" + "github.com/aws/aws-sdk-go-v2/service/ec2/types" "go.uber.org/zap" "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/datadogexporter/internal/hostmetadata/provider" @@ -42,31 +44,43 @@ func isDefaultHostname(hostname string) bool { // GetHostInfo gets the hostname info from EC2 metadata func GetHostInfo(ctx context.Context, logger *zap.Logger) (hostInfo *HostInfo) { - sess, err := session.NewSession() hostInfo = &HostInfo{} + cfg, err := config.LoadDefaultConfig(ctx) if err != nil { - logger.Warn("Failed to build AWS session", zap.Error(err)) + logger.Warn("Failed to build AWS config", zap.Error(err)) return } - meta := ec2metadata.New(sess) + client := imds.NewFromConfig(cfg) - if !meta.AvailableWithContext(ctx) { - logger.Debug("EC2 Metadata not available") + // Check if metadata service is available by trying to retrieve instance ID + _, err = client.GetMetadata(ctx, &imds.GetMetadataInput{ + Path: "instance-id", + }) + if err != nil { + logger.Debug("EC2 Metadata service is not available", zap.Error(err)) return } - if idDoc, err := meta.GetInstanceIdentityDocumentWithContext(ctx); err == nil { + idDoc, err := client.GetInstanceIdentityDocument(ctx, &imds.GetInstanceIdentityDocumentInput{}) + if err == nil { hostInfo.InstanceID = idDoc.InstanceID } else { logger.Warn("Failed to get EC2 instance id document", zap.Error(err)) } - if ec2Hostname, err := meta.GetMetadataWithContext(ctx, "hostname"); err == nil { - hostInfo.EC2Hostname = ec2Hostname + metadataOutput, err := client.GetMetadata(ctx, &imds.GetMetadataInput{Path: "hostname"}) + if err != nil { + logger.Warn("Failed to retrieve EC2 hostname", zap.Error(err)) } else { - logger.Warn("Failed to get EC2 hostname", zap.Error(err)) + defer metadataOutput.Content.Close() + hostnameBytes, readErr := io.ReadAll(metadataOutput.Content) + if readErr != nil { + logger.Warn("Failed to read EC2 hostname content", zap.Error(readErr)) + } else { + hostInfo.EC2Hostname = string(hostnameBytes) + } } return @@ -94,13 +108,13 @@ type Provider struct { } func NewProvider(logger *zap.Logger) (*Provider, error) { - sess, err := session.NewSession() + cfg, err := config.LoadDefaultConfig(context.Background()) if err != nil { return nil, err } return &Provider{ logger: logger, - detector: ec2provider.NewProvider(sess), + detector: ec2provider.NewProvider(cfg), }, nil } @@ -129,23 +143,20 @@ func (p *Provider) instanceTags(ctx context.Context) (*ec2.DescribeTagsOutput, e // Similar to: // - https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/39dbc1ac8/processor/resourcedetectionprocessor/internal/aws/ec2/ec2.go#L118-L151 // - https://github.com/DataDog/datadog-agent/blob/1b4afdd6a03e8fabcc169b924931b2bb8935dab9/pkg/util/ec2/ec2_tags.go#L104-L134 - sess, err := session.NewSession(&aws.Config{ - Region: aws.String(meta.Region), - }) + cfg, err := config.LoadDefaultConfig(ctx, + config.WithRegion(meta.Region), + ) if err != nil { - return nil, fmt.Errorf("failed to build AWS session: %w", err) + return nil, fmt.Errorf("failed to load AWS config: %w", err) } - svc := ec2.New(sess) - return svc.DescribeTagsWithContext(ctx, - &ec2.DescribeTagsInput{ - Filters: []*ec2.Filter{{ - Name: aws.String("resource-id"), - Values: []*string{ - aws.String(meta.InstanceID), - }, - }}, - }) + client := ec2.NewFromConfig(cfg) + return client.DescribeTags(ctx, &ec2.DescribeTagsInput{ + Filters: []types.Filter{{ + Name: aws.String("resource-id"), + Values: []string{meta.InstanceID}, + }}, + }) } // clusterNameFromTags gets the AWS EC2 Cluster name from the tags on an EC2 instance. diff --git a/exporter/datadogexporter/internal/hostmetadata/internal/ec2/ec2_test.go b/exporter/datadogexporter/internal/hostmetadata/internal/ec2/ec2_test.go index 26d697236466..da1dc3c1ab48 100644 --- a/exporter/datadogexporter/internal/hostmetadata/internal/ec2/ec2_test.go +++ b/exporter/datadogexporter/internal/hostmetadata/internal/ec2/ec2_test.go @@ -5,7 +5,8 @@ package ec2 import ( "testing" - "github.com/aws/aws-sdk-go/service/ec2" + "github.com/aws/aws-sdk-go-v2/service/ec2" + "github.com/aws/aws-sdk-go-v2/service/ec2/types" "github.com/stretchr/testify/assert" "go.uber.org/zap" ) @@ -56,7 +57,7 @@ func TestClusterNameFromEC2Tags(t *testing.T) { name: "missing cluster name tag", ec2Tags: &ec2.DescribeTagsOutput{ NextToken: strp("NextToken"), - Tags: []*ec2.TagDescription{ + Tags: []types.TagDescription{ {Key: strp("some key"), Value: strp("some value")}, }, }, @@ -66,7 +67,7 @@ func TestClusterNameFromEC2Tags(t *testing.T) { name: "cluster name tag only has the prefix", ec2Tags: &ec2.DescribeTagsOutput{ NextToken: strp("NextToken"), - Tags: []*ec2.TagDescription{ + Tags: []types.TagDescription{ {Key: strp("some key"), Value: strp("some value")}, {Key: strp("kubernetes.io/cluster/"), Value: strp("some value")}, }, @@ -77,7 +78,7 @@ func TestClusterNameFromEC2Tags(t *testing.T) { name: "cluster name is available", ec2Tags: &ec2.DescribeTagsOutput{ NextToken: strp("NextToken"), - Tags: []*ec2.TagDescription{ + Tags: []types.TagDescription{ {Key: strp("some key"), Value: strp("some value")}, {Key: strp("kubernetes.io/cluster/myclustername"), Value: strp("some value")}, }, diff --git a/exporter/elasticsearchexporter/exporter_test.go b/exporter/elasticsearchexporter/exporter_test.go index 5554c089e02b..33a0cf6d1383 100644 --- a/exporter/elasticsearchexporter/exporter_test.go +++ b/exporter/elasticsearchexporter/exporter_test.go @@ -450,7 +450,7 @@ func TestExporterLogs(t *testing.T) { return vm }(), isEvent: true, - wantDocument: []byte(`{"@timestamp":"1970-01-01T00:00:00.000000000Z","attributes":{"attr.foo":"attr.foo.value","event.name":"foo"},"data_stream":{"dataset":"attr.dataset.otel","namespace":"resource.attribute.namespace","type":"logs"},"dropped_attributes_count":0,"observed_timestamp":"1970-01-01T00:00:00.000000000Z","resource":{"attributes":{"resource.attr.foo":"resource.attr.foo.value"},"dropped_attributes_count":0},"scope":{"dropped_attributes_count":0},"severity_number":0,"body":{"structured":{"true":true,"false":false,"inner":{"foo":"bar"}}}}`), + wantDocument: []byte(`{"@timestamp":"1970-01-01T00:00:00.000000000Z","attributes":{"attr.foo":"attr.foo.value","event.name":"foo"},"event_name":"foo","data_stream":{"dataset":"attr.dataset.otel","namespace":"resource.attribute.namespace","type":"logs"},"dropped_attributes_count":0,"observed_timestamp":"1970-01-01T00:00:00.000000000Z","resource":{"attributes":{"resource.attr.foo":"resource.attr.foo.value"},"dropped_attributes_count":0},"scope":{"dropped_attributes_count":0},"severity_number":0,"body":{"structured":{"true":true,"false":false,"inner":{"foo":"bar"}}}}`), }, { body: func() pcommon.Value { @@ -473,7 +473,7 @@ func TestExporterLogs(t *testing.T) { return vs }(), isEvent: true, - wantDocument: []byte(`{"@timestamp":"1970-01-01T00:00:00.000000000Z","attributes":{"attr.foo":"attr.foo.value","event.name":"foo"},"data_stream":{"dataset":"attr.dataset.otel","namespace":"resource.attribute.namespace","type":"logs"},"dropped_attributes_count":0,"observed_timestamp":"1970-01-01T00:00:00.000000000Z","resource":{"attributes":{"resource.attr.foo":"resource.attr.foo.value"},"dropped_attributes_count":0},"scope":{"dropped_attributes_count":0},"severity_number":0,"body":{"structured":{"value":["foo",false,{"foo":"bar"}]}}}`), + wantDocument: []byte(`{"@timestamp":"1970-01-01T00:00:00.000000000Z","attributes":{"attr.foo":"attr.foo.value","event.name":"foo"},"event_name":"foo","data_stream":{"dataset":"attr.dataset.otel","namespace":"resource.attribute.namespace","type":"logs"},"dropped_attributes_count":0,"observed_timestamp":"1970-01-01T00:00:00.000000000Z","resource":{"attributes":{"resource.attr.foo":"resource.attr.foo.value"},"dropped_attributes_count":0},"scope":{"dropped_attributes_count":0},"severity_number":0,"body":{"structured":{"value":["foo",false,{"foo":"bar"}]}}}`), }, } { rec := newBulkRecorder() @@ -1629,7 +1629,7 @@ func TestExporterTraces(t *testing.T) { }, { Action: []byte(`{"create":{"_index":"logs-generic.otel-default"}}`), - Document: []byte(`{"@timestamp":"1970-01-01T00:00:00.000000000Z","attributes":{"event.attr.foo":"event.attr.bar","event.name":"exception"},"data_stream":{"dataset":"generic.otel","namespace":"default","type":"logs"},"dropped_attributes_count":1,"resource":{"attributes":{"resource.foo":"resource.bar"},"dropped_attributes_count":0},"scope":{"dropped_attributes_count":0}}`), + Document: []byte(`{"@timestamp":"1970-01-01T00:00:00.000000000Z","attributes":{"event.attr.foo":"event.attr.bar","event.name":"exception"},"event_name":"exception","data_stream":{"dataset":"generic.otel","namespace":"default","type":"logs"},"dropped_attributes_count":1,"resource":{"attributes":{"resource.foo":"resource.bar"},"dropped_attributes_count":0},"scope":{"dropped_attributes_count":0}}`), }, } diff --git a/exporter/elasticsearchexporter/model.go b/exporter/elasticsearchexporter/model.go index a5d9fff13892..f1c0e615f8eb 100644 --- a/exporter/elasticsearchexporter/model.go +++ b/exporter/elasticsearchexporter/model.go @@ -178,21 +178,29 @@ func (m *encodeModel) encodeLogOTelMode(resource pcommon.Resource, resourceSchem document.AddInt("severity_number", int64(record.SeverityNumber())) document.AddInt("dropped_attributes_count", int64(record.DroppedAttributesCount())) + if record.EventName() != "" { + document.AddString("event_name", record.EventName()) + } else if eventNameAttr, ok := record.Attributes().Get("event.name"); ok && eventNameAttr.Str() != "" { + document.AddString("event_name", eventNameAttr.Str()) + } + m.encodeAttributesOTelMode(&document, record.Attributes()) m.encodeResourceOTelMode(&document, resource, resourceSchemaURL) m.encodeScopeOTelMode(&document, scope, scopeSchemaURL) // Body - setOTelLogBody(&document, record.Body(), record.Attributes()) + setOTelLogBody(&document, record) return document } -func setOTelLogBody(doc *objmodel.Document, body pcommon.Value, attributes pcommon.Map) { +func setOTelLogBody(doc *objmodel.Document, record plog.LogRecord) { // Determine if this log record is an event, as they are mapped differently // https://github.com/open-telemetry/semantic-conventions/blob/main/docs/general/events.md - _, isEvent := attributes.Get("event.name") + _, isEvent := record.Attributes().Get("event.name") + isEvent = isEvent || record.EventName() != "" + body := record.Body() switch body.Type() { case pcommon.ValueTypeMap: if isEvent { @@ -734,6 +742,8 @@ func (m *encodeModel) encodeSpanEvent(resource pcommon.Resource, resourceSchemaU } var document objmodel.Document document.AddTimestamp("@timestamp", spanEvent.Timestamp()) + document.AddString("event_name", spanEvent.Name()) + // todo remove before GA, make sure Kibana uses event_name document.AddString("attributes.event.name", spanEvent.Name()) document.AddSpanID("span_id", span.SpanID()) document.AddTraceID("trace_id", span.TraceID()) diff --git a/exporter/elasticsearchexporter/model_test.go b/exporter/elasticsearchexporter/model_test.go index eda750a540e7..dddf46a14a01 100644 --- a/exporter/elasticsearchexporter/model_test.go +++ b/exporter/elasticsearchexporter/model_test.go @@ -908,6 +908,7 @@ type OTelRecord struct { ObservedTimestamp time.Time `json:"observed_timestamp"` SeverityNumber int32 `json:"severity_number"` SeverityText string `json:"severity_text"` + EventName string `json:"event_name"` Attributes map[string]any `json:"attributes"` DroppedAttributesCount uint32 `json:"dropped_attributes_count"` Scope OTelScope `json:"scope"` @@ -1076,6 +1077,30 @@ func TestEncodeLogOtelMode(t *testing.T) { return assignDatastreamData(or, "", ds, ns) }, }, + { + name: "event_name from attributes.event.name", + rec: buildOTelRecordTestData(t, func(or OTelRecord) OTelRecord { + or.Attributes["event.name"] = "foo" + or.EventName = "" + return or + }), + wantFn: func(or OTelRecord) OTelRecord { + or.EventName = "foo" + return assignDatastreamData(or) + }, + }, + { + name: "event_name takes precedent over attributes.event.name", + rec: buildOTelRecordTestData(t, func(or OTelRecord) OTelRecord { + or.Attributes["event.name"] = "foo" + or.EventName = "bar" + return or + }), + wantFn: func(or OTelRecord) OTelRecord { + or.EventName = "bar" + return assignDatastreamData(or) + }, + }, } m := encodeModel{ @@ -1117,6 +1142,7 @@ func createTestOTelLogRecord(t *testing.T, rec OTelRecord) (plog.LogRecord, pcom record.SetSeverityNumber(plog.SeverityNumber(rec.SeverityNumber)) record.SetSeverityText(rec.SeverityText) record.SetDroppedAttributesCount(rec.DroppedAttributesCount) + record.SetEventName(rec.EventName) err := record.Attributes().FromRaw(rec.Attributes) require.NoError(t, err) @@ -1143,6 +1169,7 @@ func buildOTelRecordTestData(t *testing.T, fn func(OTelRecord) OTelRecord) OTelR "event.name": "user-password-change", "foo.some": "bar" }, + "event_name": "user-password-change", "dropped_attributes_count": 1, "observed_timestamp": "2024-03-12T20:00:41.123456789Z", "resource": { diff --git a/exporter/googlecloudpubsubexporter/go.mod b/exporter/googlecloudpubsubexporter/go.mod index 0b0f8ab4b856..f133c86ddc5b 100644 --- a/exporter/googlecloudpubsubexporter/go.mod +++ b/exporter/googlecloudpubsubexporter/go.mod @@ -17,7 +17,7 @@ require ( go.opentelemetry.io/collector/pdata v1.23.0 go.uber.org/goleak v1.3.0 go.uber.org/zap v1.27.0 - google.golang.org/api v0.214.0 + google.golang.org/api v0.215.0 google.golang.org/grpc v1.69.2 ) @@ -81,7 +81,7 @@ require ( golang.org/x/time v0.8.0 // indirect google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20241223144023-3abc09e42ca8 // indirect google.golang.org/protobuf v1.36.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/exporter/googlecloudpubsubexporter/go.sum b/exporter/googlecloudpubsubexporter/go.sum index b9e328ef5852..705a38c3d1f7 100644 --- a/exporter/googlecloudpubsubexporter/go.sum +++ b/exporter/googlecloudpubsubexporter/go.sum @@ -236,8 +236,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.214.0 h1:h2Gkq07OYi6kusGOaT/9rnNljuXmqPnaig7WGPmKbwA= -google.golang.org/api v0.214.0/go.mod h1:bYPpLG8AyeMWwDU6NXoB00xC0DFkikVvd5MfwoxjLqE= +google.golang.org/api v0.215.0 h1:jdYF4qnyczlEz2ReWIsosNLDuzXyvFHJtI5gcr0J7t0= +google.golang.org/api v0.215.0/go.mod h1:fta3CVtuJYOEdugLNWm6WodzOS8KdFckABwN4I40hzY= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= @@ -247,8 +247,8 @@ google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 h1:ToEetK57OidYuqD google.golang.org/genproto v0.0.0-20241118233622-e639e219e697/go.mod h1:JJrvXBWRZaFMxBufik1a4RpFw4HhgVtBBWQeQgUj2cc= google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576 h1:CkkIfIt50+lT6NHAVoRYEyAvQGFM7xEwXUUywFvEb3Q= google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576/go.mod h1:1R3kvZ1dtP3+4p4d3G8uJ8rFk/fWlScl38vanWACI08= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576 h1:8ZmaLZE4XWrtU3MyClkYqqtl6Oegr3235h7jxsDyqCY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576/go.mod h1:5uTbfoYQed2U9p3KIj2/Zzm02PYhndfdmML0qC3q3FU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241223144023-3abc09e42ca8 h1:TqExAhdPaB60Ux47Cn0oLV07rGnxZzIsaRhQaqS666A= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241223144023-3abc09e42ca8/go.mod h1:lcTa1sDdWEIHMWlITnIczmw5w60CF9ffkb8Z+DVmmjA= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= diff --git a/exporter/kafkaexporter/go.mod b/exporter/kafkaexporter/go.mod index 4eb9ec207352..cb431d8e098e 100644 --- a/exporter/kafkaexporter/go.mod +++ b/exporter/kafkaexporter/go.mod @@ -3,7 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/exporter/kafkae go 1.22.7 require ( - github.com/IBM/sarama v1.44.0 + github.com/IBM/sarama v1.45.0 github.com/cenkalti/backoff/v4 v4.3.0 github.com/gogo/protobuf v1.3.2 github.com/jaegertracing/jaeger v1.64.0 @@ -103,9 +103,9 @@ require ( go.opentelemetry.io/otel/sdk v1.32.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.32.0 // indirect go.opentelemetry.io/otel/trace v1.32.0 // indirect - golang.org/x/crypto v0.31.0 // indirect - golang.org/x/net v0.33.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/crypto v0.32.0 // indirect + golang.org/x/net v0.34.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.69.2 // indirect diff --git a/exporter/kafkaexporter/go.sum b/exporter/kafkaexporter/go.sum index 999929f5dcd8..324056b9b3cb 100644 --- a/exporter/kafkaexporter/go.sum +++ b/exporter/kafkaexporter/go.sum @@ -1,5 +1,5 @@ -github.com/IBM/sarama v1.44.0 h1:puNKqcScjSAgVLramjsuovZrS0nJZFVsrvuUymkWqhE= -github.com/IBM/sarama v1.44.0/go.mod h1:MxQ9SvGfvKIorbk077Ff6DUnBlGpidiQOtU2vuBaxVw= +github.com/IBM/sarama v1.45.0 h1:IzeBevTn809IJ/dhNKhP5mpxEXTmELuezO2tgHD9G5E= +github.com/IBM/sarama v1.45.0/go.mod h1:EEay63m8EZkeumco9TDXf2JT3uDnZsZqFgV46n4yZdY= github.com/apache/thrift v0.21.0 h1:tdPmh/ptjE1IJnhbhrcl2++TauVjy242rkV/UzJChnE= github.com/apache/thrift v0.21.0/go.mod h1:W1H8aR/QRtYNvrPeFXBtobyRkd0/YVhTc6i07XIAgDw= github.com/aws/aws-msk-iam-sasl-signer-go v1.0.0 h1:UyjtGmO0Uwl/K+zpzPwLoXzMhcN9xmnR2nrqJoBrg3c= @@ -226,8 +226,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= -golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= +golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= +golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= @@ -240,8 +240,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= -golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= 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= @@ -256,8 +256,8 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= diff --git a/exporter/loadbalancingexporter/go.mod b/exporter/loadbalancingexporter/go.mod index d842175dcb1a..2f71655d87ce 100644 --- a/exporter/loadbalancingexporter/go.mod +++ b/exporter/loadbalancingexporter/go.mod @@ -37,7 +37,7 @@ require ( k8s.io/apimachinery v0.31.3 k8s.io/client-go v0.31.3 k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 - sigs.k8s.io/controller-runtime v0.19.3 + sigs.k8s.io/controller-runtime v0.19.4 ) require ( diff --git a/exporter/loadbalancingexporter/go.sum b/exporter/loadbalancingexporter/go.sum index da09f0f7f217..5688bc4b2b76 100644 --- a/exporter/loadbalancingexporter/go.sum +++ b/exporter/loadbalancingexporter/go.sum @@ -436,8 +436,8 @@ k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7F k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A= k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -sigs.k8s.io/controller-runtime v0.19.3 h1:XO2GvC9OPftRst6xWCpTgBZO04S2cbp0Qqkj8bX1sPw= -sigs.k8s.io/controller-runtime v0.19.3/go.mod h1:j4j87DqtsThvwTv5/Tc5NFRyyF/RF0ip4+62tbTSIUM= +sigs.k8s.io/controller-runtime v0.19.4 h1:SUmheabttt0nx8uJtoII4oIP27BVVvAKFvdvGFwV/Qo= +sigs.k8s.io/controller-runtime v0.19.4/go.mod h1:iRmWllt8IlaLjvTTDLhRBXIEtkCK6hwVBJJsYS9Ajf4= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= diff --git a/exporter/otelarrowexporter/go.mod b/exporter/otelarrowexporter/go.mod index 13511e5468b6..67f6e53f4af1 100644 --- a/exporter/otelarrowexporter/go.mod +++ b/exporter/otelarrowexporter/go.mod @@ -31,7 +31,7 @@ require ( go.uber.org/mock v0.5.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.27.0 - golang.org/x/net v0.33.0 + golang.org/x/net v0.34.0 google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 google.golang.org/grpc v1.69.2 google.golang.org/protobuf v1.36.2 @@ -89,7 +89,7 @@ require ( golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect golang.org/x/mod v0.18.0 // indirect golang.org/x/sync v0.10.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect golang.org/x/tools v0.22.0 // indirect golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect diff --git a/exporter/otelarrowexporter/go.sum b/exporter/otelarrowexporter/go.sum index 38fd54b59ab8..202138e4d594 100644 --- a/exporter/otelarrowexporter/go.sum +++ b/exporter/otelarrowexporter/go.sum @@ -213,8 +213,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.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= -golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= 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= @@ -225,8 +225,8 @@ golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7w 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.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.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.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= diff --git a/exporter/prometheusremotewriteexporter/exporter_concurrency_test.go b/exporter/prometheusremotewriteexporter/exporter_concurrency_test.go index 689cbcf7b9fc..bf9fcbd968cc 100644 --- a/exporter/prometheusremotewriteexporter/exporter_concurrency_test.go +++ b/exporter/prometheusremotewriteexporter/exporter_concurrency_test.go @@ -8,6 +8,7 @@ import ( "io" "net/http" "net/http/httptest" + "os" "strconv" "sync" "testing" @@ -31,6 +32,9 @@ import ( // Test everything works when there is more than one goroutine calling PushMetrics. // Today we only use 1 worker per exporter, but the intention of this test is to future-proof in case it changes. func Test_PushMetricsConcurrent(t *testing.T) { + if os.Getenv("ImageOs") == "win25" && os.Getenv("GITHUB_ACTIONS") == "true" { + t.Skip("Skipping test on Windows 2025 GH runners, see https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/37104") + } n := 1000 ms := make([]pmetric.Metrics, n) testIDKey := "test_id" @@ -52,6 +56,10 @@ func Test_PushMetricsConcurrent(t *testing.T) { t.Fatal(err) } assert.NotNil(t, body) + if len(body) == 0 { + // No content, nothing to do. The request is just checking that the server is up. + return + } // Receives the http requests and unzip, unmarshalls, and extracts TimeSeries assert.Equal(t, "0.1.0", r.Header.Get("X-Prometheus-Remote-Write-Version")) assert.Equal(t, "snappy", r.Header.Get("Content-Encoding")) @@ -124,6 +132,13 @@ func Test_PushMetricsConcurrent(t *testing.T) { require.NoError(t, prwe.Shutdown(ctx)) }() + // Ensure that the test server is up before making the requests + assert.EventuallyWithT(t, func(c *assert.CollectT) { + resp, checkRequestErr := http.Get(server.URL) + require.NoError(c, checkRequestErr) + assert.NoError(c, resp.Body.Close()) + }, 5*time.Second, 100*time.Millisecond) + var wg sync.WaitGroup wg.Add(n) for _, m := range ms { diff --git a/exporter/tencentcloudlogserviceexporter/go.mod b/exporter/tencentcloudlogserviceexporter/go.mod index 467b42768bee..1b77f145f6d8 100644 --- a/exporter/tencentcloudlogserviceexporter/go.mod +++ b/exporter/tencentcloudlogserviceexporter/go.mod @@ -6,7 +6,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.117.0 github.com/pierrec/lz4 v2.6.1+incompatible github.com/stretchr/testify v1.10.0 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1069 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1077 go.opentelemetry.io/collector/component v0.117.0 go.opentelemetry.io/collector/component/componenttest v0.117.0 go.opentelemetry.io/collector/config/configopaque v1.23.0 diff --git a/exporter/tencentcloudlogserviceexporter/go.sum b/exporter/tencentcloudlogserviceexporter/go.sum index c868870d0d5f..82dbca81e7f5 100644 --- a/exporter/tencentcloudlogserviceexporter/go.sum +++ b/exporter/tencentcloudlogserviceexporter/go.sum @@ -60,8 +60,8 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1069 h1:0AqLcoQu8ltxTq5jU1kyTqUMl2ORissyiZlK0BX7168= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1069/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1077 h1:ma62uyPX1M549mfkehpXq/XVNIpuJvFbtZth9/v22/w= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1077/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= 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/collector/component v0.117.0 h1:A3Im4PqLyfduAdVyUgbOZdUs7J/USegdpnkoIAOuN3Y= diff --git a/extension/cgroupruntimeextension/go.mod b/extension/cgroupruntimeextension/go.mod index 5a853b18e436..52a28502f7d5 100644 --- a/extension/cgroupruntimeextension/go.mod +++ b/extension/cgroupruntimeextension/go.mod @@ -15,7 +15,7 @@ require ( go.uber.org/automaxprocs v1.6.0 go.uber.org/goleak v1.3.0 go.uber.org/zap v1.27.0 - golang.org/x/sys v0.28.0 + golang.org/x/sys v0.29.0 ) require ( diff --git a/extension/cgroupruntimeextension/go.sum b/extension/cgroupruntimeextension/go.sum index b889e27a984e..0469c8ea2373 100644 --- a/extension/cgroupruntimeextension/go.sum +++ b/extension/cgroupruntimeextension/go.sum @@ -129,8 +129,8 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h 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.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.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.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= diff --git a/extension/oauth2clientauthextension/go.mod b/extension/oauth2clientauthextension/go.mod index 490ce3018b4f..782e98ca632c 100644 --- a/extension/oauth2clientauthextension/go.mod +++ b/extension/oauth2clientauthextension/go.mod @@ -15,7 +15,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/oauth2 v0.24.0 + golang.org/x/oauth2 v0.25.0 google.golang.org/grpc v1.69.2 ) diff --git a/extension/oauth2clientauthextension/go.sum b/extension/oauth2clientauthextension/go.sum index b178aed42f27..2d43b37a15c1 100644 --- a/extension/oauth2clientauthextension/go.sum +++ b/extension/oauth2clientauthextension/go.sum @@ -90,8 +90,8 @@ golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= -golang.org/x/oauth2 v0.24.0 h1:KTBBxWqUa0ykRPLtV69rRto9TLXcqYkeswu48x/gvNE= -golang.org/x/oauth2 v0.24.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.25.0 h1:CY4y7XT9v0cRI9oupztF8AgiIu99L/ksR/Xp/6jrZ70= +golang.org/x/oauth2 v0.25.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= 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= diff --git a/extension/oidcauthextension/go.mod b/extension/oidcauthextension/go.mod index c042617e84a5..a55296f4322d 100644 --- a/extension/oidcauthextension/go.mod +++ b/extension/oidcauthextension/go.mod @@ -3,7 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/extension/oidca go 1.22.0 require ( - github.com/coreos/go-oidc/v3 v3.11.0 + github.com/coreos/go-oidc/v3 v3.12.0 github.com/stretchr/testify v1.10.0 go.opentelemetry.io/collector/client v1.23.0 go.opentelemetry.io/collector/component v0.117.0 diff --git a/extension/oidcauthextension/go.sum b/extension/oidcauthextension/go.sum index aedcbb4a10ba..d3db1202e317 100644 --- a/extension/oidcauthextension/go.sum +++ b/extension/oidcauthextension/go.sum @@ -1,5 +1,5 @@ -github.com/coreos/go-oidc/v3 v3.11.0 h1:Ia3MxdwpSw702YW0xgfmP1GVCMA9aEFWu12XUZ3/OtI= -github.com/coreos/go-oidc/v3 v3.11.0/go.mod h1:gE3LgjOgFoHi9a4ce4/tJczr0Ai2/BoDhf0r5lltWI0= +github.com/coreos/go-oidc/v3 v3.12.0 h1:sJk+8G2qq94rDI6ehZ71Bol3oUHy63qNYmkiSjrc/Jo= +github.com/coreos/go-oidc/v3 v3.12.0/go.mod h1:gE3LgjOgFoHi9a4ce4/tJczr0Ai2/BoDhf0r5lltWI0= 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-jose/go-jose/v4 v4.0.2 h1:R3l3kkBds16bO7ZFAEEcofK0MkrAJt3jlJznWZG0nvk= diff --git a/extension/opampcustommessages/go.mod b/extension/opampcustommessages/go.mod index ae570bbaf804..061532dd4151 100644 --- a/extension/opampcustommessages/go.mod +++ b/extension/opampcustommessages/go.mod @@ -2,6 +2,6 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/extension/opamp go 1.22.0 -require github.com/open-telemetry/opamp-go v0.17.0 +require github.com/open-telemetry/opamp-go v0.18.0 -require google.golang.org/protobuf v1.34.2 // indirect +require google.golang.org/protobuf v1.36.2 // indirect diff --git a/extension/opampcustommessages/go.sum b/extension/opampcustommessages/go.sum index 856df9d69ae9..f4989ff2145b 100644 --- a/extension/opampcustommessages/go.sum +++ b/extension/opampcustommessages/go.sum @@ -1,8 +1,6 @@ -github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/open-telemetry/opamp-go v0.17.0 h1:3R4+B/6Sy8mknLBbzO3gqloqwTT02rCSRcr4ac2B124= -github.com/open-telemetry/opamp-go v0.17.0/go.mod h1:SGDhUoAx7uGutO4ENNMQla/tiSujxgZmMPJXIOPGBdk= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= -google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= +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/open-telemetry/opamp-go v0.18.0 h1:sNHsrBvGU2CMxCB1TRJXncDARrmxDEebx8dsEIawqA4= +github.com/open-telemetry/opamp-go v0.18.0/go.mod h1:9/1G6T5dnJz4cJtoYSr6AX18kHdOxnxxETJPZSHyEUg= +google.golang.org/protobuf v1.36.2 h1:R8FeyR1/eLmkutZOM5CWghmo5itiG9z0ktFlTVLuTmU= +google.golang.org/protobuf v1.36.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= diff --git a/extension/opampextension/go.mod b/extension/opampextension/go.mod index 60dfa59f529c..4e3dc9bcba93 100644 --- a/extension/opampextension/go.mod +++ b/extension/opampextension/go.mod @@ -5,7 +5,7 @@ go 1.22.0 require ( github.com/google/uuid v1.6.0 github.com/oklog/ulid/v2 v2.1.0 - github.com/open-telemetry/opamp-go v0.17.0 + github.com/open-telemetry/opamp-go v0.18.0 github.com/open-telemetry/opentelemetry-collector-contrib/extension/opampcustommessages v0.117.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/status v0.117.0 github.com/shirou/gopsutil/v4 v4.24.12 diff --git a/extension/opampextension/go.sum b/extension/opampextension/go.sum index c5f0f975dfb9..ef065ce48345 100644 --- a/extension/opampextension/go.sum +++ b/extension/opampextension/go.sum @@ -46,8 +46,8 @@ github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zx github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/oklog/ulid/v2 v2.1.0 h1:+9lhoxAP56we25tyYETBBY1YLA2SaoLvUFgrP2miPJU= github.com/oklog/ulid/v2 v2.1.0/go.mod h1:rcEKHmBBKfef9DhnvX7y1HZBYxjXb0cP5ExxNsTT1QQ= -github.com/open-telemetry/opamp-go v0.17.0 h1:3R4+B/6Sy8mknLBbzO3gqloqwTT02rCSRcr4ac2B124= -github.com/open-telemetry/opamp-go v0.17.0/go.mod h1:SGDhUoAx7uGutO4ENNMQla/tiSujxgZmMPJXIOPGBdk= +github.com/open-telemetry/opamp-go v0.18.0 h1:sNHsrBvGU2CMxCB1TRJXncDARrmxDEebx8dsEIawqA4= +github.com/open-telemetry/opamp-go v0.18.0/go.mod h1:9/1G6T5dnJz4cJtoYSr6AX18kHdOxnxxETJPZSHyEUg= github.com/pborman/getopt v0.0.0-20170112200414-7148bc3a4c30/go.mod h1:85jBQOZwpVEaDAr341tbn15RS4fCAsIst0qp7i8ex1o= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -57,6 +57,8 @@ github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDN github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/shirou/gopsutil/v4 v4.24.12 h1:qvePBOk20e0IKA1QXrIIU+jmk+zEiYVVx06WjBRlZo4= github.com/shirou/gopsutil/v4 v4.24.12/go.mod h1:DCtMPAad2XceTeIAbGyVfycbYQNBGk2P8cvDi7/VN9o= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/tklauser/go-sysconf v0.3.14 h1:g5vzr9iPFFz24v2KZXs/pvpvh8/V9Fw6vQK5ZZb78yU= diff --git a/extension/opampextension/opamp_agent.go b/extension/opampextension/opamp_agent.go index 3e26d407fd80..cca5f762ebe3 100644 --- a/extension/opampextension/opamp_agent.go +++ b/extension/opampextension/opamp_agent.go @@ -118,20 +118,20 @@ func (o *opampAgent) Start(ctx context.Context, host component.Host) error { TLSConfig: tls, OpAMPServerURL: o.cfg.Server.GetEndpoint(), InstanceUid: types.InstanceUid(o.instanceID), - Callbacks: types.CallbacksStruct{ - OnConnectFunc: func(_ context.Context) { + Callbacks: types.Callbacks{ + OnConnect: func(_ context.Context) { o.logger.Debug("Connected to the OpAMP server") }, - OnConnectFailedFunc: func(_ context.Context, err error) { + OnConnectFailed: func(_ context.Context, err error) { o.logger.Error("Failed to connect to the OpAMP server", zap.Error(err)) }, - OnErrorFunc: func(_ context.Context, err *protobufs.ServerErrorResponse) { + OnError: func(_ context.Context, err *protobufs.ServerErrorResponse) { o.logger.Error("OpAMP server returned an error response", zap.String("message", err.ErrorMessage)) }, - GetEffectiveConfigFunc: func(_ context.Context) (*protobufs.EffectiveConfig, error) { + GetEffectiveConfig: func(_ context.Context) (*protobufs.EffectiveConfig, error) { return o.composeEffectiveConfig(), nil }, - OnMessageFunc: o.onMessage, + OnMessage: o.onMessage, }, Capabilities: o.capabilities.toAgentCapabilities(), } diff --git a/extension/storage/redisstorageextension/README.md b/extension/storage/redisstorageextension/README.md index b4b300dd2f9a..df2fca5043c1 100644 --- a/extension/storage/redisstorageextension/README.md +++ b/extension/storage/redisstorageextension/README.md @@ -1,4 +1,4 @@ -# File Storage +# Redis Storage | Status | | diff --git a/internal/aws/awsutil/go.mod b/internal/aws/awsutil/go.mod index cc94f925dc11..d2977446062a 100644 --- a/internal/aws/awsutil/go.mod +++ b/internal/aws/awsutil/go.mod @@ -7,7 +7,7 @@ require ( github.com/stretchr/testify v1.10.0 go.uber.org/goleak v1.3.0 go.uber.org/zap v1.27.0 - golang.org/x/net v0.33.0 + golang.org/x/net v0.34.0 ) require ( diff --git a/internal/aws/awsutil/go.sum b/internal/aws/awsutil/go.sum index 414af39b0282..86c0d66632fe 100644 --- a/internal/aws/awsutil/go.sum +++ b/internal/aws/awsutil/go.sum @@ -26,8 +26,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/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= -golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/internal/aws/xray/go.mod b/internal/aws/xray/go.mod index 176cd98a61aa..43099a78f5a4 100644 --- a/internal/aws/xray/go.mod +++ b/internal/aws/xray/go.mod @@ -23,8 +23,8 @@ require ( go.opentelemetry.io/otel/metric v1.32.0 // indirect go.opentelemetry.io/otel/trace v1.32.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/net v0.33.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/net v0.34.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 // indirect google.golang.org/grpc v1.69.2 // indirect diff --git a/internal/aws/xray/go.sum b/internal/aws/xray/go.sum index 63956e4c2d92..e41e31fc3e98 100644 --- a/internal/aws/xray/go.sum +++ b/internal/aws/xray/go.sum @@ -67,16 +67,16 @@ 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.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= -golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= 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.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.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.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= diff --git a/internal/filter/go.mod b/internal/filter/go.mod index e900132b3dbb..8dd3024b77aa 100644 --- a/internal/filter/go.mod +++ b/internal/filter/go.mod @@ -58,8 +58,8 @@ require ( go.opentelemetry.io/otel/trace v1.32.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect - golang.org/x/net v0.33.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/net v0.34.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.69.2 // indirect diff --git a/internal/filter/go.sum b/internal/filter/go.sum index fe55dff2bf1c..9441dede3fca 100644 --- a/internal/filter/go.sum +++ b/internal/filter/go.sum @@ -149,8 +149,9 @@ golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= -golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= 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,8 +173,9 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= diff --git a/internal/kafka/go.mod b/internal/kafka/go.mod index 2338a0c5ed10..f3308103b7d6 100644 --- a/internal/kafka/go.mod +++ b/internal/kafka/go.mod @@ -3,7 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/internal/kafka go 1.22.0 require ( - github.com/IBM/sarama v1.44.0 + github.com/IBM/sarama v1.45.0 github.com/aws/aws-msk-iam-sasl-signer-go v1.0.0 github.com/aws/aws-sdk-go v1.55.5 github.com/stretchr/testify v1.10.0 @@ -41,16 +41,16 @@ require ( github.com/jcmturner/gokrb5/v8 v8.4.4 // indirect github.com/jcmturner/rpc/v2 v2.0.3 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect - github.com/klauspost/compress v1.17.9 // indirect + github.com/klauspost/compress v1.17.11 // indirect github.com/pierrec/lz4/v4 v4.1.22 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/xdg-go/pbkdf2 v1.0.0 // indirect github.com/xdg-go/stringprep v1.0.4 // indirect go.opentelemetry.io/collector/config/configopaque v1.23.0 // indirect - golang.org/x/crypto v0.31.0 // indirect - golang.org/x/net v0.33.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/crypto v0.32.0 // indirect + golang.org/x/net v0.34.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/internal/kafka/go.sum b/internal/kafka/go.sum index 76054accdcc0..6d6c6922c03c 100644 --- a/internal/kafka/go.sum +++ b/internal/kafka/go.sum @@ -1,5 +1,5 @@ -github.com/IBM/sarama v1.44.0 h1:puNKqcScjSAgVLramjsuovZrS0nJZFVsrvuUymkWqhE= -github.com/IBM/sarama v1.44.0/go.mod h1:MxQ9SvGfvKIorbk077Ff6DUnBlGpidiQOtU2vuBaxVw= +github.com/IBM/sarama v1.45.0 h1:IzeBevTn809IJ/dhNKhP5mpxEXTmELuezO2tgHD9G5E= +github.com/IBM/sarama v1.45.0/go.mod h1:EEay63m8EZkeumco9TDXf2JT3uDnZsZqFgV46n4yZdY= github.com/aws/aws-msk-iam-sasl-signer-go v1.0.0 h1:UyjtGmO0Uwl/K+zpzPwLoXzMhcN9xmnR2nrqJoBrg3c= github.com/aws/aws-msk-iam-sasl-signer-go v1.0.0/go.mod h1:TJAXuFs2HcMib3sN5L0gUC+Q01Qvy3DemvA55WuC+iA= github.com/aws/aws-sdk-go v1.55.5 h1:KKUZBfBoyqy5d3swXyiC7Q76ic40rYcbqH7qjh59kzU= @@ -72,8 +72,8 @@ github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9Y github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= -github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= -github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= +github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= +github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -114,8 +114,8 @@ go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN8 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= -golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= +golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= +golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -123,8 +123,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= -golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= @@ -135,8 +135,8 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= diff --git a/internal/metadataproviders/aws/ec2/metadata.go b/internal/metadataproviders/aws/ec2/metadata.go index 6df3f8a0e7eb..e81124b5323b 100644 --- a/internal/metadataproviders/aws/ec2/metadata.go +++ b/internal/metadataproviders/aws/ec2/metadata.go @@ -5,37 +5,59 @@ package ec2 // import "github.com/open-telemetry/opentelemetry-collector-contrib import ( "context" + "fmt" + "io" - "github.com/aws/aws-sdk-go/aws/ec2metadata" - "github.com/aws/aws-sdk-go/aws/session" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/feature/ec2/imds" ) type Provider interface { - Get(ctx context.Context) (ec2metadata.EC2InstanceIdentityDocument, error) + Get(ctx context.Context) (imds.InstanceIdentityDocument, error) Hostname(ctx context.Context) (string, error) InstanceID(ctx context.Context) (string, error) } type metadataClient struct { - metadata *ec2metadata.EC2Metadata + client *imds.Client } var _ Provider = (*metadataClient)(nil) -func NewProvider(sess *session.Session) Provider { +func NewProvider(cfg aws.Config) Provider { return &metadataClient{ - metadata: ec2metadata.New(sess), + client: imds.NewFromConfig(cfg), } } +func (c *metadataClient) getMetadata(ctx context.Context, path string) (string, error) { + output, err := c.client.GetMetadata(ctx, &imds.GetMetadataInput{Path: path}) + if err != nil { + return "", fmt.Errorf("failed to get %s from IMDS: %w", path, err) + } + defer output.Content.Close() + + data, err := io.ReadAll(output.Content) + if err != nil { + return "", fmt.Errorf("failed to read %s response: %w", path, err) + } + + return string(data), nil +} + func (c *metadataClient) InstanceID(ctx context.Context) (string, error) { - return c.metadata.GetMetadataWithContext(ctx, "instance-id") + return c.getMetadata(ctx, "instance-id") } func (c *metadataClient) Hostname(ctx context.Context) (string, error) { - return c.metadata.GetMetadataWithContext(ctx, "hostname") + return c.getMetadata(ctx, "hostname") } -func (c *metadataClient) Get(ctx context.Context) (ec2metadata.EC2InstanceIdentityDocument, error) { - return c.metadata.GetInstanceIdentityDocumentWithContext(ctx) +func (c *metadataClient) Get(ctx context.Context) (imds.InstanceIdentityDocument, error) { + output, err := c.client.GetInstanceIdentityDocument(ctx, &imds.GetInstanceIdentityDocumentInput{}) + if err != nil { + return imds.InstanceIdentityDocument{}, fmt.Errorf("failed to get instance identity document: %w", err) + } + + return output.InstanceIdentityDocument, nil } diff --git a/internal/metadataproviders/aws/ec2/metadata_test.go b/internal/metadataproviders/aws/ec2/metadata_test.go index 1cdb0f53c497..af2c80104c52 100644 --- a/internal/metadataproviders/aws/ec2/metadata_test.go +++ b/internal/metadataproviders/aws/ec2/metadata_test.go @@ -4,64 +4,198 @@ package ec2 import ( + "bytes" "context" + "fmt" + "io" + "reflect" "testing" + "time" - "github.com/aws/aws-sdk-go/aws/session" - "github.com/aws/aws-sdk-go/awstesting/mock" - "github.com/stretchr/testify/assert" + "github.com/aws/aws-sdk-go-v2/feature/ec2/imds" ) -func TestMetadataProviderGetError(t *testing.T) { - type args struct { - ctx context.Context - sess *session.Session +type ImdsGetMetadataAPI interface { + GetMetadata(ctx context.Context, params *imds.GetMetadataInput, optFns ...func(*imds.Options)) (*imds.GetMetadataOutput, error) +} + +type ImdsInstanceIdentityDocumentAPI interface { + GetInstanceIdentityDocument(ctx context.Context, params *imds.GetInstanceIdentityDocumentInput, optFns ...func(*imds.Options)) (*imds.GetInstanceIdentityDocumentOutput, error) +} + +func GetMetadataFromImds(ctx context.Context, api ImdsGetMetadataAPI, path string) ([]byte, error) { + output, err := api.GetMetadata(ctx, &imds.GetMetadataInput{ + Path: path, + }) + if err != nil { + return nil, err + } + defer output.Content.Close() + + return io.ReadAll(output.Content) +} + +func GetInstanceIdentityDocumentFromImds(ctx context.Context, api ImdsInstanceIdentityDocumentAPI) (imds.InstanceIdentityDocument, error) { + output, err := api.GetInstanceIdentityDocument(ctx, &imds.GetInstanceIdentityDocumentInput{}) + if err != nil { + return imds.InstanceIdentityDocument{}, err } - tests := []struct { - name string - args args + + return output.InstanceIdentityDocument, nil +} + +type mockGetMetadataAPI func(ctx context.Context, params *imds.GetMetadataInput, optFns ...func(*imds.Options)) (*imds.GetMetadataOutput, error) + +func (m mockGetMetadataAPI) GetMetadata(ctx context.Context, params *imds.GetMetadataInput, optFns ...func(*imds.Options)) (*imds.GetMetadataOutput, error) { + return m(ctx, params, optFns...) +} + +type mockInstanceIdentityDocumentAPI func(ctx context.Context, params *imds.GetInstanceIdentityDocumentInput, optFns ...func(*imds.Options)) (*imds.GetInstanceIdentityDocumentOutput, error) + +func (m mockInstanceIdentityDocumentAPI) GetInstanceIdentityDocument(ctx context.Context, params *imds.GetInstanceIdentityDocumentInput, optFns ...func(*imds.Options)) (*imds.GetInstanceIdentityDocumentOutput, error) { + return m(ctx, params, optFns...) +} + +func TestGetMetadataFromImds(t *testing.T) { + cases := []struct { + name string + client func(t *testing.T) ImdsGetMetadataAPI + path string + expect []byte + wantErr bool }{ { - name: "mock session", - args: args{ - ctx: context.Background(), - sess: mock.Session, + name: "Successfully retrieves InstanceID metadata", + client: func(t *testing.T) ImdsGetMetadataAPI { + return mockGetMetadataAPI(func(_ context.Context, params *imds.GetMetadataInput, _ ...func(*imds.Options)) (*imds.GetMetadataOutput, error) { + t.Helper() + if e, a := "instance-id", params.Path; e != a { + t.Errorf("expected Path: %v, got: %v", e, a) + } + return &imds.GetMetadataOutput{ + Content: io.NopCloser(bytes.NewReader([]byte("this is the body foo bar baz"))), + }, nil + }) + }, + path: "instance-id", + expect: []byte("this is the body foo bar baz"), + wantErr: false, + }, + { + name: "Successfully retrieves Hostname metadata", + client: func(t *testing.T) ImdsGetMetadataAPI { + return mockGetMetadataAPI(func(_ context.Context, params *imds.GetMetadataInput, _ ...func(*imds.Options)) (*imds.GetMetadataOutput, error) { + t.Helper() + if e, a := "hostname", params.Path; e != a { + t.Errorf("expected Path: %v, got: %v", e, a) + } + return &imds.GetMetadataOutput{ + Content: io.NopCloser(bytes.NewReader([]byte("this is the body foo bar baz"))), + }, nil + }) + }, + path: "hostname", + expect: []byte("this is the body foo bar baz"), + wantErr: false, + }, + { + name: "Path is empty", + client: func(t *testing.T) ImdsGetMetadataAPI { + return mockGetMetadataAPI(func(_ context.Context, params *imds.GetMetadataInput, _ ...func(*imds.Options)) (*imds.GetMetadataOutput, error) { + t.Helper() + if params.Path == "" { + return nil, fmt.Errorf("Path cannot be empty") + } + return nil, nil + }) }, + path: "", + expect: nil, + wantErr: true, }, } - for _, tt := range tests { + + for _, tt := range cases { t.Run(tt.name, func(t *testing.T) { - c := NewProvider(tt.args.sess) - _, err := c.Get(tt.args.ctx) - assert.Error(t, err) + ctx := context.TODO() + content, err := GetMetadataFromImds(ctx, tt.client(t), tt.path) + if (err != nil) != tt.wantErr { + t.Fatalf("expected error: %v, got: %v", tt.wantErr, err) + } + if !tt.wantErr && !bytes.Equal(tt.expect, content) { + t.Errorf("expected content: %v, got: %v", string(tt.expect), string(content)) + } }) } } -func TestMetadataProvider_available(t *testing.T) { - type fields struct{} - type args struct { - ctx context.Context - sess *session.Session - } - tests := []struct { - name string - fields fields - args args - want error +func TestInstanceIdentityDocumentFromImds(t *testing.T) { + cases := []struct { + name string + client func(t *testing.T) ImdsInstanceIdentityDocumentAPI + expect imds.InstanceIdentityDocument + wantErr bool }{ { - name: "mock session", - fields: fields{}, - args: args{ctx: context.Background(), sess: mock.Session}, - want: nil, + name: "Successfully retrieves Instance Identity Document", + client: func(t *testing.T) ImdsInstanceIdentityDocumentAPI { + return mockInstanceIdentityDocumentAPI(func(_ context.Context, _ *imds.GetInstanceIdentityDocumentInput, _ ...func(*imds.Options)) (*imds.GetInstanceIdentityDocumentOutput, error) { + t.Helper() + return &imds.GetInstanceIdentityDocumentOutput{ + InstanceIdentityDocument: imds.InstanceIdentityDocument{ + DevpayProductCodes: []string{"code1", "code2"}, + MarketplaceProductCodes: []string{"market1"}, + AvailabilityZone: "us-west-2a", + PrivateIP: "192.168.1.1", + Version: "2017-09-30", + Region: "us-west-2", + InstanceID: "i-1234567890abcdef0", + BillingProducts: []string{"prod1"}, + InstanceType: "t2.micro", + AccountID: "123456789012", + PendingTime: time.Date(2023, time.January, 1, 0, 0, 0, 0, time.UTC), + ImageID: "ami-abcdef1234567890", + KernelID: "", + RamdiskID: "", + Architecture: "x86_64", + }, + }, nil + }) + }, + expect: imds.InstanceIdentityDocument{ + DevpayProductCodes: []string{"code1", "code2"}, + MarketplaceProductCodes: []string{"market1"}, + AvailabilityZone: "us-west-2a", + PrivateIP: "192.168.1.1", + Version: "2017-09-30", + Region: "us-west-2", + InstanceID: "i-1234567890abcdef0", + BillingProducts: []string{"prod1"}, + InstanceType: "t2.micro", + AccountID: "123456789012", + PendingTime: time.Date(2023, time.January, 1, 0, 0, 0, 0, time.UTC), + ImageID: "ami-abcdef1234567890", + KernelID: "", + RamdiskID: "", + Architecture: "x86_64", + }, + wantErr: false, }, } - for _, tt := range tests { + + for _, tt := range cases { t.Run(tt.name, func(t *testing.T) { - c := NewProvider(tt.args.sess) - _, err := c.InstanceID(tt.args.ctx) - assert.ErrorIs(t, err, tt.want) + ctx := context.TODO() + document, err := GetInstanceIdentityDocumentFromImds(ctx, tt.client(t)) + if (err != nil) != tt.wantErr { + t.Fatalf("expected error: %v, got: %v", tt.wantErr, err) + } + + if !tt.wantErr { + if !reflect.DeepEqual(document, tt.expect) { + t.Errorf("expected document: %+v, got: %+v", tt.expect, document) + } + } }) } } diff --git a/internal/metadataproviders/go.mod b/internal/metadataproviders/go.mod index dff68dd443e0..1702ef4c26ce 100644 --- a/internal/metadataproviders/go.mod +++ b/internal/metadataproviders/go.mod @@ -4,7 +4,8 @@ go 1.22.0 require ( github.com/Showmax/go-fqdn v1.0.0 - github.com/aws/aws-sdk-go v1.55.5 + github.com/aws/aws-sdk-go-v2 v1.32.7 + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.22 github.com/docker/docker v27.4.1+incompatible github.com/hashicorp/consul/api v1.31.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig v0.117.0 @@ -22,6 +23,7 @@ require ( require ( github.com/Microsoft/go-winio v0.5.2 // indirect github.com/armon/go-metrics v0.4.1 // indirect + github.com/aws/smithy-go v1.22.1 // indirect github.com/containerd/log v0.1.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/distribution/reference v0.5.0 // indirect @@ -53,7 +55,6 @@ require ( github.com/hashicorp/golang-lru v1.0.2 // indirect github.com/hashicorp/serf v0.10.1 // indirect github.com/imdario/mergo v0.3.11 // indirect - github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect diff --git a/internal/metadataproviders/go.sum b/internal/metadataproviders/go.sum index 8243ed99bf5f..2995c30f4176 100644 --- a/internal/metadataproviders/go.sum +++ b/internal/metadataproviders/go.sum @@ -51,8 +51,12 @@ github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+ github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/aws/aws-sdk-go v1.55.5 h1:KKUZBfBoyqy5d3swXyiC7Q76ic40rYcbqH7qjh59kzU= -github.com/aws/aws-sdk-go v1.55.5/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU= +github.com/aws/aws-sdk-go-v2 v1.32.7 h1:ky5o35oENWi0JYWUZkB7WYvVPP+bcRF5/Iq7JWSb5Rw= +github.com/aws/aws-sdk-go-v2 v1.32.7/go.mod h1:P5WJBrYqqbWVaOxgH0X/FYYD47/nooaPOZPlQdmiN2U= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.22 h1:kqOrpojG71DxJm/KDPO+Z/y1phm1JlC8/iT+5XRmAn8= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.22/go.mod h1:NtSFajXVVL8TA2QNngagVZmUtXciyrHOt7xgz4faS/M= +github.com/aws/smithy-go v1.22.1 h1:/HPHZQ0g7f4eUeK6HKglFz8uwVfZKgoI25rb/J+dnro= +github.com/aws/smithy-go v1.22.1/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= @@ -257,10 +261,6 @@ github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1: github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.11 h1:3tnifQM4i+fbajXKBHXWEH+KvNHqojZ778UH75j3bGA= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= -github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= -github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= -github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= diff --git a/internal/otelarrow/go.mod b/internal/otelarrow/go.mod index 45c9ca6a57ff..9d0616366e4e 100644 --- a/internal/otelarrow/go.mod +++ b/internal/otelarrow/go.mod @@ -85,9 +85,9 @@ require ( go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.56.0 // indirect golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect golang.org/x/mod v0.18.0 // indirect - golang.org/x/net v0.33.0 // indirect + golang.org/x/net v0.34.0 // indirect golang.org/x/sync v0.10.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect golang.org/x/tools v0.22.0 // indirect golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect diff --git a/internal/otelarrow/go.sum b/internal/otelarrow/go.sum index f9e0af81e08b..79352a84406b 100644 --- a/internal/otelarrow/go.sum +++ b/internal/otelarrow/go.sum @@ -215,8 +215,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.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= -golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= 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= @@ -227,8 +227,8 @@ golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7w 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.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.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.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= diff --git a/internal/sqlquery/go.mod b/internal/sqlquery/go.mod index f13a791033f1..f45dd8e1853b 100644 --- a/internal/sqlquery/go.mod +++ b/internal/sqlquery/go.mod @@ -3,7 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/internal/sqlque go 1.22.0 require ( - github.com/SAP/go-hdb v1.12.7 + github.com/SAP/go-hdb v1.12.9 github.com/go-sql-driver/mysql v1.8.1 github.com/lib/pq v1.10.9 github.com/microsoft/go-mssqldb v1.8.0 @@ -85,13 +85,13 @@ require ( go.opentelemetry.io/otel/sdk v1.32.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.32.0 // indirect go.opentelemetry.io/otel/trace v1.32.0 // indirect - golang.org/x/crypto v0.31.0 // indirect + golang.org/x/crypto v0.32.0 // indirect golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3 // indirect golang.org/x/mod v0.17.0 // indirect golang.org/x/net v0.33.0 // indirect golang.org/x/sync v0.10.0 // indirect - golang.org/x/sys v0.28.0 // indirect - golang.org/x/term v0.27.0 // indirect + golang.org/x/sys v0.29.0 // indirect + golang.org/x/term v0.28.0 // indirect golang.org/x/text v0.21.0 // indirect golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect diff --git a/internal/sqlquery/go.sum b/internal/sqlquery/go.sum index 42bcf53aea4a..7e4674fe7cb5 100644 --- a/internal/sqlquery/go.sum +++ b/internal/sqlquery/go.sum @@ -22,8 +22,8 @@ github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0 github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c h1:RGWPOewvKIROun94nF7v2cua9qP+thov/7M50KEoeSU= github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c/go.mod h1:X0CRv0ky0k6m906ixxpzmDRLvX58TFUKS2eePweuyxk= -github.com/SAP/go-hdb v1.12.7 h1:b6UAWiRxgGQwzcvQD1+tkmCl2Zda4Tjfjkry7FY+/mo= -github.com/SAP/go-hdb v1.12.7/go.mod h1:zb852z999jPL3nh7wOfJiXzAnFGeYMtVlruVg3eZdY8= +github.com/SAP/go-hdb v1.12.9 h1:49Sli0rtL0Gt26onpfFQvqC3TYEgtp1YtygpTVxW4Qo= +github.com/SAP/go-hdb v1.12.9/go.mod h1:0nsCnOB9TLKsoHT4ZthxHrVweXx7LCgll7SzLnfdXlc= github.com/apache/arrow/go/v15 v15.0.0 h1:1zZACWf85oEZY5/kd9dsQS7i+2G5zVQcbKTHgslqHNA= github.com/apache/arrow/go/v15 v15.0.0/go.mod h1:DGXsR3ajT524njufqf95822i+KTh+yea1jass9YXgjA= github.com/aws/aws-sdk-go-v2 v1.26.1 h1:5554eUqIYVWpU0YmeeYZ0wU64H2VLBs8TlhRB2L+EkA= @@ -241,8 +241,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= -golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= +golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= +golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3 h1:/RIbNt/Zr7rVhIkQhooTxCxFcdWLGIKnZA4IXNFSrvo= golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -278,13 +278,13 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= -golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= +golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg= +golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek= 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.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= diff --git a/internal/tools/go.mod b/internal/tools/go.mod index 2df59e6efd92..9bdc7b0dfe35 100644 --- a/internal/tools/go.mod +++ b/internal/tools/go.mod @@ -7,7 +7,7 @@ require ( github.com/Khan/genqlient v0.7.0 github.com/client9/misspell v0.3.4 github.com/daixiang0/gci v0.13.5 - github.com/golangci/golangci-lint v1.62.2 + github.com/golangci/golangci-lint v1.63.4 github.com/google/addlicense v1.1.1 github.com/jcchavezs/porto v0.6.0 github.com/jstemmer/go-junit-report v1.0.0 @@ -19,7 +19,7 @@ require ( go.opentelemetry.io/collector/cmd/builder v0.117.0 go.opentelemetry.io/collector/cmd/mdatagen v0.117.0 go.uber.org/goleak v1.3.0 - golang.org/x/tools v0.28.0 + golang.org/x/tools v0.29.0 golang.org/x/vuln v1.1.3 gotest.tools/gotestsum v1.12.0 mvdan.cc/gofumpt v0.7.0 @@ -29,10 +29,10 @@ require ( 4d63.com/gocheckcompilerdirectives v1.2.1 // indirect 4d63.com/gochecknoglobals v0.2.1 // indirect dario.cat/mergo v1.0.0 // indirect - github.com/4meepo/tagalign v1.3.4 // indirect + github.com/4meepo/tagalign v1.4.1 // indirect github.com/Abirdcfly/dupword v0.1.3 // indirect github.com/Antonboom/errname v1.0.0 // indirect - github.com/Antonboom/nilnil v1.0.0 // indirect + github.com/Antonboom/nilnil v1.0.1 // indirect github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c // indirect github.com/Crocmagnon/fatcontext v0.5.3 // indirect github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect @@ -42,32 +42,33 @@ require ( github.com/OpenPeeDeeP/depguard/v2 v2.2.0 // indirect github.com/ProtonMail/go-crypto v1.0.0 // indirect github.com/agnivade/levenshtein v1.1.1 // indirect - github.com/alecthomas/go-check-sumtype v0.2.0 // indirect + github.com/alecthomas/go-check-sumtype v0.3.1 // indirect github.com/alexflint/go-arg v1.5.0 // indirect github.com/alexflint/go-scalar v1.2.0 // indirect github.com/alexkohler/nakedret/v2 v2.0.5 // indirect github.com/alexkohler/prealloc v1.0.0 // indirect github.com/alingse/asasalint v0.0.11 // indirect + github.com/alingse/nilnesserr v0.1.1 // indirect github.com/ashanbrown/forbidigo v1.6.0 // indirect - github.com/ashanbrown/makezero v1.1.1 // indirect + github.com/ashanbrown/makezero v1.2.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bitfield/gotestdox v0.2.2 // indirect github.com/bkielbasa/cyclop v1.2.3 // indirect github.com/blizzy78/varnamelen v0.8.0 // indirect github.com/bmatcuk/doublestar/v4 v4.0.2 // indirect - github.com/bombsimon/wsl/v4 v4.4.1 // indirect + github.com/bombsimon/wsl/v4 v4.5.0 // indirect github.com/breml/bidichk v0.3.2 // indirect github.com/breml/errchkjson v0.4.0 // indirect - github.com/butuzov/ireturn v0.3.0 // indirect - github.com/butuzov/mirror v1.2.0 // indirect + github.com/butuzov/ireturn v0.3.1 // indirect + github.com/butuzov/mirror v1.3.0 // indirect github.com/catenacyber/perfsprint v0.7.1 // indirect github.com/ccojocar/zxcvbn-go v1.0.2 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/charithe/durationcheck v0.0.10 // indirect github.com/chavacava/garif v0.1.0 // indirect - github.com/ckaznocha/intrange v0.2.1 // indirect + github.com/ckaznocha/intrange v0.3.0 // indirect github.com/cloudflare/circl v1.3.7 // indirect - github.com/curioswitch/go-reassign v0.2.0 // indirect + github.com/curioswitch/go-reassign v0.3.0 // indirect github.com/cyphar/filepath-securejoin v0.2.4 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/denis-tingaikin/go-header v0.5.0 // indirect @@ -92,16 +93,15 @@ require ( github.com/go-toolsmith/strparse v1.1.0 // indirect github.com/go-toolsmith/typep v1.1.0 // indirect github.com/go-viper/mapstructure/v2 v2.2.1 // indirect - github.com/go-xmlfmt/xmlfmt v1.1.2 // indirect + github.com/go-xmlfmt/xmlfmt v1.1.3 // indirect github.com/gobwas/glob v0.2.3 // indirect github.com/gofrs/flock v0.12.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a // indirect github.com/golangci/go-printf-func-name v0.1.0 // indirect - github.com/golangci/gofmt v0.0.0-20240816233607-d8596aa466a9 // indirect + github.com/golangci/gofmt v0.0.0-20241223200906-057b0627d9b9 // indirect github.com/golangci/misspell v0.6.0 // indirect - github.com/golangci/modinfo v0.3.4 // indirect github.com/golangci/plugin-module-register v0.1.1 // indirect github.com/golangci/revgrep v0.5.3 // indirect github.com/golangci/unconvert v0.0.0-20240309020433-c5143eacb3ed // indirect @@ -114,17 +114,19 @@ require ( github.com/gostaticanalysis/comment v1.4.2 // indirect github.com/gostaticanalysis/forcetypeassert v0.1.0 // indirect github.com/gostaticanalysis/nilerr v0.1.1 // indirect + github.com/hashicorp/go-immutable-radix/v2 v2.1.0 // indirect github.com/hashicorp/go-version v1.7.0 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/hexops/gotextdiff v1.0.3 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect github.com/jgautheron/goconst v1.7.1 // indirect github.com/jingyugao/rowserrcheck v1.1.1 // indirect - github.com/jjti/go-spancheck v0.6.2 // indirect + github.com/jjti/go-spancheck v0.6.4 // indirect github.com/joshdk/go-junit v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/julz/importas v0.1.0 // indirect + github.com/julz/importas v0.2.0 // indirect github.com/karamaru-alpha/copyloopvar v1.1.0 // indirect github.com/kevinburke/ssh_config v1.2.0 // indirect github.com/kisielk/errcheck v1.8.0 // indirect @@ -140,8 +142,11 @@ require ( github.com/kunwardeep/paralleltest v1.0.10 // indirect github.com/kyoh86/exportloopref v0.1.11 // indirect github.com/lasiar/canonicalheader v1.1.2 // indirect - github.com/ldez/gomoddirectives v0.2.4 // indirect - github.com/ldez/tagliatelle v0.5.0 // indirect + github.com/ldez/exptostd v0.3.1 // indirect + github.com/ldez/gomoddirectives v0.6.0 // indirect + github.com/ldez/grignotin v0.7.0 // indirect + github.com/ldez/tagliatelle v0.7.1 // indirect + github.com/ldez/usetesting v0.4.2 // indirect github.com/leonklingele/grouper v1.1.2 // indirect github.com/macabu/inamedparam v0.1.3 // indirect github.com/magiconair/properties v1.8.7 // indirect @@ -163,7 +168,7 @@ require ( github.com/nakabonne/nestif v0.3.1 // indirect github.com/nishanths/exhaustive v0.12.0 // indirect github.com/nishanths/predeclared v0.2.2 // indirect - github.com/nunnatsa/ginkgolinter v0.18.3 // indirect + github.com/nunnatsa/ginkgolinter v0.18.4 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/pelletier/go-toml/v2 v2.2.3 // indirect github.com/pjbgf/sha1cd v0.3.0 // indirect @@ -178,17 +183,17 @@ require ( github.com/quasilyte/gogrep v0.5.0 // indirect github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 // indirect github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 // indirect - github.com/raeperd/recvcheck v0.1.2 // indirect + github.com/raeperd/recvcheck v0.2.0 // indirect github.com/rivo/uniseg v0.4.7 // indirect github.com/rogpeppe/go-internal v1.13.1 // indirect github.com/ryancurrah/gomodguard v1.3.5 // indirect github.com/ryanrolds/sqlclosecheck v0.5.1 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect - github.com/sanposhiho/wastedassign/v2 v2.0.7 // indirect - github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect + github.com/sanposhiho/wastedassign/v2 v2.1.0 // indirect + github.com/santhosh-tekuri/jsonschema/v6 v6.0.1 // indirect github.com/sashamelentyev/interfacebloat v1.1.0 // indirect - github.com/sashamelentyev/usestdlibvars v1.27.0 // indirect + github.com/sashamelentyev/usestdlibvars v1.28.0 // indirect github.com/securego/gosec/v2 v2.21.4 // indirect github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c // indirect @@ -205,20 +210,20 @@ require ( github.com/spf13/pflag v1.0.5 // indirect github.com/spf13/viper v1.19.0 // indirect github.com/ssgreg/nlreturn/v2 v2.2.1 // indirect - github.com/stbenjam/no-sprintf-host-port v0.1.1 // indirect + github.com/stbenjam/no-sprintf-host-port v0.2.0 // indirect github.com/stretchr/objx v0.5.2 // indirect github.com/stretchr/testify v1.10.0 // indirect github.com/subosito/gotenv v1.6.0 // indirect - github.com/tdakkota/asciicheck v0.2.0 // indirect - github.com/tetafro/godot v1.4.18 // indirect - github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966 // indirect + github.com/tdakkota/asciicheck v0.3.0 // indirect + github.com/tetafro/godot v1.4.20 // indirect + github.com/timakin/bodyclose v0.0.0-20241017074812-ed6a65f985e3 // indirect github.com/timonwong/loggercheck v0.10.1 // indirect - github.com/tomarrell/wrapcheck/v2 v2.9.0 // indirect + github.com/tomarrell/wrapcheck/v2 v2.10.0 // indirect github.com/tommy-muehle/go-mnd/v2 v2.5.1 // indirect - github.com/ultraware/funlen v0.1.0 // indirect - github.com/ultraware/whitespace v0.1.1 // indirect - github.com/uudashr/gocognit v1.1.3 // indirect - github.com/uudashr/iface v1.2.1 // indirect + github.com/ultraware/funlen v0.2.0 // indirect + github.com/ultraware/whitespace v0.2.0 // indirect + github.com/uudashr/gocognit v1.2.0 // indirect + github.com/uudashr/iface v1.3.0 // indirect github.com/vektah/gqlparser/v2 v2.5.16 // indirect github.com/xanzy/ssh-agent v0.3.3 // indirect github.com/xen0n/gosmopolitan v1.2.2 // indirect @@ -241,16 +246,16 @@ require ( go.uber.org/automaxprocs v1.6.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/crypto v0.31.0 // indirect + golang.org/x/crypto v0.32.0 // indirect golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 // indirect golang.org/x/exp/typeparams v0.0.0-20241108190413-2d47ceb2692f // indirect golang.org/x/mod v0.22.0 // indirect - golang.org/x/net v0.33.0 // indirect + golang.org/x/net v0.34.0 // indirect golang.org/x/oauth2 v0.23.0 // indirect golang.org/x/sync v0.10.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/telemetry v0.0.0-20240522233618-39ace7a40ae7 // indirect - golang.org/x/term v0.27.0 // indirect + golang.org/x/term v0.28.0 // indirect golang.org/x/text v0.21.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.69.2 // indirect diff --git a/internal/tools/go.sum b/internal/tools/go.sum index 5224f33d20ef..a744c63f9fde 100644 --- a/internal/tools/go.sum +++ b/internal/tools/go.sum @@ -4,14 +4,14 @@ 4d63.com/gochecknoglobals v0.2.1/go.mod h1:KRE8wtJB3CXCsb1xy421JfTHIIbmT3U5ruxw2Qu8fSU= dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= -github.com/4meepo/tagalign v1.3.4 h1:P51VcvBnf04YkHzjfclN6BbsopfJR5rxs1n+5zHt+w8= -github.com/4meepo/tagalign v1.3.4/go.mod h1:M+pnkHH2vG8+qhE5bVc/zeP7HS/j910Fwa9TUSyZVI0= +github.com/4meepo/tagalign v1.4.1 h1:GYTu2FaPGOGb/xJalcqHeD4il5BiCywyEYZOA55P6J4= +github.com/4meepo/tagalign v1.4.1/go.mod h1:2H9Yu6sZ67hmuraFgfZkNcg5Py9Ch/Om9l2K/2W1qS4= github.com/Abirdcfly/dupword v0.1.3 h1:9Pa1NuAsZvpFPi9Pqkd93I7LIYRURj+A//dFd5tgBeE= github.com/Abirdcfly/dupword v0.1.3/go.mod h1:8VbB2t7e10KRNdwTVoxdBaxla6avbhGzb8sCTygUMhw= github.com/Antonboom/errname v1.0.0 h1:oJOOWR07vS1kRusl6YRSlat7HFnb3mSfMl6sDMRoTBA= github.com/Antonboom/errname v1.0.0/go.mod h1:gMOBFzK/vrTiXN9Oh+HFs+e6Ndl0eTFbtsRTSRdXyGI= -github.com/Antonboom/nilnil v1.0.0 h1:n+v+B12dsE5tbAqRODXmEKfZv9j2KcTBrp+LkoM4HZk= -github.com/Antonboom/nilnil v1.0.0/go.mod h1:fDJ1FSFoLN6yoG65ANb1WihItf6qt9PJVTn/s2IrcII= +github.com/Antonboom/nilnil v1.0.1 h1:C3Tkm0KUxgfO4Duk3PM+ztPncTFlOf0b2qadmS0s4xs= +github.com/Antonboom/nilnil v1.0.1/go.mod h1:CH7pW2JsRNFgEh8B2UaPZTEPhCMuFowP/e8Udp9Nnb0= github.com/Antonboom/testifylint v1.5.2 h1:4s3Xhuv5AvdIgbd8wOOEeo0uZG7PbDKQyKY5lGoQazk= github.com/Antonboom/testifylint v1.5.2/go.mod h1:vxy8VJ0bc6NavlYqjZfmp6EfqXMtBgQ4+mhCojwC1P8= github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c h1:pxW6RcqyfI9/kWtOwnv/G+AzdKuy2ZrqINhenH4HyNs= @@ -35,12 +35,12 @@ github.com/ProtonMail/go-crypto v1.0.0 h1:LRuvITjQWX+WIfr930YHG2HNfjR1uOfyf5vE0k github.com/ProtonMail/go-crypto v1.0.0/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= github.com/agnivade/levenshtein v1.1.1 h1:QY8M92nrzkmr798gCo3kmMyqXFzdQVpxLlGPRBij0P8= github.com/agnivade/levenshtein v1.1.1/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo= -github.com/alecthomas/assert/v2 v2.2.2 h1:Z/iVC0xZfWTaFNE6bA3z07T86hd45Xe2eLt6WVy2bbk= -github.com/alecthomas/assert/v2 v2.2.2/go.mod h1:pXcQ2Asjp247dahGEmsZ6ru0UVwnkhktn7S0bBDLxvQ= -github.com/alecthomas/go-check-sumtype v0.2.0 h1:Bo+e4DFf3rs7ME9w/0SU/g6nmzJaphduP8Cjiz0gbwY= -github.com/alecthomas/go-check-sumtype v0.2.0/go.mod h1:WyYPfhfkdhyrdaligV6svFopZV8Lqdzn5pyVBaV6jhQ= -github.com/alecthomas/repr v0.2.0 h1:HAzS41CIzNW5syS8Mf9UwXhNH1J9aix/BvDRf1Ml2Yk= -github.com/alecthomas/repr v0.2.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= +github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8vS6K3D0= +github.com/alecthomas/assert/v2 v2.11.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= +github.com/alecthomas/go-check-sumtype v0.3.1 h1:u9aUvbGINJxLVXiFvHUlPEaD7VDULsrxJb4Aq31NLkU= +github.com/alecthomas/go-check-sumtype v0.3.1/go.mod h1:A8TSiN3UPRw3laIgWEUOHHLPa6/r9MtoigdlP5h3K/E= +github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc= +github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= github.com/alexflint/go-arg v1.5.0 h1:rwMKGiaQuRbXfZNyRUvIfke63QvOBt1/QTshlGQHohM= github.com/alexflint/go-arg v1.5.0/go.mod h1:A7vTJzvjoaSTypg4biM5uYNTkJ27SkNTArtYXnlqVO8= github.com/alexflint/go-scalar v1.2.0 h1:WR7JPKkeNpnYIOfHRa7ivM21aWAdHD0gEWHCx+WQBRw= @@ -51,6 +51,8 @@ github.com/alexkohler/prealloc v1.0.0 h1:Hbq0/3fJPQhNkN0dR95AVrr6R7tou91y0uHG5pO github.com/alexkohler/prealloc v1.0.0/go.mod h1:VetnK3dIgFBBKmg0YnD9F9x6Icjd+9cvfHR56wJVlKE= github.com/alingse/asasalint v0.0.11 h1:SFwnQXJ49Kx/1GghOFz1XGqHYKp21Kq1nHad/0WQRnw= github.com/alingse/asasalint v0.0.11/go.mod h1:nCaoMhw7a9kSJObvQyVzNTPBDbNpdocqrSP7t/cW5+I= +github.com/alingse/nilnesserr v0.1.1 h1:7cYuJewpy9jFNMEA72Q1+3Nm3zKHzg+Q28D5f2bBFUA= +github.com/alingse/nilnesserr v0.1.1/go.mod h1:1xJPrXonEtX7wyTq8Dytns5P2hNzoWymVUIaKm4HNFg= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8= @@ -61,8 +63,8 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPd github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/ashanbrown/forbidigo v1.6.0 h1:D3aewfM37Yb3pxHujIPSpTf6oQk9sc9WZi8gerOIVIY= github.com/ashanbrown/forbidigo v1.6.0/go.mod h1:Y8j9jy9ZYAEHXdu723cUlraTqbzjKF1MUyfOKL+AjcU= -github.com/ashanbrown/makezero v1.1.1 h1:iCQ87C0V0vSyO+M9E/FZYbu65auqH0lnsOkf5FcB28s= -github.com/ashanbrown/makezero v1.1.1/go.mod h1:i1bJLCRSCHOcOa9Y6MyF2FTfMZMFdHvxKHxgO5Z1axI= +github.com/ashanbrown/makezero v1.2.0 h1:/2Lp1bypdmK9wDIq7uWBlDF1iMUpIIS4A+pF6C9IEUU= +github.com/ashanbrown/makezero v1.2.0/go.mod h1:dxlPhHbDMC6N6xICzFBSK+4njQDdK8euNO0qjQMtGY4= 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/bitfield/gotestdox v0.2.2 h1:x6RcPAbBbErKLnapz1QeAlf3ospg8efBsedU93CDsnE= @@ -73,18 +75,18 @@ github.com/blizzy78/varnamelen v0.8.0 h1:oqSblyuQvFsW1hbBHh1zfwrKe3kcSj0rnXkKzsQ github.com/blizzy78/varnamelen v0.8.0/go.mod h1:V9TzQZ4fLJ1DSrjVDfl89H7aMnTvKkApdHeyESmyR7k= github.com/bmatcuk/doublestar/v4 v4.0.2 h1:X0krlUVAVmtr2cRoTqR8aDMrDqnB36ht8wpWTiQ3jsA= github.com/bmatcuk/doublestar/v4 v4.0.2/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= -github.com/bombsimon/wsl/v4 v4.4.1 h1:jfUaCkN+aUpobrMO24zwyAMwMAV5eSziCkOKEauOLdw= -github.com/bombsimon/wsl/v4 v4.4.1/go.mod h1:Xu/kDxGZTofQcDGCtQe9KCzhHphIe0fDuyWTxER9Feo= +github.com/bombsimon/wsl/v4 v4.5.0 h1:iZRsEvDdyhd2La0FVi5k6tYehpOR/R7qIUjmKk7N74A= +github.com/bombsimon/wsl/v4 v4.5.0/go.mod h1:NOQ3aLF4nD7N5YPXMruR6ZXDOAqLoM0GEpLwTdvmOSc= github.com/bradleyjkemp/cupaloy/v2 v2.6.0 h1:knToPYa2xtfg42U3I6punFEjaGFKWQRXJwj0JTv4mTs= github.com/bradleyjkemp/cupaloy/v2 v2.6.0/go.mod h1:bm7JXdkRd4BHJk9HpwqAI8BoAY1lps46Enkdqw6aRX0= github.com/breml/bidichk v0.3.2 h1:xV4flJ9V5xWTqxL+/PMFF6dtJPvZLPsyixAoPe8BGJs= github.com/breml/bidichk v0.3.2/go.mod h1:VzFLBxuYtT23z5+iVkamXO386OB+/sVwZOpIj6zXGos= github.com/breml/errchkjson v0.4.0 h1:gftf6uWZMtIa/Is3XJgibewBm2ksAQSY/kABDNFTAdk= github.com/breml/errchkjson v0.4.0/go.mod h1:AuBOSTHyLSaaAFlWsRSuRBIroCh3eh7ZHh5YeelDIk8= -github.com/butuzov/ireturn v0.3.0 h1:hTjMqWw3y5JC3kpnC5vXmFJAWI/m31jaCYQqzkS6PL0= -github.com/butuzov/ireturn v0.3.0/go.mod h1:A09nIiwiqzN/IoVo9ogpa0Hzi9fex1kd9PSD6edP5ZA= -github.com/butuzov/mirror v1.2.0 h1:9YVK1qIjNspaqWutSv8gsge2e/Xpq1eqEkslEUHy5cs= -github.com/butuzov/mirror v1.2.0/go.mod h1:DqZZDtzm42wIAIyHXeN8W/qb1EPlb9Qn/if9icBOpdQ= +github.com/butuzov/ireturn v0.3.1 h1:mFgbEI6m+9W8oP/oDdfA34dLisRFCj2G6o/yiI1yZrY= +github.com/butuzov/ireturn v0.3.1/go.mod h1:ZfRp+E7eJLC0NQmk1Nrm1LOrn/gQlOykv+cVPdiXH5M= +github.com/butuzov/mirror v1.3.0 h1:HdWCXzmwlQHdVhwvsfBb2Au0r3HyINry3bDWLYXiKoc= +github.com/butuzov/mirror v1.3.0/go.mod h1:AEij0Z8YMALaq4yQj9CPPVYOyJQyiexpQEQgihajRfI= github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/catenacyber/perfsprint v0.7.1 h1:PGW5G/Kxn+YrN04cRAZKC+ZuvlVwolYMrIyyTJ/rMmc= github.com/catenacyber/perfsprint v0.7.1/go.mod h1:/wclWYompEyjUD2FuIIDVKNkqz7IgBIWXIH3V0Zol50= @@ -96,16 +98,16 @@ github.com/charithe/durationcheck v0.0.10 h1:wgw73BiocdBDQPik+zcEoBG/ob8uyBHf2iy github.com/charithe/durationcheck v0.0.10/go.mod h1:bCWXb7gYRysD1CU3C+u4ceO49LoGOY1C1L6uouGNreQ= github.com/chavacava/garif v0.1.0 h1:2JHa3hbYf5D9dsgseMKAmc/MZ109otzgNFk5s87H9Pc= github.com/chavacava/garif v0.1.0/go.mod h1:XMyYCkEL58DF0oyW4qDjjnPWONs2HBqYKI+UIPD+Gww= -github.com/ckaznocha/intrange v0.2.1 h1:M07spnNEQoALOJhwrImSrJLaxwuiQK+hA2DeajBlwYk= -github.com/ckaznocha/intrange v0.2.1/go.mod h1:7NEhVyf8fzZO5Ds7CRaqPEm52Ut83hsTiL5zbER/HYk= +github.com/ckaznocha/intrange v0.3.0 h1:VqnxtK32pxgkhJgYQEeOArVidIPg+ahLP7WBOXZd5ZY= +github.com/ckaznocha/intrange v0.3.0/go.mod h1:+I/o2d2A1FBHgGELbGxzIcyd3/9l9DuwjM8FsbSS3Lo= github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/curioswitch/go-reassign v0.2.0 h1:G9UZyOcpk/d7Gd6mqYgd8XYWFMw/znxwGDUstnC9DIo= -github.com/curioswitch/go-reassign v0.2.0/go.mod h1:x6OpXuWvgfQaMGks2BZybTngWjT84hqJfKoO8Tt/Roc= +github.com/curioswitch/go-reassign v0.3.0 h1:dh3kpQHuADL3cobV/sSGETA8DOv457dwl+fbBAhrQPs= +github.com/curioswitch/go-reassign v0.3.0/go.mod h1:nApPCCTtqLJN/s8HfItCcKV0jIPwluBOvZP+dsJGA88= github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/daixiang0/gci v0.13.5 h1:kThgmH1yBmZSBCh1EJVxQ7JsHpm5Oms0AMed/0LaH4c= @@ -118,6 +120,8 @@ github.com/denis-tingaikin/go-header v0.5.0 h1:SRdnP5ZKvcO9KKRP1KJrhFR3RrlGuD+42 github.com/denis-tingaikin/go-header v0.5.0/go.mod h1:mMenU5bWrok6Wl2UsZjy+1okegmwQ3UgWl4V1D8gjlY= github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48 h1:fRzb/w+pyskVMQ+UbP35JkH8yB7MYb4q/qhBarqZE6g= github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA= +github.com/dlclark/regexp2 v1.11.0 h1:G/nrcoOa7ZXlpoa/91N3X7mM3r8eIlMBBJZvsz/mxKI= +github.com/dlclark/regexp2 v1.11.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= github.com/dnephin/pflag v1.0.7 h1:oxONGlWxhmUct0YzKTgrpQv9AUA1wtPBn7zuSjJqptk= github.com/dnephin/pflag v1.0.7/go.mod h1:uxE91IoWURlOiTUIA8Mq5ZZkAv3dPUfZNaT80Zm7OQE= github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a h1:mATvB/9r/3gvcejNsXKSkQ6lcIaNec2nyfOdlTBR2lU= @@ -183,8 +187,8 @@ github.com/go-toolsmith/typep v1.1.0 h1:fIRYDyF+JywLfqzyhdiHzRop/GQDxxNhLGQ6gFUN github.com/go-toolsmith/typep v1.1.0/go.mod h1:fVIw+7zjdsMxDA3ITWnH1yOiw1rnTQKCsF/sk2H/qig= github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= -github.com/go-xmlfmt/xmlfmt v1.1.2 h1:Nea7b4icn8s57fTx1M5AI4qQT5HEM3rVUO8MuE6g80U= -github.com/go-xmlfmt/xmlfmt v1.1.2/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM= +github.com/go-xmlfmt/xmlfmt v1.1.3 h1:t8Ey3Uy7jDSEisW2K3somuMKIpzktkWptA0iFCnRUWY= +github.com/go-xmlfmt/xmlfmt v1.1.3/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM= github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= github.com/gofrs/flock v0.12.1 h1:MTLVXXHf8ekldpJk3AKicLij9MdwOWkZ+a/jHHZby9E= @@ -199,14 +203,12 @@ github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a h1:w8hkcTqaFpzKqonE9 github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a/go.mod h1:ryS0uhF+x9jgbj/N71xsEqODy9BN81/GonCZiOzirOk= github.com/golangci/go-printf-func-name v0.1.0 h1:dVokQP+NMTO7jwO4bwsRwLWeudOVUPPyAKJuzv8pEJU= github.com/golangci/go-printf-func-name v0.1.0/go.mod h1:wqhWFH5mUdJQhweRnldEywnR5021wTdZSNgwYceV14s= -github.com/golangci/gofmt v0.0.0-20240816233607-d8596aa466a9 h1:/1322Qns6BtQxUZDTAT4SdcoxknUki7IAoK4SAXr8ME= -github.com/golangci/gofmt v0.0.0-20240816233607-d8596aa466a9/go.mod h1:Oesb/0uFAyWoaw1U1qS5zyjCg5NP9C9iwjnI4tIsXEE= -github.com/golangci/golangci-lint v1.62.2 h1:b8K5K9PN+rZN1+mKLtsZHz2XXS9aYKzQ9i25x3Qnxxw= -github.com/golangci/golangci-lint v1.62.2/go.mod h1:ILWWyeFUrctpHVGMa1dg2xZPKoMUTc5OIMgW7HZr34g= +github.com/golangci/gofmt v0.0.0-20241223200906-057b0627d9b9 h1:t5wybL6RtO83VwoMOb7U/Peqe3gGKQlPIC66wXmnkvM= +github.com/golangci/gofmt v0.0.0-20241223200906-057b0627d9b9/go.mod h1:Ag3L7sh7E28qAp/5xnpMMTuGYqxLZoSaEHZDkZB1RgU= +github.com/golangci/golangci-lint v1.63.4 h1:bJQFQ3hSfUto597dkL7ipDzOxsGEpiWdLiZ359OWOBI= +github.com/golangci/golangci-lint v1.63.4/go.mod h1:Hx0B7Lg5/NXbaOHem8+KU+ZUIzMI6zNj/7tFwdnn10I= github.com/golangci/misspell v0.6.0 h1:JCle2HUTNWirNlDIAUO44hUsKhOFqGPoC4LZxlaSXDs= github.com/golangci/misspell v0.6.0/go.mod h1:keMNyY6R9isGaSAu+4Q8NMBwMPkh15Gtc8UCVoDtAWo= -github.com/golangci/modinfo v0.3.4 h1:oU5huX3fbxqQXdfspamej74DFX0kyGLkw1ppvXoJ8GA= -github.com/golangci/modinfo v0.3.4/go.mod h1:wytF1M5xl9u0ij8YSvhkEVPP3M5Mc7XLl1pxH3B2aUM= github.com/golangci/plugin-module-register v0.1.1 h1:TCmesur25LnyJkpsVrupv1Cdzo+2f7zX0H6Jkw1Ol6c= github.com/golangci/plugin-module-register v0.1.1/go.mod h1:TTpqoB6KkwOJMV8u7+NyXMrkwwESJLOkfl9TxR1DGFc= github.com/golangci/revgrep v0.5.3 h1:3tL7c1XBMtWHHqVpS5ChmiAAoe4PF/d5+ULzV9sLAzs= @@ -250,11 +252,17 @@ github.com/gostaticanalysis/forcetypeassert v0.1.0/go.mod h1:qZEedyP/sY1lTGV1uJ3 github.com/gostaticanalysis/nilerr v0.1.1 h1:ThE+hJP0fEp4zWLkWHWcRyI2Od0p7DlgYG3Uqrmrcpk= github.com/gostaticanalysis/nilerr v0.1.1/go.mod h1:wZYb6YI5YAxxq0i1+VJbY0s2YONW0HU0GPE3+5PWN4A= github.com/gostaticanalysis/testutil v0.3.1-0.20210208050101-bfb5c8eec0e4/go.mod h1:D+FIZ+7OahH3ePw/izIEeH5I06eKs1IKI4Xr64/Am3M= -github.com/gostaticanalysis/testutil v0.4.0 h1:nhdCmubdmDF6VEatUNjgUZBJKWRqugoISdUv3PPQgHY= -github.com/gostaticanalysis/testutil v0.4.0/go.mod h1:bLIoPefWXrRi/ssLFWX1dx7Repi5x3CuviD3dgAZaBU= +github.com/gostaticanalysis/testutil v0.5.0 h1:Dq4wT1DdTwTGCQQv3rl3IvD5Ld0E6HiY+3Zh0sUGqw8= +github.com/gostaticanalysis/testutil v0.5.0/go.mod h1:OLQSbuM6zw2EvCcXTz1lVq5unyoNft372msDY0nY5Hs= +github.com/hashicorp/go-immutable-radix/v2 v2.1.0 h1:CUW5RYIcysz+D3B+l1mDeXrQ7fUvGGCwJfdASSzbrfo= +github.com/hashicorp/go-immutable-radix/v2 v2.1.0/go.mod h1:hgdqLXA4f6NIjRVisM1TJ9aOJVNRqKZj+xDGF6m7PBw= +github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= +github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= 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/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= @@ -269,16 +277,16 @@ github.com/jgautheron/goconst v1.7.1 h1:VpdAG7Ca7yvvJk5n8dMwQhfEZJh95kl/Hl9S1OI5 github.com/jgautheron/goconst v1.7.1/go.mod h1:aAosetZ5zaeC/2EfMeRswtxUFBpe2Hr7HzkgX4fanO4= github.com/jingyugao/rowserrcheck v1.1.1 h1:zibz55j/MJtLsjP1OF4bSdgXxwL1b+Vn7Tjzq7gFzUs= github.com/jingyugao/rowserrcheck v1.1.1/go.mod h1:4yvlZSDb3IyDTUZJUmpZfm2Hwok+Dtp+nu2qOq+er9c= -github.com/jjti/go-spancheck v0.6.2 h1:iYtoxqPMzHUPp7St+5yA8+cONdyXD3ug6KK15n7Pklk= -github.com/jjti/go-spancheck v0.6.2/go.mod h1:+X7lvIrR5ZdUTkxFYqzJ0abr8Sb5LOo80uOhWNqIrYA= +github.com/jjti/go-spancheck v0.6.4 h1:Tl7gQpYf4/TMU7AT84MN83/6PutY21Nb9fuQjFTpRRc= +github.com/jjti/go-spancheck v0.6.4/go.mod h1:yAEYdKJ2lRkDA8g7X+oKUHXOWVAXSBJRv04OhF+QUjk= github.com/joshdk/go-junit v1.0.0 h1:S86cUKIdwBHWwA6xCmFlf3RTLfVXYQfvanM5Uh+K6GE= github.com/joshdk/go-junit v1.0.0/go.mod h1:TiiV0PqkaNfFXjEiyjWM3XXrhVyCa1K4Zfga6W52ung= 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/jstemmer/go-junit-report v1.0.0 h1:8X1gzZpR+nVQLAht+L/foqOeX2l9DTZoaIPbEQHxsds= github.com/jstemmer/go-junit-report v1.0.0/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/julz/importas v0.1.0 h1:F78HnrsjY3cR7j0etXy5+TU1Zuy7Xt08X/1aJnH5xXY= -github.com/julz/importas v0.1.0/go.mod h1:oSFU2R4XK/P7kNBrnL/FEQlDGN1/6WoxXEjSSXO0DV0= +github.com/julz/importas v0.2.0 h1:y+MJN/UdL63QbFJHws9BVC5RpA2iq0kpjrFajTGivjQ= +github.com/julz/importas v0.2.0/go.mod h1:pThlt589EnCYtMnmhmRYY/qn9lCf/frPOK+WMx3xiJY= github.com/karamaru-alpha/copyloopvar v1.1.0 h1:x7gNyKcC2vRBO1H2Mks5u1VxQtYvFiym7fCjIP8RPos= github.com/karamaru-alpha/copyloopvar v1.1.0/go.mod h1:u7CIfztblY0jZLOQZgH3oYsJzpC2A7S6u/lfgSXHy0k= github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= @@ -320,10 +328,16 @@ github.com/kyoh86/exportloopref v0.1.11 h1:1Z0bcmTypkL3Q4k+IDHMWTcnCliEZcaPiIe0/ github.com/kyoh86/exportloopref v0.1.11/go.mod h1:qkV4UF1zGl6EkF1ox8L5t9SwyeBAZ3qLMd6up458uqA= github.com/lasiar/canonicalheader v1.1.2 h1:vZ5uqwvDbyJCnMhmFYimgMZnJMjwljN5VGY0VKbMXb4= github.com/lasiar/canonicalheader v1.1.2/go.mod h1:qJCeLFS0G/QlLQ506T+Fk/fWMa2VmBUiEI2cuMK4djI= -github.com/ldez/gomoddirectives v0.2.4 h1:j3YjBIjEBbqZ0NKtBNzr8rtMHTOrLPeiwTkfUJZ3alg= -github.com/ldez/gomoddirectives v0.2.4/go.mod h1:oWu9i62VcQDYp9EQ0ONTfqLNh+mDLWWDO+SO0qSQw5g= -github.com/ldez/tagliatelle v0.5.0 h1:epgfuYt9v0CG3fms0pEgIMNPuFf/LpPIfjk4kyqSioo= -github.com/ldez/tagliatelle v0.5.0/go.mod h1:rj1HmWiL1MiKQuOONhd09iySTEkUuE/8+5jtPYz9xa4= +github.com/ldez/exptostd v0.3.1 h1:90yWWoAKMFHeovTK8uzBms9Ppp8Du/xQ20DRO26Ymrw= +github.com/ldez/exptostd v0.3.1/go.mod h1:iZBRYaUmcW5jwCR3KROEZ1KivQQp6PHXbDPk9hqJKCQ= +github.com/ldez/gomoddirectives v0.6.0 h1:Jyf1ZdTeiIB4dd+2n4qw+g4aI9IJ6JyfOZ8BityWvnA= +github.com/ldez/gomoddirectives v0.6.0/go.mod h1:TuwOGYoPAoENDWQpe8DMqEm5nIfjrxZXmxX/CExWyZ4= +github.com/ldez/grignotin v0.7.0 h1:vh0dI32WhHaq6LLPZ38g7WxXuZ1+RzyrJ7iPG9JMa8c= +github.com/ldez/grignotin v0.7.0/go.mod h1:uaVTr0SoZ1KBii33c47O1M8Jp3OP3YDwhZCmzT9GHEk= +github.com/ldez/tagliatelle v0.7.1 h1:bTgKjjc2sQcsgPiT902+aadvMjCeMHrY7ly2XKFORIk= +github.com/ldez/tagliatelle v0.7.1/go.mod h1:3zjxUpsNB2aEZScWiZTHrAXOl1x25t3cRmzfK1mlo2I= +github.com/ldez/usetesting v0.4.2 h1:J2WwbrFGk3wx4cZwSMiCQQ00kjGR0+tuuyW0Lqm4lwA= +github.com/ldez/usetesting v0.4.2/go.mod h1:eEs46T3PpQ+9RgN9VjpY6qWdiw2/QmfiDeWmdZdrjIQ= github.com/leonklingele/grouper v1.1.2 h1:o1ARBDLOmmasUaNDesWqWCIFH3u7hoFlM84YrjT3mIY= github.com/leonklingele/grouper v1.1.2/go.mod h1:6D0M/HVkhs2yRKRFZUoGjeDy7EZTfFBE9gl4kjmIGkA= github.com/macabu/inamedparam v0.1.3 h1:2tk/phHkMlEL/1GNe/Yf6kkR/hkcUdAEY3L0hjYV1Mk= @@ -373,8 +387,8 @@ github.com/nishanths/exhaustive v0.12.0 h1:vIY9sALmw6T/yxiASewa4TQcFsVYZQQRUQJhK github.com/nishanths/exhaustive v0.12.0/go.mod h1:mEZ95wPIZW+x8kC4TgC+9YCUgiST7ecevsVDTgc2obs= github.com/nishanths/predeclared v0.2.2 h1:V2EPdZPliZymNAn79T8RkNApBjMmVKh5XRpLm/w98Vk= github.com/nishanths/predeclared v0.2.2/go.mod h1:RROzoN6TnGQupbC+lqggsOlcgysk3LMK/HI84Mp280c= -github.com/nunnatsa/ginkgolinter v0.18.3 h1:WgS7X3zzmni3vwHSBhvSgqrRgUecN6PQUcfB0j1noDw= -github.com/nunnatsa/ginkgolinter v0.18.3/go.mod h1:BE1xyB/PNtXXG1azrvrqJW5eFH0hSRylNzFy8QHPwzs= +github.com/nunnatsa/ginkgolinter v0.18.4 h1:zmX4KUR+6fk/vhUFt8DOP6KwznekhkmVSzzVJve2vyM= +github.com/nunnatsa/ginkgolinter v0.18.4/go.mod h1:AMEane4QQ6JwFz5GgjI5xLUM9S/CylO+UyM97fN2iBI= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo/v2 v2.20.2 h1:7NVCeyIWROIAheY21RLS+3j2bb52W0W82tkberYytp4= @@ -419,8 +433,8 @@ github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 h1:TCg2WBOl github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727/go.mod h1:rlzQ04UMyJXu/aOvhd8qT+hvDrFpiwqp8MRXDY9szc0= github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 h1:M8mH9eK4OUR4lu7Gd+PU1fV2/qnDNfzT635KRSObncs= github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567/go.mod h1:DWNGW8A4Y+GyBgPuaQJuWiy0XYftx4Xm/y5Jqk9I6VQ= -github.com/raeperd/recvcheck v0.1.2 h1:SjdquRsRXJc26eSonWIo8b7IMtKD3OAT2Lb5G3ZX1+4= -github.com/raeperd/recvcheck v0.1.2/go.mod h1:n04eYkwIR0JbgD73wT8wL4JjPC3wm0nFtzBnWNocnYU= +github.com/raeperd/recvcheck v0.2.0 h1:GnU+NsbiCqdC2XX5+vMZzP+jAJC5fht7rcVTAhX74UI= +github.com/raeperd/recvcheck v0.2.0/go.mod h1:n04eYkwIR0JbgD73wT8wL4JjPC3wm0nFtzBnWNocnYU= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= @@ -436,14 +450,14 @@ github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6ke github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= -github.com/sanposhiho/wastedassign/v2 v2.0.7 h1:J+6nrY4VW+gC9xFzUc+XjPD3g3wF3je/NsJFwFK7Uxc= -github.com/sanposhiho/wastedassign/v2 v2.0.7/go.mod h1:KyZ0MWTwxxBmfwn33zh3k1dmsbF2ud9pAAGfoLfjhtI= -github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 h1:lZUw3E0/J3roVtGQ+SCrUrg3ON6NgVqpn3+iol9aGu4= -github.com/santhosh-tekuri/jsonschema/v5 v5.3.1/go.mod h1:uToXkOrWAZ6/Oc07xWQrPOhJotwFIyu2bBVN41fcDUY= +github.com/sanposhiho/wastedassign/v2 v2.1.0 h1:crurBF7fJKIORrV85u9UUpePDYGWnwvv3+A96WvwXT0= +github.com/sanposhiho/wastedassign/v2 v2.1.0/go.mod h1:+oSmSC+9bQ+VUAxA66nBb0Z7N8CK7mscKTDYC6aIek4= +github.com/santhosh-tekuri/jsonschema/v6 v6.0.1 h1:PKK9DyHxif4LZo+uQSgXNqs0jj5+xZwwfKHgph2lxBw= +github.com/santhosh-tekuri/jsonschema/v6 v6.0.1/go.mod h1:JXeL+ps8p7/KNMjDQk3TCwPpBy0wYklyWTfbkIzdIFU= github.com/sashamelentyev/interfacebloat v1.1.0 h1:xdRdJp0irL086OyW1H/RTZTr1h/tMEOsumirXcOJqAw= github.com/sashamelentyev/interfacebloat v1.1.0/go.mod h1:+Y9yU5YdTkrNvoX0xHc84dxiN1iBi9+G8zZIhPVoNjQ= -github.com/sashamelentyev/usestdlibvars v1.27.0 h1:t/3jZpSXtRPRf2xr0m63i32ZrusyurIGT9E5wAvXQnI= -github.com/sashamelentyev/usestdlibvars v1.27.0/go.mod h1:9nl0jgOfHKWNFS43Ojw0i7aRoS4j6EBye3YBhmAIRF8= +github.com/sashamelentyev/usestdlibvars v1.28.0 h1:jZnudE2zKCtYlGzLVreNp5pmCdOxXUzwsMDBkR21cyQ= +github.com/sashamelentyev/usestdlibvars v1.28.0/go.mod h1:9nl0jgOfHKWNFS43Ojw0i7aRoS4j6EBye3YBhmAIRF8= github.com/securego/gosec/v2 v2.21.4 h1:Le8MSj0PDmOnHJgUATjD96PaXRvCpKC+DGJvwyy0Mlk= github.com/securego/gosec/v2 v2.21.4/go.mod h1:Jtb/MwRQfRxCXyCm1rfM1BEiiiTfUOdyzzAhlr6lUTA= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8= @@ -479,8 +493,8 @@ github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI= github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg= github.com/ssgreg/nlreturn/v2 v2.2.1 h1:X4XDI7jstt3ySqGU86YGAURbxw3oTDPK9sPEi6YEwQ0= github.com/ssgreg/nlreturn/v2 v2.2.1/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRkkxBiELzh2I= -github.com/stbenjam/no-sprintf-host-port v0.1.1 h1:tYugd/yrm1O0dV+ThCbaKZh195Dfm07ysF0U6JQXczc= -github.com/stbenjam/no-sprintf-host-port v0.1.1/go.mod h1:TLhvtIvONRzdmkFiio4O8LHsN9N74I+PhRquPsxpL0I= +github.com/stbenjam/no-sprintf-host-port v0.2.0 h1:i8pxvGrt1+4G0czLr/WnmyH7zbZ8Bg8etvARQ1rpyl4= +github.com/stbenjam/no-sprintf-host-port v0.2.0/go.mod h1:eL0bQ9PasS0hsyTyfTjjG+E80QIyPnBVQbYZyv20Jfk= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= @@ -499,30 +513,30 @@ github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOf github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= -github.com/tdakkota/asciicheck v0.2.0 h1:o8jvnUANo0qXtnslk2d3nMKTFNlOnJjRrNcj0j9qkHM= -github.com/tdakkota/asciicheck v0.2.0/go.mod h1:Qb7Y9EgjCLJGup51gDHFzbI08/gbGhL/UVhYIPWG2rg= +github.com/tdakkota/asciicheck v0.3.0 h1:LqDGgZdholxZMaJgpM6b0U9CFIjDCbFdUF00bDnBKOQ= +github.com/tdakkota/asciicheck v0.3.0/go.mod h1:KoJKXuX/Z/lt6XzLo8WMBfQGzak0SrAKZlvRr4tg8Ac= github.com/tenntenn/modver v1.0.1 h1:2klLppGhDgzJrScMpkj9Ujy3rXPUspSjAcev9tSEBgA= github.com/tenntenn/modver v1.0.1/go.mod h1:bePIyQPb7UeioSRkw3Q0XeMhYZSMx9B8ePqg6SAMGH0= github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3 h1:f+jULpRQGxTSkNYKJ51yaw6ChIqO+Je8UqsTKN/cDag= github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3/go.mod h1:ON8b8w4BN/kE1EOhwT0o+d62W65a6aPw1nouo9LMgyY= -github.com/tetafro/godot v1.4.18 h1:ouX3XGiziKDypbpXqShBfnNLTSjR8r3/HVzrtJ+bHlI= -github.com/tetafro/godot v1.4.18/go.mod h1:2oVxTBSftRTh4+MVfUaUXR6bn2GDXCaMcOG4Dk3rfio= -github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966 h1:quvGphlmUVU+nhpFa4gg4yJyTRJ13reZMDHrKwYw53M= -github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966/go.mod h1:27bSVNWSBOHm+qRp1T9qzaIpsWEP6TbUnei/43HK+PQ= +github.com/tetafro/godot v1.4.20 h1:z/p8Ek55UdNvzt4TFn2zx2KscpW4rWqcnUrdmvWJj7E= +github.com/tetafro/godot v1.4.20/go.mod h1:2oVxTBSftRTh4+MVfUaUXR6bn2GDXCaMcOG4Dk3rfio= +github.com/timakin/bodyclose v0.0.0-20241017074812-ed6a65f985e3 h1:y4mJRFlM6fUyPhoXuFg/Yu02fg/nIPFMOY8tOqppoFg= +github.com/timakin/bodyclose v0.0.0-20241017074812-ed6a65f985e3/go.mod h1:mkjARE7Yr8qU23YcGMSALbIxTQ9r9QBVahQOBRfU460= github.com/timonwong/loggercheck v0.10.1 h1:uVZYClxQFpw55eh+PIoqM7uAOHMrhVcDoWDery9R8Lg= github.com/timonwong/loggercheck v0.10.1/go.mod h1:HEAWU8djynujaAVX7QI65Myb8qgfcZ1uKbdpg3ZzKl8= -github.com/tomarrell/wrapcheck/v2 v2.9.0 h1:801U2YCAjLhdN8zhZ/7tdjB3EnAoRlJHt/s+9hijLQ4= -github.com/tomarrell/wrapcheck/v2 v2.9.0/go.mod h1:g9vNIyhb5/9TQgumxQyOEqDHsmGYcGsVMOx/xGkqdMo= +github.com/tomarrell/wrapcheck/v2 v2.10.0 h1:SzRCryzy4IrAH7bVGG4cK40tNUhmVmMDuJujy4XwYDg= +github.com/tomarrell/wrapcheck/v2 v2.10.0/go.mod h1:g9vNIyhb5/9TQgumxQyOEqDHsmGYcGsVMOx/xGkqdMo= github.com/tommy-muehle/go-mnd/v2 v2.5.1 h1:NowYhSdyE/1zwK9QCLeRb6USWdoif80Ie+v+yU8u1Zw= github.com/tommy-muehle/go-mnd/v2 v2.5.1/go.mod h1:WsUAkMJMYww6l/ufffCD3m+P7LEvr8TnZn9lwVDlgzw= -github.com/ultraware/funlen v0.1.0 h1:BuqclbkY6pO+cvxoq7OsktIXZpgBSkYTQtmwhAK81vI= -github.com/ultraware/funlen v0.1.0/go.mod h1:XJqmOQja6DpxarLj6Jj1U7JuoS8PvL4nEqDaQhy22p4= -github.com/ultraware/whitespace v0.1.1 h1:bTPOGejYFulW3PkcrqkeQwOd6NKOOXvmGD9bo/Gk8VQ= -github.com/ultraware/whitespace v0.1.1/go.mod h1:XcP1RLD81eV4BW8UhQlpaR+SDc2givTvyI8a586WjW8= -github.com/uudashr/gocognit v1.1.3 h1:l+a111VcDbKfynh+airAy/DJQKaXh2m9vkoysMPSZyM= -github.com/uudashr/gocognit v1.1.3/go.mod h1:aKH8/e8xbTRBwjbCkwZ8qt4l2EpKXl31KMHgSS+lZ2U= -github.com/uudashr/iface v1.2.1 h1:vHHyzAUmWZ64Olq6NZT3vg/z1Ws56kyPdBOd5kTXDF8= -github.com/uudashr/iface v1.2.1/go.mod h1:4QvspiRd3JLPAEXBQ9AiZpLbJlrWWgRChOKDJEuQTdg= +github.com/ultraware/funlen v0.2.0 h1:gCHmCn+d2/1SemTdYMiKLAHFYxTYz7z9VIDRaTGyLkI= +github.com/ultraware/funlen v0.2.0/go.mod h1:ZE0q4TsJ8T1SQcjmkhN/w+MceuatI6pBFSxxyteHIJA= +github.com/ultraware/whitespace v0.2.0 h1:TYowo2m9Nfj1baEQBjuHzvMRbp19i+RCcRYrSWoFa+g= +github.com/ultraware/whitespace v0.2.0/go.mod h1:XcP1RLD81eV4BW8UhQlpaR+SDc2givTvyI8a586WjW8= +github.com/uudashr/gocognit v1.2.0 h1:3BU9aMr1xbhPlvJLSydKwdLN3tEUUrzPSSM8S4hDYRA= +github.com/uudashr/gocognit v1.2.0/go.mod h1:k/DdKPI6XBZO1q7HgoV2juESI2/Ofj9AcHPZhBBdrTU= +github.com/uudashr/iface v1.3.0 h1:zwPch0fs9tdh9BmL5kcgSpvnObV+yHjO4JjVBl8IA10= +github.com/uudashr/iface v1.3.0/go.mod h1:4QvspiRd3JLPAEXBQ9AiZpLbJlrWWgRChOKDJEuQTdg= github.com/vektah/gqlparser/v2 v2.5.16 h1:1gcmLTvs3JLKXckwCwlUagVn/IlV2bwqle0vJ0vy5p8= github.com/vektah/gqlparser/v2 v2.5.16/go.mod h1:1lz1OeCqgQbQepsGxPVywrjdBHW2T08PUS3pJqepRww= github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= @@ -606,10 +620,11 @@ golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2Uz golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= -golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= -golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= +golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= +golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 h1:e66Fs6Z+fZTbFBAxKfP3PALWBtpfqks2bwGcexMxgtk= golang.org/x/exp v0.0.0-20240909161429-701f63a606c0/go.mod h1:2TbTHSBQa924w8M6Xs1QcRcFwyucIwBGpK1p2f1YFFY= golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= @@ -620,7 +635,6 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= @@ -628,6 +642,7 @@ 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.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= @@ -651,10 +666,11 @@ golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= +golang.org/x/net v0.16.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= -golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= -golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs= golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -665,6 +681,7 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= @@ -674,7 +691,6 @@ golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -695,11 +711,12 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= 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= @@ -713,10 +730,11 @@ golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= -golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= -golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= +golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg= +golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek= 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= @@ -743,23 +761,23 @@ golang.org/x/tools v0.0.0-20200724022722-7017fd6b1305/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200820010801-b793a1359eac/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20201023174141-c8cfbd0f21e6/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1-0.20210205202024-ef80cdb6ec6d/go.mod h1:9bzcO0MWcOuT0tm1iBGzDVPshzfwoVvREIui8C+MHqU= golang.org/x/tools v0.1.1-0.20210302220138-2ac05c832e1a/go.mod h1:9bzcO0MWcOuT0tm1iBGzDVPshzfwoVvREIui8C+MHqU= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= 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.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= golang.org/x/tools v0.11.0/go.mod h1:anzJrxPjNtfgiYQYirP2CPGzGLxrH2u2QBhn6Bf3qY8= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= +golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc= -golang.org/x/tools v0.28.0 h1:WuB6qZ4RPCQo5aP3WdKZS7i595EdWqWR8vqJTlwTVK8= -golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw= +golang.org/x/tools v0.29.0 h1:Xx0h3TtM9rzQpQuR4dKLrdglAmCEN5Oi+P74JdhdzXE= +golang.org/x/tools v0.29.0/go.mod h1:KMQVMRsVxU6nHCFXrBPhDB8XncLNLM0lIy/F14RP588= 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/pkg/ottl/README.md b/pkg/ottl/README.md index b7d7a125f45f..33017a22d0a7 100644 --- a/pkg/ottl/README.md +++ b/pkg/ottl/README.md @@ -4,7 +4,7 @@ | ------------- |-----------| | Stability | [alpha]: traces, metrics, logs | | Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Apkg%2Fottl%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Apkg%2Fottl) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Apkg%2Fottl%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Apkg%2Fottl) | -| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@TylerHelmuth](https://www.github.com/TylerHelmuth), [@kentquirk](https://www.github.com/kentquirk), [@bogdandrutu](https://www.github.com/bogdandrutu), [@evan-bradley](https://www.github.com/evan-bradley) \| Seeking more code owners! | +| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@TylerHelmuth](https://www.github.com/TylerHelmuth), [@kentquirk](https://www.github.com/kentquirk), [@bogdandrutu](https://www.github.com/bogdandrutu), [@evan-bradley](https://www.github.com/evan-bradley), [@edmocosta](https://www.github.com/edmocosta) \| Seeking more code owners! | [alpha]: https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/component-stability.md#alpha diff --git a/pkg/ottl/contexts/internal/map.go b/pkg/ottl/contexts/internal/map.go index 34e891c032c1..9965d6dc5c86 100644 --- a/pkg/ottl/contexts/internal/map.go +++ b/pkg/ottl/contexts/internal/map.go @@ -22,7 +22,11 @@ func GetMapValue[K any](ctx context.Context, tCtx K, m pcommon.Map, keys []ottl. return nil, err } if s == nil { - return nil, fmt.Errorf("non-string indexing is not supported") + resString, err := FetchValueFromExpression[K, string](ctx, tCtx, keys[0]) + if err != nil { + return nil, fmt.Errorf("unable to resolve a string index in map: %w", err) + } + s = resString } val, ok := m.Get(*s) @@ -43,7 +47,11 @@ func SetMapValue[K any](ctx context.Context, tCtx K, m pcommon.Map, keys []ottl. return err } if s == nil { - return fmt.Errorf("non-string indexing is not supported") + resString, err := FetchValueFromExpression[K, string](ctx, tCtx, keys[0]) + if err != nil { + return fmt.Errorf("unable to resolve a string index in map: %w", err) + } + s = resString } currentValue, ok := m.Get(*s) @@ -52,3 +60,22 @@ func SetMapValue[K any](ctx context.Context, tCtx K, m pcommon.Map, keys []ottl. } return setIndexableValue[K](ctx, tCtx, currentValue, val, keys[1:]) } + +func FetchValueFromExpression[K any, T int64 | string](ctx context.Context, tCtx K, key ottl.Key[K]) (*T, error) { + p, err := key.ExpressionGetter(ctx, tCtx) + if err != nil { + return nil, err + } + if p == nil { + return nil, fmt.Errorf("invalid key type") + } + res, err := p.Get(ctx, tCtx) + if err != nil { + return nil, err + } + resVal, ok := res.(T) + if !ok { + return nil, fmt.Errorf("could not resolve key for map/slice, expecting '%T' but got '%T'", resVal, res) + } + return &resVal, nil +} diff --git a/pkg/ottl/contexts/internal/map_test.go b/pkg/ottl/contexts/internal/map_test.go index 18d41462413e..cc1544e18e5e 100644 --- a/pkg/ottl/contexts/internal/map_test.go +++ b/pkg/ottl/contexts/internal/map_test.go @@ -16,6 +16,14 @@ import ( ) func Test_GetMapValue_Invalid(t *testing.T) { + getSetter := &ottl.StandardGetSetter[any]{ + Getter: func(_ context.Context, _ any) (any, error) { + return nil, nil + }, + Setter: func(_ context.Context, _ any, _ any) error { + return nil + }, + } tests := []struct { name string keys []ottl.Key[any] @@ -26,42 +34,49 @@ func Test_GetMapValue_Invalid(t *testing.T) { keys: []ottl.Key[any]{ &TestKey[any]{ I: ottltest.Intp(0), + G: getSetter, }, }, - err: fmt.Errorf("non-string indexing is not supported"), + err: fmt.Errorf("unable to resolve a string index in map: could not resolve key for map/slice, expecting 'string' but got ''"), }, { name: "index map with int", keys: []ottl.Key[any]{ &TestKey[any]{ S: ottltest.Strp("map"), + G: getSetter, }, &TestKey[any]{ I: ottltest.Intp(0), + G: getSetter, }, }, - err: fmt.Errorf("map must be indexed by a string"), + err: fmt.Errorf("unable to resolve a string index in map: could not resolve key for map/slice, expecting 'string' but got ''"), }, { name: "index slice with string", keys: []ottl.Key[any]{ &TestKey[any]{ S: ottltest.Strp("slice"), + G: getSetter, }, &TestKey[any]{ S: ottltest.Strp("invalid"), + G: getSetter, }, }, - err: fmt.Errorf("slice must be indexed by an int"), + err: fmt.Errorf("unable to resolve an integer index in slice: could not resolve key for map/slice, expecting 'int64' but got ''"), }, { name: "index too large", keys: []ottl.Key[any]{ &TestKey[any]{ S: ottltest.Strp("slice"), + G: getSetter, }, &TestKey[any]{ I: ottltest.Intp(1), + G: getSetter, }, }, err: fmt.Errorf("index 1 out of bounds"), @@ -71,9 +86,11 @@ func Test_GetMapValue_Invalid(t *testing.T) { keys: []ottl.Key[any]{ &TestKey[any]{ S: ottltest.Strp("slice"), + G: getSetter, }, &TestKey[any]{ I: ottltest.Intp(-1), + G: getSetter, }, }, err: fmt.Errorf("index -1 out of bounds"), @@ -83,9 +100,11 @@ func Test_GetMapValue_Invalid(t *testing.T) { keys: []ottl.Key[any]{ &TestKey[any]{ S: ottltest.Strp("string"), + G: getSetter, }, &TestKey[any]{ S: ottltest.Strp("string"), + G: getSetter, }, }, err: fmt.Errorf("type Str does not support string indexing"), @@ -102,7 +121,7 @@ func Test_GetMapValue_Invalid(t *testing.T) { s.AppendEmpty() _, err := GetMapValue[any](context.Background(), nil, m, tt.keys) - assert.Equal(t, tt.err, err) + assert.Equal(t, tt.err.Error(), err.Error()) }) } } @@ -129,6 +148,14 @@ func Test_GetMapValue_NilKey(t *testing.T) { } func Test_SetMapValue_Invalid(t *testing.T) { + getSetter := &ottl.StandardGetSetter[any]{ + Getter: func(_ context.Context, _ any) (any, error) { + return nil, nil + }, + Setter: func(_ context.Context, _ any, _ any) error { + return nil + }, + } tests := []struct { name string keys []ottl.Key[any] @@ -139,42 +166,49 @@ func Test_SetMapValue_Invalid(t *testing.T) { keys: []ottl.Key[any]{ &TestKey[any]{ I: ottltest.Intp(0), + G: getSetter, }, }, - err: fmt.Errorf("non-string indexing is not supported"), + err: fmt.Errorf("unable to resolve a string index in map: could not resolve key for map/slice, expecting 'string' but got ''"), }, { name: "index map with int", keys: []ottl.Key[any]{ &TestKey[any]{ S: ottltest.Strp("map"), + G: getSetter, }, &TestKey[any]{ I: ottltest.Intp(0), + G: getSetter, }, }, - err: fmt.Errorf("map must be indexed by a string"), + err: fmt.Errorf("unable to resolve a string index in map: could not resolve key for map/slice, expecting 'string' but got ''"), }, { name: "index slice with string", keys: []ottl.Key[any]{ &TestKey[any]{ S: ottltest.Strp("slice"), + G: getSetter, }, &TestKey[any]{ S: ottltest.Strp("map"), + G: getSetter, }, }, - err: fmt.Errorf("slice must be indexed by an int"), + err: fmt.Errorf("unable to resolve an integer index in slice: could not resolve key for map/slice, expecting 'int64' but got ''"), }, { name: "slice index too large", keys: []ottl.Key[any]{ &TestKey[any]{ S: ottltest.Strp("slice"), + G: getSetter, }, &TestKey[any]{ I: ottltest.Intp(1), + G: getSetter, }, }, err: fmt.Errorf("index 1 out of bounds"), @@ -184,9 +218,11 @@ func Test_SetMapValue_Invalid(t *testing.T) { keys: []ottl.Key[any]{ &TestKey[any]{ S: ottltest.Strp("slice"), + G: getSetter, }, &TestKey[any]{ I: ottltest.Intp(-1), + G: getSetter, }, }, err: fmt.Errorf("index -1 out of bounds"), @@ -196,9 +232,11 @@ func Test_SetMapValue_Invalid(t *testing.T) { keys: []ottl.Key[any]{ &TestKey[any]{ S: ottltest.Strp("string"), + G: getSetter, }, &TestKey[any]{ S: ottltest.Strp("string"), + G: getSetter, }, }, err: fmt.Errorf("type Str does not support string indexing"), @@ -215,7 +253,7 @@ func Test_SetMapValue_Invalid(t *testing.T) { s.AppendEmpty() err := SetMapValue[any](context.Background(), nil, m, tt.keys, "value") - assert.Equal(t, tt.err, err) + assert.Equal(t, tt.err.Error(), err.Error()) }) } } diff --git a/pkg/ottl/contexts/internal/path.go b/pkg/ottl/contexts/internal/path.go index 954d14329646..ebbb12a6eaae 100644 --- a/pkg/ottl/contexts/internal/path.go +++ b/pkg/ottl/contexts/internal/path.go @@ -46,6 +46,7 @@ var _ ottl.Key[any] = &TestKey[any]{} type TestKey[K any] struct { S *string I *int64 + G ottl.Getter[K] } func (k *TestKey[K]) String(_ context.Context, _ K) (*string, error) { @@ -55,3 +56,7 @@ func (k *TestKey[K]) String(_ context.Context, _ K) (*string, error) { func (k *TestKey[K]) Int(_ context.Context, _ K) (*int64, error) { return k.I, nil } + +func (k *TestKey[K]) ExpressionGetter(_ context.Context, _ K) (ottl.Getter[K], error) { + return k.G, nil +} diff --git a/pkg/ottl/contexts/internal/slice.go b/pkg/ottl/contexts/internal/slice.go index 5a90e281a902..9004d08ae836 100644 --- a/pkg/ottl/contexts/internal/slice.go +++ b/pkg/ottl/contexts/internal/slice.go @@ -22,7 +22,11 @@ func GetSliceValue[K any](ctx context.Context, tCtx K, s pcommon.Slice, keys []o return nil, err } if i == nil { - return nil, fmt.Errorf("non-integer indexing is not supported") + resInt, err := FetchValueFromExpression[K, int64](ctx, tCtx, keys[0]) + if err != nil { + return nil, fmt.Errorf("unable to resolve an integer index in slice: %w", err) + } + i = resInt } idx := int(*i) @@ -44,7 +48,11 @@ func SetSliceValue[K any](ctx context.Context, tCtx K, s pcommon.Slice, keys []o return err } if i == nil { - return fmt.Errorf("non-integer indexing is not supported") + resInt, err := FetchValueFromExpression[K, int64](ctx, tCtx, keys[0]) + if err != nil { + return fmt.Errorf("unable to resolve an integer index in slice: %w", err) + } + i = resInt } idx := int(*i) diff --git a/pkg/ottl/contexts/internal/slice_test.go b/pkg/ottl/contexts/internal/slice_test.go index 0f238225251a..8e1b7e0b977b 100644 --- a/pkg/ottl/contexts/internal/slice_test.go +++ b/pkg/ottl/contexts/internal/slice_test.go @@ -16,6 +16,14 @@ import ( ) func Test_GetSliceValue_Invalid(t *testing.T) { + getSetter := &ottl.StandardGetSetter[any]{ + Getter: func(_ context.Context, _ any) (any, error) { + return nil, nil + }, + Setter: func(_ context.Context, _ any, _ any) error { + return nil + }, + } tests := []struct { name string keys []ottl.Key[any] @@ -26,15 +34,17 @@ func Test_GetSliceValue_Invalid(t *testing.T) { keys: []ottl.Key[any]{ &TestKey[any]{ S: ottltest.Strp("key"), + G: getSetter, }, }, - err: fmt.Errorf("non-integer indexing is not supported"), + err: fmt.Errorf(`unable to resolve an integer index in slice: could not resolve key for map/slice, expecting 'int64' but got ''`), }, { name: "index too large", keys: []ottl.Key[any]{ &TestKey[any]{ I: ottltest.Intp(1), + G: getSetter, }, }, err: fmt.Errorf("index 1 out of bounds"), @@ -44,6 +54,7 @@ func Test_GetSliceValue_Invalid(t *testing.T) { keys: []ottl.Key[any]{ &TestKey[any]{ I: ottltest.Intp(-1), + G: getSetter, }, }, err: fmt.Errorf("index -1 out of bounds"), @@ -53,9 +64,11 @@ func Test_GetSliceValue_Invalid(t *testing.T) { keys: []ottl.Key[any]{ &TestKey[any]{ I: ottltest.Intp(0), + G: getSetter, }, &TestKey[any]{ S: ottltest.Strp("string"), + G: getSetter, }, }, err: fmt.Errorf("type Str does not support string indexing"), @@ -68,7 +81,7 @@ func Test_GetSliceValue_Invalid(t *testing.T) { s.AppendEmpty().SetStr("val") _, err := GetSliceValue[any](context.Background(), nil, s, tt.keys) - assert.Equal(t, tt.err, err) + assert.Equal(t, tt.err.Error(), err.Error()) }) } } @@ -79,6 +92,14 @@ func Test_GetSliceValue_NilKey(t *testing.T) { } func Test_SetSliceValue_Invalid(t *testing.T) { + getSetter := &ottl.StandardGetSetter[any]{ + Getter: func(_ context.Context, _ any) (any, error) { + return nil, nil + }, + Setter: func(_ context.Context, _ any, _ any) error { + return nil + }, + } tests := []struct { name string keys []ottl.Key[any] @@ -89,15 +110,17 @@ func Test_SetSliceValue_Invalid(t *testing.T) { keys: []ottl.Key[any]{ &TestKey[any]{ S: ottltest.Strp("key"), + G: getSetter, }, }, - err: fmt.Errorf("non-integer indexing is not supported"), + err: fmt.Errorf(`unable to resolve an integer index in slice: could not resolve key for map/slice, expecting 'int64' but got ''`), }, { name: "index too large", keys: []ottl.Key[any]{ &TestKey[any]{ I: ottltest.Intp(1), + G: getSetter, }, }, err: fmt.Errorf("index 1 out of bounds"), @@ -107,6 +130,7 @@ func Test_SetSliceValue_Invalid(t *testing.T) { keys: []ottl.Key[any]{ &TestKey[any]{ I: ottltest.Intp(-1), + G: getSetter, }, }, err: fmt.Errorf("index -1 out of bounds"), @@ -116,9 +140,11 @@ func Test_SetSliceValue_Invalid(t *testing.T) { keys: []ottl.Key[any]{ &TestKey[any]{ I: ottltest.Intp(0), + G: getSetter, }, &TestKey[any]{ S: ottltest.Strp("string"), + G: getSetter, }, }, err: fmt.Errorf("type Str does not support string indexing"), @@ -131,7 +157,7 @@ func Test_SetSliceValue_Invalid(t *testing.T) { s.AppendEmpty().SetStr("val") err := SetSliceValue[any](context.Background(), nil, s, tt.keys, "value") - assert.Equal(t, tt.err, err) + assert.Equal(t, tt.err.Error(), err.Error()) }) } } diff --git a/pkg/ottl/contexts/internal/value.go b/pkg/ottl/contexts/internal/value.go index ce335854eb3a..34136fe89caf 100644 --- a/pkg/ottl/contexts/internal/value.go +++ b/pkg/ottl/contexts/internal/value.go @@ -71,27 +71,35 @@ func SetValue(value pcommon.Value, val any) error { func getIndexableValue[K any](ctx context.Context, tCtx K, value pcommon.Value, keys []ottl.Key[K]) (any, error) { val := value var ok bool - for i := 0; i < len(keys); i++ { + for index := 0; index < len(keys); index++ { switch val.Type() { case pcommon.ValueTypeMap: - s, err := keys[i].String(ctx, tCtx) + s, err := keys[index].String(ctx, tCtx) if err != nil { return nil, err } if s == nil { - return nil, fmt.Errorf("map must be indexed by a string") + resString, err := FetchValueFromExpression[K, string](ctx, tCtx, keys[index]) + if err != nil { + return nil, fmt.Errorf("unable to resolve a string index in map: %w", err) + } + s = resString } val, ok = val.Map().Get(*s) if !ok { return nil, nil } case pcommon.ValueTypeSlice: - i, err := keys[i].Int(ctx, tCtx) + i, err := keys[index].Int(ctx, tCtx) if err != nil { return nil, err } if i == nil { - return nil, fmt.Errorf("slice must be indexed by an int") + resInt, err := FetchValueFromExpression[K, int64](ctx, tCtx, keys[index]) + if err != nil { + return nil, fmt.Errorf("unable to resolve an integer index in slice: %w", err) + } + i = resInt } if int(*i) >= val.Slice().Len() || int(*i) < 0 { return nil, fmt.Errorf("index %v out of bounds", *i) @@ -117,15 +125,19 @@ func setIndexableValue[K any](ctx context.Context, tCtx K, currentValue pcommon. return err } - for i := 0; i < len(keys); i++ { + for index := 0; index < len(keys); index++ { switch currentValue.Type() { case pcommon.ValueTypeMap: - s, err := keys[i].String(ctx, tCtx) + s, err := keys[index].String(ctx, tCtx) if err != nil { return err } if s == nil { - return errors.New("map must be indexed by a string") + resString, err := FetchValueFromExpression[K, string](ctx, tCtx, keys[index]) + if err != nil { + return fmt.Errorf("unable to resolve a string index in map: %w", err) + } + s = resString } potentialValue, ok := currentValue.Map().Get(*s) if !ok { @@ -134,23 +146,27 @@ func setIndexableValue[K any](ctx context.Context, tCtx K, currentValue pcommon. currentValue = potentialValue } case pcommon.ValueTypeSlice: - i, err := keys[i].Int(ctx, tCtx) + i, err := keys[index].Int(ctx, tCtx) if err != nil { return err } if i == nil { - return errors.New("slice must be indexed by an int") + resInt, err := FetchValueFromExpression[K, int64](ctx, tCtx, keys[index]) + if err != nil { + return fmt.Errorf("unable to resolve an integer index in slice: %w", err) + } + i = resInt } if int(*i) >= currentValue.Slice().Len() || int(*i) < 0 { return fmt.Errorf("index %v out of bounds", *i) } currentValue = currentValue.Slice().At(int(*i)) case pcommon.ValueTypeEmpty: - s, err := keys[i].String(ctx, tCtx) + s, err := keys[index].String(ctx, tCtx) if err != nil { return err } - i, err := keys[i].Int(ctx, tCtx) + i, err := keys[index].Int(ctx, tCtx) if err != nil { return err } @@ -164,7 +180,20 @@ func setIndexableValue[K any](ctx context.Context, tCtx K, currentValue pcommon. } currentValue = currentValue.Slice().AppendEmpty() default: - return errors.New("neither a string nor an int index was given, this is an error in the OTTL") + resString, errString := FetchValueFromExpression[K, string](ctx, tCtx, keys[index]) + resInt, errInt := FetchValueFromExpression[K, int64](ctx, tCtx, keys[index]) + switch { + case errInt == nil: + currentValue.SetEmptySlice() + for k := 0; k < int(*resInt); k++ { + currentValue.Slice().AppendEmpty() + } + currentValue = currentValue.Slice().AppendEmpty() + case errString == nil: + currentValue = currentValue.SetEmptyMap().PutEmpty(*resString) + default: + return errors.New("neither a string nor an int index was given, this is an error in the OTTL") + } } default: return fmt.Errorf("type %v does not support string indexing", currentValue.Type()) diff --git a/pkg/ottl/contexts/internal/value_test.go b/pkg/ottl/contexts/internal/value_test.go index 5be89f72ea46..726fd6de5eaa 100644 --- a/pkg/ottl/contexts/internal/value_test.go +++ b/pkg/ottl/contexts/internal/value_test.go @@ -13,10 +13,10 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" ) -func Test_SetIndexableValue_EmptyValueNoIndex(t *testing.T) { +func Test_SetIndexableValue_InvalidValue(t *testing.T) { keys := []ottl.Key[any]{ &TestKey[any]{}, } - err := setIndexableValue[any](context.Background(), nil, pcommon.NewValueEmpty(), nil, keys) + err := setIndexableValue[any](context.Background(), nil, pcommon.NewValueStr("str"), nil, keys) assert.Error(t, err) } diff --git a/pkg/ottl/e2e/e2e_test.go b/pkg/ottl/e2e/e2e_test.go index 72077e66dd23..a11d78a72305 100644 --- a/pkg/ottl/e2e/e2e_test.go +++ b/pkg/ottl/e2e/e2e_test.go @@ -308,10 +308,10 @@ func Test_e2e_editors(t *testing.T) { logStatements, err := logParser.ParseStatement(tt.statement) assert.NoError(t, err) - tCtx := constructLogTransformContext() + tCtx := constructLogTransformContextEditors() _, _, _ = logStatements.Execute(context.Background(), tCtx) - exTCtx := constructLogTransformContext() + exTCtx := constructLogTransformContextEditors() tt.want(exTCtx) assert.NoError(t, plogtest.CompareResourceLogs(newResourceLogs(exTCtx), newResourceLogs(tCtx))) @@ -323,7 +323,88 @@ func Test_e2e_converters(t *testing.T) { tests := []struct { statement string want func(tCtx ottllog.TransformContext) + wantErr bool + errMsg string }{ + { + statement: `set(attributes["newOne"], attributes[1])`, + want: func(_ ottllog.TransformContext) {}, + errMsg: "unable to resolve a string index in map: invalid key type", + }, + { + statement: `set(attributes["array"][0.0], "bar")`, + want: func(_ ottllog.TransformContext) {}, + errMsg: "unable to resolve an integer index in slice: invalid key type", + }, + { + statement: `set(attributes["array"][ConvertCase(attributes["A|B|C"], "upper")], "bar")`, + want: func(_ ottllog.TransformContext) {}, + errMsg: "unable to resolve an integer index in slice: could not resolve key for map/slice, expecting 'int64'", + }, + { + statement: `set(attributes[ConvertCase(attributes["A|B|C"], "upper")], "myvalue")`, + want: func(tCtx ottllog.TransformContext) { + tCtx.GetLogRecord().Attributes().PutStr("SOMETHING", "myvalue") + }, + }, + { + statement: `set(attributes[ConvertCase(attributes[attributes["flags"]], "upper")], "myvalue")`, + want: func(tCtx ottllog.TransformContext) { + tCtx.GetLogRecord().Attributes().PutStr("SOMETHING", "myvalue") + }, + }, + { + statement: `set(attributes[attributes["flags"]], "something33")`, + want: func(tCtx ottllog.TransformContext) { + tCtx.GetLogRecord().Attributes().PutStr("A|B|C", "something33") + }, + }, + { + statement: `set(attributes[attributes[attributes["flags"]]], "something2")`, + want: func(tCtx ottllog.TransformContext) { + tCtx.GetLogRecord().Attributes().PutStr("something", "something2") + }, + }, + { + statement: `set(body, attributes[attributes["foo"][attributes["slice"]][attributes["int_value"]]])`, + want: func(tCtx ottllog.TransformContext) { + tCtx.GetLogRecord().Body().SetStr("val2") + }, + }, + { + statement: `set(resource.attributes[attributes["flags"]], "something33")`, + want: func(tCtx ottllog.TransformContext) { + tCtx.GetResource().Attributes().PutStr("A|B|C", "something33") + }, + }, + { + statement: `set(resource.attributes[resource.attributes[attributes["flags"]]], "something33")`, + want: func(tCtx ottllog.TransformContext) { + tCtx.GetResource().Attributes().PutStr("newValue", "something33") + }, + }, + { + statement: `set(attributes[resource.attributes[attributes["flags"]]], "something33")`, + want: func(tCtx ottllog.TransformContext) { + tCtx.GetLogRecord().Attributes().PutStr("newValue", "something33") + }, + }, + { + statement: `set(body, attributes["array"])`, + want: func(tCtx ottllog.TransformContext) { + arr := tCtx.GetLogRecord().Body().SetEmptySlice() + arr0 := arr.AppendEmpty() + arr0.SetStr("looong") + }, + }, + { + statement: `set(attributes["array"][attributes["int_value"]], 3)`, + want: func(tCtx ottllog.TransformContext) { + arr := tCtx.GetLogRecord().Attributes().PutEmptySlice("array") + arr0 := arr.AppendEmpty() + arr0.SetInt(3) + }, + }, { statement: `set(attributes["test"], Base64Decode("cGFzcw=="))`, want: func(tCtx ottllog.TransformContext) { @@ -965,7 +1046,12 @@ func Test_e2e_converters(t *testing.T) { assert.NoError(t, err) tCtx := constructLogTransformContext() - _, _, _ = logStatements.Execute(context.Background(), tCtx) + _, _, err = logStatements.Execute(context.Background(), tCtx) + if tt.errMsg == "" { + assert.NoError(t, err) + } else { + assert.Contains(t, err.Error(), tt.errMsg) + } exTCtx := constructLogTransformContext() tt.want(exTCtx) @@ -993,6 +1079,13 @@ func Test_e2e_ottl_features(t *testing.T) { tCtx.GetLogRecord().Attributes().PutStr("test", "pass") }, }, + { + name: "where clause with dynamic indexing", + statement: `set(attributes["foo"], "bar") where attributes[attributes["flags"]] != nil`, + want: func(tCtx ottllog.TransformContext) { + tCtx.GetLogRecord().Attributes().PutStr("foo", "bar") + }, + }, { name: "Using enums", statement: `set(severity_number, SEVERITY_NUMBER_TRACE2) where severity_number == SEVERITY_NUMBER_TRACE`, @@ -1125,6 +1218,57 @@ func Test_ProcessTraces_TraceContext(t *testing.T) { func constructLogTransformContext() ottllog.TransformContext { resource := pcommon.NewResource() resource.Attributes().PutStr("host.name", "localhost") + resource.Attributes().PutStr("A|B|C", "newValue") + + scope := pcommon.NewInstrumentationScope() + scope.SetName("scope") + + logRecord := plog.NewLogRecord() + logRecord.Body().SetStr("operationA") + logRecord.SetTimestamp(TestLogTimestamp) + logRecord.SetObservedTimestamp(TestObservedTimestamp) + logRecord.SetDroppedAttributesCount(1) + logRecord.SetFlags(plog.DefaultLogRecordFlags.WithIsSampled(true)) + logRecord.SetSeverityNumber(1) + logRecord.SetTraceID(traceID) + logRecord.SetSpanID(spanID) + logRecord.Attributes().PutStr("http.method", "get") + logRecord.Attributes().PutStr("http.path", "/health") + logRecord.Attributes().PutStr("http.url", "http://localhost/health") + logRecord.Attributes().PutStr("flags", "A|B|C") + logRecord.Attributes().PutStr("total.string", "123456789") + logRecord.Attributes().PutStr("A|B|C", "something") + logRecord.Attributes().PutStr("foo", "foo") + logRecord.Attributes().PutStr("slice", "slice") + logRecord.Attributes().PutStr("val", "val2") + logRecord.Attributes().PutInt("int_value", 0) + arr := logRecord.Attributes().PutEmptySlice("array") + arr0 := arr.AppendEmpty() + arr0.SetStr("looong") + m := logRecord.Attributes().PutEmptyMap("foo") + m.PutStr("bar", "pass") + m.PutStr("flags", "pass") + s := m.PutEmptySlice("slice") + v := s.AppendEmpty() + v.SetStr("val") + m2 := m.PutEmptyMap("nested") + m2.PutStr("test", "pass") + + s2 := logRecord.Attributes().PutEmptySlice("things") + thing1 := s2.AppendEmpty().SetEmptyMap() + thing1.PutStr("name", "foo") + thing1.PutInt("value", 2) + + thing2 := s2.AppendEmpty().SetEmptyMap() + thing2.PutStr("name", "bar") + thing2.PutInt("value", 5) + + return ottllog.NewTransformContext(logRecord, scope, resource, plog.NewScopeLogs(), plog.NewResourceLogs()) +} + +func constructLogTransformContextEditors() ottllog.TransformContext { + resource := pcommon.NewResource() + resource.Attributes().PutStr("host.name", "localhost") scope := pcommon.NewInstrumentationScope() scope.SetName("scope") diff --git a/pkg/ottl/functions.go b/pkg/ottl/functions.go index 4ff92123c7e6..5740328fa1c2 100644 --- a/pkg/ottl/functions.go +++ b/pkg/ottl/functions.go @@ -53,6 +53,17 @@ func buildOriginalKeysText(keys []key) string { if k.String != nil { builder.WriteString(*k.String) } + if k.Expression != nil { + if k.Expression.Path != nil { + builder.WriteString(buildOriginalText(k.Expression.Path)) + } + if k.Expression.Float != nil { + builder.WriteString(strconv.FormatFloat(*k.Expression.Float, 'f', 10, 64)) + } + if k.Expression.Int != nil { + builder.WriteString(strconv.FormatInt(*k.Expression.Int, 10)) + } + } builder.WriteString("]") } } @@ -72,10 +83,14 @@ func (p *Parser[K]) newPath(path *path) (*basePath[K], error) { originalText := buildOriginalText(path) var current *basePath[K] for i := len(fields) - 1; i >= 0; i-- { + keys, err := p.newKeys(fields[i].Keys) + if err != nil { + return nil, err + } current = &basePath[K]{ context: pathContext, name: fields[i].Name, - keys: newKeys[K](fields[i].Keys), + keys: keys, nextPath: current, originalText: originalText, } @@ -203,18 +218,36 @@ func (p *basePath[K]) isComplete() error { return p.nextPath.isComplete() } -func newKeys[K any](keys []key) []Key[K] { +func (p *Parser[K]) newKeys(keys []key) ([]Key[K], error) { if len(keys) == 0 { - return nil + return nil, nil } ks := make([]Key[K], len(keys)) for i := range keys { + var getter Getter[K] + if keys[i].Expression != nil { + if keys[i].Expression.Path != nil { + g, err := p.buildGetSetterFromPath(keys[i].Expression.Path) + if err != nil { + return nil, err + } + getter = g + } + if keys[i].Expression.Converter != nil { + g, err := p.newGetterFromConverter(*keys[i].Expression.Converter) + if err != nil { + return nil, err + } + getter = g + } + } ks[i] = &baseKey[K]{ s: keys[i].String, i: keys[i].Int, + g: getter, } } - return ks + return ks, nil } // Key represents a chain of keys in an OTTL statement, such as `attributes["foo"]["bar"]`. @@ -230,6 +263,12 @@ type Key[K any] interface { // If the Key does not have a int value the returned value is nil. // If Key experiences an error retrieving the value it is returned. Int(context.Context, K) (*int64, error) + + // ExpressionGetter returns a Getter to the expression, that can be + // part of the path. + // If the Key does not have an expression the returned value is nil. + // If Key experiences an error retrieving the value it is returned. + ExpressionGetter(context.Context, K) (Getter[K], error) } var _ Key[any] = &baseKey[any]{} @@ -237,6 +276,7 @@ var _ Key[any] = &baseKey[any]{} type baseKey[K any] struct { s *string i *int64 + g Getter[K] } func (k *baseKey[K]) String(_ context.Context, _ K) (*string, error) { @@ -247,6 +287,10 @@ func (k *baseKey[K]) Int(_ context.Context, _ K) (*int64, error) { return k.i, nil } +func (k *baseKey[K]) ExpressionGetter(_ context.Context, _ K) (Getter[K], error) { + return k.g, nil +} + func (p *Parser[K]) parsePath(ip *basePath[K]) (GetSetter[K], error) { g, err := p.pathParser(ip) if err != nil { @@ -474,6 +518,18 @@ func (p *Parser[K]) buildSliceArg(argVal value, argType reflect.Type) (any, erro } } +func (p *Parser[K]) buildGetSetterFromPath(path *path) (GetSetter[K], error) { + np, err := p.newPath(path) + if err != nil { + return nil, err + } + arg, err := p.parsePath(np) + if err != nil { + return nil, err + } + return arg, nil +} + // Handle interfaces that can be passed as arguments to OTTL functions. func (p *Parser[K]) buildArg(argVal value, argType reflect.Type) (any, error) { name := argType.Name() @@ -481,18 +537,10 @@ func (p *Parser[K]) buildArg(argVal value, argType reflect.Type) (any, error) { case strings.HasPrefix(name, "Setter"): fallthrough case strings.HasPrefix(name, "GetSetter"): - if argVal.Literal == nil || argVal.Literal.Path == nil { - return nil, fmt.Errorf("must be a path") + if argVal.Literal != nil && argVal.Literal.Path != nil { + return p.buildGetSetterFromPath(argVal.Literal.Path) } - np, err := p.newPath(argVal.Literal.Path) - if err != nil { - return nil, err - } - arg, err := p.parsePath(np) - if err != nil { - return nil, err - } - return arg, nil + return nil, fmt.Errorf("must be a path") case strings.HasPrefix(name, "Getter"): arg, err := p.newGetter(argVal) if err != nil { diff --git a/pkg/ottl/functions_test.go b/pkg/ottl/functions_test.go index a7bd4aef87c7..bb81c316dd27 100644 --- a/pkg/ottl/functions_test.go +++ b/pkg/ottl/functions_test.go @@ -2525,6 +2525,13 @@ func Test_baseKey_Int(t *testing.T) { } func Test_newKey(t *testing.T) { + ps, _ := NewParser[any]( + defaultFunctionsForTests(), + testParsePath[any], + componenttest.NewNopTelemetrySettings(), + WithEnumParser[any](testParseEnum), + WithPathContextNames[any]([]string{"log"}), + ) keys := []key{ { String: ottltest.Strp("foo"), @@ -2533,7 +2540,7 @@ func Test_newKey(t *testing.T) { String: ottltest.Strp("bar"), }, } - ks := newKeys[any](keys) + ks, _ := ps.newKeys(keys) assert.Len(t, ks, 2) diff --git a/pkg/ottl/go.mod b/pkg/ottl/go.mod index ad4d5969ab59..1ca19e502e7f 100644 --- a/pkg/ottl/go.mod +++ b/pkg/ottl/go.mod @@ -23,7 +23,7 @@ require ( go.uber.org/goleak v1.3.0 go.uber.org/zap v1.27.0 golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 - golang.org/x/net v0.33.0 + golang.org/x/net v0.34.0 golang.org/x/text v0.21.0 ) @@ -48,7 +48,7 @@ require ( go.opentelemetry.io/otel/sdk v1.32.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.32.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/sys v0.29.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.69.2 // indirect google.golang.org/protobuf v1.36.2 // indirect diff --git a/pkg/ottl/go.sum b/pkg/ottl/go.sum index c9b92d3df521..7f1b4c1dfdb0 100644 --- a/pkg/ottl/go.sum +++ b/pkg/ottl/go.sum @@ -125,8 +125,9 @@ golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= -golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= 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= @@ -148,8 +149,9 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= diff --git a/pkg/ottl/grammar.go b/pkg/ottl/grammar.go index b7d6743f4afa..8a79ca978db6 100644 --- a/pkg/ottl/grammar.go +++ b/pkg/ottl/grammar.go @@ -270,15 +270,35 @@ type path struct { Fields []field `parser:"@@ ( '.' @@ )*"` } +func (p *path) accept(v grammarVisitor) { + v.visitPath(p) + for _, field := range p.Fields { + field.accept(v) + } +} + // field is an item within a path. type field struct { Name string `parser:"@Lowercase"` Keys []key `parser:"( @@ )*"` } +func (f *field) accept(v grammarVisitor) { + for _, key := range f.Keys { + key.accept(v) + } +} + type key struct { - String *string `parser:"'[' (@String "` - Int *int64 `parser:"| @Int) ']'"` + String *string `parser:"'[' (@String "` + Int *int64 `parser:"| @Int"` + Expression *mathExprLiteral `parser:"| @@ ) ']'"` +} + +func (k *key) accept(v grammarVisitor) { + if k.Expression != nil { + k.Expression.accept(v) + } } type list struct { @@ -343,7 +363,7 @@ type mathExprLiteral struct { func (m *mathExprLiteral) accept(v grammarVisitor) { v.visitMathExprLiteral(m) if m.Path != nil { - v.visitPath(m.Path) + m.Path.accept(v) } if m.Editor != nil { m.Editor.accept(v) diff --git a/pkg/ottl/lexer_test.go b/pkg/ottl/lexer_test.go index b73d71d80e8f..4cd54f3fd9b8 100644 --- a/pkg/ottl/lexer_test.go +++ b/pkg/ottl/lexer_test.go @@ -130,6 +130,15 @@ func Test_lexer(t *testing.T) { {"String", `"bar"`}, {"RBrace", "}"}, }}, + {"Dynamic path", `attributes[attributes["foo"]]`, false, []result{ + {"Lowercase", "attributes"}, + {"Punct", "["}, + {"Lowercase", "attributes"}, + {"Punct", "["}, + {"String", `"foo"`}, + {"Punct", "]"}, + {"Punct", "]"}, + }}, } for _, tt := range tests { diff --git a/pkg/ottl/metadata.yaml b/pkg/ottl/metadata.yaml index b326d06fb184..b1ad2216dd44 100644 --- a/pkg/ottl/metadata.yaml +++ b/pkg/ottl/metadata.yaml @@ -5,5 +5,5 @@ status: stability: alpha: [ traces, metrics, logs ] codeowners: - active: [TylerHelmuth, kentquirk, bogdandrutu, evan-bradley] + active: [TylerHelmuth, kentquirk, bogdandrutu, evan-bradley, edmocosta] seeking_new: true \ No newline at end of file diff --git a/pkg/ottl/ottlfuncs/README.md b/pkg/ottl/ottlfuncs/README.md index 8e48eb3083b2..ac86e36fc297 100644 --- a/pkg/ottl/ottlfuncs/README.md +++ b/pkg/ottl/ottlfuncs/README.md @@ -444,6 +444,7 @@ Available Converters: - [Minute](#minute) - [Minutes](#minutes) - [Month](#month) +- [Nanosecond](#nanosecond) - [Nanoseconds](#nanoseconds) - [Now](#now) - [ParseCSV](#parsecsv) @@ -452,6 +453,7 @@ Available Converters: - [ParseSimplifiedXML](#parsesimplifiedxml) - [ParseXML](#parsexml) - [RemoveXML](#removexml) +- [Second](#second) - [Seconds](#seconds) - [SHA1](#sha1) - [SHA256](#sha256) @@ -1237,6 +1239,20 @@ Examples: - `Month(Now())` +### Nanosecond + +`Nanosecond(value)` + +The `Nanosecond` Converter returns the nanosecond component from the specified time using the Go stdlib [`time.Nanosecond` function](https://pkg.go.dev/time#Time.Nanosecond). + +`value` is a `time.Time`. If `value` is another type, an error is returned. + +The returned type is `int64`. + +Examples: + +- `Nanosecond(Now())` + ### Nanoseconds `Nanoseconds(value)` @@ -1611,6 +1627,20 @@ Delete text from nodes that contain the word "sensitive" - `RemoveXML(body, "//*[contains(text(), 'sensitive')]")` +### Second + +`Second(value)` + +The `Second` Converter returns the second component from the specified time using the Go stdlib [`time.Second` function](https://pkg.go.dev/time#Time.Second). + +`value` is a `time.Time`. If `value` is another type, an error is returned. + +The returned type is `int64`. + +Examples: + +- `Second(Now())` + ### Seconds `Seconds(value)` diff --git a/pkg/ottl/ottlfuncs/func_nanosecond.go b/pkg/ottl/ottlfuncs/func_nanosecond.go new file mode 100644 index 000000000000..f35a72e2cfdd --- /dev/null +++ b/pkg/ottl/ottlfuncs/func_nanosecond.go @@ -0,0 +1,39 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package ottlfuncs // import "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/ottlfuncs" + +import ( + "context" + "fmt" + + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" +) + +type NanosecondArguments[K any] struct { + Time ottl.TimeGetter[K] +} + +func NewNanosecondFactory[K any]() ottl.Factory[K] { + return ottl.NewFactory("Nanosecond", &NanosecondArguments[K]{}, createNanosecondFunction[K]) +} + +func createNanosecondFunction[K any](_ ottl.FunctionContext, oArgs ottl.Arguments) (ottl.ExprFunc[K], error) { + args, ok := oArgs.(*NanosecondArguments[K]) + + if !ok { + return nil, fmt.Errorf("NanosecondFactory args must be of type *NanosecondArguments[K]") + } + + return Nanosecond(args.Time) +} + +func Nanosecond[K any](time ottl.TimeGetter[K]) (ottl.ExprFunc[K], error) { + return func(ctx context.Context, tCtx K) (any, error) { + t, err := time.Get(ctx, tCtx) + if err != nil { + return nil, err + } + return int64(t.Nanosecond()), nil + }, nil +} diff --git a/pkg/ottl/ottlfuncs/func_nanosecond_test.go b/pkg/ottl/ottlfuncs/func_nanosecond_test.go new file mode 100644 index 000000000000..6383ce89d544 --- /dev/null +++ b/pkg/ottl/ottlfuncs/func_nanosecond_test.go @@ -0,0 +1,54 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package ottlfuncs + +import ( + "context" + "testing" + "time" + + "github.com/stretchr/testify/assert" + + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" +) + +func Test_Nanosecond(t *testing.T) { + tests := []struct { + name string + time ottl.TimeGetter[any] + expected int64 + }{ + { + name: "some time", + time: &ottl.StandardTimeGetter[any]{ + Getter: func(_ context.Context, _ any) (any, error) { + return time.Date(2006, time.January, 2, 15, 4, 5, 197382465, time.UTC), nil + }, + }, + expected: 197382465, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + exprFunc, err := Nanosecond(tt.time) + assert.NoError(t, err) + result, err := exprFunc(nil, nil) + assert.NoError(t, err) + assert.Equal(t, tt.expected, result) + }) + } +} + +func Test_Nanosecond_Error(t *testing.T) { + var getter ottl.TimeGetter[any] = &ottl.StandardTimeGetter[any]{ + Getter: func(_ context.Context, _ any) (any, error) { + return "not a time", nil + }, + } + exprFunc, err := Nanosecond(getter) + assert.NoError(t, err) + result, err := exprFunc(context.Background(), nil) + assert.Nil(t, result) + assert.Error(t, err) +} diff --git a/pkg/ottl/ottlfuncs/func_second.go b/pkg/ottl/ottlfuncs/func_second.go new file mode 100644 index 000000000000..1e8306aad5ef --- /dev/null +++ b/pkg/ottl/ottlfuncs/func_second.go @@ -0,0 +1,39 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package ottlfuncs // import "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/ottlfuncs" + +import ( + "context" + "fmt" + + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" +) + +type SecondArguments[K any] struct { + Time ottl.TimeGetter[K] +} + +func NewSecondFactory[K any]() ottl.Factory[K] { + return ottl.NewFactory("Second", &SecondArguments[K]{}, createSecondFunction[K]) +} + +func createSecondFunction[K any](_ ottl.FunctionContext, oArgs ottl.Arguments) (ottl.ExprFunc[K], error) { + args, ok := oArgs.(*SecondArguments[K]) + + if !ok { + return nil, fmt.Errorf("SecondFactory args must be of type *SecondArguments[K]") + } + + return Second(args.Time) +} + +func Second[K any](time ottl.TimeGetter[K]) (ottl.ExprFunc[K], error) { + return func(ctx context.Context, tCtx K) (any, error) { + t, err := time.Get(ctx, tCtx) + if err != nil { + return nil, err + } + return int64(t.Second()), nil + }, nil +} diff --git a/pkg/ottl/ottlfuncs/func_second_test.go b/pkg/ottl/ottlfuncs/func_second_test.go new file mode 100644 index 000000000000..75e9e3b3438f --- /dev/null +++ b/pkg/ottl/ottlfuncs/func_second_test.go @@ -0,0 +1,54 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package ottlfuncs + +import ( + "context" + "testing" + "time" + + "github.com/stretchr/testify/assert" + + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" +) + +func Test_Second(t *testing.T) { + tests := []struct { + name string + time ottl.TimeGetter[any] + expected int64 + }{ + { + name: "some time", + time: &ottl.StandardTimeGetter[any]{ + Getter: func(_ context.Context, _ any) (any, error) { + return time.Date(2006, time.January, 2, 15, 4, 5, 0, time.UTC), nil + }, + }, + expected: 5, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + exprFunc, err := Second(tt.time) + assert.NoError(t, err) + result, err := exprFunc(nil, nil) + assert.NoError(t, err) + assert.Equal(t, tt.expected, result) + }) + } +} + +func Test_Second_Error(t *testing.T) { + var getter ottl.TimeGetter[any] = &ottl.StandardTimeGetter[any]{ + Getter: func(_ context.Context, _ any) (any, error) { + return "not a time", nil + }, + } + exprFunc, err := Second(getter) + assert.NoError(t, err) + result, err := exprFunc(context.Background(), nil) + assert.Nil(t, result) + assert.Error(t, err) +} diff --git a/pkg/ottl/ottlfuncs/functions.go b/pkg/ottl/ottlfuncs/functions.go index efd8480fc691..d00bc578e04b 100644 --- a/pkg/ottl/ottlfuncs/functions.go +++ b/pkg/ottl/ottlfuncs/functions.go @@ -68,6 +68,7 @@ func converters[K any]() []ottl.Factory[K] { NewMinuteFactory[K](), NewMinutesFactory[K](), NewMonthFactory[K](), + NewNanosecondFactory[K](), NewNanosecondsFactory[K](), NewNowFactory[K](), NewParseCSVFactory[K](), @@ -76,6 +77,7 @@ func converters[K any]() []ottl.Factory[K] { NewParseSimplifiedXMLFactory[K](), NewParseXMLFactory[K](), NewRemoveXMLFactory[K](), + NewSecondFactory[K](), NewSecondsFactory[K](), NewSHA1Factory[K](), NewSHA256Factory[K](), diff --git a/pkg/stanza/docs/operators/severity_parser.md b/pkg/stanza/docs/operators/severity_parser.md index c78f133a0900..2df648c9ad97 100644 --- a/pkg/stanza/docs/operators/severity_parser.md +++ b/pkg/stanza/docs/operators/severity_parser.md @@ -12,7 +12,7 @@ The `severity_parser` operator sets the severity on an entry by parsing a value | `on_error` | `send` | The behavior of the operator if it encounters an error. See [on_error](../types/on_error.md). | | `preset` | `default` | A predefined set of values that should be interpreted at specific severity levels. | | `mapping` | | A formatted set of values that should be interpreted as severity levels. | -| `overwrite_with` | `false` | If `true`, the severity text will be set to the [standard short name](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md#displaying-severity) corresponding to the severity number. | +| `overwrite_text` | `false` | If `true`, the severity text will be set to the [standard short name](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md#displaying-severity) corresponding to the severity number. | | `if` | | An [expression](../types/expression.md) that, when set, will be evaluated to determine whether this operator should be used for the given entry. This allows you to do easy conditional parsing without branching logic with routers. | ### Example Configurations diff --git a/pkg/stanza/go.mod b/pkg/stanza/go.mod index ff13e16844a9..9da68fdeb995 100644 --- a/pkg/stanza/go.mod +++ b/pkg/stanza/go.mod @@ -37,7 +37,7 @@ require ( 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.28.0 + golang.org/x/sys v0.29.0 golang.org/x/text v0.21.0 gonum.org/v1/gonum v0.15.1 gopkg.in/yaml.v2 v2.4.0 diff --git a/pkg/stanza/go.sum b/pkg/stanza/go.sum index 6161a2fcaab1..88e4cfa2014c 100644 --- a/pkg/stanza/go.sum +++ b/pkg/stanza/go.sum @@ -158,8 +158,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.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.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.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= diff --git a/pkg/winperfcounters/go.mod b/pkg/winperfcounters/go.mod index 35755baf3705..493301abd92c 100644 --- a/pkg/winperfcounters/go.mod +++ b/pkg/winperfcounters/go.mod @@ -5,7 +5,7 @@ go 1.22.0 require ( github.com/stretchr/testify v1.10.0 go.uber.org/goleak v1.3.0 - golang.org/x/sys v0.28.0 + golang.org/x/sys v0.29.0 ) require ( diff --git a/pkg/winperfcounters/go.sum b/pkg/winperfcounters/go.sum index 362186474ed2..756c6566f6fb 100644 --- a/pkg/winperfcounters/go.sum +++ b/pkg/winperfcounters/go.sum @@ -18,8 +18,8 @@ github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOf github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= -golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= diff --git a/processor/attributesprocessor/factory_test.go b/processor/attributesprocessor/factory_test.go index c210ffd08a1d..72a26027ba52 100644 --- a/processor/attributesprocessor/factory_test.go +++ b/processor/attributesprocessor/factory_test.go @@ -91,7 +91,7 @@ func TestFactory_CreateMetrics(t *testing.T) { {Key: "fake_key", Action: attraction.UPSERT}, } - // Upsert should fail on non-existent key + // Upsert should fail on nonexistent key mp, err = factory.CreateMetrics(context.Background(), processortest.NewNopSettings(), cfg, consumertest.NewNop()) require.Nil(t, mp) require.Error(t, err) diff --git a/processor/attributesprocessor/go.mod b/processor/attributesprocessor/go.mod index 008274f8045e..157c9a6bbfa4 100644 --- a/processor/attributesprocessor/go.mod +++ b/processor/attributesprocessor/go.mod @@ -71,8 +71,8 @@ require ( go.opentelemetry.io/otel/trace v1.32.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect - golang.org/x/net v0.33.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/net v0.34.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.69.2 // indirect diff --git a/processor/attributesprocessor/go.sum b/processor/attributesprocessor/go.sum index 1f3fbaf37f22..a62258846951 100644 --- a/processor/attributesprocessor/go.sum +++ b/processor/attributesprocessor/go.sum @@ -169,8 +169,9 @@ golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= -golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= 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= @@ -192,8 +193,9 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= diff --git a/processor/attributesprocessor/testdata/config.yaml b/processor/attributesprocessor/testdata/config.yaml index ec78f3b09c96..8f0f7dbb09a8 100644 --- a/processor/attributesprocessor/testdata/config.yaml +++ b/processor/attributesprocessor/testdata/config.yaml @@ -33,7 +33,7 @@ attributes/regex_insert: # http_path: path # http_query_params=queryParam1=value1,queryParam2=value2 # http.url value does NOT change. - # Note: Similar to the Span Procesor, if a target key already exists, + # Note: Similar to the Span Processor, if a target key already exists, # it will be updated. - key: "http.url" pattern: ^(?P.*):\/\/(?P.*)\/(?P.*)(\?|\&)(?P.*) diff --git a/processor/cumulativetodeltaprocessor/go.mod b/processor/cumulativetodeltaprocessor/go.mod index d9b230214734..11505d828b32 100644 --- a/processor/cumulativetodeltaprocessor/go.mod +++ b/processor/cumulativetodeltaprocessor/go.mod @@ -50,8 +50,8 @@ require ( go.opentelemetry.io/otel/sdk/metric v1.32.0 // indirect go.opentelemetry.io/otel/trace v1.32.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/net v0.33.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/net v0.34.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.69.2 // indirect diff --git a/processor/cumulativetodeltaprocessor/go.sum b/processor/cumulativetodeltaprocessor/go.sum index 8dc2d9c33c28..9008a8b6e7a6 100644 --- a/processor/cumulativetodeltaprocessor/go.sum +++ b/processor/cumulativetodeltaprocessor/go.sum @@ -109,16 +109,16 @@ 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.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= -golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= 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.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.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.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= diff --git a/processor/cumulativetodeltaprocessor/internal/tracking/tracker_test.go b/processor/cumulativetodeltaprocessor/internal/tracking/tracker_test.go index 8ebcdb188f23..3412efc5849b 100644 --- a/processor/cumulativetodeltaprocessor/internal/tracking/tracker_test.go +++ b/processor/cumulativetodeltaprocessor/internal/tracking/tracker_test.go @@ -40,7 +40,7 @@ func TestMetricTracker_Convert(t *testing.T) { future := time.Now().Add(1 * time.Hour) keepSubsequentTest := subTest{ - name: "keep subsequet value", + name: "keep subsequent value", value: ValuePoint{ ObservedTimestamp: pcommon.NewTimestampFromTime(future.Add(time.Minute)), FloatValue: 225, diff --git a/processor/deltatocumulativeprocessor/go.mod b/processor/deltatocumulativeprocessor/go.mod index aaa316cc218e..de603d17f113 100644 --- a/processor/deltatocumulativeprocessor/go.mod +++ b/processor/deltatocumulativeprocessor/go.mod @@ -21,7 +21,7 @@ require ( go.opentelemetry.io/otel/sdk/metric v1.32.0 go.opentelemetry.io/otel/trace v1.32.0 go.uber.org/goleak v1.3.0 - golang.org/x/tools v0.28.0 + golang.org/x/tools v0.29.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -52,8 +52,8 @@ require ( go.opentelemetry.io/otel/sdk v1.32.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/net v0.33.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/net v0.34.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 // indirect google.golang.org/grpc v1.69.2 // indirect diff --git a/processor/deltatocumulativeprocessor/go.sum b/processor/deltatocumulativeprocessor/go.sum index 320db2c68c49..2c5606b17d04 100644 --- a/processor/deltatocumulativeprocessor/go.sum +++ b/processor/deltatocumulativeprocessor/go.sum @@ -107,16 +107,16 @@ 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.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= -golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= 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.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.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.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= @@ -125,8 +125,8 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm 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= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.28.0 h1:WuB6qZ4RPCQo5aP3WdKZS7i595EdWqWR8vqJTlwTVK8= -golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw= +golang.org/x/tools v0.29.0 h1:Xx0h3TtM9rzQpQuR4dKLrdglAmCEN5Oi+P74JdhdzXE= +golang.org/x/tools v0.29.0/go.mod h1:KMQVMRsVxU6nHCFXrBPhDB8XncLNLM0lIy/F14RP588= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 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= diff --git a/processor/deltatocumulativeprocessor/internal/data/expo/scale.go b/processor/deltatocumulativeprocessor/internal/data/expo/scale.go index c19830071eaf..9c3ee88652c8 100644 --- a/processor/deltatocumulativeprocessor/internal/data/expo/scale.go +++ b/processor/deltatocumulativeprocessor/internal/data/expo/scale.go @@ -47,7 +47,7 @@ func Downscale(bs Buckets, from, to Scale) { case from < to: // because even distribution within the buckets cannot be assumed, it is // not possible to correctly upscale (split) buckets. - // any attempt to do so would yield erronous data. + // any attempt to do so would yield erroneous data. panic(fmt.Sprintf("cannot upscale without introducing error (%d -> %d)", from, to)) } @@ -107,7 +107,7 @@ func Collapse(bs Buckets) { // zero the excess area. its not needed to represent the observation // anymore, but kept for two reasons: // 1. future observations may need it, no need to re-alloc then if kept - // 2. [pcommon.Uint64Slice] can not, in fact, be sliced, so getting rid + // 2. [pcommon.Uint64Slice] cannot, in fact, be sliced, so getting rid // of it would alloc ¯\_(ツ)_/¯ for i := size; i < counts.Len(); i++ { counts.SetAt(i, 0) diff --git a/processor/filterprocessor/go.mod b/processor/filterprocessor/go.mod index 2f710fd794f2..ab2fd338efcf 100644 --- a/processor/filterprocessor/go.mod +++ b/processor/filterprocessor/go.mod @@ -69,8 +69,8 @@ require ( go.opentelemetry.io/collector/semconv v0.117.0 // indirect go.opentelemetry.io/otel/sdk v1.32.0 // indirect golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect - golang.org/x/net v0.33.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/net v0.34.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.69.2 // indirect diff --git a/processor/filterprocessor/go.sum b/processor/filterprocessor/go.sum index 455da3e98fca..7ec709a3385c 100644 --- a/processor/filterprocessor/go.sum +++ b/processor/filterprocessor/go.sum @@ -167,8 +167,9 @@ golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= -golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= 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= @@ -190,8 +191,9 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= diff --git a/processor/filterprocessor/metrics.go b/processor/filterprocessor/metrics.go index 63beb811e2d6..655f4ba0b3f7 100644 --- a/processor/filterprocessor/metrics.go +++ b/processor/filterprocessor/metrics.go @@ -157,7 +157,7 @@ func (fmp *filterMetricProcessor) processMetrics(ctx context.Context, md pmetric errors = multierr.Append(errors, fmp.handleHistogramDataPoints(ctx, metric.Histogram().DataPoints(), metric, smetrics.Metrics(), scope, resource)) return metric.Histogram().DataPoints().Len() == 0 case pmetric.MetricTypeExponentialHistogram: - errors = multierr.Append(errors, fmp.handleExponetialHistogramDataPoints(ctx, metric.ExponentialHistogram().DataPoints(), metric, smetrics.Metrics(), scope, resource)) + errors = multierr.Append(errors, fmp.handleExponentialHistogramDataPoints(ctx, metric.ExponentialHistogram().DataPoints(), metric, smetrics.Metrics(), scope, resource)) return metric.ExponentialHistogram().DataPoints().Len() == 0 case pmetric.MetricTypeSummary: errors = multierr.Append(errors, fmp.handleSummaryDataPoints(ctx, metric.Summary().DataPoints(), metric, smetrics.Metrics(), scope, resource)) @@ -283,7 +283,7 @@ func (fmp *filterMetricProcessor) handleHistogramDataPoints(ctx context.Context, return errors } -func (fmp *filterMetricProcessor) handleExponetialHistogramDataPoints(ctx context.Context, dps pmetric.ExponentialHistogramDataPointSlice, metric pmetric.Metric, metrics pmetric.MetricSlice, is pcommon.InstrumentationScope, resource pcommon.Resource) error { +func (fmp *filterMetricProcessor) handleExponentialHistogramDataPoints(ctx context.Context, dps pmetric.ExponentialHistogramDataPointSlice, metric pmetric.Metric, metrics pmetric.MetricSlice, is pcommon.InstrumentationScope, resource pcommon.Resource) error { var errors error dps.RemoveIf(func(datapoint pmetric.ExponentialHistogramDataPoint) bool { skip, err := fmp.skipDataPointExpr.Eval(ctx, ottldatapoint.NewTransformContext(datapoint, metric, metrics, is, resource, pmetric.NewScopeMetrics(), pmetric.NewResourceMetrics())) diff --git a/processor/geoipprocessor/internal/provider/maxmindprovider/provider.go b/processor/geoipprocessor/internal/provider/maxmindprovider/provider.go index f56b02fe4de0..9fb128b69bcc 100644 --- a/processor/geoipprocessor/internal/provider/maxmindprovider/provider.go +++ b/processor/geoipprocessor/internal/provider/maxmindprovider/provider.go @@ -58,7 +58,7 @@ func (g *maxMindProvider) Location(_ context.Context, ipAddress net.IP) (attribu } } -// cityAttributes returns a list of key-values containing geographical metadata associated to the provided IP. The key names are populated using the internal geo IP conventions package. If the an invalid or nil IP is provided, an error is returned. +// cityAttributes returns a list of key-values containing geographical metadata associated to the provided IP. The key names are populated using the internal geo IP conventions package. If an invalid or nil IP is provided, an error is returned. func (g *maxMindProvider) cityAttributes(ipAddress net.IP) (*[]attribute.KeyValue, error) { attributes := make([]attribute.KeyValue, 0, 11) diff --git a/processor/geoipprocessor/internal/provider/maxmindprovider/testdata/generate_db.go b/processor/geoipprocessor/internal/provider/maxmindprovider/testdata/generate_db.go index 335713f2deec..10fc2f5f3779 100644 --- a/processor/geoipprocessor/internal/provider/maxmindprovider/testdata/generate_db.go +++ b/processor/geoipprocessor/internal/provider/maxmindprovider/testdata/generate_db.go @@ -10,7 +10,7 @@ import ( "github.com/maxmind/MaxMind-DB/pkg/writer" ) -// GenerateLocalDB generates *.mmdb databases files given a source directory data. It uses a the writer functionality provided by MaxMind-Db/pkg/writer +// GenerateLocalDB generates *.mmdb databases files given a source directory data. It uses the writer functionality provided by MaxMind-Db/pkg/writer func GenerateLocalDB(t *testing.T, sourceData string) string { tmpDir, err := os.MkdirTemp("", "") if err != nil { diff --git a/processor/groupbytraceprocessor/README.md b/processor/groupbytraceprocessor/README.md index c4fc5e14ba3a..9aa43e96df53 100644 --- a/processor/groupbytraceprocessor/README.md +++ b/processor/groupbytraceprocessor/README.md @@ -68,7 +68,7 @@ The following metrics are recorded by this processor: A healthy system would have the same value for the metric `otelcol_processor_groupbytrace_spans_released` and for three events under `otelcol_processor_groupbytrace_event_latency_bucket`: `onTraceExpired`, `onTraceRemoved` and `onTraceReleased`. -The metric `otelcol_processor_groupbytrace_event_latency_bucket` is a bucket and shows how long each event took to be processed in miliseconds. In most cases, it should take less than 5ms for an event to be processed, but it might be the case where an event could take 10ms. Higher latencies are possible, but it should never really reach the last item, representing 1s. Events taking more than 1s are killed automatically, and if you have multiple items in this bucket, it might indicate a bug in the software. +The metric `otelcol_processor_groupbytrace_event_latency_bucket` is a bucket and shows how long each event took to be processed in milliseconds. In most cases, it should take less than 5ms for an event to be processed, but it might be the case where an event could take 10ms. Higher latencies are possible, but it should never really reach the last item, representing 1s. Events taking more than 1s are killed automatically, and if you have multiple items in this bucket, it might indicate a bug in the software. Most metrics are updated when the events occur, except for the following ones, which are updated periodically: * `otelcol_processor_groupbytrace_num_events_in_queue` diff --git a/processor/intervalprocessor/README.md b/processor/intervalprocessor/README.md index 3e958b9d72d4..8659cd76629b 100644 --- a/processor/intervalprocessor/README.md +++ b/processor/intervalprocessor/README.md @@ -3,13 +3,15 @@ | Status | | | ------------- |-----------| -| Stability | [development]: metrics | -| Distributions | [] | +| Stability | [alpha]: metrics | +| Distributions | [contrib], [k8s] | | Warnings | [Statefulness](#warnings) | | Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Aprocessor%2Finterval%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Aprocessor%2Finterval) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Aprocessor%2Finterval%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Aprocessor%2Finterval) | | [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@RichieSams](https://www.github.com/RichieSams), [@sh0rez](https://www.github.com/sh0rez) | -[development]: https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/component-stability.md#development +[alpha]: https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/component-stability.md#alpha +[contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib +[k8s]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-k8s ## Description @@ -49,29 +51,29 @@ intervalprocessor: The following sum metrics come into the processor to be handled -| Timestamp | Metric Name | Aggregation Temporarility | Attributes | Value | -| --------- | ------------ | ------------------------- | ----------------- | ----: | -| 0 | test_metric | Cumulative | labelA: foo | 4.0 | -| 2 | test_metric | Cumulative | labelA: bar | 3.1 | -| 4 | other_metric | Delta | fruitType: orange | 77.4 | -| 6 | test_metric | Cumulative | labelA: foo | 8.2 | -| 8 | test_metric | Cumulative | labelA: foo | 12.8 | -| 10 | test_metric | Cumulative | labelA: bar | 6.4 | +| Timestamp | Metric Name | Aggregation Temporality | Attributes | Value | +| --------- | ------------ | ----------------------- | ----------------- | ----: | +| 0 | test_metric | Cumulative | labelA: foo | 4.0 | +| 2 | test_metric | Cumulative | labelA: bar | 3.1 | +| 4 | other_metric | Delta | fruitType: orange | 77.4 | +| 6 | test_metric | Cumulative | labelA: foo | 8.2 | +| 8 | test_metric | Cumulative | labelA: foo | 12.8 | +| 10 | test_metric | Cumulative | labelA: bar | 6.4 | The processor would immediately pass the following metrics to the next processor in the chain -| Timestamp | Metric Name | Aggregation Temporarility | Attributes | Value | -| --------- | ------------ | ------------------------- | ----------------- | ----: | -| 4 | other_metric | Delta | fruitType: orange | 77.4 | +| Timestamp | Metric Name | Aggregation Temporality | Attributes | Value | +| --------- | ------------ | ----------------------- | ----------------- | ----: | +| 4 | other_metric | Delta | fruitType: orange | 77.4 | Because it's a Delta metric. At the next `interval` (15s by default), the processor would pass the following metrics to the next processor in the chain -| Timestamp | Metric Name | Aggregation Temporarility | Attributes | Value | -| --------- | ----------- | ------------------------- | ----------- | ----: | -| 8 | test_metric | Cumulative | labelA: foo | 12.8 | -| 10 | test_metric | Cumulative | labelA: bar | 6.4 | +| Timestamp | Metric Name | Aggregation Temporality | Attributes | Value | +| --------- | ----------- | ----------------------- | ----------- | ----: | +| 8 | test_metric | Cumulative | labelA: foo | 12.8 | +| 10 | test_metric | Cumulative | labelA: bar | 6.4 | > [!IMPORTANT] > After exporting, any internal state is cleared. So if no new metrics come in, the next interval will export nothing. diff --git a/processor/intervalprocessor/internal/metadata/generated_status.go b/processor/intervalprocessor/internal/metadata/generated_status.go index b0b04e036877..6570e6058471 100644 --- a/processor/intervalprocessor/internal/metadata/generated_status.go +++ b/processor/intervalprocessor/internal/metadata/generated_status.go @@ -12,5 +12,5 @@ var ( ) const ( - MetricsStability = component.StabilityLevelDevelopment + MetricsStability = component.StabilityLevelAlpha ) diff --git a/processor/intervalprocessor/metadata.yaml b/processor/intervalprocessor/metadata.yaml index 2a4700c3e069..c2fa2559a3ee 100644 --- a/processor/intervalprocessor/metadata.yaml +++ b/processor/intervalprocessor/metadata.yaml @@ -3,8 +3,8 @@ type: interval status: class: processor stability: - development: [metrics] - distributions: [] + alpha: [metrics] + distributions: [contrib, k8s] warnings: [Statefulness] codeowners: active: [RichieSams, sh0rez] diff --git a/processor/k8sattributesprocessor/README.md b/processor/k8sattributesprocessor/README.md index ca38d8599ff9..425bef183f4a 100644 --- a/processor/k8sattributesprocessor/README.md +++ b/processor/k8sattributesprocessor/README.md @@ -341,7 +341,7 @@ k8sattributes: filter: namespace: ``` -With the namespace filter set, the processor will only look up pods and replicasets in the selected namespace. Note that with just a role binding, the processor can not query metadata such as labels and annotations from k8s `nodes` and `namespaces` which are cluster-scoped objects. This also means that the processor can not set the value for `k8s.cluster.uid` attribute if enabled, since the `k8s.cluster.uid` attribute is set to the uid of the namespace `kube-system` which is not queryable with namespaced rbac. +With the namespace filter set, the processor will only look up pods and replicasets in the selected namespace. Note that with just a role binding, the processor cannot query metadata such as labels and annotations from k8s `nodes` and `namespaces` which are cluster-scoped objects. This also means that the processor cannot set the value for `k8s.cluster.uid` attribute if enabled, since the `k8s.cluster.uid` attribute is set to the uid of the namespace `kube-system` which is not queryable with namespaced rbac. Example `Role` and `RoleBinding` to create in the namespace being watched. ```yaml @@ -389,7 +389,7 @@ When running as an agent, the processor detects IP addresses of pods sending spa and uses this information to extract metadata from pods. When running as an agent, it is important to apply a discovery filter so that the processor only discovers pods from the same host that it is running on. Not using such a filter can result in unnecessary resource usage especially on very large clusters. Once the filter is applied, -each processor will only query the k8s API for pods running on it's own node. +each processor will only query the k8s API for pods running on its own node. Node filter can be applied by setting the `filter.node` config option to the name of a k8s node. While this works as expected, it cannot be used to automatically filter pods by the same node that the processor is running on in @@ -498,7 +498,7 @@ The following config with the feature gate set will lead to validation error: #### Migration -Deprecation of the `extract.annotations.regex` and `extract.labels.regex` fields means that it is recommended to use the `ExtractPatterns` function from the transform processor instead. To convert your current configuration please check the `ExtractPatterns` function [documentation](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/pkg/ottl/ottlfuncs#extractpatterns). You should use the `pattern` parameter of `ExtractPatterns` instead of using the the `extract.annotations.regex` and `extract.labels.regex` fields. +Deprecation of the `extract.annotations.regex` and `extract.labels.regex` fields means that it is recommended to use the `ExtractPatterns` function from the transform processor instead. To convert your current configuration please check the `ExtractPatterns` function [documentation](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/pkg/ottl/ottlfuncs#extractpatterns). You should use the `pattern` parameter of `ExtractPatterns` instead of using the `extract.annotations.regex` and `extract.labels.regex` fields. ##### Example diff --git a/processor/k8sattributesprocessor/e2e_test.go b/processor/k8sattributesprocessor/e2e_test.go index 47d57b2c6a29..147b968ec913 100644 --- a/processor/k8sattributesprocessor/e2e_test.go +++ b/processor/k8sattributesprocessor/e2e_test.go @@ -1087,6 +1087,505 @@ func TestE2E_NamespacedRBACNoPodIP(t *testing.T) { } } +// TestE2E_ClusterRBACCollectorRestart tests the k8s attributes processor in a k8s cluster with the collector's service account having +// cluster-wide permissions to list/watch namespaces, nodes, pods and replicasets. The config in the test does not +// set filter::namespace, and the telemetrygen image has a latest tag but no digest. +// The test starts the collector after the telemetrygen objects, to verify the initial sync of the k8sattributesproccessor +// captures all available resources in the cluster in a way that ensures the relations between them (e.g. pod <-> replicaset <-> deployment) are not lost. +// The test requires a prebuilt otelcontribcol image uploaded to a kind k8s cluster defined in +// `/tmp/kube-config-otelcol-e2e-testing`. Run the following command prior to running the test locally: +// +// kind create cluster --kubeconfig=/tmp/kube-config-otelcol-e2e-testing +// make docker-otelcontribcol +// KUBECONFIG=/tmp/kube-config-otelcol-e2e-testing kind load docker-image otelcontribcol:latest +func TestE2E_ClusterRBACCollectorStartAfterTelemetryGen(t *testing.T) { + // TODO: Re-enable this test when the issue being tested here is fully solved: https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/37056 + t.Skip("Skipping test as https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/37056 is not fully solved yet") + testDir := filepath.Join("testdata", "e2e", "clusterrbac") + + k8sClient, err := k8stest.NewK8sClient(testKubeConfig) + require.NoError(t, err) + + nsFile := filepath.Join(testDir, "namespace.yaml") + buf, err := os.ReadFile(nsFile) + require.NoErrorf(t, err, "failed to read namespace object file %s", nsFile) + nsObj, err := k8stest.CreateObject(k8sClient, buf) + require.NoErrorf(t, err, "failed to create k8s namespace from file %s", nsFile) + + testNs := nsObj.GetName() + defer func() { + require.NoErrorf(t, k8stest.DeleteObject(k8sClient, nsObj), "failed to delete namespace %s", testNs) + }() + + metricsConsumer := new(consumertest.MetricsSink) + tracesConsumer := new(consumertest.TracesSink) + logsConsumer := new(consumertest.LogsSink) + profilesConsumer := new(consumertest.ProfilesSink) + shutdownSinks := startUpSinks(t, metricsConsumer, tracesConsumer, logsConsumer, profilesConsumer) + defer shutdownSinks() + + testID := uuid.NewString()[:8] + createTeleOpts := &k8stest.TelemetrygenCreateOpts{ + ManifestsDir: filepath.Join(testDir, "telemetrygen"), + TestID: testID, + OtlpEndpoint: fmt.Sprintf("otelcol-%s.%s:4317", testID, testNs), + // `telemetrygen` doesn't support profiles + // https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/36127 + // TODO: add "profiles" to DataTypes once #36127 is resolved + DataTypes: []string{"metrics", "logs", "traces"}, + } + telemetryGenObjs, telemetryGenObjInfos := k8stest.CreateTelemetryGenObjects(t, k8sClient, createTeleOpts) + defer func() { + for _, obj := range telemetryGenObjs { + require.NoErrorf(t, k8stest.DeleteObject(k8sClient, obj), "failed to delete object %s", obj.GetName()) + } + }() + + for _, info := range telemetryGenObjInfos { + k8stest.WaitForTelemetryGenToStart(t, k8sClient, info.Namespace, info.PodLabelSelectors, info.Workload, info.DataType) + } + + // start the collector after the telemetry gen objects + collectorObjs := k8stest.CreateCollectorObjects(t, k8sClient, testID, filepath.Join(testDir, "collector")) + defer func() { + for _, obj := range collectorObjs { + require.NoErrorf(t, k8stest.DeleteObject(k8sClient, obj), "failed to delete object %s", obj.GetName()) + } + }() + + wantEntries := 128 // Minimal number of metrics/traces/logs/profiles to wait for. + waitForData(t, wantEntries, metricsConsumer, tracesConsumer, logsConsumer, profilesConsumer) + + tcs := []struct { + name string + dataType pipeline.Signal + service string + attrs map[string]*expectedValue + }{ + { + name: "traces-job", + dataType: pipeline.SignalTraces, + service: "test-traces-job", + attrs: map[string]*expectedValue{ + "k8s.pod.name": newExpectedValue(regex, "telemetrygen-"+testID+"-traces-job-[a-z0-9]*"), + "k8s.pod.ip": newExpectedValue(exist, ""), + "k8s.pod.uid": newExpectedValue(regex, uidRe), + "k8s.pod.start_time": newExpectedValue(exist, ""), + "k8s.node.name": newExpectedValue(exist, ""), + "k8s.namespace.name": newExpectedValue(equal, testNs), + "k8s.job.name": newExpectedValue(equal, "telemetrygen-"+testID+"-traces-job"), + "k8s.job.uid": newExpectedValue(exist, ""), + "k8s.annotations.workload": newExpectedValue(equal, "job"), + "k8s.labels.app": newExpectedValue(equal, "telemetrygen-"+testID+"-traces-job"), + "k8s.container.name": newExpectedValue(equal, "telemetrygen"), + "k8s.cluster.uid": newExpectedValue(regex, uidRe), + "container.image.name": newExpectedValue(equal, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen"), + "container.image.repo_digests": newExpectedValue(regex, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen@sha256:[0-9a-fA-f]{64}"), + "container.image.tag": newExpectedValue(equal, "latest"), + "container.id": newExpectedValue(exist, ""), + "k8s.node.labels.foo": newExpectedValue(equal, "too"), + "k8s.namespace.labels.foons": newExpectedValue(equal, "barns"), + }, + }, + { + name: "traces-statefulset", + dataType: pipeline.SignalTraces, + service: "test-traces-statefulset", + attrs: map[string]*expectedValue{ + "k8s.pod.name": newExpectedValue(equal, "telemetrygen-"+testID+"-traces-statefulset-0"), + "k8s.pod.ip": newExpectedValue(exist, ""), + "k8s.pod.uid": newExpectedValue(regex, uidRe), + "k8s.pod.start_time": newExpectedValue(exist, ""), + "k8s.node.name": newExpectedValue(exist, ""), + "k8s.namespace.name": newExpectedValue(equal, testNs), + "k8s.statefulset.name": newExpectedValue(equal, "telemetrygen-"+testID+"-traces-statefulset"), + "k8s.statefulset.uid": newExpectedValue(exist, ""), + "k8s.annotations.workload": newExpectedValue(equal, "statefulset"), + "k8s.labels.app": newExpectedValue(equal, "telemetrygen-"+testID+"-traces-statefulset"), + "k8s.container.name": newExpectedValue(equal, "telemetrygen"), + "k8s.cluster.uid": newExpectedValue(regex, uidRe), + "container.image.name": newExpectedValue(equal, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen"), + "container.image.repo_digests": newExpectedValue(regex, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen@sha256:[0-9a-fA-f]{64}"), + "container.image.tag": newExpectedValue(equal, "latest"), + "container.id": newExpectedValue(exist, ""), + "k8s.node.labels.foo": newExpectedValue(equal, "too"), + "k8s.namespace.labels.foons": newExpectedValue(equal, "barns"), + }, + }, + { + name: "traces-deployment", + dataType: pipeline.SignalTraces, + service: "test-traces-deployment", + attrs: map[string]*expectedValue{ + "k8s.pod.name": newExpectedValue(regex, "telemetrygen-"+testID+"-traces-deployment-[a-z0-9]*-[a-z0-9]*"), + "k8s.pod.ip": newExpectedValue(exist, ""), + "k8s.pod.uid": newExpectedValue(regex, uidRe), + "k8s.pod.start_time": newExpectedValue(exist, ""), + "k8s.node.name": newExpectedValue(exist, ""), + "k8s.namespace.name": newExpectedValue(equal, testNs), + "k8s.deployment.name": newExpectedValue(equal, "telemetrygen-"+testID+"-traces-deployment"), + "k8s.deployment.uid": newExpectedValue(exist, ""), + "k8s.replicaset.name": newExpectedValue(regex, "telemetrygen-"+testID+"-traces-deployment-[a-z0-9]*"), + "k8s.replicaset.uid": newExpectedValue(exist, ""), + "k8s.annotations.workload": newExpectedValue(equal, "deployment"), + "k8s.labels.app": newExpectedValue(equal, "telemetrygen-"+testID+"-traces-deployment"), + "k8s.container.name": newExpectedValue(equal, "telemetrygen"), + "k8s.cluster.uid": newExpectedValue(regex, uidRe), + "container.image.name": newExpectedValue(equal, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen"), + "container.image.repo_digests": newExpectedValue(regex, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen@sha256:[0-9a-fA-f]{64}"), + "container.image.tag": newExpectedValue(equal, "latest"), + "container.id": newExpectedValue(exist, ""), + "k8s.namespace.labels.foons": newExpectedValue(equal, "barns"), + }, + }, + { + name: "traces-daemonset", + dataType: pipeline.SignalTraces, + service: "test-traces-daemonset", + attrs: map[string]*expectedValue{ + "k8s.pod.name": newExpectedValue(regex, "telemetrygen-"+testID+"-traces-daemonset-[a-z0-9]*"), + "k8s.pod.ip": newExpectedValue(exist, ""), + "k8s.pod.uid": newExpectedValue(regex, uidRe), + "k8s.pod.start_time": newExpectedValue(exist, ""), + "k8s.node.name": newExpectedValue(exist, ""), + "k8s.namespace.name": newExpectedValue(equal, testNs), + "k8s.daemonset.name": newExpectedValue(equal, "telemetrygen-"+testID+"-traces-daemonset"), + "k8s.daemonset.uid": newExpectedValue(exist, ""), + "k8s.annotations.workload": newExpectedValue(equal, "daemonset"), + "k8s.labels.app": newExpectedValue(equal, "telemetrygen-"+testID+"-traces-daemonset"), + "k8s.container.name": newExpectedValue(equal, "telemetrygen"), + "k8s.cluster.uid": newExpectedValue(regex, uidRe), + "container.image.name": newExpectedValue(equal, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen"), + "container.image.repo_digests": newExpectedValue(regex, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen@sha256:[0-9a-fA-f]{64}"), + "container.image.tag": newExpectedValue(equal, "latest"), + "container.id": newExpectedValue(exist, ""), + "k8s.node.labels.foo": newExpectedValue(equal, "too"), + "k8s.namespace.labels.foons": newExpectedValue(equal, "barns"), + }, + }, + { + name: "metrics-job", + dataType: pipeline.SignalMetrics, + service: "test-metrics-job", + attrs: map[string]*expectedValue{ + "k8s.pod.name": newExpectedValue(regex, "telemetrygen-"+testID+"-metrics-job-[a-z0-9]*"), + "k8s.pod.ip": newExpectedValue(exist, ""), + "k8s.pod.uid": newExpectedValue(regex, uidRe), + "k8s.pod.start_time": newExpectedValue(exist, ""), + "k8s.node.name": newExpectedValue(exist, ""), + "k8s.namespace.name": newExpectedValue(equal, testNs), + "k8s.job.name": newExpectedValue(equal, "telemetrygen-"+testID+"-metrics-job"), + "k8s.job.uid": newExpectedValue(exist, ""), + "k8s.annotations.workload": newExpectedValue(equal, "job"), + "k8s.labels.app": newExpectedValue(equal, "telemetrygen-"+testID+"-metrics-job"), + "k8s.container.name": newExpectedValue(equal, "telemetrygen"), + "k8s.cluster.uid": newExpectedValue(regex, uidRe), + "container.image.name": newExpectedValue(equal, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen"), + "container.image.repo_digests": newExpectedValue(regex, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen@sha256:[0-9a-fA-f]{64}"), + "container.image.tag": newExpectedValue(equal, "latest"), + "container.id": newExpectedValue(exist, ""), + "k8s.node.labels.foo": newExpectedValue(equal, "too"), + "k8s.namespace.labels.foons": newExpectedValue(equal, "barns"), + }, + }, + { + name: "metrics-statefulset", + dataType: pipeline.SignalMetrics, + service: "test-metrics-statefulset", + attrs: map[string]*expectedValue{ + "k8s.pod.name": newExpectedValue(equal, "telemetrygen-"+testID+"-metrics-statefulset-0"), + "k8s.pod.ip": newExpectedValue(exist, ""), + "k8s.pod.uid": newExpectedValue(regex, uidRe), + "k8s.pod.start_time": newExpectedValue(exist, ""), + "k8s.node.name": newExpectedValue(exist, ""), + "k8s.namespace.name": newExpectedValue(equal, testNs), + "k8s.statefulset.name": newExpectedValue(equal, "telemetrygen-"+testID+"-metrics-statefulset"), + "k8s.statefulset.uid": newExpectedValue(exist, ""), + "k8s.annotations.workload": newExpectedValue(equal, "statefulset"), + "k8s.labels.app": newExpectedValue(equal, "telemetrygen-"+testID+"-metrics-statefulset"), + "k8s.container.name": newExpectedValue(equal, "telemetrygen"), + "k8s.cluster.uid": newExpectedValue(regex, uidRe), + "container.image.name": newExpectedValue(equal, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen"), + "container.image.repo_digests": newExpectedValue(regex, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen@sha256:[0-9a-fA-f]{64}"), + "container.image.tag": newExpectedValue(equal, "latest"), + "container.id": newExpectedValue(exist, ""), + "k8s.node.labels.foo": newExpectedValue(equal, "too"), + "k8s.namespace.labels.foons": newExpectedValue(equal, "barns"), + }, + }, + { + name: "metrics-deployment", + dataType: pipeline.SignalMetrics, + service: "test-metrics-deployment", + attrs: map[string]*expectedValue{ + "k8s.pod.name": newExpectedValue(regex, "telemetrygen-"+testID+"-metrics-deployment-[a-z0-9]*-[a-z0-9]*"), + "k8s.pod.ip": newExpectedValue(exist, ""), + "k8s.pod.uid": newExpectedValue(regex, uidRe), + "k8s.pod.start_time": newExpectedValue(exist, ""), + "k8s.node.name": newExpectedValue(exist, ""), + "k8s.namespace.name": newExpectedValue(equal, testNs), + "k8s.deployment.name": newExpectedValue(equal, "telemetrygen-"+testID+"-metrics-deployment"), + "k8s.deployment.uid": newExpectedValue(exist, ""), + "k8s.replicaset.name": newExpectedValue(regex, "telemetrygen-"+testID+"-metrics-deployment-[a-z0-9]*"), + "k8s.replicaset.uid": newExpectedValue(exist, ""), + "k8s.annotations.workload": newExpectedValue(equal, "deployment"), + "k8s.labels.app": newExpectedValue(equal, "telemetrygen-"+testID+"-metrics-deployment"), + "k8s.container.name": newExpectedValue(equal, "telemetrygen"), + "k8s.cluster.uid": newExpectedValue(regex, uidRe), + "container.image.name": newExpectedValue(equal, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen"), + "container.image.repo_digests": newExpectedValue(regex, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen@sha256:[0-9a-fA-f]{64}"), + "container.image.tag": newExpectedValue(equal, "latest"), + "container.id": newExpectedValue(exist, ""), + "k8s.namespace.labels.foons": newExpectedValue(equal, "barns"), + }, + }, + { + name: "metrics-daemonset", + dataType: pipeline.SignalMetrics, + service: "test-metrics-daemonset", + attrs: map[string]*expectedValue{ + "k8s.pod.name": newExpectedValue(regex, "telemetrygen-"+testID+"-metrics-daemonset-[a-z0-9]*"), + "k8s.pod.ip": newExpectedValue(exist, ""), + "k8s.pod.uid": newExpectedValue(regex, uidRe), + "k8s.pod.start_time": newExpectedValue(exist, ""), + "k8s.node.name": newExpectedValue(exist, ""), + "k8s.namespace.name": newExpectedValue(equal, testNs), + "k8s.daemonset.name": newExpectedValue(equal, "telemetrygen-"+testID+"-metrics-daemonset"), + "k8s.daemonset.uid": newExpectedValue(exist, ""), + "k8s.annotations.workload": newExpectedValue(equal, "daemonset"), + "k8s.labels.app": newExpectedValue(equal, "telemetrygen-"+testID+"-metrics-daemonset"), + "k8s.container.name": newExpectedValue(equal, "telemetrygen"), + "k8s.cluster.uid": newExpectedValue(regex, uidRe), + "container.image.name": newExpectedValue(equal, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen"), + "container.image.repo_digests": newExpectedValue(regex, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen@sha256:[0-9a-fA-f]{64}"), + "container.image.tag": newExpectedValue(equal, "latest"), + "container.id": newExpectedValue(exist, ""), + "k8s.node.labels.foo": newExpectedValue(equal, "too"), + "k8s.namespace.labels.foons": newExpectedValue(equal, "barns"), + }, + }, + { + name: "logs-job", + dataType: pipeline.SignalLogs, + service: "test-logs-job", + attrs: map[string]*expectedValue{ + "k8s.pod.name": newExpectedValue(regex, "telemetrygen-"+testID+"-logs-job-[a-z0-9]*"), + "k8s.pod.ip": newExpectedValue(exist, ""), + "k8s.pod.uid": newExpectedValue(regex, uidRe), + "k8s.pod.start_time": newExpectedValue(exist, ""), + "k8s.node.name": newExpectedValue(exist, ""), + "k8s.namespace.name": newExpectedValue(equal, testNs), + "k8s.job.name": newExpectedValue(equal, "telemetrygen-"+testID+"-logs-job"), + "k8s.job.uid": newExpectedValue(exist, ""), + "k8s.annotations.workload": newExpectedValue(equal, "job"), + "k8s.labels.app": newExpectedValue(equal, "telemetrygen-"+testID+"-logs-job"), + "k8s.container.name": newExpectedValue(equal, "telemetrygen"), + "k8s.cluster.uid": newExpectedValue(regex, uidRe), + "container.image.name": newExpectedValue(equal, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen"), + "container.image.repo_digests": newExpectedValue(regex, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen@sha256:[0-9a-fA-f]{64}"), + "container.image.tag": newExpectedValue(equal, "latest"), + "container.id": newExpectedValue(exist, ""), + "k8s.node.labels.foo": newExpectedValue(equal, "too"), + "k8s.namespace.labels.foons": newExpectedValue(equal, "barns"), + }, + }, + { + name: "logs-statefulset", + dataType: pipeline.SignalLogs, + service: "test-logs-statefulset", + attrs: map[string]*expectedValue{ + "k8s.pod.name": newExpectedValue(equal, "telemetrygen-"+testID+"-logs-statefulset-0"), + "k8s.pod.ip": newExpectedValue(exist, ""), + "k8s.pod.uid": newExpectedValue(regex, uidRe), + "k8s.pod.start_time": newExpectedValue(exist, ""), + "k8s.node.name": newExpectedValue(exist, ""), + "k8s.namespace.name": newExpectedValue(equal, testNs), + "k8s.statefulset.name": newExpectedValue(equal, "telemetrygen-"+testID+"-logs-statefulset"), + "k8s.statefulset.uid": newExpectedValue(exist, ""), + "k8s.annotations.workload": newExpectedValue(equal, "statefulset"), + "k8s.labels.app": newExpectedValue(equal, "telemetrygen-"+testID+"-logs-statefulset"), + "k8s.container.name": newExpectedValue(equal, "telemetrygen"), + "k8s.cluster.uid": newExpectedValue(regex, uidRe), + "container.image.name": newExpectedValue(equal, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen"), + "container.image.repo_digests": newExpectedValue(regex, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen@sha256:[0-9a-fA-f]{64}"), + "container.image.tag": newExpectedValue(equal, "latest"), + "container.id": newExpectedValue(exist, ""), + "k8s.namespace.labels.foons": newExpectedValue(equal, "barns"), + }, + }, + { + name: "logs-deployment", + dataType: pipeline.SignalLogs, + service: "test-logs-deployment", + attrs: map[string]*expectedValue{ + "k8s.pod.name": newExpectedValue(regex, "telemetrygen-"+testID+"-logs-deployment-[a-z0-9]*-[a-z0-9]*"), + "k8s.pod.ip": newExpectedValue(exist, ""), + "k8s.pod.uid": newExpectedValue(regex, uidRe), + "k8s.pod.start_time": newExpectedValue(exist, ""), + "k8s.node.name": newExpectedValue(exist, ""), + "k8s.namespace.name": newExpectedValue(equal, testNs), + "k8s.deployment.name": newExpectedValue(equal, "telemetrygen-"+testID+"-logs-deployment"), + "k8s.deployment.uid": newExpectedValue(exist, ""), + "k8s.replicaset.name": newExpectedValue(regex, "telemetrygen-"+testID+"-logs-deployment-[a-z0-9]*"), + "k8s.replicaset.uid": newExpectedValue(exist, ""), + "k8s.annotations.workload": newExpectedValue(equal, "deployment"), + "k8s.labels.app": newExpectedValue(equal, "telemetrygen-"+testID+"-logs-deployment"), + "k8s.container.name": newExpectedValue(equal, "telemetrygen"), + "k8s.cluster.uid": newExpectedValue(regex, uidRe), + "container.image.name": newExpectedValue(equal, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen"), + "container.image.repo_digests": newExpectedValue(regex, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen@sha256:[0-9a-fA-f]{64}"), + "container.image.tag": newExpectedValue(equal, "latest"), + "container.id": newExpectedValue(exist, ""), + "k8s.node.labels.foo": newExpectedValue(equal, "too"), + "k8s.namespace.labels.foons": newExpectedValue(equal, "barns"), + }, + }, + { + name: "logs-daemonset", + dataType: pipeline.SignalLogs, + service: "test-logs-daemonset", + attrs: map[string]*expectedValue{ + "k8s.pod.name": newExpectedValue(regex, "telemetrygen-"+testID+"-logs-daemonset-[a-z0-9]*"), + "k8s.pod.ip": newExpectedValue(exist, ""), + "k8s.pod.uid": newExpectedValue(regex, uidRe), + "k8s.pod.start_time": newExpectedValue(exist, ""), + "k8s.node.name": newExpectedValue(exist, ""), + "k8s.namespace.name": newExpectedValue(equal, testNs), + "k8s.daemonset.name": newExpectedValue(equal, "telemetrygen-"+testID+"-logs-daemonset"), + "k8s.daemonset.uid": newExpectedValue(exist, ""), + "k8s.annotations.workload": newExpectedValue(equal, "daemonset"), + "k8s.labels.app": newExpectedValue(equal, "telemetrygen-"+testID+"-logs-daemonset"), + "k8s.container.name": newExpectedValue(equal, "telemetrygen"), + "k8s.cluster.uid": newExpectedValue(regex, uidRe), + "container.image.name": newExpectedValue(equal, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen"), + "container.image.repo_digests": newExpectedValue(regex, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen@sha256:[0-9a-fA-f]{64}"), + "container.image.tag": newExpectedValue(equal, "latest"), + "container.id": newExpectedValue(exist, ""), + "k8s.node.labels.foo": newExpectedValue(equal, "too"), + "k8s.namespace.labels.foons": newExpectedValue(equal, "barns"), + }, + }, + { + name: "profiles-job", + dataType: pipelineprofiles.SignalProfiles, + service: "test-profiles-job", + attrs: map[string]*expectedValue{ + "k8s.pod.name": newExpectedValue(regex, "telemetrygen-"+testID+"-profiles-job-[a-z0-9]*"), + "k8s.pod.ip": newExpectedValue(exist, ""), + "k8s.pod.uid": newExpectedValue(regex, uidRe), + "k8s.pod.start_time": newExpectedValue(exist, ""), + "k8s.node.name": newExpectedValue(exist, ""), + "k8s.namespace.name": newExpectedValue(equal, testNs), + "k8s.job.name": newExpectedValue(equal, "telemetrygen-"+testID+"-profiles-job"), + "k8s.job.uid": newExpectedValue(exist, ""), + "k8s.annotations.workload": newExpectedValue(equal, "job"), + "k8s.labels.app": newExpectedValue(equal, "telemetrygen-"+testID+"-profiles-job"), + "k8s.container.name": newExpectedValue(equal, "telemetrygen"), + "k8s.cluster.uid": newExpectedValue(regex, uidRe), + "container.image.name": newExpectedValue(equal, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen"), + "container.image.repo_digests": newExpectedValue(regex, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen@sha256:[0-9a-fA-f]{64}"), + "container.image.tag": newExpectedValue(equal, "latest"), + "container.id": newExpectedValue(exist, ""), + "k8s.node.labels.foo": newExpectedValue(equal, "too"), + "k8s.namespace.labels.foons": newExpectedValue(equal, "barns"), + }, + }, + { + name: "profiles-statefulset", + dataType: pipelineprofiles.SignalProfiles, + service: "test-profiles-statefulset", + attrs: map[string]*expectedValue{ + "k8s.pod.name": newExpectedValue(equal, "telemetrygen-"+testID+"-profiles-statefulset-0"), + "k8s.pod.ip": newExpectedValue(exist, ""), + "k8s.pod.uid": newExpectedValue(regex, uidRe), + "k8s.pod.start_time": newExpectedValue(exist, ""), + "k8s.node.name": newExpectedValue(exist, ""), + "k8s.namespace.name": newExpectedValue(equal, testNs), + "k8s.statefulset.name": newExpectedValue(equal, "telemetrygen-"+testID+"-profiles-statefulset"), + "k8s.statefulset.uid": newExpectedValue(exist, ""), + "k8s.annotations.workload": newExpectedValue(equal, "statefulset"), + "k8s.labels.app": newExpectedValue(equal, "telemetrygen-"+testID+"-profiles-statefulset"), + "k8s.container.name": newExpectedValue(equal, "telemetrygen"), + "k8s.cluster.uid": newExpectedValue(regex, uidRe), + "container.image.name": newExpectedValue(equal, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen"), + "container.image.repo_digests": newExpectedValue(regex, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen@sha256:[0-9a-fA-f]{64}"), + "container.image.tag": newExpectedValue(equal, "latest"), + "container.id": newExpectedValue(exist, ""), + "k8s.namespace.labels.foons": newExpectedValue(equal, "barns"), + }, + }, + { + name: "profiles-deployment", + dataType: pipelineprofiles.SignalProfiles, + service: "test-profiles-deployment", + attrs: map[string]*expectedValue{ + "k8s.pod.name": newExpectedValue(regex, "telemetrygen-"+testID+"-profiles-deployment-[a-z0-9]*-[a-z0-9]*"), + "k8s.pod.ip": newExpectedValue(exist, ""), + "k8s.pod.uid": newExpectedValue(regex, uidRe), + "k8s.pod.start_time": newExpectedValue(exist, ""), + "k8s.node.name": newExpectedValue(exist, ""), + "k8s.namespace.name": newExpectedValue(equal, testNs), + "k8s.deployment.name": newExpectedValue(equal, "telemetrygen-"+testID+"-profiles-deployment"), + "k8s.deployment.uid": newExpectedValue(exist, ""), + "k8s.replicaset.name": newExpectedValue(regex, "telemetrygen-"+testID+"-profiles-deployment-[a-z0-9]*"), + "k8s.replicaset.uid": newExpectedValue(exist, ""), + "k8s.annotations.workload": newExpectedValue(equal, "deployment"), + "k8s.labels.app": newExpectedValue(equal, "telemetrygen-"+testID+"-profiles-deployment"), + "k8s.container.name": newExpectedValue(equal, "telemetrygen"), + "k8s.cluster.uid": newExpectedValue(regex, uidRe), + "container.image.name": newExpectedValue(equal, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen"), + "container.image.repo_digests": newExpectedValue(regex, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen@sha256:[0-9a-fA-f]{64}"), + "container.image.tag": newExpectedValue(equal, "latest"), + "container.id": newExpectedValue(exist, ""), + "k8s.node.labels.foo": newExpectedValue(equal, "too"), + "k8s.namespace.labels.foons": newExpectedValue(equal, "barns"), + }, + }, + { + name: "profiles-daemonset", + dataType: pipelineprofiles.SignalProfiles, + service: "test-profiles-daemonset", + attrs: map[string]*expectedValue{ + "k8s.pod.name": newExpectedValue(regex, "telemetrygen-"+testID+"-profiles-daemonset-[a-z0-9]*"), + "k8s.pod.ip": newExpectedValue(exist, ""), + "k8s.pod.uid": newExpectedValue(regex, uidRe), + "k8s.pod.start_time": newExpectedValue(exist, ""), + "k8s.node.name": newExpectedValue(exist, ""), + "k8s.namespace.name": newExpectedValue(equal, testNs), + "k8s.daemonset.name": newExpectedValue(equal, "telemetrygen-"+testID+"-profiles-daemonset"), + "k8s.daemonset.uid": newExpectedValue(exist, ""), + "k8s.annotations.workload": newExpectedValue(equal, "daemonset"), + "k8s.labels.app": newExpectedValue(equal, "telemetrygen-"+testID+"-profiles-daemonset"), + "k8s.container.name": newExpectedValue(equal, "telemetrygen"), + "k8s.cluster.uid": newExpectedValue(regex, uidRe), + "container.image.name": newExpectedValue(equal, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen"), + "container.image.repo_digests": newExpectedValue(regex, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen@sha256:[0-9a-fA-f]{64}"), + "container.image.tag": newExpectedValue(equal, "latest"), + "container.id": newExpectedValue(exist, ""), + "k8s.node.labels.foo": newExpectedValue(equal, "too"), + "k8s.namespace.labels.foons": newExpectedValue(equal, "barns"), + }, + }, + } + + for _, tc := range tcs { + t.Run(tc.name, func(t *testing.T) { + switch tc.dataType { + case pipeline.SignalTraces: + scanTracesForAttributes(t, tracesConsumer, tc.service, tc.attrs) + case pipeline.SignalMetrics: + scanMetricsForAttributes(t, metricsConsumer, tc.service, tc.attrs) + case pipeline.SignalLogs: + scanLogsForAttributes(t, logsConsumer, tc.service, tc.attrs) + case pipelineprofiles.SignalProfiles: + scanProfilesForAttributes(t, profilesConsumer, tc.service, tc.attrs) + default: + t.Fatalf("unknown data type %s", tc.dataType) + } + }) + } +} + func scanTracesForAttributes(t *testing.T, ts *consumertest.TracesSink, expectedService string, kvs map[string]*expectedValue, ) { diff --git a/processor/k8sattributesprocessor/internal/kube/client.go b/processor/k8sattributesprocessor/internal/kube/client.go index a984e7f85cbd..3e38cafeaaef 100644 --- a/processor/k8sattributesprocessor/internal/kube/client.go +++ b/processor/k8sattributesprocessor/internal/kube/client.go @@ -209,6 +209,22 @@ func New( // Start registers pod event handlers and starts watching the kubernetes cluster for pod changes. func (c *WatchClient) Start() error { synced := make([]cache.InformerSynced, 0) + + // start the replicaSet informer first, as the replica sets need to be + // present at the time the pods are handled, to correctly establish the connection between pods and deployments + if c.Rules.DeploymentName || c.Rules.DeploymentUID { + reg, err := c.replicasetInformer.AddEventHandler(cache.ResourceEventHandlerFuncs{ + AddFunc: c.handleReplicaSetAdd, + UpdateFunc: c.handleReplicaSetUpdate, + DeleteFunc: c.handleReplicaSetDelete, + }) + if err != nil { + return err + } + synced = append(synced, reg.HasSynced) + go c.replicasetInformer.Run(c.stopCh) + } + reg, err := c.informer.AddEventHandler(cache.ResourceEventHandlerFuncs{ AddFunc: c.handlePodAdd, UpdateFunc: c.handlePodUpdate, @@ -231,19 +247,6 @@ func (c *WatchClient) Start() error { synced = append(synced, reg.HasSynced) go c.namespaceInformer.Run(c.stopCh) - if c.Rules.DeploymentName || c.Rules.DeploymentUID { - reg, err = c.replicasetInformer.AddEventHandler(cache.ResourceEventHandlerFuncs{ - AddFunc: c.handleReplicaSetAdd, - UpdateFunc: c.handleReplicaSetUpdate, - DeleteFunc: c.handleReplicaSetDelete, - }) - if err != nil { - return err - } - synced = append(synced, reg.HasSynced) - go c.replicasetInformer.Run(c.stopCh) - } - if c.nodeInformer != nil { reg, err = c.nodeInformer.AddEventHandler(cache.ResourceEventHandlerFuncs{ AddFunc: c.handleNodeAdd, @@ -270,7 +273,7 @@ func (c *WatchClient) Start() error { return nil } -// Stop signals the the k8s watcher/informer to stop watching for new events. +// Stop signals the k8s watcher/informer to stop watching for new events. func (c *WatchClient) Stop() { close(c.stopCh) } diff --git a/processor/k8sattributesprocessor/internal/kube/client_test.go b/processor/k8sattributesprocessor/internal/kube/client_test.go index de701f6fd673..5d28ac5b9508 100644 --- a/processor/k8sattributesprocessor/internal/kube/client_test.go +++ b/processor/k8sattributesprocessor/internal/kube/client_test.go @@ -428,7 +428,7 @@ func TestPodDelete(t *testing.T) { // delete empty IP pod c.handlePodDelete(&api_v1.Pod{}) - // delete non-existent IP + // delete nonexistent IP c.deleteQueue = c.deleteQueue[:0] pod := &api_v1.Pod{} pod.Status.PodIP = "9.9.9.9" @@ -494,14 +494,14 @@ func TestNamespaceDelete(t *testing.T) { // delete empty namespace c.handleNamespaceDelete(&api_v1.Namespace{}) - // delete non-existent namespace + // delete nonexistent namespace namespace := &api_v1.Namespace{} namespace.Name = "namespaceC" c.handleNamespaceDelete(namespace) assert.Len(t, c.Namespaces, 2) got := c.Namespaces["namespaceA"] assert.Equal(t, "namespaceA", got.Name) - // delete non-existent namespace when DeletedFinalStateUnknown + // delete nonexistent namespace when DeletedFinalStateUnknown c.handleNamespaceDelete(cache.DeletedFinalStateUnknown{Obj: namespace}) assert.Len(t, c.Namespaces, 2) got = c.Namespaces["namespaceA"] @@ -529,14 +529,14 @@ func TestNodeDelete(t *testing.T) { // delete empty node c.handleNodeDelete(&api_v1.Node{}) - // delete non-existent node + // delete nonexistent node node := &api_v1.Node{} node.Name = "nodeC" c.handleNodeDelete(node) assert.Len(t, c.Nodes, 2) got := c.Nodes["nodeA"] assert.Equal(t, "nodeA", got.Name) - // delete non-existent namespace when DeletedFinalStateUnknown + // delete nonexistent namespace when DeletedFinalStateUnknown c.handleNodeDelete(cache.DeletedFinalStateUnknown{Obj: node}) assert.Len(t, c.Nodes, 2) got = c.Nodes["nodeA"] diff --git a/processor/k8sattributesprocessor/processor_test.go b/processor/k8sattributesprocessor/processor_test.go index ee51cc82d9f0..6e6458ea4c82 100644 --- a/processor/k8sattributesprocessor/processor_test.go +++ b/processor/k8sattributesprocessor/processor_test.go @@ -1296,7 +1296,7 @@ func TestProcessorAddContainerAttributes(t *testing.T) { } } -func TestProcessorPicksUpPassthoughPodIp(t *testing.T) { +func TestProcessorPicksUpPassthroughPodIp(t *testing.T) { m := newMultiTest( t, NewFactory().CreateDefaultConfig(), diff --git a/processor/k8sattributesprocessor/testdata/config.yaml b/processor/k8sattributesprocessor/testdata/config.yaml index 1078ab73b7c5..9ac386ad4763 100644 --- a/processor/k8sattributesprocessor/testdata/config.yaml +++ b/processor/k8sattributesprocessor/testdata/config.yaml @@ -89,7 +89,7 @@ k8sattributes/4: auth_type: "kubeConfig" extract: metadata: - # the following metadata field has been depracated + # the following metadata field has been deprecated - k8s.cluster.name k8sattributes/too_many_sources: diff --git a/processor/logdedupprocessor/config_test.go b/processor/logdedupprocessor/config_test.go index a4e8fb120cd5..23a2b484f542 100644 --- a/processor/logdedupprocessor/config_test.go +++ b/processor/logdedupprocessor/config_test.go @@ -75,7 +75,7 @@ func TestValidateConfig(t *testing.T) { expectedErr: errors.New("an excludefield must start with"), }, { - desc: "invalid duplice exclude field", + desc: "invalid duplicate exclude field", cfg: &Config{ LogCountAttribute: defaultLogCountAttribute, Interval: defaultInterval, diff --git a/processor/logdedupprocessor/field_remover.go b/processor/logdedupprocessor/field_remover.go index bd82a7715214..dd261a14c6f1 100644 --- a/processor/logdedupprocessor/field_remover.go +++ b/processor/logdedupprocessor/field_remover.go @@ -15,7 +15,7 @@ const ( // fieldDelimiter is the delimiter used to split a field key into its parts. fieldDelimiter = "." - // fieldEscapeKeyReplacement is the string used to temporarily replace escaped delimters while splitting a field key. + // fieldEscapeKeyReplacement is the string used to temporarily replace escaped delimiters while splitting a field key. fieldEscapeKeyReplacement = "{TEMP_REPLACE}" ) diff --git a/processor/logdedupprocessor/field_remover_test.go b/processor/logdedupprocessor/field_remover_test.go index 173bee6b2e9e..9972acd3ee9d 100644 --- a/processor/logdedupprocessor/field_remover_test.go +++ b/processor/logdedupprocessor/field_remover_test.go @@ -73,7 +73,7 @@ func TestRemoveFields(t *testing.T) { nestedAttrMap := logRecord.Attributes().PutEmptyMap("nested") nestedAttrMap.PutInt("int", 2) - // Expected attribut map + // Expected attribute map expectedAttrsMap := pcommon.NewMap() expectedAttrsMap.PutStr("str", "attr str") expectedAttrHash := pdatautil.MapHash(expectedAttrsMap) diff --git a/processor/logdedupprocessor/go.mod b/processor/logdedupprocessor/go.mod index da6a2da475bd..cf7aeb2550a0 100644 --- a/processor/logdedupprocessor/go.mod +++ b/processor/logdedupprocessor/go.mod @@ -71,8 +71,8 @@ require ( go.opentelemetry.io/otel/sdk v1.32.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect - golang.org/x/net v0.33.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/net v0.34.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.69.2 // indirect diff --git a/processor/logdedupprocessor/go.sum b/processor/logdedupprocessor/go.sum index fcbf3cb8c1aa..69d9076e2f17 100644 --- a/processor/logdedupprocessor/go.sum +++ b/processor/logdedupprocessor/go.sum @@ -161,8 +161,9 @@ golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= -golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= 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,8 +185,9 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= diff --git a/processor/logstransformprocessor/go.mod b/processor/logstransformprocessor/go.mod index 966d2a43c1a0..6c768ff49941 100644 --- a/processor/logstransformprocessor/go.mod +++ b/processor/logstransformprocessor/go.mod @@ -69,7 +69,7 @@ require ( go.opentelemetry.io/otel/sdk/metric v1.32.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.33.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect gonum.org/v1/gonum v0.15.1 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect diff --git a/processor/logstransformprocessor/go.sum b/processor/logstransformprocessor/go.sum index 94731f40741f..5b3e0d4babc8 100644 --- a/processor/logstransformprocessor/go.sum +++ b/processor/logstransformprocessor/go.sum @@ -154,8 +154,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.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.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.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= diff --git a/processor/metricsgenerationprocessor/README.md b/processor/metricsgenerationprocessor/README.md index e029dd94c39d..92a475ad3b01 100644 --- a/processor/metricsgenerationprocessor/README.md +++ b/processor/metricsgenerationprocessor/README.md @@ -12,11 +12,9 @@ [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib -**Status: under development; Not recommended for production usage.** - ## Description -The metrics generation processor (`metricsgenerationprocessor`) can be used to create new metrics using existing metrics following a given rule. This processor currently supports the following two rule types for creating a new metric. +The metrics generation processor (`metricsgeneration`) can be used to create new metrics using existing metrics following a given rule. This processor currently supports the following two rule types for creating a new metric. 1. `calculate`: It can create a new metric from two existing metrics by applying one of the following arithmetic operations: add, subtract, multiply, divide, or percent. One use case is to calculate the `pod.memory.utilization` metric like the following equation- `pod.memory.utilization` = (`pod.memory.usage.bytes` / `node.memory.limit`) diff --git a/processor/metricsgenerationprocessor/config.go b/processor/metricsgenerationprocessor/config.go index d9be98b559f0..54c857c5604b 100644 --- a/processor/metricsgenerationprocessor/config.go +++ b/processor/metricsgenerationprocessor/config.go @@ -61,7 +61,7 @@ type GenerationType string const ( - // Generates a new metric applying an arithmatic operation with two operands + // Generates a new metric applying an arithmetic operation with two operands calculate GenerationType = "calculate" // Generates a new metric scaling the value of s given metric with a provided constant diff --git a/processor/metricstransformprocessor/README.md b/processor/metricstransformprocessor/README.md index 34b3d25b59e5..c4b87e17307a 100644 --- a/processor/metricstransformprocessor/README.md +++ b/processor/metricstransformprocessor/README.md @@ -311,7 +311,7 @@ operations: ```yaml # Group metrics from one single ResourceMetrics and report them as multiple ResourceMetrics. # -# ex: Consider pod and container metrics collected from Kubernetes. Both the metrics are recorded under under one ResourceMetric +# ex: Consider pod and container metrics collected from Kubernetes. Both the metrics are recorded under one ResourceMetric # applying this transformation will result in two separate ResourceMetric packets with corresponding resource labels in the resource headers # # instead of regular $ use double dollar $$. Because $ is treated as a special character. @@ -320,11 +320,11 @@ operations: - include: ^k8s\.pod\.(.*)$$ match_type: regexp action: group - group_resource_labels: {"resouce.type": "k8s.pod", "source": "kubelet"} + group_resource_labels: {"resource.type": "k8s.pod", "source": "kubelet"} - include: ^container\.(.*)$$ match_type: regexp action: group - group_resource_labels: {"resouce.type": "container", "source": "kubelet"} + group_resource_labels: {"resource.type": "container", "source": "kubelet"} ``` ### Metric Transform Processor vs. [Attributes Processor for Metrics](../attributesprocessor) diff --git a/processor/metricstransformprocessor/config.go b/processor/metricstransformprocessor/config.go index ca08ec49c47c..d86493b97a28 100644 --- a/processor/metricstransformprocessor/config.go +++ b/processor/metricstransformprocessor/config.go @@ -18,7 +18,7 @@ const ( // newNameFieldName is the mapstructure field name for NewName field newNameFieldName = "new_name" - // groupResourceLabelsFieldName is the mapstructure field name for GroupResouceLabels field + // groupResourceLabelsFieldName is the mapstructure field name for GroupResourceLabels field groupResourceLabelsFieldName = "group_resource_labels" // aggregationTypeFieldName is the mapstructure field name for aggregationType field @@ -69,7 +69,7 @@ type transform struct { // REQUIRED only if Action is INSERT. NewName string `mapstructure:"new_name"` - // GroupResourceLabels specifes resource labels that will be appended to this group's new ResourceMetrics message + // GroupResourceLabels specifies resource labels that will be appended to this group's new ResourceMetrics message // REQUIRED only if Action is GROUP GroupResourceLabels map[string]string `mapstructure:"group_resource_labels"` @@ -152,7 +152,7 @@ const ( // Combine combines multiple metrics into a single metric. Combine ConfigAction = "combine" - // Group groups mutiple metrics matching the predicate into multiple ResourceMetrics messages + // Group groups multiple metrics matching the predicate into multiple ResourceMetrics messages Group ConfigAction = "group" ) @@ -168,7 +168,7 @@ func (ca ConfigAction) isValid() bool { return false } -// operationAction is the enum to capture the thress types of actions to perform for an operation. +// operationAction is the enum to capture the types of actions to perform for an operation. type operationAction string const ( diff --git a/processor/metricstransformprocessor/metrics_transform_processor_otlp.go b/processor/metricstransformprocessor/metrics_transform_processor_otlp.go index 398cd67cd96e..cf6ee289bb86 100644 --- a/processor/metricstransformprocessor/metrics_transform_processor_otlp.go +++ b/processor/metricstransformprocessor/metrics_transform_processor_otlp.go @@ -91,9 +91,9 @@ func (f internalFilterRegexp) submatches(metric pmetric.Metric) []int { return f.include.FindStringSubmatchIndex(metric.Name()) } -func (f internalFilterRegexp) expand(metricTempate, metricName string) string { +func (f internalFilterRegexp) expand(metricTemplate, metricName string) string { if submatches := f.include.FindStringSubmatchIndex(metricName); submatches != nil { - return string(f.include.ExpandString([]byte{}, metricTempate, metricName, submatches)) + return string(f.include.ExpandString([]byte{}, metricTemplate, metricName, submatches)) } return "" } @@ -442,7 +442,7 @@ func combine(transform internalTransform, metrics pmetric.MetricSlice) pmetric.M // groupMetrics groups all the provided timeseries that will be aggregated together based on all the label values. // Returns a map of grouped timeseries and the corresponding selected labels -// canBeCombined must be callled before. +// canBeCombined must be called before. func groupMetrics(metrics pmetric.MetricSlice, aggType aggregateutil.AggregationType, to pmetric.Metric) { ag := aggregateutil.AggGroups{} for i := 0; i < metrics.Len(); i++ { diff --git a/processor/probabilisticsamplerprocessor/README.md b/processor/probabilisticsamplerprocessor/README.md index e0059d9050e3..e4409897b0dd 100644 --- a/processor/probabilisticsamplerprocessor/README.md +++ b/processor/probabilisticsamplerprocessor/README.md @@ -60,7 +60,7 @@ instead of using the parent-based approach (e.g., using the `TraceIDRatioBased` sampler for a non-root span), incompleteness may result, and when spans and log records are independently sampled in a processor, as by this component, the same potential for completeness -arises. The consistency guarantee helps minimimize this issue. +arises. The consistency guarantee helps minimize this issue. Consistent probability samplers can be safely used with a mixture of probabilities and preserve sub-trace completeness, provided that child @@ -158,7 +158,7 @@ implies collecting log records from an expected value of 10 pods. OpenTelemetry specifies a consistent sampling mechanism using 56 bits of randomness, which may be obtained from the Trace ID according to the W3C Trace Context Level 2 specification. Randomness can also be -explicly encoding in the OpenTelemetry `tracestate` field, where it is +explicitly encoding in the OpenTelemetry `tracestate` field, where it is known as the R-value. This mode is named because it reduces the number of items transmitted @@ -183,7 +183,7 @@ for every 4 items input. ### Equalizing -This mode uses the same randomness mechanism as the propotional +This mode uses the same randomness mechanism as the proportional sampling mode, in this case considering how much each item was already sampled by preceding samplers. This mode can be used to lower sampling probability to a minimum value across a whole pipeline, @@ -241,7 +241,7 @@ tracestate: ot=th:0;rv:9b8233f7e3a151 This component, using either proportional or equalizing modes, could apply 50% sampling the Span. This span with randomness value `9b8233f7e3a151` is consistently sampled at 50% because the threshold, -when zero padded (i.e., `80000000000000`), is less than the randomess +when zero padded (i.e., `80000000000000`), is less than the randomness value. The resulting span will have the following tracestate: ``` diff --git a/processor/probabilisticsamplerprocessor/logsprocessor.go b/processor/probabilisticsamplerprocessor/logsprocessor.go index fd4fa6b3ff53..970c5321f7b7 100644 --- a/processor/probabilisticsamplerprocessor/logsprocessor.go +++ b/processor/probabilisticsamplerprocessor/logsprocessor.go @@ -166,7 +166,7 @@ func (th *hashingSampler) randomnessFromLogRecord(logRec plog.LogRecord) (random } // randomnessFromLogRecord (hashingSampler) uses OTEP 235 semantic -// conventions basing its deicsion only on the TraceID. +// conventions basing its decision only on the TraceID. func (ctc *consistentTracestateCommon) randomnessFromLogRecord(logRec plog.LogRecord) (randomnessNamer, samplingCarrier, error) { lrc, err := newLogRecordCarrier(logRec) rnd := newMissingRandomnessMethod() diff --git a/processor/probabilisticsamplerprocessor/logsprocessor_test.go b/processor/probabilisticsamplerprocessor/logsprocessor_test.go index 7f675d80a09e..510ff038c92e 100644 --- a/processor/probabilisticsamplerprocessor/logsprocessor_test.go +++ b/processor/probabilisticsamplerprocessor/logsprocessor_test.go @@ -354,7 +354,7 @@ func TestLogsSamplingState(t *testing.T) { tid: mustParseTID("fefefefefefefefefefefefefefefefe"), attrs: map[string]any{ "sampling.threshold": "c", // Corresponds with 25% - "prio": 37, // Lower than 50, higher than 25 + "prio": 37, // Lower than 50, greater than 25 }, sampled: true, adjCount: 4, diff --git a/processor/probabilisticsamplerprocessor/sampler_mode.go b/processor/probabilisticsamplerprocessor/sampler_mode.go index 3fe15612280c..47b74e520b6d 100644 --- a/processor/probabilisticsamplerprocessor/sampler_mode.go +++ b/processor/probabilisticsamplerprocessor/sampler_mode.go @@ -63,7 +63,7 @@ const ( // Proportional uses OpenTelemetry consistent probability // sampling information (OTEP 235), multiplies incoming - // sampling probaiblities. + // sampling probabilities. Proportional SamplerMode = "proportional" // defaultHashSeed is applied when the mode is unset. diff --git a/processor/remotetapprocessor/go.mod b/processor/remotetapprocessor/go.mod index 5ce6a67d5606..ad146d02b028 100644 --- a/processor/remotetapprocessor/go.mod +++ b/processor/remotetapprocessor/go.mod @@ -19,7 +19,7 @@ require ( go.uber.org/goleak v1.3.0 go.uber.org/zap v1.27.0 golang.org/x/net v0.34.0 - golang.org/x/time v0.8.0 + golang.org/x/time v0.9.0 ) require ( diff --git a/processor/remotetapprocessor/go.sum b/processor/remotetapprocessor/go.sum index 56ca115220d7..a7bd20804aa0 100644 --- a/processor/remotetapprocessor/go.sum +++ b/processor/remotetapprocessor/go.sum @@ -155,8 +155,8 @@ 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.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= -golang.org/x/time v0.8.0 h1:9i3RxcPv3PZnitoVGMPDKZSq1xW1gK1Xy3ArNOGZfEg= -golang.org/x/time v0.8.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/time v0.9.0 h1:EsRrnYcQiGH+5FfbgvV4AP7qEZstoyrHB0DzarOQ4ZY= +golang.org/x/time v0.9.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= 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= diff --git a/processor/resourcedetectionprocessor/README.md b/processor/resourcedetectionprocessor/README.md index cf16a5abc9e8..6186156d57ab 100644 --- a/processor/resourcedetectionprocessor/README.md +++ b/processor/resourcedetectionprocessor/README.md @@ -410,7 +410,7 @@ If accurate parsing cannot be performed, the infrastructure resource group value ### Consul -Queries a [consul agent](https://www.consul.io/docs/agent) and reads its' [configuration endpoint](https://www.consul.io/api-docs/agent#read-configuration) to retrieve related resource attributes: +Queries a [consul agent](https://www.consul.io/docs/agent) and reads its [configuration endpoint](https://www.consul.io/api-docs/agent#read-configuration) to retrieve related resource attributes: The list of the populated resource attributes can be found at [Consul Detector Resource Attributes](./internal/consul/documentation.md). @@ -481,11 +481,11 @@ and add this to your workload: fieldPath: spec.nodeName ``` -### Openshift +### OpenShift Queries the OpenShift and Kubernetes API to retrieve related resource attributes. -The list of the populated resource attributes can be found at [Openshift Detector Resource Attributes](./internal/openshift/documentation.md). +The list of the populated resource attributes can be found at [OpenShift Detector Resource Attributes](./internal/openshift/documentation.md). The following permissions are required: ```yaml @@ -588,5 +588,5 @@ Note that if multiple detectors are inserting the same attribute name, the first * ecs * ec2 -The full list of settings exposed for this extension are documented [here](./config.go) -with detailed sample configurations [here](./testdata/config.yaml). +The full list of settings exposed for this extension are documented in [config.go](./config.go) +with detailed sample configurations in [testdata/config.yaml](./testdata/config.yaml). diff --git a/processor/resourcedetectionprocessor/config.go b/processor/resourcedetectionprocessor/config.go index 78fb07a423ba..ba34649e2c72 100644 --- a/processor/resourcedetectionprocessor/config.go +++ b/processor/resourcedetectionprocessor/config.go @@ -80,7 +80,7 @@ type DetectorConfig struct { // SystemConfig contains user-specified configurations for the System detector SystemConfig system.Config `mapstructure:"system"` - // OpenShift contains user-specified configurations for the Openshift detector + // OpenShift contains user-specified configurations for the OpenShift detector OpenShiftConfig openshift.Config `mapstructure:"openshift"` // K8SNode contains user-specified configurations for the K8SNode detector diff --git a/processor/resourcedetectionprocessor/go.mod b/processor/resourcedetectionprocessor/go.mod index 84a80555bd0a..f0a243f22c46 100644 --- a/processor/resourcedetectionprocessor/go.mod +++ b/processor/resourcedetectionprocessor/go.mod @@ -6,6 +6,10 @@ require ( cloud.google.com/go/compute/metadata v0.6.0 github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.25.0 github.com/aws/aws-sdk-go v1.55.5 + github.com/aws/aws-sdk-go-v2 v1.32.7 + github.com/aws/aws-sdk-go-v2/config v1.28.6 + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.22 + github.com/aws/aws-sdk-go-v2/service/ec2 v1.196.0 github.com/google/go-cmp v0.6.0 github.com/hashicorp/consul/api v1.31.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/ecsutil v0.117.0 @@ -42,6 +46,16 @@ require ( github.com/Microsoft/go-winio v0.6.1 // indirect github.com/Showmax/go-fqdn v1.0.0 // indirect github.com/armon/go-metrics v0.4.1 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.17.47 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.25 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.25 // indirect + github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.6 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.24.7 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.6 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.33.2 // indirect + github.com/aws/smithy-go v1.22.1 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/distribution/reference v0.5.0 // indirect diff --git a/processor/resourcedetectionprocessor/go.sum b/processor/resourcedetectionprocessor/go.sum index bfda0111b757..5768da501f80 100644 --- a/processor/resourcedetectionprocessor/go.sum +++ b/processor/resourcedetectionprocessor/go.sum @@ -57,6 +57,34 @@ github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgI github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/aws/aws-sdk-go v1.55.5 h1:KKUZBfBoyqy5d3swXyiC7Q76ic40rYcbqH7qjh59kzU= github.com/aws/aws-sdk-go v1.55.5/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU= +github.com/aws/aws-sdk-go-v2 v1.32.7 h1:ky5o35oENWi0JYWUZkB7WYvVPP+bcRF5/Iq7JWSb5Rw= +github.com/aws/aws-sdk-go-v2 v1.32.7/go.mod h1:P5WJBrYqqbWVaOxgH0X/FYYD47/nooaPOZPlQdmiN2U= +github.com/aws/aws-sdk-go-v2/config v1.28.6 h1:D89IKtGrs/I3QXOLNTH93NJYtDhm8SYa9Q5CsPShmyo= +github.com/aws/aws-sdk-go-v2/config v1.28.6/go.mod h1:GDzxJ5wyyFSCoLkS+UhGB0dArhb9mI+Co4dHtoTxbko= +github.com/aws/aws-sdk-go-v2/credentials v1.17.47 h1:48bA+3/fCdi2yAwVt+3COvmatZ6jUDNkDTIsqDiMUdw= +github.com/aws/aws-sdk-go-v2/credentials v1.17.47/go.mod h1:+KdckOejLW3Ks3b0E3b5rHsr2f9yuORBum0WPnE5o5w= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.22 h1:kqOrpojG71DxJm/KDPO+Z/y1phm1JlC8/iT+5XRmAn8= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.22/go.mod h1:NtSFajXVVL8TA2QNngagVZmUtXciyrHOt7xgz4faS/M= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.25 h1:s/fF4+yDQDoElYhfIVvSNyeCydfbuTKzhxSXDXCPasU= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.25/go.mod h1:IgPfDv5jqFIzQSNbUEMoitNooSMXjRSDkhXv8jiROvU= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.25 h1:ZntTCl5EsYnhN/IygQEUugpdwbhdkom9uHcbCftiGgA= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.25/go.mod h1:DBdPrgeocww+CSl1C8cEV8PN1mHMBhuCDLpXezyvWkE= +github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 h1:VaRN3TlFdd6KxX1x3ILT5ynH6HvKgqdiXoTxAF4HQcQ= +github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1/go.mod h1:FbtygfRFze9usAadmnGJNc8KsP346kEe+y2/oyhGAGc= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.196.0 h1:ZBtoihAqfT+5b1FwGHOubq8k10KwaIyKZd2/CRTucAU= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.196.0/go.mod h1:00zqVNJFK6UASrTnuvjJHJuaqUdkVz5tW8Ip+VhzuNg= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1 h1:iXtILhvDxB6kPvEXgsDhGaZCSC6LQET5ZHSdJozeI0Y= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1/go.mod h1:9nu0fVANtYiAePIBh2/pFUSwtJ402hLnp854CNoDOeE= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.6 h1:50+XsN70RS7dwJ2CkVNXzj7U2L1HKP8nqTd3XWEXBN4= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.6/go.mod h1:WqgLmwY7so32kG01zD8CPTJWVWM+TzJoOVHwTg4aPug= +github.com/aws/aws-sdk-go-v2/service/sso v1.24.7 h1:rLnYAfXQ3YAccocshIH5mzNNwZBkBo+bP6EhIxak6Hw= +github.com/aws/aws-sdk-go-v2/service/sso v1.24.7/go.mod h1:ZHtuQJ6t9A/+YDuxOLnbryAmITtr8UysSny3qcyvJTc= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.6 h1:JnhTZR3PiYDNKlXy50/pNeix9aGMo6lLpXwJ1mw8MD4= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.6/go.mod h1:URronUEGfXZN1VpdktPSD1EkAL9mfrV+2F4sjH38qOY= +github.com/aws/aws-sdk-go-v2/service/sts v1.33.2 h1:s4074ZO1Hk8qv65GqNXqDjmkf4HSQqJukaLuuW0TpDA= +github.com/aws/aws-sdk-go-v2/service/sts v1.33.2/go.mod h1:mVggCnIWoM09jP71Wh+ea7+5gAp53q+49wDFs1SW5z8= +github.com/aws/smithy-go v1.22.1 h1:/HPHZQ0g7f4eUeK6HKglFz8uwVfZKgoI25rb/J+dnro= +github.com/aws/smithy-go v1.22.1/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= diff --git a/processor/resourcedetectionprocessor/internal/aws/ec2/ec2.go b/processor/resourcedetectionprocessor/internal/aws/ec2/ec2.go index a785030e4f40..21f2183443fc 100644 --- a/processor/resourcedetectionprocessor/internal/aws/ec2/ec2.go +++ b/processor/resourcedetectionprocessor/internal/aws/ec2/ec2.go @@ -9,10 +9,10 @@ import ( "net/http" "regexp" - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/session" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/aws/aws-sdk-go/service/ec2/ec2iface" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/config" + "github.com/aws/aws-sdk-go-v2/service/ec2" + "github.com/aws/aws-sdk-go-v2/service/ec2/types" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/processor" conventions "go.opentelemetry.io/collector/semconv/v1.6.1" @@ -32,21 +32,21 @@ const ( var _ internal.Detector = (*Detector)(nil) type ec2ifaceBuilder interface { - buildClient(region string, client *http.Client) (ec2iface.EC2API, error) + buildClient(ctx context.Context, region string, client *http.Client) (ec2.DescribeTagsAPIClient, error) } type ec2ClientBuilder struct{} -func (e *ec2ClientBuilder) buildClient(region string, client *http.Client) (ec2iface.EC2API, error) { - sess, err := session.NewSession(&aws.Config{ - Region: aws.String(region), - HTTPClient: client, - }, +func (e *ec2ClientBuilder) buildClient(ctx context.Context, region string, client *http.Client) (ec2.DescribeTagsAPIClient, error) { + cfg, err := config.LoadDefaultConfig(ctx, + config.WithRegion(region), + config.WithHTTPClient(client), ) if err != nil { return nil, err } - return ec2.New(sess), nil + + return ec2.NewFromConfig(cfg), nil } type Detector struct { @@ -59,7 +59,7 @@ type Detector struct { func NewDetector(set processor.Settings, dcfg internal.DetectorConfig) (internal.Detector, error) { cfg := dcfg.(Config) - sess, err := session.NewSession() + awsConfig, err := config.LoadDefaultConfig(context.Background()) if err != nil { return nil, err } @@ -69,7 +69,7 @@ func NewDetector(set processor.Settings, dcfg internal.DetectorConfig) (internal } return &Detector{ - metadataProvider: ec2provider.NewProvider(sess), + metadataProvider: ec2provider.NewProvider(awsConfig), tagKeyRegexes: tagKeyRegexes, logger: set.Logger, rb: metadata.NewResourceBuilder(cfg.ResourceAttributes), @@ -106,12 +106,12 @@ func (d *Detector) Detect(ctx context.Context) (resource pcommon.Resource, schem if len(d.tagKeyRegexes) != 0 { httpClient := getClientConfig(ctx, d.logger) - ec2Client, err := d.ec2ClientBuilder.buildClient(meta.Region, httpClient) + ec2Client, err := d.ec2ClientBuilder.buildClient(ctx, meta.Region, httpClient) if err != nil { d.logger.Warn("failed to build ec2 client", zap.Error(err)) return res, conventions.SchemaURL, nil } - tags, err := fetchEC2Tags(ec2Client, meta.InstanceID, d.tagKeyRegexes) + tags, err := fetchEC2Tags(ctx, ec2Client, meta.InstanceID, d.tagKeyRegexes) if err != nil { d.logger.Warn("failed fetching ec2 instance tags", zap.Error(err)) } else { @@ -132,13 +132,11 @@ func getClientConfig(ctx context.Context, logger *zap.Logger) *http.Client { return client } -func fetchEC2Tags(svc ec2iface.EC2API, instanceID string, tagKeyRegexes []*regexp.Regexp) (map[string]string, error) { - ec2Tags, err := svc.DescribeTags(&ec2.DescribeTagsInput{ - Filters: []*ec2.Filter{{ - Name: aws.String("resource-id"), - Values: []*string{ - aws.String(instanceID), - }, +func fetchEC2Tags(ctx context.Context, svc ec2.DescribeTagsAPIClient, instanceID string, tagKeyRegexes []*regexp.Regexp) (map[string]string, error) { + ec2Tags, err := svc.DescribeTags(ctx, &ec2.DescribeTagsInput{ + Filters: []types.Filter{{ + Name: aws.String("resource-id"), + Values: []string{instanceID}, }}, }) if err != nil { diff --git a/processor/resourcedetectionprocessor/internal/aws/ec2/ec2_test.go b/processor/resourcedetectionprocessor/internal/aws/ec2/ec2_test.go index 4925b8a6b9a4..d0d6e314e9c5 100644 --- a/processor/resourcedetectionprocessor/internal/aws/ec2/ec2_test.go +++ b/processor/resourcedetectionprocessor/internal/aws/ec2/ec2_test.go @@ -10,9 +10,10 @@ import ( "regexp" "testing" - "github.com/aws/aws-sdk-go/aws/ec2metadata" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/aws/aws-sdk-go/service/ec2/ec2iface" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/feature/ec2/imds" + "github.com/aws/aws-sdk-go-v2/service/ec2" + ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/pdata/pcommon" @@ -26,7 +27,7 @@ import ( var errUnavailable = errors.New("ec2metadata unavailable") type mockMetadata struct { - retIDDoc ec2metadata.EC2InstanceIdentityDocument + retIDDoc imds.InstanceIdentityDocument retErrIDDoc error retHostname string @@ -39,13 +40,13 @@ var _ ec2provider.Provider = (*mockMetadata)(nil) type mockClientBuilder struct{} -func (e *mockClientBuilder) buildClient(_ string, _ *http.Client) (ec2iface.EC2API, error) { +func (e *mockClientBuilder) buildClient(_ context.Context, _ string, _ *http.Client) (ec2.DescribeTagsAPIClient, error) { return &mockEC2Client{}, nil } type mockClientBuilderError struct{} -func (e *mockClientBuilderError) buildClient(_ string, _ *http.Client) (ec2iface.EC2API, error) { +func (e *mockClientBuilderError) buildClient(_ context.Context, _ string, _ *http.Client) (ec2.DescribeTagsAPIClient, error) { return &mockEC2ClientError{}, nil } @@ -56,9 +57,9 @@ func (mm mockMetadata) InstanceID(_ context.Context) (string, error) { return "", nil } -func (mm mockMetadata) Get(_ context.Context) (ec2metadata.EC2InstanceIdentityDocument, error) { +func (mm mockMetadata) Get(_ context.Context) (imds.InstanceIdentityDocument, error) { if mm.retErrIDDoc != nil { - return ec2metadata.EC2InstanceIdentityDocument{}, mm.retErrIDDoc + return imds.InstanceIdentityDocument{}, mm.retErrIDDoc } return mm.retIDDoc, nil } @@ -111,36 +112,35 @@ func TestNewDetector(t *testing.T) { } // Define a mock client to mock connecting to an EC2 instance -type mockEC2ClientError struct { - ec2iface.EC2API -} +type mockEC2ClientError struct{} // override the DescribeTags function to mock the output from an actual EC2 instance -func (m *mockEC2ClientError) DescribeTags(_ *ec2.DescribeTagsInput) (*ec2.DescribeTagsOutput, error) { +func (m *mockEC2ClientError) DescribeTags(_ context.Context, _ *ec2.DescribeTagsInput, _ ...func(*ec2.Options)) (*ec2.DescribeTagsOutput, error) { return nil, errors.New("Error fetching tags") } -type mockEC2Client struct { - ec2iface.EC2API -} +type mockEC2Client struct{} // override the DescribeTags function to mock the output from an actual EC2 instance -func (m *mockEC2Client) DescribeTags(input *ec2.DescribeTagsInput) (*ec2.DescribeTagsOutput, error) { - if *input.Filters[0].Values[0] == "error" { +func (m *mockEC2Client) DescribeTags(_ context.Context, input *ec2.DescribeTagsInput, _ ...func(*ec2.Options)) (*ec2.DescribeTagsOutput, error) { + if len(input.Filters) > 0 && len(input.Filters[0].Values) > 0 && input.Filters[0].Values[0] == "error" { return nil, errors.New("error") } - tag1 := "tag1" - tag2 := "tag2" - resource1 := "resource1" - val1 := "val1" - val2 := "val2" - resourceType := "type" - return &ec2.DescribeTagsOutput{ - Tags: []*ec2.TagDescription{ - {Key: &tag1, ResourceId: &resource1, ResourceType: &resourceType, Value: &val1}, - {Key: &tag2, ResourceId: &resource1, ResourceType: &resourceType, Value: &val2}, + Tags: []ec2types.TagDescription{ + { + Key: aws.String("tag1"), + ResourceId: aws.String("resource1"), + ResourceType: "type", + Value: aws.String("val1"), + }, + { + Key: aws.String("tag2"), + ResourceId: aws.String("resource1"), + ResourceType: "type", + Value: aws.String("val2"), + }, }, }, nil } @@ -164,7 +164,7 @@ func TestDetector_Detect(t *testing.T) { { name: "success", fields: fields{metadataProvider: &mockMetadata{ - retIDDoc: ec2metadata.EC2InstanceIdentityDocument{ + retIDDoc: imds.InstanceIdentityDocument{ Region: "us-west-2", AccountID: "account1234", AvailabilityZone: "us-west-2a", @@ -194,7 +194,7 @@ func TestDetector_Detect(t *testing.T) { { name: "success with tags", fields: fields{metadataProvider: &mockMetadata{ - retIDDoc: ec2metadata.EC2InstanceIdentityDocument{ + retIDDoc: imds.InstanceIdentityDocument{ Region: "us-west-2", AccountID: "account1234", AvailabilityZone: "us-west-2a", @@ -228,7 +228,7 @@ func TestDetector_Detect(t *testing.T) { { name: "success without tags returned from describeTags", fields: fields{metadataProvider: &mockMetadata{ - retIDDoc: ec2metadata.EC2InstanceIdentityDocument{ + retIDDoc: imds.InstanceIdentityDocument{ Region: "us-west-2", AccountID: "account1234", AvailabilityZone: "us-west-2a", @@ -259,7 +259,7 @@ func TestDetector_Detect(t *testing.T) { { name: "endpoint not available", fields: fields{metadataProvider: &mockMetadata{ - retIDDoc: ec2metadata.EC2InstanceIdentityDocument{}, + retIDDoc: imds.InstanceIdentityDocument{}, retErrIDDoc: errors.New("should not be called"), isAvailable: false, }}, @@ -270,7 +270,7 @@ func TestDetector_Detect(t *testing.T) { { name: "get fails", fields: fields{metadataProvider: &mockMetadata{ - retIDDoc: ec2metadata.EC2InstanceIdentityDocument{}, + retIDDoc: imds.InstanceIdentityDocument{}, retErrIDDoc: errors.New("get failed"), isAvailable: true, }}, @@ -281,7 +281,7 @@ func TestDetector_Detect(t *testing.T) { { name: "hostname fails", fields: fields{metadataProvider: &mockMetadata{ - retIDDoc: ec2metadata.EC2InstanceIdentityDocument{}, + retIDDoc: imds.InstanceIdentityDocument{}, retHostname: "", retErrHostname: errors.New("hostname failed"), isAvailable: true, @@ -354,7 +354,7 @@ func TestEC2Tags(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { m := &mockEC2Client{} - output, err := fetchEC2Tags(m, tt.resourceID, tt.tagKeyRegexes) + output, err := fetchEC2Tags(context.Background(), m, tt.resourceID, tt.tagKeyRegexes) if tt.shouldError { assert.Error(t, err) return diff --git a/processor/resourcedetectionprocessor/internal/heroku/documentation.md b/processor/resourcedetectionprocessor/internal/heroku/documentation.md index 674a47c4bade..ac927afa7c53 100644 --- a/processor/resourcedetectionprocessor/internal/heroku/documentation.md +++ b/processor/resourcedetectionprocessor/internal/heroku/documentation.md @@ -15,4 +15,4 @@ | heroku.release.creation_timestamp | The heroku.release.creation_timestamp | Any Str | true | | service.instance.id | The service.instance.id | Any Str | true | | service.name | Heroku app name recorded as service.name. | Any Str | true | -| service.version | Heroku relese version set as service.version. | Any Str | true | +| service.version | Heroku release version set as service.version. | Any Str | true | diff --git a/processor/resourcedetectionprocessor/internal/heroku/metadata.yaml b/processor/resourcedetectionprocessor/internal/heroku/metadata.yaml index 275932d67fb7..3deaa872d0fa 100644 --- a/processor/resourcedetectionprocessor/internal/heroku/metadata.yaml +++ b/processor/resourcedetectionprocessor/internal/heroku/metadata.yaml @@ -32,6 +32,6 @@ resource_attributes: enabled: true type: string service.version: - description: Heroku relese version set as service.version. + description: Heroku release version set as service.version. enabled: true type: string diff --git a/processor/resourcedetectionprocessor/internal/openshift/config.go b/processor/resourcedetectionprocessor/internal/openshift/config.go index 408bcc760984..bed20f02f493 100644 --- a/processor/resourcedetectionprocessor/internal/openshift/config.go +++ b/processor/resourcedetectionprocessor/internal/openshift/config.go @@ -47,7 +47,7 @@ type Config struct { Token string `mapstructure:"token"` // TLSSettings contains TLS configurations that are specific to client - // connection used to communicate with the Openshift API. + // connection used to communicate with the OpenShift API. TLSSettings configtls.ClientConfig `mapstructure:"tls"` ResourceAttributes metadata.ResourceAttributesConfig `mapstructure:"resource_attributes"` diff --git a/processor/resourcedetectionprocessor/internal/resourcedetection_test.go b/processor/resourcedetectionprocessor/internal/resourcedetection_test.go index 4fcba6437995..f07702adac8b 100644 --- a/processor/resourcedetectionprocessor/internal/resourcedetection_test.go +++ b/processor/resourcedetectionprocessor/internal/resourcedetection_test.go @@ -119,7 +119,7 @@ func TestDetectResource_InvalidDetectorType(t *testing.T) { require.EqualError(t, err, fmt.Sprintf("invalid detector key: %v", mockDetectorKey)) } -func TestDetectResource_DetectoryFactoryError(t *testing.T) { +func TestDetectResource_DetectorFactoryError(t *testing.T) { mockDetectorKey := DetectorType("mock") p := NewProviderFactory(map[DetectorType]DetectorFactory{ mockDetectorKey: func(processor.Settings, DetectorConfig) (Detector, error) { diff --git a/processor/routingprocessor/README.md b/processor/routingprocessor/README.md index 5ae2c563d5c7..3a4dbc65b6a7 100644 --- a/processor/routingprocessor/README.md +++ b/processor/routingprocessor/README.md @@ -175,7 +175,7 @@ It is also possible to mix both the conventional routing configuration and the r - [delete_key](../../pkg/ottl/ottlfuncs/README.md#delete_key) - [delete_matching_keys](../../pkg/ottl/ottlfuncs/README.md#delete_matching_keys) -The full list of settings exposed for this processor are documented [here](./config.go) with detailed sample configuration files: +The full list of settings exposed for this processor are documented in [config.go](./config.go) with detailed sample configuration files: - [logs](./testdata/config_logs.yaml) - [metrics](./testdata/config_metrics.yaml) diff --git a/processor/routingprocessor/extract_test.go b/processor/routingprocessor/extract_test.go index b5a3136ab23b..243f2fa9b7b7 100644 --- a/processor/routingprocessor/extract_test.go +++ b/processor/routingprocessor/extract_test.go @@ -68,7 +68,7 @@ func TestExtractorForTraces_FromContext(t *testing.T) { expectedValue: "acme", }, { - name: "value from existing HTTP attribute: case insensitive", + name: "value from existing HTTP attribute: case-insensitive", ctxFunc: func() context.Context { return client.NewContext(context.Background(), client.Info{Metadata: client.NewMetadata(map[string][]string{ diff --git a/processor/routingprocessor/go.mod b/processor/routingprocessor/go.mod index d797ce591f07..621ed2bbab1e 100644 --- a/processor/routingprocessor/go.mod +++ b/processor/routingprocessor/go.mod @@ -92,8 +92,8 @@ require ( go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.56.0 // indirect go.opentelemetry.io/otel/sdk v1.32.0 // indirect golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect - golang.org/x/net v0.33.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/net v0.34.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/protobuf v1.36.2 // indirect diff --git a/processor/routingprocessor/go.sum b/processor/routingprocessor/go.sum index 80f74b8fb9c3..cc885b9d28a5 100644 --- a/processor/routingprocessor/go.sum +++ b/processor/routingprocessor/go.sum @@ -223,8 +223,9 @@ golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= -golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= 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= @@ -246,8 +247,9 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= diff --git a/processor/schemaprocessor/README.md b/processor/schemaprocessor/README.md index 93af6889ffed..08e322121d71 100644 --- a/processor/schemaprocessor/README.md +++ b/processor/schemaprocessor/README.md @@ -26,7 +26,7 @@ the translations needed for signals that match the schema URL. ## Schema Formats -A schema URl is made up in two parts, _Schema Family_ and _Schema Version_, the schema URL is broken down like so: +A [schema URL](https://opentelemetry.io/docs/reference/specification/schemas/overview/#schema-url) is made up in two parts, _Schema Family_ and _Schema Version_, the schema URL is broken down like so: ```text | Schema URL | @@ -35,7 +35,6 @@ A schema URl is made up in two parts, _Schema Family_ and _Schema Version_, the ``` The final path in the schema URL _MUST_ be the schema version and the preceding portion of the URL is the _Schema Family_. -To read about schema formats, please read more [here](https://opentelemetry.io/docs/reference/specification/schemas/overview/#schema-url) ## Targets Schemas diff --git a/processor/schemaprocessor/internal/fixture/parallel.go b/processor/schemaprocessor/internal/fixture/parallel.go index efbcff92de40..c7c0eb5233de 100644 --- a/processor/schemaprocessor/internal/fixture/parallel.go +++ b/processor/schemaprocessor/internal/fixture/parallel.go @@ -14,7 +14,7 @@ import ( ) // ParallelRaceCompute starts `count` number of go routines that calls the provided function `fn` -// at the same to allow the race detector greater oppotunity to capture known race conditions. +// at the same to allow the race detector greater opportunity to capture known race conditions. // This method blocks until each count number of fn has completed, any returned errors is considered // a failing test method. // If the race detector is not enabled, the function then skips with an notice. diff --git a/processor/schemaprocessor/internal/migrate/conditional_test.go b/processor/schemaprocessor/internal/migrate/conditional_test.go index de6e5cad298c..8c2c6a10d3d6 100644 --- a/processor/schemaprocessor/internal/migrate/conditional_test.go +++ b/processor/schemaprocessor/internal/migrate/conditional_test.go @@ -39,7 +39,7 @@ func TestConditionalAttributeSetApply(t *testing.T) { }, "application start", ), - check: "datatbase operation", + check: "database operation", attr: testHelperBuildMap(func(m pcommon.Map) { m.PutStr("service.version", "v0.0.0") }), @@ -48,13 +48,13 @@ func TestConditionalAttributeSetApply(t *testing.T) { }), }, { - name: "No condition set, applys to all", + name: "No condition set, applies to all", cond: NewConditionalAttributeSet[string]( map[string]string{ "service.version": "application.version", }, ), - check: "datatbase operation", + check: "database operation", attr: testHelperBuildMap(func(m pcommon.Map) { m.PutStr("service.version", "v0.0.0") }), @@ -118,7 +118,7 @@ func TestConditionalAttributeSetRollback(t *testing.T) { }, "application start", ), - check: "datatbase operation", + check: "database operation", attr: testHelperBuildMap(func(m pcommon.Map) { m.PutStr("service.version", "v0.0.0") }), @@ -127,13 +127,13 @@ func TestConditionalAttributeSetRollback(t *testing.T) { }), }, { - name: "No condition set, applys to all", + name: "No condition set, applies to all", cond: NewConditionalAttributeSet[string]( map[string]string{ "service.version": "application.version", }, ), - check: "datatbase operation", + check: "database operation", attr: testHelperBuildMap(func(m pcommon.Map) { m.PutStr("application.version", "v0.0.0") }), diff --git a/processor/schemaprocessor/internal/migrate/multi_conditional_test.go b/processor/schemaprocessor/internal/migrate/multi_conditional_test.go index 98c2c204b43a..af1013e432f4 100644 --- a/processor/schemaprocessor/internal/migrate/multi_conditional_test.go +++ b/processor/schemaprocessor/internal/migrate/multi_conditional_test.go @@ -40,7 +40,7 @@ func TestMultiConditionalAttributeSetApply(t *testing.T) { }, map[string][]string{"span.name": {"application start"}}, ), - inCondData: map[string]string{"span.name": "datatbase operation"}, + inCondData: map[string]string{"span.name": "database operation"}, inAttr: testHelperBuildMap(func(m pcommon.Map) { m.PutStr("service.version", "v0.0.0") }), @@ -49,14 +49,14 @@ func TestMultiConditionalAttributeSetApply(t *testing.T) { }), }, { - name: "No condition set, applys to all", + name: "No condition set, applies to all", cond: NewMultiConditionalAttributeSet[string]( map[string]string{ "service.version": "application.version", }, map[string][]string{}, ), - inCondData: map[string]string{"span.name": "datatbase operation"}, + inCondData: map[string]string{"span.name": "database operation"}, inAttr: testHelperBuildMap(func(m pcommon.Map) { m.PutStr("service.version", "v0.0.0") }), diff --git a/processor/spanprocessor/go.mod b/processor/spanprocessor/go.mod index b3a201aca027..8acfde8fb99a 100644 --- a/processor/spanprocessor/go.mod +++ b/processor/spanprocessor/go.mod @@ -69,8 +69,8 @@ require ( 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.33.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/net v0.34.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.69.2 // indirect diff --git a/processor/spanprocessor/go.sum b/processor/spanprocessor/go.sum index 9593fd670712..1c1b6e45b717 100644 --- a/processor/spanprocessor/go.sum +++ b/processor/spanprocessor/go.sum @@ -165,8 +165,9 @@ golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= -golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= 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= @@ -188,8 +189,9 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= diff --git a/processor/sumologicprocessor/README.md b/processor/sumologicprocessor/README.md index d49a71d42bf9..4f46afec810a 100644 --- a/processor/sumologicprocessor/README.md +++ b/processor/sumologicprocessor/README.md @@ -101,7 +101,7 @@ processors: ### Adding `cloud.namespace` resource attribute Some of the apps in Sumo Logic require the `cloud.namespace` attribute to be set -to better understand the data coming from AWS EC2, AWS ECS and AWS Elactic Beanstalk. +to better understand the data coming from AWS EC2, AWS ECS and AWS Elastic Beanstalk. This attribute is similar to the standard OpenTelemetry attribute [`cloud.provider`][opentelemetry_cloud_provider_attribute]. In the future, the Sumo Logic apps might switch to the standard `cloud.provider` attribute. Before this happens, the following mapping defines the relationship between `cloud.provider` and `cloud.namespace` values: diff --git a/processor/sumologicprocessor/config.go b/processor/sumologicprocessor/config.go index ec38c01da927..4c7c3ee55608 100644 --- a/processor/sumologicprocessor/config.go +++ b/processor/sumologicprocessor/config.go @@ -26,7 +26,7 @@ const ( defaultAddCloudNamespace = true defaultTranslateAttributes = true defaultTranslateTelegrafAttributes = true - defaultTranlateDockerMetrics = false + defaultTranslateDockerMetrics = false // Nesting processor default config defaultNestingEnabled = false @@ -72,7 +72,7 @@ func createDefaultConfig() component.Config { SpanIDAttribute: &logFieldAttribute{defaultAddSpanIDAttribute, SpanIDAttributeName}, TraceIDAttribute: &logFieldAttribute{defaultAddTraceIDAttribute, TraceIDAttributeName}, }, - TranslateDockerMetrics: defaultTranlateDockerMetrics, + TranslateDockerMetrics: defaultTranslateDockerMetrics, } } diff --git a/processor/sumologicprocessor/processor_test.go b/processor/sumologicprocessor/processor_test.go index 6f9c11a726c0..02f31879a84f 100644 --- a/processor/sumologicprocessor/processor_test.go +++ b/processor/sumologicprocessor/processor_test.go @@ -86,7 +86,7 @@ func TestAddCloudNamespaceForLogs(t *testing.T) { }, }, { - name: "does not add cloud.namespce attribute when disabled", + name: "does not add cloud.namespace attribute when disabled", addCloudNamespace: false, createLogs: func() plog.Logs { inputLogs := plog.NewLogs() @@ -212,7 +212,7 @@ func TestAddCloudNamespaceForMetrics(t *testing.T) { }, }, { - name: "does not add cloud.namespce attribute when disabled", + name: "does not add cloud.namespace attribute when disabled", addCloudNamespace: false, createMetrics: func() pmetric.Metrics { inputMetrics := pmetric.NewMetrics() @@ -338,7 +338,7 @@ func TestAddCloudNamespaceForTraces(t *testing.T) { }, }, { - name: "does not add cloud.namespce attribute when disabled", + name: "does not add cloud.namespace attribute when disabled", addCloudNamespace: false, createTraces: func() ptrace.Traces { inputTraces := ptrace.NewTraces() diff --git a/processor/sumologicprocessor/translate_docker_metrics_processor.go b/processor/sumologicprocessor/translate_docker_metrics_processor.go index 9e103bd8bcaa..2e8ee41ee29d 100644 --- a/processor/sumologicprocessor/translate_docker_metrics_processor.go +++ b/processor/sumologicprocessor/translate_docker_metrics_processor.go @@ -68,7 +68,7 @@ var dockerMetricsTranslations = map[string]string{ "container.blockio.sectors_recursive": "sectors_recursive", } -var dockerReasourceAttributeTranslations = map[string]string{ +var dockerResourceAttributeTranslations = map[string]string{ "container.id": "container.FullID", "container.image.name": "container.ImageName", "container.name": "container.Name", @@ -132,7 +132,7 @@ func translateDockerResourceAttributes(attributes pcommon.Map) { result.EnsureCapacity(attributes.Len()) attributes.Range(func(otKey string, value pcommon.Value) bool { - if sumoKey, ok := dockerReasourceAttributeTranslations[otKey]; ok { + if sumoKey, ok := dockerResourceAttributeTranslations[otKey]; ok { // Only insert if it doesn't exist yet to prevent overwriting. // We have to do it this way since the final return value is not // ready yet to rely on .Insert() not overwriting. diff --git a/processor/sumologicprocessor/translate_docker_metrics_processor_test.go b/processor/sumologicprocessor/translate_docker_metrics_processor_test.go index a6dd12f78ae6..5f3c871bdc87 100644 --- a/processor/sumologicprocessor/translate_docker_metrics_processor_test.go +++ b/processor/sumologicprocessor/translate_docker_metrics_processor_test.go @@ -77,7 +77,7 @@ func TestTranslateDockerMetric_NamesAreTranslatedCorrectly(t *testing.T) { } } -func TestTranslateDockerMetric_ResourceAttrbutesAreTranslatedCorrectly(t *testing.T) { +func TestTranslateDockerMetric_ResourceAttributesAreTranslatedCorrectly(t *testing.T) { testcases := []struct { nameIn string nameOut string diff --git a/processor/tailsamplingprocessor/README.md b/processor/tailsamplingprocessor/README.md index 0c859105c8a8..a6df70b6566a 100644 --- a/processor/tailsamplingprocessor/README.md +++ b/processor/tailsamplingprocessor/README.md @@ -31,7 +31,7 @@ Multiple policies exist today and it is straight forward to add more. These incl - `status_code`: Sample based upon the status code (`OK`, `ERROR` or `UNSET`) - `string_attribute`: Sample based on string attributes (resource and record) value matches, both exact and regex value matches are supported - `trace_state`: Sample based on [TraceState](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#tracestate) value matches -- `rate_limiting`: Sample based on rate +- `rate_limiting`: Sample based on the rate of spans per second. - `span_count`: Sample based on the minimum and/or maximum number of spans, inclusive. If the sum of all spans in the trace is outside the range threshold, the trace will not be sampled. - `boolean_attribute`: Sample based on boolean attribute (resource and record). - `ottl_condition`: Sample based on given boolean OTTL condition (span and span event). @@ -49,7 +49,7 @@ The following configuration options can also be modified: - `decision_cache`: Options for configuring caches for sampling decisions. You may want to vary the size of these caches depending on how many "keep" vs "drop" decisions you expect from your policies. For example, you may allocate a larger `non_sampled_cache_size` if you expect most traces to be dropped. - Additionally, if using, configure this as much higher than `num_traces` so decisions for trace IDs are kept + Additionally, if using, configure this as much greater than `num_traces` so decisions for trace IDs are kept longer than the span data for the trace. - `sampled_cache_size` (default = 0): Configures amount of trace IDs to be kept in an LRU cache, persisting the "keep" decisions for traces that may have already been released from memory. @@ -469,7 +469,7 @@ A circular buffer is used to ensure the number of traces in-memory doesn't excee otelcol_processor_tail_sampling_sampling_trace_dropped_too_early ``` -**Pre-emptively Preventing Dropped Traces** +**Preemptively Preventing Dropped Traces** A trace is dropped without sampling if it's removed from the circular buffer before `decision_wait`. diff --git a/processor/tailsamplingprocessor/config.go b/processor/tailsamplingprocessor/config.go index 1b18c039fb00..9bda384d64b2 100644 --- a/processor/tailsamplingprocessor/config.go +++ b/processor/tailsamplingprocessor/config.go @@ -190,7 +190,7 @@ type StringAttributeCfg struct { // RateLimitingCfg holds the configurable settings to create a rate limiting // sampling policy evaluator. type RateLimitingCfg struct { - // SpansPerSecond sets the limit on the maximum nuber of spans that can be processed each second. + // SpansPerSecond sets the limit on the maximum number of spans that can be processed each second. SpansPerSecond int64 `mapstructure:"spans_per_second"` } @@ -227,12 +227,12 @@ type OTTLConditionCfg struct { type DecisionCacheConfig struct { // SampledCacheSize specifies the size of the cache that holds the sampled trace IDs. // This value will be the maximum amount of trace IDs that the cache can hold before overwriting previous IDs. - // For effective use, this value should be at least an order of magnitude higher than Config.NumTraces. + // For effective use, this value should be at least an order of magnitude greater than Config.NumTraces. // If left as default 0, a no-op DecisionCache will be used. SampledCacheSize int `mapstructure:"sampled_cache_size"` // NonSampledCacheSize specifies the size of the cache that holds the non-sampled trace IDs. // This value will be the maximum amount of trace IDs that the cache can hold before overwriting previous IDs. - // For effective use, this value should be at least an order of magnitude higher than Config.NumTraces. + // For effective use, this value should be at least an order of magnitude greater than Config.NumTraces. // If left as default 0, a no-op DecisionCache will be used. NonSampledCacheSize int `mapstructure:"non_sampled_cache_size"` } diff --git a/processor/tailsamplingprocessor/go.mod b/processor/tailsamplingprocessor/go.mod index 777629b8faff..5270f6799b86 100644 --- a/processor/tailsamplingprocessor/go.mod +++ b/processor/tailsamplingprocessor/go.mod @@ -68,8 +68,8 @@ require ( go.opentelemetry.io/otel/sdk v1.32.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect - golang.org/x/net v0.33.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/net v0.34.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.69.2 // indirect diff --git a/processor/tailsamplingprocessor/go.sum b/processor/tailsamplingprocessor/go.sum index f2eafd2369a2..fa90b3222bb2 100644 --- a/processor/tailsamplingprocessor/go.sum +++ b/processor/tailsamplingprocessor/go.sum @@ -163,8 +163,9 @@ golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= -golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= 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= @@ -186,8 +187,9 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= diff --git a/processor/tailsamplingprocessor/internal/sampling/composite_test.go b/processor/tailsamplingprocessor/internal/sampling/composite_test.go index c323fe849946..c813bdeddabf 100644 --- a/processor/tailsamplingprocessor/internal/sampling/composite_test.go +++ b/processor/tailsamplingprocessor/internal/sampling/composite_test.go @@ -119,7 +119,7 @@ func TestCompositeEvaluator_OverflowAlwaysSampled(t *testing.T) { decision, err = c.Evaluate(context.Background(), traceID, trace) require.NoError(t, err, "Failed to evaluate composite policy: %v", err) - // The first policy fails as the tag value is higher than the range set where as the second policy is AlwaysSample, so the decision should be Sampled. + // The first policy fails as the tag value is greater than the range set whereas the second policy is AlwaysSample, so the decision should be Sampled. expected = Sampled assert.Equal(t, expected, decision) } diff --git a/processor/tailsamplingprocessor/internal/sampling/latency.go b/processor/tailsamplingprocessor/internal/sampling/latency.go index be87f47165c9..2b24ba3a2496 100644 --- a/processor/tailsamplingprocessor/internal/sampling/latency.go +++ b/processor/tailsamplingprocessor/internal/sampling/latency.go @@ -20,7 +20,7 @@ type latency struct { var _ PolicyEvaluator = (*latency)(nil) -// NewLatency creates a policy evaluator sampling traces with a duration higher than a configured threshold +// NewLatency creates a policy evaluator sampling traces with a duration greater than a configured threshold func NewLatency(settings component.TelemetrySettings, thresholdMs int64, upperThresholdMs int64) PolicyEvaluator { return &latency{ logger: settings.Logger, diff --git a/processor/tailsamplingprocessor/internal/sampling/string_tag_filter.go b/processor/tailsamplingprocessor/internal/sampling/string_tag_filter.go index dd22d04eaa24..02f965af8bd5 100644 --- a/processor/tailsamplingprocessor/internal/sampling/string_tag_filter.go +++ b/processor/tailsamplingprocessor/internal/sampling/string_tag_filter.go @@ -92,7 +92,7 @@ func NewStringAttributeFilter(settings component.TelemetrySettings, key string, // The SamplingDecision is made by comparing the attribute values with the matching values, // which might be static strings or regular expressions. func (saf *stringAttributeFilter) Evaluate(_ context.Context, _ pcommon.TraceID, trace *TraceData) (Decision, error) { - saf.logger.Debug("Evaluting spans in string-tag filter") + saf.logger.Debug("Evaluating spans in string-tag filter") trace.Lock() defer trace.Unlock() batches := trace.ReceivedBatches @@ -111,8 +111,8 @@ func (saf *stringAttributeFilter) Evaluate(_ context.Context, _ pcommon.TraceID, }, func(span ptrace.Span) bool { if v, ok := span.Attributes().Get(saf.key); ok { - truncableStr := v.Str() - if len(truncableStr) > 0 { + truncatableStr := v.Str() + if len(truncatableStr) > 0 { if ok := saf.matcher(v.Str()); ok { return false } @@ -135,8 +135,8 @@ func (saf *stringAttributeFilter) Evaluate(_ context.Context, _ pcommon.TraceID, }, func(span ptrace.Span) bool { if v, ok := span.Attributes().Get(saf.key); ok { - truncableStr := v.Str() - if len(truncableStr) > 0 { + truncatableStr := v.Str() + if len(truncatableStr) > 0 { if ok := saf.matcher(v.Str()); ok { return true } diff --git a/processor/transformprocessor/README.md b/processor/transformprocessor/README.md index 707fa4247eae..4651ab6be710 100644 --- a/processor/transformprocessor/README.md +++ b/processor/transformprocessor/README.md @@ -6,7 +6,7 @@ | Distributions | [contrib], [k8s] | | Warnings | [Unsound Transformations, Identity Conflict, Orphaned Telemetry, Other](#warnings) | | Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Aprocessor%2Ftransform%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Aprocessor%2Ftransform) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Aprocessor%2Ftransform%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Aprocessor%2Ftransform) | -| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@TylerHelmuth](https://www.github.com/TylerHelmuth), [@kentquirk](https://www.github.com/kentquirk), [@bogdandrutu](https://www.github.com/bogdandrutu), [@evan-bradley](https://www.github.com/evan-bradley) | +| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@TylerHelmuth](https://www.github.com/TylerHelmuth), [@kentquirk](https://www.github.com/kentquirk), [@bogdandrutu](https://www.github.com/bogdandrutu), [@evan-bradley](https://www.github.com/evan-bradley), [@edmocosta](https://www.github.com/edmocosta) | [alpha]: https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/component-stability.md#alpha [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib @@ -264,7 +264,7 @@ The `extract_count_metric` function creates a new Sum metric from a Histogram, E `is_monotonic` is a boolean representing the monotonicity of the new metric. -The name for the new metric will be `_count`. The fields that are copied are: `timestamp`, `starttimestamp`, `attibutes`, `description`, and `aggregation_temporality`. As metrics of type Summary don't have an `aggregation_temporality` field, this field will be set to `AGGREGATION_TEMPORALITY_CUMULATIVE` for those metrics. +The name for the new metric will be `_count`. The fields that are copied are: `timestamp`, `starttimestamp`, `attributes`, `description`, and `aggregation_temporality`. As metrics of type Summary don't have an `aggregation_temporality` field, this field will be set to `AGGREGATION_TEMPORALITY_CUMULATIVE` for those metrics. The new metric that is created will be passed to all subsequent statements in the metrics statements list. @@ -288,7 +288,7 @@ The `extract_sum_metric` function creates a new Sum metric from a Histogram, Exp `is_monotonic` is a boolean representing the monotonicity of the new metric. -The name for the new metric will be `_sum`. The fields that are copied are: `timestamp`, `starttimestamp`, `attibutes`, `description`, and `aggregation_temporality`. As metrics of type Summary don't have an `aggregation_temporality` field, this field will be set to `AGGREGATION_TEMPORALITY_CUMULATIVE` for those metrics. +The name for the new metric will be `_sum`. The fields that are copied are: `timestamp`, `starttimestamp`, `attributes`, `description`, and `aggregation_temporality`. As metrics of type Summary don't have an `aggregation_temporality` field, this field will be set to `AGGREGATION_TEMPORALITY_CUMULATIVE` for those metrics. The new metric that is created will be passed to all subsequent statements in the metrics statements list. @@ -309,7 +309,7 @@ The `convert_summary_count_val_to_sum` function creates a new Sum metric from a `aggregation_temporality` is a string (`"cumulative"` or `"delta"`) representing the desired aggregation temporality of the new metric. `is_monotonic` is a boolean representing the monotonicity of the new metric. -The name for the new metric will be `_count`. The fields that are copied are: `timestamp`, `starttimestamp`, `attibutes`, and `description`. The new metric that is created will be passed to all functions in the metrics statements list. Function conditions will apply. +The name for the new metric will be `_count`. The fields that are copied are: `timestamp`, `starttimestamp`, `attributes`, and `description`. The new metric that is created will be passed to all functions in the metrics statements list. Function conditions will apply. **NOTE:** This function may cause a metric to break semantics for [Sum metrics](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/data-model.md#sums). Use at your own risk. @@ -328,7 +328,7 @@ The `convert_summary_sum_val_to_sum` function creates a new Sum metric from a Su `aggregation_temporality` is a string (`"cumulative"` or `"delta"`) representing the desired aggregation temporality of the new metric. `is_monotonic` is a boolean representing the monotonicity of the new metric. -The name for the new metric will be `_sum`. The fields that are copied are: `timestamp`, `starttimestamp`, `attibutes`, and `description`. The new metric that is created will be passed to all functions in the metrics statements list. Function conditions will apply. +The name for the new metric will be `_sum`. The fields that are copied are: `timestamp`, `starttimestamp`, `attributes`, and `description`. The new metric that is created will be passed to all functions in the metrics statements list. Function conditions will apply. **NOTE:** This function may cause a metric to break semantics for [Sum metrics](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/data-model.md#sums). Use at your own risk. diff --git a/processor/transformprocessor/go.mod b/processor/transformprocessor/go.mod index 2badee8f28ce..aa42430e659b 100644 --- a/processor/transformprocessor/go.mod +++ b/processor/transformprocessor/go.mod @@ -74,8 +74,8 @@ require ( go.opentelemetry.io/otel v1.32.0 // indirect go.opentelemetry.io/otel/sdk v1.32.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.32.0 // indirect - golang.org/x/net v0.33.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/net v0.34.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.69.2 // indirect diff --git a/processor/transformprocessor/go.sum b/processor/transformprocessor/go.sum index 9593fd670712..1c1b6e45b717 100644 --- a/processor/transformprocessor/go.sum +++ b/processor/transformprocessor/go.sum @@ -165,8 +165,9 @@ golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= -golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= 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= @@ -188,8 +189,9 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= diff --git a/processor/transformprocessor/internal/common/metrics.go b/processor/transformprocessor/internal/common/metrics.go index 3ae07920ca2c..f4cec79cd15e 100644 --- a/processor/transformprocessor/internal/common/metrics.go +++ b/processor/transformprocessor/internal/common/metrics.go @@ -88,7 +88,7 @@ func (d dataPointStatements) ConsumeMetrics(ctx context.Context, md pmetric.Metr case pmetric.MetricTypeHistogram: err = d.handleHistogramDataPoints(ctx, metric.Histogram().DataPoints(), metrics.At(k), metrics, smetrics.Scope(), rmetrics.Resource(), smetrics, rmetrics) case pmetric.MetricTypeExponentialHistogram: - err = d.handleExponetialHistogramDataPoints(ctx, metric.ExponentialHistogram().DataPoints(), metrics.At(k), metrics, smetrics.Scope(), rmetrics.Resource(), smetrics, rmetrics) + err = d.handleExponentialHistogramDataPoints(ctx, metric.ExponentialHistogram().DataPoints(), metrics.At(k), metrics, smetrics.Scope(), rmetrics.Resource(), smetrics, rmetrics) case pmetric.MetricTypeSummary: err = d.handleSummaryDataPoints(ctx, metric.Summary().DataPoints(), metrics.At(k), metrics, smetrics.Scope(), rmetrics.Resource(), smetrics, rmetrics) } @@ -135,7 +135,7 @@ func (d dataPointStatements) handleHistogramDataPoints(ctx context.Context, dps return nil } -func (d dataPointStatements) handleExponetialHistogramDataPoints(ctx context.Context, dps pmetric.ExponentialHistogramDataPointSlice, metric pmetric.Metric, metrics pmetric.MetricSlice, is pcommon.InstrumentationScope, resource pcommon.Resource, scopeMetrics pmetric.ScopeMetrics, resourceMetrics pmetric.ResourceMetrics) error { +func (d dataPointStatements) handleExponentialHistogramDataPoints(ctx context.Context, dps pmetric.ExponentialHistogramDataPointSlice, metric pmetric.Metric, metrics pmetric.MetricSlice, is pcommon.InstrumentationScope, resource pcommon.Resource, scopeMetrics pmetric.ScopeMetrics, resourceMetrics pmetric.ResourceMetrics) error { for i := 0; i < dps.Len(); i++ { tCtx := ottldatapoint.NewTransformContext(dps.At(i), metric, metrics, is, resource, scopeMetrics, resourceMetrics) condition, err := d.BoolExpr.Eval(ctx, tCtx) diff --git a/processor/transformprocessor/internal/logs/processor_test.go b/processor/transformprocessor/internal/logs/processor_test.go index d3e06f65ac01..448328138c21 100644 --- a/processor/transformprocessor/internal/logs/processor_test.go +++ b/processor/transformprocessor/internal/logs/processor_test.go @@ -366,13 +366,13 @@ func Test_ProcessLogs_LogContext(t *testing.T) { func Test_ProcessLogs_MixContext(t *testing.T) { tests := []struct { - name string - contextStatments []common.ContextStatements - want func(td plog.Logs) + name string + contextStatements []common.ContextStatements + want func(td plog.Logs) }{ { name: "set resource and then use", - contextStatments: []common.ContextStatements{ + contextStatements: []common.ContextStatements{ { Context: "resource", Statements: []string{ @@ -394,7 +394,7 @@ func Test_ProcessLogs_MixContext(t *testing.T) { }, { name: "set scope and then use", - contextStatments: []common.ContextStatements{ + contextStatements: []common.ContextStatements{ { Context: "scope", Statements: []string{ @@ -416,7 +416,7 @@ func Test_ProcessLogs_MixContext(t *testing.T) { }, { name: "order matters", - contextStatments: []common.ContextStatements{ + contextStatements: []common.ContextStatements{ { Context: "log", Statements: []string{ @@ -436,7 +436,7 @@ func Test_ProcessLogs_MixContext(t *testing.T) { }, { name: "reuse context", - contextStatments: []common.ContextStatements{ + contextStatements: []common.ContextStatements{ { Context: "scope", Statements: []string{ @@ -467,7 +467,7 @@ func Test_ProcessLogs_MixContext(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { td := constructLogs() - processor, err := NewProcessor(tt.contextStatments, ottl.IgnoreError, false, componenttest.NewNopTelemetrySettings()) + processor, err := NewProcessor(tt.contextStatements, ottl.IgnoreError, false, componenttest.NewNopTelemetrySettings()) assert.NoError(t, err) _, err = processor.ProcessLogs(context.Background(), td) diff --git a/processor/transformprocessor/internal/metrics/func_convert_exponential_hist_to_explicit_hist.go b/processor/transformprocessor/internal/metrics/func_convert_exponential_hist_to_explicit_hist.go index f23136ac5d66..167d5293461d 100644 --- a/processor/transformprocessor/internal/metrics/func_convert_exponential_hist_to_explicit_hist.go +++ b/processor/transformprocessor/internal/metrics/func_convert_exponential_hist_to_explicit_hist.go @@ -199,7 +199,7 @@ var midpointAlgorithm distAlgorithm = func(count uint64, (*bucketCountsDst)[len(boundaries)-1] += count // Overflow bucket } -// uniformAlgorithm distributes counts from a given set of bucket sounrces into a set of linear boundaries using uniform distribution +// uniformAlgorithm distributes counts from a given set of bucket sources into a set of linear boundaries using uniform distribution var uniformAlgorithm distAlgorithm = func(count uint64, upper, lower float64, boundaries []float64, bucketCountsDst *[]uint64, diff --git a/processor/transformprocessor/internal/metrics/func_convert_exponential_hist_to_explicit_hist_test.go b/processor/transformprocessor/internal/metrics/func_convert_exponential_hist_to_explicit_hist_test.go index aee2cdf07fea..4aede94561f5 100644 --- a/processor/transformprocessor/internal/metrics/func_convert_exponential_hist_to_explicit_hist_test.go +++ b/processor/transformprocessor/internal/metrics/func_convert_exponential_hist_to_explicit_hist_test.go @@ -191,7 +191,7 @@ func TestUpper_convert_exponential_hist_to_explicit_hist(t *testing.T) { // 0 scale exponential histogram will result in an extremely large upper bound // resulting in all the counts being in buckets much larger than the explicit bounds // thus all counts will be in the overflow bucket - name: "0 scale expontential histogram given using upper distribute", + name: "0 scale exponential histogram given using upper distribute", input: func() pmetric.Metric { m := pmetric.NewMetric() defaultTestMetric().CopyTo(m) @@ -221,7 +221,7 @@ func TestUpper_convert_exponential_hist_to_explicit_hist(t *testing.T) { }, }, { - name: "empty expontential histogram given using upper distribute", + name: "empty exponential histogram given using upper distribute", input: func() pmetric.Metric { m := pmetric.NewMetric() m.SetName("empty") @@ -236,7 +236,7 @@ func TestUpper_convert_exponential_hist_to_explicit_hist(t *testing.T) { }, }, { - name: "non-expontential histogram", + name: "non-exponential histogram", arg: []float64{0}, distribution: "upper", input: nonExponentialHist, @@ -403,7 +403,7 @@ func TestMidpoint_convert_exponential_hist_to_explicit_hist(t *testing.T) { }, }, { - name: "empty expontential histogram given", + name: "empty exponential histogram given", input: func() pmetric.Metric { m := pmetric.NewMetric() m.SetName("empty") @@ -418,7 +418,7 @@ func TestMidpoint_convert_exponential_hist_to_explicit_hist(t *testing.T) { }, }, { - name: "non-expontential histogram given using upper distribute", + name: "non-exponential histogram given using upper distribute", arg: []float64{0}, distribution: "midpoint", input: nonExponentialHist, @@ -448,7 +448,7 @@ func TestMidpoint_convert_exponential_hist_to_explicit_hist(t *testing.T) { } } -func TestUniforn_convert_exponential_hist_to_explicit_hist(t *testing.T) { +func TestUniform_convert_exponential_hist_to_explicit_hist(t *testing.T) { ts := pcommon.NewTimestampFromTime(time.Now()) defaultTestMetric := func() pmetric.Metric { m := pmetric.NewMetric() diff --git a/processor/transformprocessor/internal/metrics/processor_test.go b/processor/transformprocessor/internal/metrics/processor_test.go index 6087fcd70d74..128a9d00ced0 100644 --- a/processor/transformprocessor/internal/metrics/processor_test.go +++ b/processor/transformprocessor/internal/metrics/processor_test.go @@ -726,13 +726,13 @@ func Test_ProcessMetrics_DataPointContext(t *testing.T) { func Test_ProcessMetrics_MixContext(t *testing.T) { tests := []struct { - name string - contextStatments []common.ContextStatements - want func(td pmetric.Metrics) + name string + contextStatements []common.ContextStatements + want func(td pmetric.Metrics) }{ { name: "set resource and then use", - contextStatments: []common.ContextStatements{ + contextStatements: []common.ContextStatements{ { Context: "resource", Statements: []string{ @@ -761,7 +761,7 @@ func Test_ProcessMetrics_MixContext(t *testing.T) { }, { name: "set scope and then use", - contextStatments: []common.ContextStatements{ + contextStatements: []common.ContextStatements{ { Context: "scope", Statements: []string{ @@ -790,7 +790,7 @@ func Test_ProcessMetrics_MixContext(t *testing.T) { }, { name: "order matters", - contextStatments: []common.ContextStatements{ + contextStatements: []common.ContextStatements{ { Context: "datapoint", Statements: []string{ @@ -810,7 +810,7 @@ func Test_ProcessMetrics_MixContext(t *testing.T) { }, { name: "reuse context ", - contextStatments: []common.ContextStatements{ + contextStatements: []common.ContextStatements{ { Context: "scope", Statements: []string{ @@ -848,7 +848,7 @@ func Test_ProcessMetrics_MixContext(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { td := constructMetrics() - processor, err := NewProcessor(tt.contextStatments, ottl.IgnoreError, componenttest.NewNopTelemetrySettings()) + processor, err := NewProcessor(tt.contextStatements, ottl.IgnoreError, componenttest.NewNopTelemetrySettings()) assert.NoError(t, err) _, err = processor.ProcessMetrics(context.Background(), td) diff --git a/processor/transformprocessor/internal/traces/processor_test.go b/processor/transformprocessor/internal/traces/processor_test.go index e6928ba9fa38..0da86dfeb262 100644 --- a/processor/transformprocessor/internal/traces/processor_test.go +++ b/processor/transformprocessor/internal/traces/processor_test.go @@ -443,13 +443,13 @@ func Test_ProcessTraces_SpanEventContext(t *testing.T) { func Test_ProcessTraces_MixContext(t *testing.T) { tests := []struct { - name string - contextStatments []common.ContextStatements - want func(td ptrace.Traces) + name string + contextStatements []common.ContextStatements + want func(td ptrace.Traces) }{ { name: "set resource and then use", - contextStatments: []common.ContextStatements{ + contextStatements: []common.ContextStatements{ { Context: "resource", Statements: []string{ @@ -471,7 +471,7 @@ func Test_ProcessTraces_MixContext(t *testing.T) { }, { name: "set scope and then use", - contextStatments: []common.ContextStatements{ + contextStatements: []common.ContextStatements{ { Context: "scope", Statements: []string{ @@ -493,7 +493,7 @@ func Test_ProcessTraces_MixContext(t *testing.T) { }, { name: "order matters", - contextStatments: []common.ContextStatements{ + contextStatements: []common.ContextStatements{ { Context: "span", Statements: []string{ @@ -513,7 +513,7 @@ func Test_ProcessTraces_MixContext(t *testing.T) { }, { name: "reuse context", - contextStatments: []common.ContextStatements{ + contextStatements: []common.ContextStatements{ { Context: "scope", Statements: []string{ @@ -544,7 +544,7 @@ func Test_ProcessTraces_MixContext(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { td := constructTraces() - processor, err := NewProcessor(tt.contextStatments, ottl.IgnoreError, componenttest.NewNopTelemetrySettings()) + processor, err := NewProcessor(tt.contextStatements, ottl.IgnoreError, componenttest.NewNopTelemetrySettings()) assert.NoError(t, err) _, err = processor.ProcessTraces(context.Background(), td) diff --git a/processor/transformprocessor/metadata.yaml b/processor/transformprocessor/metadata.yaml index f1b78a1e1a59..240734a7959f 100644 --- a/processor/transformprocessor/metadata.yaml +++ b/processor/transformprocessor/metadata.yaml @@ -7,7 +7,7 @@ status: distributions: [contrib, k8s] warnings: [Unsound Transformations, Identity Conflict, Orphaned Telemetry, Other] codeowners: - active: [TylerHelmuth, kentquirk, bogdandrutu, evan-bradley] + active: [TylerHelmuth, kentquirk, bogdandrutu, evan-bradley, edmocosta] tests: config: diff --git a/receiver/activedirectorydsreceiver/go.mod b/receiver/activedirectorydsreceiver/go.mod index 94bfac41b687..bd76fb88fbd8 100644 --- a/receiver/activedirectorydsreceiver/go.mod +++ b/receiver/activedirectorydsreceiver/go.mod @@ -54,7 +54,7 @@ require ( go.opentelemetry.io/otel/sdk/metric v1.32.0 // indirect go.opentelemetry.io/otel/trace v1.32.0 // indirect golang.org/x/net v0.33.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.69.2 // indirect diff --git a/receiver/activedirectorydsreceiver/go.sum b/receiver/activedirectorydsreceiver/go.sum index 8448a867a3d2..9b11a63a5729 100644 --- a/receiver/activedirectorydsreceiver/go.sum +++ b/receiver/activedirectorydsreceiver/go.sum @@ -119,8 +119,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.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.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.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= diff --git a/receiver/awsfirehosereceiver/factory.go b/receiver/awsfirehosereceiver/factory.go index 5058ad42064d..1e6b2347276f 100644 --- a/receiver/awsfirehosereceiver/factory.go +++ b/receiver/awsfirehosereceiver/factory.go @@ -13,7 +13,6 @@ import ( "go.opentelemetry.io/collector/receiver" "go.uber.org/zap" - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/common/testutil" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awsfirehosereceiver/internal/metadata" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awsfirehosereceiver/internal/unmarshaler" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awsfirehosereceiver/internal/unmarshaler/cwlog" @@ -22,8 +21,7 @@ import ( ) const ( - defaultEndpoint = "0.0.0.0:4433" - defaultPort = 4433 + defaultEndpoint = "localhost:4433" ) var ( @@ -78,7 +76,7 @@ func defaultLogsUnmarshalers(logger *zap.Logger) map[string]unmarshaler.LogsUnma func createDefaultConfig() component.Config { return &Config{ ServerConfig: confighttp.ServerConfig{ - Endpoint: testutil.EndpointForPort(defaultPort), + Endpoint: defaultEndpoint, }, } } diff --git a/receiver/awsfirehosereceiver/go.mod b/receiver/awsfirehosereceiver/go.mod index daa42d826da7..d06e8866eaec 100644 --- a/receiver/awsfirehosereceiver/go.mod +++ b/receiver/awsfirehosereceiver/go.mod @@ -4,7 +4,6 @@ go 1.22.0 require ( github.com/gogo/protobuf v1.3.2 - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.117.0 github.com/stretchr/testify v1.10.0 go.opentelemetry.io/collector/component v0.117.0 go.opentelemetry.io/collector/component/componentstatus v0.117.0 @@ -33,7 +32,6 @@ require ( github.com/go-viper/mapstructure/v2 v2.2.1 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/uuid v1.6.0 // indirect - github.com/hashicorp/go-version v1.7.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.17.11 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect @@ -53,7 +51,6 @@ require ( go.opentelemetry.io/collector/consumer/xconsumer v0.117.0 // indirect go.opentelemetry.io/collector/extension v0.117.0 // indirect go.opentelemetry.io/collector/extension/auth v0.117.0 // indirect - go.opentelemetry.io/collector/featuregate v1.23.0 // indirect go.opentelemetry.io/collector/pdata/pprofile v0.117.0 // indirect go.opentelemetry.io/collector/pipeline v0.117.0 // indirect go.opentelemetry.io/collector/receiver/xreceiver v0.117.0 // indirect @@ -78,5 +75,3 @@ retract ( v0.76.1 v0.65.0 ) - -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => ../../internal/common diff --git a/receiver/awsfirehosereceiver/go.sum b/receiver/awsfirehosereceiver/go.sum index 9ae5164809d2..7843e6073fcf 100644 --- a/receiver/awsfirehosereceiver/go.sum +++ b/receiver/awsfirehosereceiver/go.sum @@ -23,8 +23,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/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= @@ -100,8 +98,6 @@ go.opentelemetry.io/collector/extension/auth v0.117.0 h1:tXQdYIdcABXalWyFZP22pRE go.opentelemetry.io/collector/extension/auth v0.117.0/go.mod h1:ofrV2BuE46+k7Su/h0ccrMl5Zk5Y7NVlzOb3AwU7Dzw= go.opentelemetry.io/collector/extension/auth/authtest v0.117.0 h1:wV4OIiWrt7gteQrxL8MCmGvjGhMiu5TplKJHOfVZO6Y= go.opentelemetry.io/collector/extension/auth/authtest v0.117.0/go.mod h1:nHxcAOyo26JnuYwKIoQM9mDlSXpERQrbjIw3Dtp9hug= -go.opentelemetry.io/collector/featuregate v1.23.0 h1:N033ROo85qKrsK16QzR6RV+3UWOWF7kpOO8FSnX99s0= -go.opentelemetry.io/collector/featuregate v1.23.0/go.mod h1:3GaXqflNDVwWndNGBJ1+XJFy3Fv/XrFgjMN60N3z7yg= go.opentelemetry.io/collector/pdata v1.23.0 h1:tEk0dkfB8RdSukoOMfEa8duB938gfZowdfRkrJxGDrw= go.opentelemetry.io/collector/pdata v1.23.0/go.mod h1:I2jggpBMiO8A+7TXhzNpcJZkJtvi1cU0iVNIi+6bc+o= go.opentelemetry.io/collector/pdata/pprofile v0.117.0 h1:AyOK+rkNGeawmLGUqF84wYks22BSGJtEV++3YSfvD1I= diff --git a/receiver/awss3receiver/go.mod b/receiver/awss3receiver/go.mod index ac70927012ef..91d9e27f21df 100644 --- a/receiver/awss3receiver/go.mod +++ b/receiver/awss3receiver/go.mod @@ -5,9 +5,9 @@ go 1.22.0 require ( github.com/aws/aws-sdk-go-v2 v1.32.7 github.com/aws/aws-sdk-go-v2/config v1.28.7 - github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.44 - github.com/aws/aws-sdk-go-v2/service/s3 v1.71.1 - github.com/open-telemetry/opamp-go v0.17.0 + github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.45 + github.com/aws/aws-sdk-go-v2/service/s3 v1.72.0 + github.com/open-telemetry/opamp-go v0.18.0 github.com/open-telemetry/opentelemetry-collector-contrib/extension/opampcustommessages v0.117.0 github.com/stretchr/testify v1.10.0 go.opentelemetry.io/collector/component v0.117.0 diff --git a/receiver/awss3receiver/go.sum b/receiver/awss3receiver/go.sum index 04352bba946b..ff44222ee522 100644 --- a/receiver/awss3receiver/go.sum +++ b/receiver/awss3receiver/go.sum @@ -8,8 +8,8 @@ github.com/aws/aws-sdk-go-v2/credentials v1.17.48 h1:IYdLD1qTJ0zanRavulofmqut4af github.com/aws/aws-sdk-go-v2/credentials v1.17.48/go.mod h1:tOscxHN3CGmuX9idQ3+qbkzrjVIx32lqDSU1/0d/qXs= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.22 h1:kqOrpojG71DxJm/KDPO+Z/y1phm1JlC8/iT+5XRmAn8= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.22/go.mod h1:NtSFajXVVL8TA2QNngagVZmUtXciyrHOt7xgz4faS/M= -github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.44 h1:2zxMLXLedpB4K1ilbJFxtMKsVKaexOqDttOhc0QGm3Q= -github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.44/go.mod h1:VuLHdqwjSvgftNC7yqPWyGVhEwPmJpeRi07gOgOfHF8= +github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.45 h1:ZxB8WFVYwolhDZxuZXoesHkl+L9cXLWy0K/G0QkNATc= +github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.45/go.mod h1:1krrbyoFFDqaNldmltPTP+mK3sAXLHPoaFtISOw2Hkk= github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.26 h1:I/5wmGMffY4happ8NOCuIUEWGUvvFp5NSeQcXl9RHcI= github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.26/go.mod h1:FR8f4turZtNy6baO0KJ5FJUmXH/cSkI9fOngs0yl6mA= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.26 h1:zXFLuEuMMUOvEARXFUVJdfqZ4bvvSgdGRq/ATcrQxzM= @@ -26,8 +26,8 @@ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.7 h1:8eUsivBQz github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.7/go.mod h1:kLPQvGUmxn/fqiCrDeohwG33bq2pQpGeY62yRO6Nrh0= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.7 h1:Hi0KGbrnr57bEHWM0bJ1QcBzxLrL/k2DHvGYhb8+W1w= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.7/go.mod h1:wKNgWgExdjjrm4qvfbTorkvocEstaoDl4WCvGfeCy9c= -github.com/aws/aws-sdk-go-v2/service/s3 v1.71.1 h1:aOVVZJgWbaH+EJYPvEgkNhCEbXXvH7+oML36oaPK3zE= -github.com/aws/aws-sdk-go-v2/service/s3 v1.71.1/go.mod h1:r+xl5yzMk9083rMR+sJ5TYj9Tihvf/l1oxzZXDgGj2Q= +github.com/aws/aws-sdk-go-v2/service/s3 v1.72.0 h1:SAfh4pNx5LuTafKKWR02Y+hL3A+3TX8cTKG1OIAJaBk= +github.com/aws/aws-sdk-go-v2/service/s3 v1.72.0/go.mod h1:r+xl5yzMk9083rMR+sJ5TYj9Tihvf/l1oxzZXDgGj2Q= github.com/aws/aws-sdk-go-v2/service/sso v1.24.8 h1:CvuUmnXI7ebaUAhbJcDy9YQx8wHR69eZ9I7q5hszt/g= github.com/aws/aws-sdk-go-v2/service/sso v1.24.8/go.mod h1:XDeGv1opzwm8ubxddF0cgqkZWsyOtw4lr6dxwmb6YQg= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.7 h1:F2rBfNAL5UyswqoeWv9zs74N/NanhK16ydHW1pahX6E= @@ -79,8 +79,8 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/open-telemetry/opamp-go v0.17.0 h1:3R4+B/6Sy8mknLBbzO3gqloqwTT02rCSRcr4ac2B124= -github.com/open-telemetry/opamp-go v0.17.0/go.mod h1:SGDhUoAx7uGutO4ENNMQla/tiSujxgZmMPJXIOPGBdk= +github.com/open-telemetry/opamp-go v0.18.0 h1:sNHsrBvGU2CMxCB1TRJXncDARrmxDEebx8dsEIawqA4= +github.com/open-telemetry/opamp-go v0.18.0/go.mod h1:9/1G6T5dnJz4cJtoYSr6AX18kHdOxnxxETJPZSHyEUg= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= diff --git a/receiver/awsxrayreceiver/factory.go b/receiver/awsxrayreceiver/factory.go index e0c802fa4778..d739fb14f807 100644 --- a/receiver/awsxrayreceiver/factory.go +++ b/receiver/awsxrayreceiver/factory.go @@ -12,12 +12,11 @@ import ( "go.opentelemetry.io/collector/receiver" "github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/proxy" - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/common/testutil" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awsxrayreceiver/internal/metadata" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awsxrayreceiver/internal/udppoller" ) -const defaultPort = 2000 +const defaultEndpoint = "localhost:2000" // NewFactory creates a factory for AWS receiver. func NewFactory() receiver.Factory { @@ -33,7 +32,7 @@ func createDefaultConfig() component.Config { // https://github.com/aws/aws-xray-daemon/blob/master/pkg/cfg/cfg.go#L99 return &Config{ AddrConfig: confignet.AddrConfig{ - Endpoint: testutil.EndpointForPort(defaultPort), + Endpoint: defaultEndpoint, Transport: udppoller.Transport, }, ProxyServer: proxy.DefaultConfig(), diff --git a/receiver/awsxrayreceiver/go.mod b/receiver/awsxrayreceiver/go.mod index f5e8aab30ab3..c9b161fe4bfb 100644 --- a/receiver/awsxrayreceiver/go.mod +++ b/receiver/awsxrayreceiver/go.mod @@ -63,8 +63,8 @@ require ( go.opentelemetry.io/otel/sdk/metric v1.32.0 // indirect go.opentelemetry.io/otel/trace v1.32.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/net v0.33.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/net v0.34.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.69.2 // indirect diff --git a/receiver/awsxrayreceiver/go.sum b/receiver/awsxrayreceiver/go.sum index e775b5ddf342..eaec434920e0 100644 --- a/receiver/awsxrayreceiver/go.sum +++ b/receiver/awsxrayreceiver/go.sum @@ -129,16 +129,16 @@ 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.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= -golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= 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.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.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.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= diff --git a/receiver/filelogreceiver/go.mod b/receiver/filelogreceiver/go.mod index 308243057993..12faad144651 100644 --- a/receiver/filelogreceiver/go.mod +++ b/receiver/filelogreceiver/go.mod @@ -70,7 +70,7 @@ require ( go.uber.org/zap v1.27.0 // indirect golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect golang.org/x/net v0.33.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect gonum.org/v1/gonum v0.15.1 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect diff --git a/receiver/filelogreceiver/go.sum b/receiver/filelogreceiver/go.sum index 53abbd332b91..988cbe052f8b 100644 --- a/receiver/filelogreceiver/go.sum +++ b/receiver/filelogreceiver/go.sum @@ -150,8 +150,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.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.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.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= diff --git a/receiver/githubreceiver/go.mod b/receiver/githubreceiver/go.mod index 993de6852371..82d28b8f4496 100644 --- a/receiver/githubreceiver/go.mod +++ b/receiver/githubreceiver/go.mod @@ -5,7 +5,7 @@ go 1.22.8 require ( github.com/Khan/genqlient v0.7.0 github.com/google/go-cmp v0.6.0 - github.com/google/go-github/v67 v67.0.0 + github.com/google/go-github/v68 v68.0.0 github.com/gorilla/mux v1.8.1 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.117.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.117.0 diff --git a/receiver/githubreceiver/go.sum b/receiver/githubreceiver/go.sum index 6aef258ecc30..857011fdf38a 100644 --- a/receiver/githubreceiver/go.sum +++ b/receiver/githubreceiver/go.sum @@ -37,8 +37,8 @@ github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEW github.com/google/go-cmp v0.5.2/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/go-github/v67 v67.0.0 h1:g11NDAmfaBaCO8qYdI9fsmbaRipHNWRIU/2YGvlh4rg= -github.com/google/go-github/v67 v67.0.0/go.mod h1:zH3K7BxjFndr9QSeFibx4lTKkYS3K9nDanoI1NjaOtY= +github.com/google/go-github/v68 v68.0.0 h1:ZW57zeNZiXTdQ16qrDiZ0k6XucrxZ2CGmoTvcCyQG6s= +github.com/google/go-github/v68 v68.0.0/go.mod h1:K9HAUBovM2sLwM408A18h+wd9vqdLOEqTUCbnRIcx68= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= diff --git a/receiver/githubreceiver/internal/scraper/githubscraper/github_scraper_test.go b/receiver/githubreceiver/internal/scraper/githubscraper/github_scraper_test.go index 85e8cec8de4c..d712f5093fe5 100644 --- a/receiver/githubreceiver/internal/scraper/githubscraper/github_scraper_test.go +++ b/receiver/githubreceiver/internal/scraper/githubscraper/github_scraper_test.go @@ -11,7 +11,7 @@ import ( "testing" "time" - "github.com/google/go-github/v67/github" + "github.com/google/go-github/v68/github" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component/componenttest" @@ -148,7 +148,7 @@ func TestScrape(t *testing.T) { contribs: [][]*github.Contributor{ { { - ID: github.Int64(1), + ID: github.Ptr(int64(1)), }, }, }, diff --git a/receiver/githubreceiver/internal/scraper/githubscraper/helpers.go b/receiver/githubreceiver/internal/scraper/githubscraper/helpers.go index 4630ec1acb10..4a9753525176 100644 --- a/receiver/githubreceiver/internal/scraper/githubscraper/helpers.go +++ b/receiver/githubreceiver/internal/scraper/githubscraper/helpers.go @@ -12,7 +12,7 @@ import ( "time" "github.com/Khan/genqlient/graphql" - "github.com/google/go-github/v67/github" + "github.com/google/go-github/v68/github" ) const ( diff --git a/receiver/githubreceiver/internal/scraper/githubscraper/helpers_test.go b/receiver/githubreceiver/internal/scraper/githubscraper/helpers_test.go index 859859f1e36d..e7341ef73066 100644 --- a/receiver/githubreceiver/internal/scraper/githubscraper/helpers_test.go +++ b/receiver/githubreceiver/internal/scraper/githubscraper/helpers_test.go @@ -15,7 +15,7 @@ import ( "time" "github.com/Khan/genqlient/graphql" - "github.com/google/go-github/v67/github" + "github.com/google/go-github/v68/github" "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/receiver/receivertest" ) @@ -685,10 +685,10 @@ func TestGetContributors(t *testing.T) { contribResponse: contribResponse{ contribs: [][]*github.Contributor{{ { - ID: github.Int64(1), + ID: github.Ptr(int64(1)), }, { - ID: github.Int64(2), + ID: github.Ptr(int64(2)), }, }}, responseCode: http.StatusOK, diff --git a/receiver/githubreceiver/traces_receiver.go b/receiver/githubreceiver/traces_receiver.go index 7a9ebc62c382..13486b70ab1d 100644 --- a/receiver/githubreceiver/traces_receiver.go +++ b/receiver/githubreceiver/traces_receiver.go @@ -10,7 +10,7 @@ import ( "net/http" "sync" - "github.com/google/go-github/v67/github" + "github.com/google/go-github/v68/github" "github.com/gorilla/mux" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componentstatus" diff --git a/receiver/googlecloudmonitoringreceiver/go.mod b/receiver/googlecloudmonitoringreceiver/go.mod index 75316171d384..b3c6602803b4 100644 --- a/receiver/googlecloudmonitoringreceiver/go.mod +++ b/receiver/googlecloudmonitoringreceiver/go.mod @@ -14,8 +14,8 @@ require ( go.opentelemetry.io/collector/receiver/receivertest v0.117.0 go.opentelemetry.io/collector/scraper/scraperhelper v0.117.0 go.uber.org/zap v1.27.0 - golang.org/x/oauth2 v0.24.0 - google.golang.org/genproto/googleapis/api v0.0.0-20241118233622-e639e219e697 + golang.org/x/oauth2 v0.25.0 + google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576 ) require ( @@ -24,7 +24,7 @@ require ( cloud.google.com/go/compute/metadata v0.6.0 // indirect github.com/google/s2a-go v0.1.8 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect - github.com/googleapis/gax-go/v2 v2.14.0 // indirect + github.com/googleapis/gax-go/v2 v2.14.1 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect go.opentelemetry.io/collector/consumer/consumererror v0.117.0 // indirect go.opentelemetry.io/collector/consumer/xconsumer v0.117.0 // indirect @@ -66,8 +66,8 @@ require ( golang.org/x/net v0.33.0 // indirect golang.org/x/sys v0.28.0 // indirect golang.org/x/text v0.21.0 // indirect - google.golang.org/api v0.214.0 - google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576 // indirect + google.golang.org/api v0.215.0 + google.golang.org/genproto/googleapis/rpc v0.0.0-20241223144023-3abc09e42ca8 // indirect google.golang.org/grpc v1.69.2 // indirect google.golang.org/protobuf v1.36.2 gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/receiver/googlecloudmonitoringreceiver/go.sum b/receiver/googlecloudmonitoringreceiver/go.sum index 7ad7522b7e6e..a605c0540be9 100644 --- a/receiver/googlecloudmonitoringreceiver/go.sum +++ b/receiver/googlecloudmonitoringreceiver/go.sum @@ -31,8 +31,8 @@ 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/googleapis/enterprise-certificate-proxy v0.3.4 h1:XYIDZApgAnrN1c855gTgghdIA6Stxb52D5RnLI1SLyw= github.com/googleapis/enterprise-certificate-proxy v0.3.4/go.mod h1:YKe7cfqYXjKGpGvmSg28/fFvhNzinZQm8DGnaburhGA= -github.com/googleapis/gax-go/v2 v2.14.0 h1:f+jMrjBPl+DL9nI4IQzLUxMq7XrAqFYB7hBPqMNIe8o= -github.com/googleapis/gax-go/v2 v2.14.0/go.mod h1:lhBCnjdLrWRaPvLWhmc8IS24m9mr07qSYnHncrgo+zk= +github.com/googleapis/gax-go/v2 v2.14.1 h1:hb0FFeiPaQskmvakKu5EbCbpntQn48jyHuvrkurSS/Q= +github.com/googleapis/gax-go/v2 v2.14.1/go.mod h1:Hb/NubMaVM88SrNkvl8X/o8XWwDJEPqouaLeN2IUxoA= 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= @@ -133,8 +133,8 @@ golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= -golang.org/x/oauth2 v0.24.0 h1:KTBBxWqUa0ykRPLtV69rRto9TLXcqYkeswu48x/gvNE= -golang.org/x/oauth2 v0.24.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.25.0 h1:CY4y7XT9v0cRI9oupztF8AgiIu99L/ksR/Xp/6jrZ70= +golang.org/x/oauth2 v0.25.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= 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= @@ -159,14 +159,14 @@ 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/api v0.214.0 h1:h2Gkq07OYi6kusGOaT/9rnNljuXmqPnaig7WGPmKbwA= -google.golang.org/api v0.214.0/go.mod h1:bYPpLG8AyeMWwDU6NXoB00xC0DFkikVvd5MfwoxjLqE= +google.golang.org/api v0.215.0 h1:jdYF4qnyczlEz2ReWIsosNLDuzXyvFHJtI5gcr0J7t0= +google.golang.org/api v0.215.0/go.mod h1:fta3CVtuJYOEdugLNWm6WodzOS8KdFckABwN4I40hzY= google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 h1:ToEetK57OidYuqD4Q5w+vfEnPvPpuTwedCNVohYJfNk= google.golang.org/genproto v0.0.0-20241118233622-e639e219e697/go.mod h1:JJrvXBWRZaFMxBufik1a4RpFw4HhgVtBBWQeQgUj2cc= -google.golang.org/genproto/googleapis/api v0.0.0-20241118233622-e639e219e697 h1:pgr/4QbFyktUv9CtQ/Fq4gzEE6/Xs7iCXbktaGzLHbQ= -google.golang.org/genproto/googleapis/api v0.0.0-20241118233622-e639e219e697/go.mod h1:+D9ySVjN8nY8YCVjc5O7PZDIdZporIDY3KaGfJunh88= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576 h1:8ZmaLZE4XWrtU3MyClkYqqtl6Oegr3235h7jxsDyqCY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576/go.mod h1:5uTbfoYQed2U9p3KIj2/Zzm02PYhndfdmML0qC3q3FU= +google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576 h1:CkkIfIt50+lT6NHAVoRYEyAvQGFM7xEwXUUywFvEb3Q= +google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576/go.mod h1:1R3kvZ1dtP3+4p4d3G8uJ8rFk/fWlScl38vanWACI08= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241223144023-3abc09e42ca8 h1:TqExAhdPaB60Ux47Cn0oLV07rGnxZzIsaRhQaqS666A= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241223144023-3abc09e42ca8/go.mod h1:lcTa1sDdWEIHMWlITnIczmw5w60CF9ffkb8Z+DVmmjA= google.golang.org/grpc v1.69.2 h1:U3S9QEtbXC0bYNvRtcoklF3xGtLViumSYxWykJS+7AU= google.golang.org/grpc v1.69.2/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4= google.golang.org/protobuf v1.36.2 h1:R8FeyR1/eLmkutZOM5CWghmo5itiG9z0ktFlTVLuTmU= diff --git a/receiver/googlecloudpubsubreceiver/go.mod b/receiver/googlecloudpubsubreceiver/go.mod index 4e4cda1199e2..a34ff926fc41 100644 --- a/receiver/googlecloudpubsubreceiver/go.mod +++ b/receiver/googlecloudpubsubreceiver/go.mod @@ -21,9 +21,9 @@ require ( go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.27.0 - google.golang.org/api v0.214.0 + google.golang.org/api v0.215.0 google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 - google.golang.org/genproto/googleapis/api v0.0.0-20241118233622-e639e219e697 + google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576 google.golang.org/grpc v1.69.2 google.golang.org/protobuf v1.36.2 ) @@ -46,7 +46,7 @@ require ( github.com/google/s2a-go v0.1.8 // indirect github.com/google/uuid v1.6.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect - github.com/googleapis/gax-go/v2 v2.14.0 // indirect + github.com/googleapis/gax-go/v2 v2.14.1 // 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 @@ -83,7 +83,7 @@ require ( golang.org/x/sys v0.28.0 // indirect golang.org/x/text v0.21.0 // indirect golang.org/x/time v0.8.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20241223144023-3abc09e42ca8 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/receiver/googlecloudpubsubreceiver/go.sum b/receiver/googlecloudpubsubreceiver/go.sum index 55a2156406d1..5ca8b1668615 100644 --- a/receiver/googlecloudpubsubreceiver/go.sum +++ b/receiver/googlecloudpubsubreceiver/go.sum @@ -71,8 +71,8 @@ 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/googleapis/enterprise-certificate-proxy v0.3.4 h1:XYIDZApgAnrN1c855gTgghdIA6Stxb52D5RnLI1SLyw= github.com/googleapis/enterprise-certificate-proxy v0.3.4/go.mod h1:YKe7cfqYXjKGpGvmSg28/fFvhNzinZQm8DGnaburhGA= -github.com/googleapis/gax-go/v2 v2.14.0 h1:f+jMrjBPl+DL9nI4IQzLUxMq7XrAqFYB7hBPqMNIe8o= -github.com/googleapis/gax-go/v2 v2.14.0/go.mod h1:lhBCnjdLrWRaPvLWhmc8IS24m9mr07qSYnHncrgo+zk= +github.com/googleapis/gax-go/v2 v2.14.1 h1:hb0FFeiPaQskmvakKu5EbCbpntQn48jyHuvrkurSS/Q= +github.com/googleapis/gax-go/v2 v2.14.1/go.mod h1:Hb/NubMaVM88SrNkvl8X/o8XWwDJEPqouaLeN2IUxoA= 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/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= @@ -242,8 +242,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.214.0 h1:h2Gkq07OYi6kusGOaT/9rnNljuXmqPnaig7WGPmKbwA= -google.golang.org/api v0.214.0/go.mod h1:bYPpLG8AyeMWwDU6NXoB00xC0DFkikVvd5MfwoxjLqE= +google.golang.org/api v0.215.0 h1:jdYF4qnyczlEz2ReWIsosNLDuzXyvFHJtI5gcr0J7t0= +google.golang.org/api v0.215.0/go.mod h1:fta3CVtuJYOEdugLNWm6WodzOS8KdFckABwN4I40hzY= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= @@ -251,10 +251,10 @@ google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98 google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 h1:ToEetK57OidYuqD4Q5w+vfEnPvPpuTwedCNVohYJfNk= google.golang.org/genproto v0.0.0-20241118233622-e639e219e697/go.mod h1:JJrvXBWRZaFMxBufik1a4RpFw4HhgVtBBWQeQgUj2cc= -google.golang.org/genproto/googleapis/api v0.0.0-20241118233622-e639e219e697 h1:pgr/4QbFyktUv9CtQ/Fq4gzEE6/Xs7iCXbktaGzLHbQ= -google.golang.org/genproto/googleapis/api v0.0.0-20241118233622-e639e219e697/go.mod h1:+D9ySVjN8nY8YCVjc5O7PZDIdZporIDY3KaGfJunh88= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576 h1:8ZmaLZE4XWrtU3MyClkYqqtl6Oegr3235h7jxsDyqCY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576/go.mod h1:5uTbfoYQed2U9p3KIj2/Zzm02PYhndfdmML0qC3q3FU= +google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576 h1:CkkIfIt50+lT6NHAVoRYEyAvQGFM7xEwXUUywFvEb3Q= +google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576/go.mod h1:1R3kvZ1dtP3+4p4d3G8uJ8rFk/fWlScl38vanWACI08= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241223144023-3abc09e42ca8 h1:TqExAhdPaB60Ux47Cn0oLV07rGnxZzIsaRhQaqS666A= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241223144023-3abc09e42ca8/go.mod h1:lcTa1sDdWEIHMWlITnIczmw5w60CF9ffkb8Z+DVmmjA= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= diff --git a/receiver/googlecloudspannerreceiver/go.mod b/receiver/googlecloudspannerreceiver/go.mod index a125026f868c..6815f6ec3b3b 100644 --- a/receiver/googlecloudspannerreceiver/go.mod +++ b/receiver/googlecloudspannerreceiver/go.mod @@ -20,7 +20,7 @@ require ( go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.27.0 - google.golang.org/api v0.214.0 + google.golang.org/api v0.215.0 google.golang.org/grpc v1.69.2 gopkg.in/yaml.v3 v3.0.1 ) @@ -51,7 +51,7 @@ require ( github.com/google/s2a-go v0.1.8 // indirect github.com/google/uuid v1.6.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect - github.com/googleapis/gax-go/v2 v2.14.0 // indirect + github.com/googleapis/gax-go/v2 v2.14.1 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect github.com/knadh/koanf/providers/confmap v0.1.0 // indirect @@ -87,8 +87,8 @@ require ( golang.org/x/text v0.21.0 // indirect golang.org/x/time v0.8.0 // indirect google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20241113202542-65e8d215514f // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20241223144023-3abc09e42ca8 // indirect google.golang.org/protobuf v1.36.2 // indirect ) diff --git a/receiver/googlecloudspannerreceiver/go.sum b/receiver/googlecloudspannerreceiver/go.sum index 5096b40806e9..e1cc29f48ee2 100644 --- a/receiver/googlecloudspannerreceiver/go.sum +++ b/receiver/googlecloudspannerreceiver/go.sum @@ -821,8 +821,8 @@ github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqE github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= github.com/googleapis/gax-go/v2 v2.7.0/go.mod h1:TEop28CZZQ2y+c0VxMUmu1lV+fQx57QpBWsYpwqHJx8= github.com/googleapis/gax-go/v2 v2.7.1/go.mod h1:4orTrqY6hXxxaUL4LHIPl6lGo8vAE38/qKbhSAKP6QI= -github.com/googleapis/gax-go/v2 v2.14.0 h1:f+jMrjBPl+DL9nI4IQzLUxMq7XrAqFYB7hBPqMNIe8o= -github.com/googleapis/gax-go/v2 v2.14.0/go.mod h1:lhBCnjdLrWRaPvLWhmc8IS24m9mr07qSYnHncrgo+zk= +github.com/googleapis/gax-go/v2 v2.14.1 h1:hb0FFeiPaQskmvakKu5EbCbpntQn48jyHuvrkurSS/Q= +github.com/googleapis/gax-go/v2 v2.14.1/go.mod h1:Hb/NubMaVM88SrNkvl8X/o8XWwDJEPqouaLeN2IUxoA= github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= @@ -1431,8 +1431,8 @@ google.golang.org/api v0.108.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/ google.golang.org/api v0.110.0/go.mod h1:7FC4Vvx1Mooxh8C5HWjzZHcavuS2f6pmJpZx60ca7iI= google.golang.org/api v0.111.0/go.mod h1:qtFHvU9mhgTJegR31csQ+rwxyUTHOKFqCKWp1J0fdw0= google.golang.org/api v0.114.0/go.mod h1:ifYI2ZsFK6/uGddGfAD5BMxlnkBqCmqHSDUVi45N5Yg= -google.golang.org/api v0.214.0 h1:h2Gkq07OYi6kusGOaT/9rnNljuXmqPnaig7WGPmKbwA= -google.golang.org/api v0.214.0/go.mod h1:bYPpLG8AyeMWwDU6NXoB00xC0DFkikVvd5MfwoxjLqE= +google.golang.org/api v0.215.0 h1:jdYF4qnyczlEz2ReWIsosNLDuzXyvFHJtI5gcr0J7t0= +google.golang.org/api v0.215.0/go.mod h1:fta3CVtuJYOEdugLNWm6WodzOS8KdFckABwN4I40hzY= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1574,10 +1574,10 @@ google.golang.org/genproto v0.0.0-20230331144136-dcfb400f0633/go.mod h1:UUQDJDOl google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 h1:ToEetK57OidYuqD4Q5w+vfEnPvPpuTwedCNVohYJfNk= google.golang.org/genproto v0.0.0-20241118233622-e639e219e697/go.mod h1:JJrvXBWRZaFMxBufik1a4RpFw4HhgVtBBWQeQgUj2cc= -google.golang.org/genproto/googleapis/api v0.0.0-20241113202542-65e8d215514f h1:M65LEviCfuZTfrfzwwEoxVtgvfkFkBUbFnRbxCXuXhU= -google.golang.org/genproto/googleapis/api v0.0.0-20241113202542-65e8d215514f/go.mod h1:Yo94eF2nj7igQt+TiJ49KxjIH8ndLYPZMIRSiRcEbg0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576 h1:8ZmaLZE4XWrtU3MyClkYqqtl6Oegr3235h7jxsDyqCY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576/go.mod h1:5uTbfoYQed2U9p3KIj2/Zzm02PYhndfdmML0qC3q3FU= +google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576 h1:CkkIfIt50+lT6NHAVoRYEyAvQGFM7xEwXUUywFvEb3Q= +google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576/go.mod h1:1R3kvZ1dtP3+4p4d3G8uJ8rFk/fWlScl38vanWACI08= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241223144023-3abc09e42ca8 h1:TqExAhdPaB60Ux47Cn0oLV07rGnxZzIsaRhQaqS666A= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241223144023-3abc09e42ca8/go.mod h1:lcTa1sDdWEIHMWlITnIczmw5w60CF9ffkb8Z+DVmmjA= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/receiver/hostmetricsreceiver/config.go b/receiver/hostmetricsreceiver/config.go index f4adbf86077a..5e6ba246d1c4 100644 --- a/receiver/hostmetricsreceiver/config.go +++ b/receiver/hostmetricsreceiver/config.go @@ -19,7 +19,7 @@ import ( // Config defines configuration for HostMetrics receiver. type Config struct { scraperhelper.ControllerConfig `mapstructure:",squash"` - Scrapers map[component.Type]internal.Config `mapstructure:"-"` + Scrapers map[component.Type]component.Config `mapstructure:"-"` // RootPath is the host's root directory (linux only). RootPath string `mapstructure:"root_path"` @@ -58,7 +58,7 @@ func (cfg *Config) Unmarshal(componentParser *confmap.Conf) error { // dynamically load the individual collector configs based on the key name - cfg.Scrapers = map[component.Type]internal.Config{} + cfg.Scrapers = map[component.Type]component.Config{} scrapersSection, err := componentParser.Sub("scrapers") if err != nil { @@ -84,7 +84,9 @@ func (cfg *Config) Unmarshal(componentParser *confmap.Conf) error { return fmt.Errorf("error reading settings for scraper type %q: %w", key, err) } - scraperCfg.SetRootPath(cfg.RootPath) + if iCfg, ok := scraperCfg.(internal.Config); ok { + iCfg.SetRootPath(cfg.RootPath) + } cfg.Scrapers[key] = scraperCfg } diff --git a/receiver/hostmetricsreceiver/config_test.go b/receiver/hostmetricsreceiver/config_test.go index 48d655eaa0c6..0e2f82727690 100644 --- a/receiver/hostmetricsreceiver/config_test.go +++ b/receiver/hostmetricsreceiver/config_test.go @@ -15,7 +15,6 @@ import ( "go.opentelemetry.io/collector/scraper/scraperhelper" "github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter/filterset" - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/metadata" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/cpuscraper" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/diskscraper" @@ -43,8 +42,8 @@ func TestLoadConfig(t *testing.T) { id: component.NewID(metadata.Type), expected: func() component.Config { cfg := createDefaultConfig().(*Config) - cfg.Scrapers = map[component.Type]internal.Config{ - cpuscraper.Type: func() internal.Config { + cfg.Scrapers = map[component.Type]component.Config{ + cpuscraper.Type: func() component.Config { cfg := (&cpuscraper.Factory{}).CreateDefaultConfig() return cfg }(), @@ -60,29 +59,29 @@ func TestLoadConfig(t *testing.T) { CollectionInterval: 30 * time.Second, InitialDelay: time.Second, }, - Scrapers: map[component.Type]internal.Config{ - cpuscraper.Type: func() internal.Config { + Scrapers: map[component.Type]component.Config{ + cpuscraper.Type: func() component.Config { cfg := (&cpuscraper.Factory{}).CreateDefaultConfig() return cfg }(), - diskscraper.Type: func() internal.Config { + diskscraper.Type: func() component.Config { cfg := (&diskscraper.Factory{}).CreateDefaultConfig() return cfg }(), - loadscraper.Type: (func() internal.Config { + loadscraper.Type: (func() component.Config { cfg := (&loadscraper.Factory{}).CreateDefaultConfig() cfg.(*loadscraper.Config).CPUAverage = true return cfg })(), - filesystemscraper.Type: func() internal.Config { + filesystemscraper.Type: func() component.Config { cfg := (&filesystemscraper.Factory{}).CreateDefaultConfig() return cfg }(), - memoryscraper.Type: func() internal.Config { + memoryscraper.Type: func() component.Config { cfg := (&memoryscraper.Factory{}).CreateDefaultConfig() return cfg }(), - networkscraper.Type: (func() internal.Config { + networkscraper.Type: (func() component.Config { cfg := (&networkscraper.Factory{}).CreateDefaultConfig() cfg.(*networkscraper.Config).Include = networkscraper.MatchConfig{ Interfaces: []string{"test1"}, @@ -90,15 +89,15 @@ func TestLoadConfig(t *testing.T) { } return cfg })(), - processesscraper.Type: func() internal.Config { + processesscraper.Type: func() component.Config { cfg := (&processesscraper.Factory{}).CreateDefaultConfig() return cfg }(), - pagingscraper.Type: func() internal.Config { + pagingscraper.Type: func() component.Config { cfg := (&pagingscraper.Factory{}).CreateDefaultConfig() return cfg }(), - processscraper.Type: (func() internal.Config { + processscraper.Type: (func() component.Config { cfg := (&processscraper.Factory{}).CreateDefaultConfig() cfg.(*processscraper.Config).Include = processscraper.MatchConfig{ Names: []string{"test2", "test3"}, @@ -106,7 +105,7 @@ func TestLoadConfig(t *testing.T) { } return cfg })(), - systemscraper.Type: (func() internal.Config { + systemscraper.Type: (func() component.Config { cfg := (&systemscraper.Factory{}).CreateDefaultConfig() return cfg })(), diff --git a/receiver/hostmetricsreceiver/factory.go b/receiver/hostmetricsreceiver/factory.go index 0fac30742796..e1af92a95d48 100644 --- a/receiver/hostmetricsreceiver/factory.go +++ b/receiver/hostmetricsreceiver/factory.go @@ -130,7 +130,7 @@ func createAddScraperOptions( return scraperControllerOptions, nil } -func createHostMetricsScraper(ctx context.Context, set receiver.Settings, key component.Type, cfg internal.Config, factories map[component.Type]internal.ScraperFactory) (s scraper.Metrics, ok bool, err error) { +func createHostMetricsScraper(ctx context.Context, set receiver.Settings, key component.Type, cfg component.Config, factories map[component.Type]internal.ScraperFactory) (s scraper.Metrics, ok bool, err error) { factory := factories[key] if factory == nil { ok = false diff --git a/receiver/hostmetricsreceiver/factory_test.go b/receiver/hostmetricsreceiver/factory_test.go index d9cd23736c4a..7a3ecb047728 100644 --- a/receiver/hostmetricsreceiver/factory_test.go +++ b/receiver/hostmetricsreceiver/factory_test.go @@ -14,8 +14,6 @@ import ( "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/pipeline" "go.opentelemetry.io/collector/receiver/receivertest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal" ) var creationSet = receivertest.NewNopSettings() @@ -48,7 +46,7 @@ func TestCreateReceiver_ScraperKeyConfigError(t *testing.T) { const errorKey string = "error" factory := NewFactory() - cfg := &Config{Scrapers: map[component.Type]internal.Config{component.MustNewType(errorKey): &mockConfig{}}} + cfg := &Config{Scrapers: map[component.Type]component.Config{component.MustNewType(errorKey): &mockConfig{}}} _, err := factory.CreateMetrics(context.Background(), creationSet, cfg, consumertest.NewNop()) assert.EqualError(t, err, fmt.Sprintf("host metrics scraper factory not found for key: %q", errorKey)) diff --git a/receiver/hostmetricsreceiver/go.mod b/receiver/hostmetricsreceiver/go.mod index 2d4a4a8c0763..436351a27e82 100644 --- a/receiver/hostmetricsreceiver/go.mod +++ b/receiver/hostmetricsreceiver/go.mod @@ -30,7 +30,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/sys v0.28.0 + golang.org/x/sys v0.29.0 ) require ( @@ -105,8 +105,8 @@ require ( go.opentelemetry.io/otel/sdk v1.32.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.32.0 // indirect go.opentelemetry.io/otel/trace v1.32.0 // indirect - golang.org/x/crypto v0.31.0 // indirect - golang.org/x/net v0.33.0 // indirect + golang.org/x/crypto v0.32.0 // indirect + golang.org/x/net v0.34.0 // indirect golang.org/x/text v0.21.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect diff --git a/receiver/hostmetricsreceiver/go.sum b/receiver/hostmetricsreceiver/go.sum index d409d9de82d9..ed1ed63dd831 100644 --- a/receiver/hostmetricsreceiver/go.sum +++ b/receiver/hostmetricsreceiver/go.sum @@ -216,16 +216,16 @@ go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= -golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= +golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= +golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 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= 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.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= -golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= 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= @@ -239,10 +239,10 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 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.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= -golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg= +golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek= 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.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= diff --git a/receiver/hostmetricsreceiver/hostmetrics_linux_test.go b/receiver/hostmetricsreceiver/hostmetrics_linux_test.go index 7722e0bd2b12..93288dcf383e 100644 --- a/receiver/hostmetricsreceiver/hostmetrics_linux_test.go +++ b/receiver/hostmetricsreceiver/hostmetrics_linux_test.go @@ -15,7 +15,6 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/confmap/confmaptest" - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/cpuscraper" ) @@ -45,8 +44,7 @@ func TestLoadConfigRootPath(t *testing.T) { expectedConfig := factory.CreateDefaultConfig().(*Config) expectedConfig.RootPath = "testdata" cpuScraperCfg := (&cpuscraper.Factory{}).CreateDefaultConfig() - cpuScraperCfg.SetRootPath("testdata") - expectedConfig.Scrapers = map[component.Type]internal.Config{cpuscraper.Type: cpuScraperCfg} + expectedConfig.Scrapers = map[component.Type]component.Config{cpuscraper.Type: cpuScraperCfg} assert.Equal(t, expectedConfig, cfg) expectedEnvMap := common.EnvMap{ common.HostDevEnvKey: "testdata/dev", diff --git a/receiver/hostmetricsreceiver/hostmetrics_receiver_test.go b/receiver/hostmetricsreceiver/hostmetrics_receiver_test.go index 482bd84bc461..071020e58d68 100644 --- a/receiver/hostmetricsreceiver/hostmetrics_receiver_test.go +++ b/receiver/hostmetricsreceiver/hostmetrics_receiver_test.go @@ -78,7 +78,7 @@ func TestGatherMetrics_EndToEnd(t *testing.T) { ControllerConfig: scraperhelper.ControllerConfig{ CollectionInterval: 100 * time.Millisecond, }, - Scrapers: map[component.Type]internal.Config{ + Scrapers: map[component.Type]component.Config{ cpuscraper.Type: scraperFactories[cpuscraper.Type].CreateDefaultConfig(), diskscraper.Type: scraperFactories[diskscraper.Type].CreateDefaultConfig(), filesystemscraper.Type: (&filesystemscraper.Factory{}).CreateDefaultConfig(), @@ -186,12 +186,10 @@ var mockType = component.MustNewType("mock") type mockConfig struct{} -func (m *mockConfig) SetRootPath(_ string) {} - type errFactory struct{} -func (m *errFactory) CreateDefaultConfig() internal.Config { return &mockConfig{} } -func (m *errFactory) CreateMetricsScraper(context.Context, receiver.Settings, internal.Config) (scraper.Metrics, error) { +func (m *errFactory) CreateDefaultConfig() component.Config { return &mockConfig{} } +func (m *errFactory) CreateMetricsScraper(context.Context, receiver.Settings, component.Config) (scraper.Metrics, error) { return nil, errors.New("err1") } @@ -202,7 +200,7 @@ func TestGatherMetrics_ScraperKeyConfigError(t *testing.T) { scraperFactories = tmp }() - cfg := &Config{Scrapers: map[component.Type]internal.Config{component.MustNewType("error"): &mockConfig{}}} + cfg := &Config{Scrapers: map[component.Type]component.Config{component.MustNewType("error"): &mockConfig{}}} _, err := NewFactory().CreateMetrics(context.Background(), creationSet, cfg, consumertest.NewNop()) require.Error(t, err) } @@ -215,7 +213,7 @@ func TestGatherMetrics_CreateMetricsScraperError(t *testing.T) { scraperFactories = tmp }() - cfg := &Config{Scrapers: map[component.Type]internal.Config{mockType: &mockConfig{}}} + cfg := &Config{Scrapers: map[component.Type]component.Config{mockType: &mockConfig{}}} _, err := NewFactory().CreateMetrics(context.Background(), creationSet, cfg, consumertest.NewNop()) require.Error(t, err) } @@ -267,7 +265,7 @@ func benchmarkScrapeMetrics(b *testing.B, cfg *Config) { func Benchmark_ScrapeCpuMetrics(b *testing.B) { cfg := &Config{ ControllerConfig: scraperhelper.NewDefaultControllerConfig(), - Scrapers: map[component.Type]internal.Config{cpuscraper.Type: (&cpuscraper.Factory{}).CreateDefaultConfig()}, + Scrapers: map[component.Type]component.Config{cpuscraper.Type: (&cpuscraper.Factory{}).CreateDefaultConfig()}, } benchmarkScrapeMetrics(b, cfg) @@ -276,7 +274,7 @@ func Benchmark_ScrapeCpuMetrics(b *testing.B) { func Benchmark_ScrapeDiskMetrics(b *testing.B) { cfg := &Config{ ControllerConfig: scraperhelper.NewDefaultControllerConfig(), - Scrapers: map[component.Type]internal.Config{diskscraper.Type: (&diskscraper.Factory{}).CreateDefaultConfig()}, + Scrapers: map[component.Type]component.Config{diskscraper.Type: (&diskscraper.Factory{}).CreateDefaultConfig()}, } benchmarkScrapeMetrics(b, cfg) @@ -285,7 +283,7 @@ func Benchmark_ScrapeDiskMetrics(b *testing.B) { func Benchmark_ScrapeFileSystemMetrics(b *testing.B) { cfg := &Config{ ControllerConfig: scraperhelper.NewDefaultControllerConfig(), - Scrapers: map[component.Type]internal.Config{filesystemscraper.Type: (&filesystemscraper.Factory{}).CreateDefaultConfig()}, + Scrapers: map[component.Type]component.Config{filesystemscraper.Type: (&filesystemscraper.Factory{}).CreateDefaultConfig()}, } benchmarkScrapeMetrics(b, cfg) @@ -294,7 +292,7 @@ func Benchmark_ScrapeFileSystemMetrics(b *testing.B) { func Benchmark_ScrapeLoadMetrics(b *testing.B) { cfg := &Config{ ControllerConfig: scraperhelper.NewDefaultControllerConfig(), - Scrapers: map[component.Type]internal.Config{loadscraper.Type: (&loadscraper.Factory{}).CreateDefaultConfig()}, + Scrapers: map[component.Type]component.Config{loadscraper.Type: (&loadscraper.Factory{}).CreateDefaultConfig()}, } benchmarkScrapeMetrics(b, cfg) @@ -303,7 +301,7 @@ func Benchmark_ScrapeLoadMetrics(b *testing.B) { func Benchmark_ScrapeMemoryMetrics(b *testing.B) { cfg := &Config{ ControllerConfig: scraperhelper.NewDefaultControllerConfig(), - Scrapers: map[component.Type]internal.Config{memoryscraper.Type: (&memoryscraper.Factory{}).CreateDefaultConfig()}, + Scrapers: map[component.Type]component.Config{memoryscraper.Type: (&memoryscraper.Factory{}).CreateDefaultConfig()}, } benchmarkScrapeMetrics(b, cfg) @@ -312,7 +310,7 @@ func Benchmark_ScrapeMemoryMetrics(b *testing.B) { func Benchmark_ScrapeNetworkMetrics(b *testing.B) { cfg := &Config{ ControllerConfig: scraperhelper.NewDefaultControllerConfig(), - Scrapers: map[component.Type]internal.Config{networkscraper.Type: (&networkscraper.Factory{}).CreateDefaultConfig()}, + Scrapers: map[component.Type]component.Config{networkscraper.Type: (&networkscraper.Factory{}).CreateDefaultConfig()}, } benchmarkScrapeMetrics(b, cfg) @@ -321,7 +319,7 @@ func Benchmark_ScrapeNetworkMetrics(b *testing.B) { func Benchmark_ScrapeProcessesMetrics(b *testing.B) { cfg := &Config{ ControllerConfig: scraperhelper.NewDefaultControllerConfig(), - Scrapers: map[component.Type]internal.Config{processesscraper.Type: (&processesscraper.Factory{}).CreateDefaultConfig()}, + Scrapers: map[component.Type]component.Config{processesscraper.Type: (&processesscraper.Factory{}).CreateDefaultConfig()}, } benchmarkScrapeMetrics(b, cfg) @@ -330,7 +328,7 @@ func Benchmark_ScrapeProcessesMetrics(b *testing.B) { func Benchmark_ScrapePagingMetrics(b *testing.B) { cfg := &Config{ ControllerConfig: scraperhelper.NewDefaultControllerConfig(), - Scrapers: map[component.Type]internal.Config{pagingscraper.Type: (&pagingscraper.Factory{}).CreateDefaultConfig()}, + Scrapers: map[component.Type]component.Config{pagingscraper.Type: (&pagingscraper.Factory{}).CreateDefaultConfig()}, } benchmarkScrapeMetrics(b, cfg) @@ -343,7 +341,7 @@ func Benchmark_ScrapeProcessMetrics(b *testing.B) { cfg := &Config{ ControllerConfig: scraperhelper.NewDefaultControllerConfig(), - Scrapers: map[component.Type]internal.Config{processscraper.Type: (&processscraper.Factory{}).CreateDefaultConfig()}, + Scrapers: map[component.Type]component.Config{processscraper.Type: (&processscraper.Factory{}).CreateDefaultConfig()}, } benchmarkScrapeMetrics(b, cfg) @@ -356,7 +354,7 @@ func Benchmark_ScrapeUptimeMetrics(b *testing.B) { cfg := &Config{ ControllerConfig: scraperhelper.NewDefaultControllerConfig(), - Scrapers: map[component.Type]internal.Config{systemscraper.Type: (&systemscraper.Factory{}).CreateDefaultConfig()}, + Scrapers: map[component.Type]component.Config{systemscraper.Type: (&systemscraper.Factory{}).CreateDefaultConfig()}, } benchmarkScrapeMetrics(b, cfg) @@ -365,7 +363,7 @@ func Benchmark_ScrapeUptimeMetrics(b *testing.B) { func Benchmark_ScrapeSystemMetrics(b *testing.B) { cfg := &Config{ ControllerConfig: scraperhelper.NewDefaultControllerConfig(), - Scrapers: map[component.Type]internal.Config{ + Scrapers: map[component.Type]component.Config{ cpuscraper.Type: (&cpuscraper.Factory{}).CreateDefaultConfig(), diskscraper.Type: (&diskscraper.Factory{}).CreateDefaultConfig(), filesystemscraper.Type: (&filesystemscraper.Factory{}).CreateDefaultConfig(), @@ -387,16 +385,9 @@ func Benchmark_ScrapeSystemAndProcessMetrics(b *testing.B) { cfg := &Config{ ControllerConfig: scraperhelper.NewDefaultControllerConfig(), - Scrapers: map[component.Type]internal.Config{ - cpuscraper.Type: &cpuscraper.Config{}, - diskscraper.Type: &diskscraper.Config{}, + Scrapers: map[component.Type]component.Config{ filesystemscraper.Type: (&filesystemscraper.Factory{}).CreateDefaultConfig(), - loadscraper.Type: &loadscraper.Config{}, - memoryscraper.Type: &memoryscraper.Config{}, - networkscraper.Type: &networkscraper.Config{}, pagingscraper.Type: (&pagingscraper.Factory{}).CreateDefaultConfig(), - processesscraper.Type: &processesscraper.Config{}, - systemscraper.Type: &systemscraper.Config{}, }, } diff --git a/receiver/hostmetricsreceiver/integration_test.go b/receiver/hostmetricsreceiver/integration_test.go index 9e765e3714f7..a45968059f41 100644 --- a/receiver/hostmetricsreceiver/integration_test.go +++ b/receiver/hostmetricsreceiver/integration_test.go @@ -17,7 +17,6 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/scraperinttest" "github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter/filterset" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest/pmetrictest" - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/processscraper" ) @@ -41,7 +40,7 @@ func Test_ProcessScrape(t *testing.T) { Config: filterset.Config{MatchType: filterset.Regexp}, Names: []string{"sleep"}, } - rCfg.Scrapers = map[component.Type]internal.Config{ + rCfg.Scrapers = map[component.Type]component.Config{ processscraper.Type: pCfg, } }), @@ -71,8 +70,7 @@ func Test_ProcessScrapeWithCustomRootPath(t *testing.T) { rCfg.CollectionInterval = time.Second rCfg.RootPath = rootPath pCfg := (&processscraper.Factory{}).CreateDefaultConfig().(*processscraper.Config) - pCfg.SetRootPath(rootPath) - rCfg.Scrapers = map[component.Type]internal.Config{ + rCfg.Scrapers = map[component.Type]component.Config{ processscraper.Type: pCfg, } }), @@ -99,12 +97,11 @@ func Test_ProcessScrapeWithBadRootPathAndEnvVar(t *testing.T) { func(_ *testing.T, cfg component.Config, _ *scraperinttest.ContainerInfo) { rCfg := cfg.(*Config) rCfg.CollectionInterval = time.Second + rCfg.RootPath = badRootPath pCfg := (&processscraper.Factory{}).CreateDefaultConfig().(*processscraper.Config) - pCfg.SetRootPath(badRootPath) - rCfg.Scrapers = map[component.Type]internal.Config{ + rCfg.Scrapers = map[component.Type]component.Config{ processscraper.Type: pCfg, } - rCfg.RootPath = badRootPath }), scraperinttest.WithExpectedFile(expectedFile), scraperinttest.WithCompareOptions( diff --git a/receiver/hostmetricsreceiver/internal/scraper.go b/receiver/hostmetricsreceiver/internal/scraper.go index 7cbb8872df32..704faf32232c 100644 --- a/receiver/hostmetricsreceiver/internal/scraper.go +++ b/receiver/hostmetricsreceiver/internal/scraper.go @@ -16,11 +16,11 @@ import ( // ScraperFactory can create a MetricScraper. type ScraperFactory interface { // CreateDefaultConfig creates the default configuration for the Scraper. - CreateDefaultConfig() Config + CreateDefaultConfig() component.Config // CreateMetricsScraper creates a scraper based on this config. // If the config is not valid, error will be returned instead. - CreateMetricsScraper(ctx context.Context, settings receiver.Settings, cfg Config) (scraper.Metrics, error) + CreateMetricsScraper(ctx context.Context, settings receiver.Settings, cfg component.Config) (scraper.Metrics, error) } // Config is the configuration of a scraper. @@ -28,14 +28,6 @@ type Config interface { SetRootPath(rootPath string) } -type ScraperConfig struct { - RootPath string `mapstructure:"-"` -} - -func (p *ScraperConfig) SetRootPath(rootPath string) { - p.RootPath = rootPath -} - type EnvVarScraper struct { delegate scraper.Metrics envMap common.EnvMap diff --git a/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/config.go b/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/config.go index 1509f2606a9d..34adc2e4821e 100644 --- a/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/config.go +++ b/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/config.go @@ -4,12 +4,10 @@ package cpuscraper // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/cpuscraper" import ( - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/internal/metadata" ) // Config relating to CPU Metric Scraper. type Config struct { metadata.MetricsBuilderConfig `mapstructure:",squash"` - internal.ScraperConfig } diff --git a/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/factory.go b/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/factory.go index d072159c8a98..f0d0e182c427 100644 --- a/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/factory.go +++ b/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/factory.go @@ -10,7 +10,6 @@ import ( "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/scraper" - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/internal/metadata" ) @@ -23,7 +22,7 @@ var Type = component.MustNewType("cpu") type Factory struct{} // CreateDefaultConfig creates the default configuration for the Scraper. -func (f *Factory) CreateDefaultConfig() internal.Config { +func (f *Factory) CreateDefaultConfig() component.Config { return &Config{ MetricsBuilderConfig: metadata.DefaultMetricsBuilderConfig(), } @@ -33,7 +32,7 @@ func (f *Factory) CreateDefaultConfig() internal.Config { func (f *Factory) CreateMetricsScraper( ctx context.Context, settings receiver.Settings, - config internal.Config, + config component.Config, ) (scraper.Metrics, error) { cfg := config.(*Config) s := newCPUScraper(ctx, settings, cfg) diff --git a/receiver/hostmetricsreceiver/internal/scraper/diskscraper/config.go b/receiver/hostmetricsreceiver/internal/scraper/diskscraper/config.go index 29048bd3188e..b9121fb423c2 100644 --- a/receiver/hostmetricsreceiver/internal/scraper/diskscraper/config.go +++ b/receiver/hostmetricsreceiver/internal/scraper/diskscraper/config.go @@ -5,7 +5,6 @@ package diskscraper // import "github.com/open-telemetry/opentelemetry-collector import ( "github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter/filterset" - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/diskscraper/internal/metadata" ) @@ -13,7 +12,6 @@ import ( type Config struct { // MetricsbuilderConfig allows to customize scraped metrics/attributes representation. metadata.MetricsBuilderConfig `mapstructure:",squash"` - internal.ScraperConfig // Include specifies a filter on the devices that should be included from the generated metrics. // Exclude specifies a filter on the devices that should be excluded from the generated metrics. diff --git a/receiver/hostmetricsreceiver/internal/scraper/diskscraper/factory.go b/receiver/hostmetricsreceiver/internal/scraper/diskscraper/factory.go index f1e30bd378f6..064e2242bae6 100644 --- a/receiver/hostmetricsreceiver/internal/scraper/diskscraper/factory.go +++ b/receiver/hostmetricsreceiver/internal/scraper/diskscraper/factory.go @@ -10,7 +10,6 @@ import ( "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/scraper" - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/diskscraper/internal/metadata" ) @@ -23,7 +22,7 @@ var Type = component.MustNewType("disk") type Factory struct{} // CreateDefaultConfig creates the default configuration for the Scraper. -func (f *Factory) CreateDefaultConfig() internal.Config { +func (f *Factory) CreateDefaultConfig() component.Config { return &Config{ MetricsBuilderConfig: metadata.DefaultMetricsBuilderConfig(), } @@ -33,7 +32,7 @@ func (f *Factory) CreateDefaultConfig() internal.Config { func (f *Factory) CreateMetricsScraper( ctx context.Context, settings receiver.Settings, - config internal.Config, + config component.Config, ) (scraper.Metrics, error) { cfg := config.(*Config) s, err := newDiskScraper(ctx, settings, cfg) diff --git a/receiver/hostmetricsreceiver/internal/scraper/filesystemscraper/config.go b/receiver/hostmetricsreceiver/internal/scraper/filesystemscraper/config.go index f8acc4e30b0a..f38adc5ff806 100644 --- a/receiver/hostmetricsreceiver/internal/scraper/filesystemscraper/config.go +++ b/receiver/hostmetricsreceiver/internal/scraper/filesystemscraper/config.go @@ -7,7 +7,6 @@ import ( "fmt" "github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter/filterset" - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/filesystemscraper/internal/metadata" ) @@ -15,7 +14,6 @@ import ( type Config struct { // MetricsBuilderConfig allows to customize scraped metrics/attributes representation. metadata.MetricsBuilderConfig `mapstructure:",squash"` - internal.ScraperConfig // IncludeVirtualFS will also capture filesystems such as tmpfs, ramfs // and other filesystem types that do no have an associated physical device. @@ -37,6 +35,8 @@ type Config struct { // ExcludeMountPoints specifies a filter on the mount points that should be excluded from the generated metrics. // When `root_path` is set, the mount points must be from the host's perspective. ExcludeMountPoints MountPointMatchConfig `mapstructure:"exclude_mount_points"` + + rootPath string `mapstructure:"-"` } type DeviceMatchConfig struct { @@ -67,6 +67,10 @@ type fsFilter struct { filtersExist bool } +func (cfg *Config) SetRootPath(rootPath string) { + cfg.rootPath = rootPath +} + func (cfg *Config) createFilter() (*fsFilter, error) { var err error filter := fsFilter{} diff --git a/receiver/hostmetricsreceiver/internal/scraper/filesystemscraper/factory.go b/receiver/hostmetricsreceiver/internal/scraper/filesystemscraper/factory.go index 9702d63e1414..250060a9108a 100644 --- a/receiver/hostmetricsreceiver/internal/scraper/filesystemscraper/factory.go +++ b/receiver/hostmetricsreceiver/internal/scraper/filesystemscraper/factory.go @@ -11,7 +11,6 @@ import ( "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/scraper" - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/filesystemscraper/internal/metadata" ) @@ -24,7 +23,7 @@ var Type = component.MustNewType("filesystem") type Factory struct{} // CreateDefaultConfig creates the default configuration for the Scraper. -func (f *Factory) CreateDefaultConfig() internal.Config { +func (f *Factory) CreateDefaultConfig() component.Config { return &Config{ MetricsBuilderConfig: metadata.DefaultMetricsBuilderConfig(), } @@ -34,11 +33,11 @@ func (f *Factory) CreateDefaultConfig() internal.Config { func (f *Factory) CreateMetricsScraper( ctx context.Context, settings receiver.Settings, - config internal.Config, + config component.Config, ) (scraper.Metrics, error) { cfg := config.(*Config) - if cfg.RootPath == "" { + if cfg.rootPath == "" { inContainer := os.Getpid() == 1 for _, p := range []string{ "/.dockerenv", // Mounted by dockerd when starting a container by default diff --git a/receiver/hostmetricsreceiver/internal/scraper/filesystemscraper/filesystem_scraper.go b/receiver/hostmetricsreceiver/internal/scraper/filesystemscraper/filesystem_scraper.go index 0304b3ab9289..9c6cd943ba92 100644 --- a/receiver/hostmetricsreceiver/internal/scraper/filesystemscraper/filesystem_scraper.go +++ b/receiver/hostmetricsreceiver/internal/scraper/filesystemscraper/filesystem_scraper.go @@ -108,7 +108,7 @@ func (s *filesystemsScraper) scrape(ctx context.Context) (pmetric.Metrics, error if !s.fsFilter.includePartition(partition) { continue } - translatedMountpoint := translateMountpoint(ctx, s.config.RootPath, partition.Mountpoint) + translatedMountpoint := translateMountpoint(ctx, s.config.rootPath, partition.Mountpoint) usage, usageErr := s.usage(ctx, translatedMountpoint) if usageErr != nil { errors.AddPartial(0, fmt.Errorf("failed to read usage at %s: %w", translatedMountpoint, usageErr)) diff --git a/receiver/hostmetricsreceiver/internal/scraper/loadscraper/config.go b/receiver/hostmetricsreceiver/internal/scraper/loadscraper/config.go index 996952370448..fae25f263485 100644 --- a/receiver/hostmetricsreceiver/internal/scraper/loadscraper/config.go +++ b/receiver/hostmetricsreceiver/internal/scraper/loadscraper/config.go @@ -4,7 +4,6 @@ package loadscraper // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/loadscraper" import ( - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/loadscraper/internal/metadata" ) @@ -14,5 +13,4 @@ type Config struct { CPUAverage bool `mapstructure:"cpu_average"` // MetricsBuilderConfig allows to customize scraped metrics/attributes representation. metadata.MetricsBuilderConfig `mapstructure:",squash"` - internal.ScraperConfig } diff --git a/receiver/hostmetricsreceiver/internal/scraper/loadscraper/factory.go b/receiver/hostmetricsreceiver/internal/scraper/loadscraper/factory.go index 695884ba1097..79dc32a9d6bd 100644 --- a/receiver/hostmetricsreceiver/internal/scraper/loadscraper/factory.go +++ b/receiver/hostmetricsreceiver/internal/scraper/loadscraper/factory.go @@ -10,7 +10,6 @@ import ( "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/scraper" - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/loadscraper/internal/metadata" ) @@ -23,7 +22,7 @@ var Type = component.MustNewType("load") type Factory struct{} // CreateDefaultConfig creates the default configuration for the Scraper. -func (f *Factory) CreateDefaultConfig() internal.Config { +func (f *Factory) CreateDefaultConfig() component.Config { return &Config{ MetricsBuilderConfig: metadata.DefaultMetricsBuilderConfig(), } @@ -33,7 +32,7 @@ func (f *Factory) CreateDefaultConfig() internal.Config { func (f *Factory) CreateMetricsScraper( ctx context.Context, settings receiver.Settings, - config internal.Config, + config component.Config, ) (scraper.Metrics, error) { cfg := config.(*Config) s := newLoadScraper(ctx, settings, cfg) diff --git a/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/config.go b/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/config.go index c273c8dd8a85..ba8e5589993a 100644 --- a/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/config.go +++ b/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/config.go @@ -4,12 +4,10 @@ package memoryscraper // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/memoryscraper" import ( - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/internal/metadata" ) // Config relating to Memory Metric Scraper. type Config struct { metadata.MetricsBuilderConfig `mapstructure:",squash"` - internal.ScraperConfig } diff --git a/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/factory.go b/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/factory.go index 3a34a4013704..a966d478ec6b 100644 --- a/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/factory.go +++ b/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/factory.go @@ -10,7 +10,6 @@ import ( "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/scraper" - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/internal/metadata" ) @@ -23,7 +22,7 @@ var Type = component.MustNewType("memory") type Factory struct{} // CreateDefaultConfig creates the default configuration for the Scraper. -func (f *Factory) CreateDefaultConfig() internal.Config { +func (f *Factory) CreateDefaultConfig() component.Config { return &Config{ MetricsBuilderConfig: metadata.DefaultMetricsBuilderConfig(), } @@ -33,7 +32,7 @@ func (f *Factory) CreateDefaultConfig() internal.Config { func (f *Factory) CreateMetricsScraper( ctx context.Context, settings receiver.Settings, - config internal.Config, + config component.Config, ) (scraper.Metrics, error) { cfg := config.(*Config) s := newMemoryScraper(ctx, settings, cfg) diff --git a/receiver/hostmetricsreceiver/internal/scraper/networkscraper/config.go b/receiver/hostmetricsreceiver/internal/scraper/networkscraper/config.go index b7fa0728c599..7c888564b5eb 100644 --- a/receiver/hostmetricsreceiver/internal/scraper/networkscraper/config.go +++ b/receiver/hostmetricsreceiver/internal/scraper/networkscraper/config.go @@ -5,14 +5,12 @@ package networkscraper // import "github.com/open-telemetry/opentelemetry-collec import ( "github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter/filterset" - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/networkscraper/internal/metadata" ) // Config relating to Network Metric Scraper. type Config struct { metadata.MetricsBuilderConfig `mapstructure:",squash"` - internal.ScraperConfig // Include specifies a filter on the network interfaces that should be included from the generated metrics. Include MatchConfig `mapstructure:"include"` // Exclude specifies a filter on the network interfaces that should be excluded from the generated metrics. diff --git a/receiver/hostmetricsreceiver/internal/scraper/networkscraper/factory.go b/receiver/hostmetricsreceiver/internal/scraper/networkscraper/factory.go index 1746fd3e93f1..307b12ba32f9 100644 --- a/receiver/hostmetricsreceiver/internal/scraper/networkscraper/factory.go +++ b/receiver/hostmetricsreceiver/internal/scraper/networkscraper/factory.go @@ -10,7 +10,6 @@ import ( "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/scraper" - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/networkscraper/internal/metadata" ) @@ -23,7 +22,7 @@ var Type = component.MustNewType("network") type Factory struct{} // CreateDefaultConfig creates the default configuration for the Scraper. -func (f *Factory) CreateDefaultConfig() internal.Config { +func (f *Factory) CreateDefaultConfig() component.Config { return &Config{ MetricsBuilderConfig: metadata.DefaultMetricsBuilderConfig(), } @@ -33,7 +32,7 @@ func (f *Factory) CreateDefaultConfig() internal.Config { func (f *Factory) CreateMetricsScraper( ctx context.Context, settings receiver.Settings, - config internal.Config, + config component.Config, ) (scraper.Metrics, error) { cfg := config.(*Config) s, err := newNetworkScraper(ctx, settings, cfg) diff --git a/receiver/hostmetricsreceiver/internal/scraper/pagingscraper/config.go b/receiver/hostmetricsreceiver/internal/scraper/pagingscraper/config.go index ac64f83ae034..50bc880f73d6 100644 --- a/receiver/hostmetricsreceiver/internal/scraper/pagingscraper/config.go +++ b/receiver/hostmetricsreceiver/internal/scraper/pagingscraper/config.go @@ -4,7 +4,6 @@ package pagingscraper // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/pagingscraper" import ( - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/pagingscraper/internal/metadata" ) @@ -12,5 +11,4 @@ import ( type Config struct { // MetricsBuilderConfig allows customizing scraped metrics/attributes representation. metadata.MetricsBuilderConfig `mapstructure:",squash"` - internal.ScraperConfig } diff --git a/receiver/hostmetricsreceiver/internal/scraper/pagingscraper/factory.go b/receiver/hostmetricsreceiver/internal/scraper/pagingscraper/factory.go index 1ec88b5fadff..b85d0278a75c 100644 --- a/receiver/hostmetricsreceiver/internal/scraper/pagingscraper/factory.go +++ b/receiver/hostmetricsreceiver/internal/scraper/pagingscraper/factory.go @@ -10,7 +10,6 @@ import ( "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/scraper" - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/pagingscraper/internal/metadata" ) @@ -23,7 +22,7 @@ var Type = component.MustNewType("paging") type Factory struct{} // CreateDefaultConfig creates the default configuration for the Scraper. -func (f *Factory) CreateDefaultConfig() internal.Config { +func (f *Factory) CreateDefaultConfig() component.Config { return &Config{ MetricsBuilderConfig: metadata.DefaultMetricsBuilderConfig(), } @@ -33,7 +32,7 @@ func (f *Factory) CreateDefaultConfig() internal.Config { func (f *Factory) CreateMetricsScraper( ctx context.Context, settings receiver.Settings, - config internal.Config, + config component.Config, ) (scraper.Metrics, error) { cfg := config.(*Config) s := newPagingScraper(ctx, settings, cfg) diff --git a/receiver/hostmetricsreceiver/internal/scraper/processesscraper/config.go b/receiver/hostmetricsreceiver/internal/scraper/processesscraper/config.go index 712b769f52e9..ce5beab04d8e 100644 --- a/receiver/hostmetricsreceiver/internal/scraper/processesscraper/config.go +++ b/receiver/hostmetricsreceiver/internal/scraper/processesscraper/config.go @@ -4,7 +4,6 @@ package processesscraper // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/processesscraper" import ( - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/processesscraper/internal/metadata" ) @@ -12,5 +11,4 @@ import ( type Config struct { // MetricsBuilderConfig allows customizing scraped metrics/attributes representation. metadata.MetricsBuilderConfig `mapstructure:",squash"` - internal.ScraperConfig } diff --git a/receiver/hostmetricsreceiver/internal/scraper/processesscraper/factory.go b/receiver/hostmetricsreceiver/internal/scraper/processesscraper/factory.go index b5b6201a22b6..21e73d2835d2 100644 --- a/receiver/hostmetricsreceiver/internal/scraper/processesscraper/factory.go +++ b/receiver/hostmetricsreceiver/internal/scraper/processesscraper/factory.go @@ -10,7 +10,6 @@ import ( "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/scraper" - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/processesscraper/internal/metadata" ) @@ -23,7 +22,7 @@ var Type = component.MustNewType("processes") type Factory struct{} // CreateDefaultConfig creates the default configuration for the Scraper. -func (f *Factory) CreateDefaultConfig() internal.Config { +func (f *Factory) CreateDefaultConfig() component.Config { return &Config{ MetricsBuilderConfig: metadata.DefaultMetricsBuilderConfig(), } @@ -33,7 +32,7 @@ func (f *Factory) CreateDefaultConfig() internal.Config { func (f *Factory) CreateMetricsScraper( ctx context.Context, settings receiver.Settings, - config internal.Config, + config component.Config, ) (scraper.Metrics, error) { cfg := config.(*Config) s := newProcessesScraper(ctx, settings, cfg) diff --git a/receiver/hostmetricsreceiver/internal/scraper/processscraper/config.go b/receiver/hostmetricsreceiver/internal/scraper/processscraper/config.go index 60c3ea0b8535..246a025ece1f 100644 --- a/receiver/hostmetricsreceiver/internal/scraper/processscraper/config.go +++ b/receiver/hostmetricsreceiver/internal/scraper/processscraper/config.go @@ -7,7 +7,6 @@ import ( "time" "github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter/filterset" - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/processscraper/internal/metadata" ) @@ -15,7 +14,6 @@ import ( type Config struct { // MetricsBuilderConfig allows to customize scraped metrics/attributes representation. metadata.MetricsBuilderConfig `mapstructure:",squash"` - internal.ScraperConfig // Include specifies a filter on the process names that should be included from the generated metrics. // Exclude specifies a filter on the process names that should be excluded from the generated metrics. // If neither `include` or `exclude` are set, process metrics will be generated for all processes. diff --git a/receiver/hostmetricsreceiver/internal/scraper/processscraper/factory.go b/receiver/hostmetricsreceiver/internal/scraper/processscraper/factory.go index 20971d017849..7b68429cd3dd 100644 --- a/receiver/hostmetricsreceiver/internal/scraper/processscraper/factory.go +++ b/receiver/hostmetricsreceiver/internal/scraper/processscraper/factory.go @@ -13,7 +13,6 @@ import ( "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/scraper" - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/processscraper/internal/metadata" ) @@ -37,7 +36,7 @@ var ( type Factory struct{} // CreateDefaultConfig creates the default configuration for the Scraper. -func (f *Factory) CreateDefaultConfig() internal.Config { +func (f *Factory) CreateDefaultConfig() component.Config { return &Config{ MetricsBuilderConfig: metadata.DefaultMetricsBuilderConfig(), } @@ -47,7 +46,7 @@ func (f *Factory) CreateDefaultConfig() internal.Config { func (f *Factory) CreateMetricsScraper( _ context.Context, settings receiver.Settings, - cfg internal.Config, + cfg component.Config, ) (scraper.Metrics, error) { if runtime.GOOS != "linux" && runtime.GOOS != "windows" && runtime.GOOS != "darwin" { return nil, errors.New("process scraper only available on Linux, Windows, or MacOS") diff --git a/receiver/hostmetricsreceiver/internal/scraper/systemscraper/config.go b/receiver/hostmetricsreceiver/internal/scraper/systemscraper/config.go index 9c101ad03347..8d902bbc6c1d 100644 --- a/receiver/hostmetricsreceiver/internal/scraper/systemscraper/config.go +++ b/receiver/hostmetricsreceiver/internal/scraper/systemscraper/config.go @@ -4,7 +4,6 @@ package systemscraper // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/systemscraper" import ( - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/systemscraper/internal/metadata" ) @@ -12,5 +11,4 @@ import ( type Config struct { // MetricsBuilderConfig allows to customize scraped metrics/attributes representation. metadata.MetricsBuilderConfig `mapstructure:",squash"` - internal.ScraperConfig } diff --git a/receiver/hostmetricsreceiver/internal/scraper/systemscraper/factory.go b/receiver/hostmetricsreceiver/internal/scraper/systemscraper/factory.go index c163bea26ec4..abd1994a2fd6 100644 --- a/receiver/hostmetricsreceiver/internal/scraper/systemscraper/factory.go +++ b/receiver/hostmetricsreceiver/internal/scraper/systemscraper/factory.go @@ -12,7 +12,6 @@ import ( "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/scraper" - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/systemscraper/internal/metadata" ) @@ -25,7 +24,7 @@ var Type = component.MustNewType("system") type Factory struct{} // CreateDefaultConfig creates the default configuration for the Scraper. -func (f *Factory) CreateDefaultConfig() internal.Config { +func (f *Factory) CreateDefaultConfig() component.Config { return &Config{ MetricsBuilderConfig: metadata.DefaultMetricsBuilderConfig(), } @@ -35,7 +34,7 @@ func (f *Factory) CreateDefaultConfig() internal.Config { func (f *Factory) CreateMetricsScraper( ctx context.Context, settings receiver.Settings, - cfg internal.Config, + cfg component.Config, ) (scraper.Metrics, error) { if runtime.GOOS != "linux" && runtime.GOOS != "windows" && runtime.GOOS != "darwin" { return nil, errors.New("uptime scraper only available on Linux, Windows, or MacOS") diff --git a/receiver/huaweicloudcesreceiver/README.md b/receiver/huaweicloudcesreceiver/README.md index 9761bb06ba00..28e006ebe991 100644 --- a/receiver/huaweicloudcesreceiver/README.md +++ b/receiver/huaweicloudcesreceiver/README.md @@ -3,12 +3,12 @@ | Status | | | ------------- |-----------| -| Stability | [development]: metrics | +| Stability | [alpha]: metrics | | Distributions | [] | | Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Areceiver%2Fhuaweicloudces%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Areceiver%2Fhuaweicloudces) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Areceiver%2Fhuaweicloudces%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Areceiver%2Fhuaweicloudces) | | [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@heitorganzeli](https://www.github.com/heitorganzeli), [@narcis96](https://www.github.com/narcis96), [@mwear](https://www.github.com/mwear) | -[development]: https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/component-stability.md#development +[alpha]: https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/component-stability.md#alpha This receiver contains the implementation of the Huawei Cloud [Cloud Eye Service](https://www.huaweicloud.com/intl/en-us/product/ces.html) (CES) receiver for the OpenTelemetry Collector. The receiver collects metrics from Huawei Cloud's CES service and sends them to the OpenTelemetry Collector for processing and exporting. diff --git a/receiver/huaweicloudcesreceiver/internal/metadata/generated_status.go b/receiver/huaweicloudcesreceiver/internal/metadata/generated_status.go index b91aef665ff8..1c87234f5043 100644 --- a/receiver/huaweicloudcesreceiver/internal/metadata/generated_status.go +++ b/receiver/huaweicloudcesreceiver/internal/metadata/generated_status.go @@ -12,5 +12,5 @@ var ( ) const ( - MetricsStability = component.StabilityLevelDevelopment + MetricsStability = component.StabilityLevelAlpha ) diff --git a/receiver/huaweicloudcesreceiver/metadata.yaml b/receiver/huaweicloudcesreceiver/metadata.yaml index 31b50e271989..8abc5d5c84df 100644 --- a/receiver/huaweicloudcesreceiver/metadata.yaml +++ b/receiver/huaweicloudcesreceiver/metadata.yaml @@ -3,7 +3,7 @@ type: huaweicloudcesreceiver status: class: receiver stability: - development: [metrics] + alpha: [metrics] distributions: [] codeowners: active: [heitorganzeli, narcis96, mwear] diff --git a/receiver/iisreceiver/go.mod b/receiver/iisreceiver/go.mod index a4e069c244f3..835e2bedbc7f 100644 --- a/receiver/iisreceiver/go.mod +++ b/receiver/iisreceiver/go.mod @@ -94,7 +94,7 @@ require ( go.opentelemetry.io/proto/otlp v1.0.0 // indirect golang.org/x/crypto v0.31.0 // indirect golang.org/x/net v0.33.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.69.2 // indirect diff --git a/receiver/iisreceiver/go.sum b/receiver/iisreceiver/go.sum index fc63d2a39d64..e0e23f9e9cce 100644 --- a/receiver/iisreceiver/go.sum +++ b/receiver/iisreceiver/go.sum @@ -217,8 +217,8 @@ golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 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.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/receiver/influxdbreceiver/factory.go b/receiver/influxdbreceiver/factory.go index 46f625bbf40b..0bad4bcdc7d4 100644 --- a/receiver/influxdbreceiver/factory.go +++ b/receiver/influxdbreceiver/factory.go @@ -11,11 +11,10 @@ import ( "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/receiver" - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/common/testutil" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/influxdbreceiver/internal/metadata" ) -const defaultPort = 8086 +const defaultEndpoint = "localhost:8086" func NewFactory() receiver.Factory { return receiver.NewFactory( @@ -28,7 +27,7 @@ func NewFactory() receiver.Factory { func createDefaultConfig() component.Config { return &Config{ ServerConfig: confighttp.ServerConfig{ - Endpoint: testutil.EndpointForPort(defaultPort), + Endpoint: defaultEndpoint, }, } } diff --git a/receiver/jaegerreceiver/config.go b/receiver/jaegerreceiver/config.go index bfa43c09e3c8..adb5b087778a 100644 --- a/receiver/jaegerreceiver/config.go +++ b/receiver/jaegerreceiver/config.go @@ -37,10 +37,10 @@ type RemoteSamplingConfig struct { // Protocols is the configuration for the supported protocols. type Protocols struct { - GRPC *configgrpc.ServerConfig `mapstructure:"grpc"` - ThriftHTTP *confighttp.ServerConfig `mapstructure:"thrift_http"` - ThriftBinary *ProtocolUDP `mapstructure:"thrift_binary"` - ThriftCompact *ProtocolUDP `mapstructure:"thrift_compact"` + GRPC *configgrpc.ServerConfig `mapstructure:"grpc"` + ThriftHTTP *confighttp.ServerConfig `mapstructure:"thrift_http"` + ThriftBinaryUDP *ProtocolUDP `mapstructure:"thrift_binary"` + ThriftCompactUDP *ProtocolUDP `mapstructure:"thrift_compact"` } // ProtocolUDP is the configuration for a UDP protocol. @@ -82,8 +82,8 @@ var ( func (cfg *Config) Validate() error { if cfg.GRPC == nil && cfg.ThriftHTTP == nil && - cfg.ThriftBinary == nil && - cfg.ThriftCompact == nil { + cfg.ThriftBinaryUDP == nil && + cfg.ThriftCompactUDP == nil { return errors.New("must specify at least one protocol when using the Jaeger receiver") } @@ -99,14 +99,14 @@ func (cfg *Config) Validate() error { } } - if cfg.ThriftBinary != nil { - if err := checkPortFromEndpoint(cfg.ThriftBinary.Endpoint); err != nil { + if cfg.ThriftBinaryUDP != nil { + if err := checkPortFromEndpoint(cfg.ThriftBinaryUDP.Endpoint); err != nil { return fmt.Errorf("invalid port number for the Thrift UDP Binary endpoint: %w", err) } } - if cfg.ThriftCompact != nil { - if err := checkPortFromEndpoint(cfg.ThriftCompact.Endpoint); err != nil { + if cfg.ThriftCompactUDP != nil { + if err := checkPortFromEndpoint(cfg.ThriftCompactUDP.Endpoint); err != nil { return fmt.Errorf("invalid port number for the Thrift UDP Compact endpoint: %w", err) } } @@ -145,10 +145,10 @@ func (cfg *Config) Unmarshal(componentParser *confmap.Conf) error { cfg.ThriftHTTP = nil } if !protocols.IsSet(protoThriftBinary) { - cfg.ThriftBinary = nil + cfg.ThriftBinaryUDP = nil } if !protocols.IsSet(protoThriftCompact) { - cfg.ThriftCompact = nil + cfg.ThriftCompactUDP = nil } return nil diff --git a/receiver/jaegerreceiver/config_test.go b/receiver/jaegerreceiver/config_test.go index ee9a05b6e23d..e2bcaeb154c6 100644 --- a/receiver/jaegerreceiver/config_test.go +++ b/receiver/jaegerreceiver/config_test.go @@ -42,7 +42,7 @@ func TestLoadConfig(t *testing.T) { ThriftHTTP: &confighttp.ServerConfig{ Endpoint: ":3456", }, - ThriftCompact: &ProtocolUDP{ + ThriftCompactUDP: &ProtocolUDP{ Endpoint: "0.0.0.0:456", ServerConfigUDP: ServerConfigUDP{ QueueSize: 100_000, @@ -51,7 +51,7 @@ func TestLoadConfig(t *testing.T) { SocketBufferSize: 65_536, }, }, - ThriftBinary: &ProtocolUDP{ + ThriftBinaryUDP: &ProtocolUDP{ Endpoint: "0.0.0.0:789", ServerConfigUDP: ServerConfigUDP{ QueueSize: 1_000, @@ -76,11 +76,11 @@ func TestLoadConfig(t *testing.T) { ThriftHTTP: &confighttp.ServerConfig{ Endpoint: "localhost:14268", }, - ThriftCompact: &ProtocolUDP{ + ThriftCompactUDP: &ProtocolUDP{ Endpoint: "localhost:6831", ServerConfigUDP: defaultServerConfigUDP(), }, - ThriftBinary: &ProtocolUDP{ + ThriftBinaryUDP: &ProtocolUDP{ Endpoint: "localhost:6832", ServerConfigUDP: defaultServerConfigUDP(), }, @@ -97,7 +97,7 @@ func TestLoadConfig(t *testing.T) { Transport: confignet.TransportTypeTCP, }, }, - ThriftCompact: &ProtocolUDP{ + ThriftCompactUDP: &ProtocolUDP{ Endpoint: "localhost:6831", ServerConfigUDP: defaultServerConfigUDP(), }, @@ -183,7 +183,7 @@ func TestInvalidConfig(t *testing.T) { { desc: "thrift-udp-compact-no-port", apply: func(cfg *Config) { - cfg.ThriftCompact = &ProtocolUDP{ + cfg.ThriftCompactUDP = &ProtocolUDP{ Endpoint: "localhost:", } }, @@ -192,7 +192,7 @@ func TestInvalidConfig(t *testing.T) { { desc: "thrift-udp-binary-no-port", apply: func(cfg *Config) { - cfg.ThriftBinary = &ProtocolUDP{ + cfg.ThriftBinaryUDP = &ProtocolUDP{ Endpoint: "localhost:", } }, @@ -220,7 +220,7 @@ func TestInvalidConfig(t *testing.T) { { desc: "port-outside-of-range", apply: func(cfg *Config) { - cfg.ThriftBinary = &ProtocolUDP{ + cfg.ThriftBinaryUDP = &ProtocolUDP{ Endpoint: "localhost:65536", } }, diff --git a/receiver/jaegerreceiver/factory.go b/receiver/jaegerreceiver/factory.go index 7519e9148fbc..56e4b6084bd4 100644 --- a/receiver/jaegerreceiver/factory.go +++ b/receiver/jaegerreceiver/factory.go @@ -16,7 +16,6 @@ import ( "go.opentelemetry.io/collector/featuregate" "go.opentelemetry.io/collector/receiver" - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/common/testutil" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver/internal/metadata" ) @@ -27,11 +26,11 @@ const ( protoThriftBinary = "thrift_binary" protoThriftCompact = "thrift_compact" - // Default ports to bind to. - defaultGRPCPort = 14250 - defaultHTTPPort = 14268 - defaultThriftCompactPort = 6831 - defaultThriftBinaryPort = 6832 + // Default endpoints to bind to. + defaultGRPCEndpoint = "localhost:14250" + defaultHTTPEndpoint = "localhost:14268" + defaultThriftCompactEndpoint = "localhost:6831" + defaultThriftBinaryEndpoint = "localhost:6832" ) var disableJaegerReceiverRemoteSampling = featuregate.GlobalRegistry().MustRegister( @@ -54,19 +53,19 @@ func createDefaultConfig() component.Config { Protocols: Protocols{ GRPC: &configgrpc.ServerConfig{ NetAddr: confignet.AddrConfig{ - Endpoint: testutil.EndpointForPort(defaultGRPCPort), + Endpoint: defaultGRPCEndpoint, Transport: confignet.TransportTypeTCP, }, }, ThriftHTTP: &confighttp.ServerConfig{ - Endpoint: testutil.EndpointForPort(defaultHTTPPort), + Endpoint: defaultHTTPEndpoint, }, - ThriftBinary: &ProtocolUDP{ - Endpoint: testutil.EndpointForPort(defaultThriftBinaryPort), + ThriftBinaryUDP: &ProtocolUDP{ + Endpoint: defaultThriftBinaryEndpoint, ServerConfigUDP: defaultServerConfigUDP(), }, - ThriftCompact: &ProtocolUDP{ - Endpoint: testutil.EndpointForPort(defaultThriftCompactPort), + ThriftCompactUDP: &ProtocolUDP{ + Endpoint: defaultThriftCompactEndpoint, ServerConfigUDP: defaultServerConfigUDP(), }, }, @@ -86,28 +85,10 @@ func createTracesReceiver( rCfg := cfg.(*Config) - var config configuration - // Set ports - if rCfg.Protocols.GRPC != nil { - config.GRPCServerConfig = *rCfg.Protocols.GRPC - } - - if rCfg.Protocols.ThriftHTTP != nil { - config.HTTPServerConfig = *rCfg.ThriftHTTP - } - - if rCfg.Protocols.ThriftBinary != nil { - config.AgentBinaryThrift = *rCfg.ThriftBinary - } - - if rCfg.Protocols.ThriftCompact != nil { - config.AgentCompactThrift = *rCfg.ThriftCompact - } - if rCfg.RemoteSampling != nil { set.Logger.Warn("You are using a deprecated no-op `remote_sampling` option which will be removed soon; use a `jaegerremotesampling` extension instead") } // Create the receiver. - return newJaegerReceiver(set.ID, &config, nextConsumer, set) + return newJaegerReceiver(set.ID, rCfg.Protocols, nextConsumer, set) } diff --git a/receiver/jaegerreceiver/factory_test.go b/receiver/jaegerreceiver/factory_test.go index 194a5dcaebcb..6c809c823891 100644 --- a/receiver/jaegerreceiver/factory_test.go +++ b/receiver/jaegerreceiver/factory_test.go @@ -91,7 +91,7 @@ func TestCreateDefaultGRPCEndpoint(t *testing.T) { r, err := factory.CreateTraces(context.Background(), set, cfg, nil) assert.NoError(t, err, "unexpected error creating receiver") - assert.Equal(t, "0.0.0.0:14250", r.(*jReceiver).config.GRPCServerConfig.NetAddr.Endpoint, "grpc port should be default") + assert.Equal(t, "0.0.0.0:14250", r.(*jReceiver).config.GRPC.NetAddr.Endpoint, "grpc port should be default") } func TestCreateTLSGPRCEndpoint(t *testing.T) { @@ -144,33 +144,33 @@ func TestCreateInvalidHTTPEndpoint(t *testing.T) { r, err := factory.CreateTraces(context.Background(), set, cfg, nil) assert.NoError(t, err, "unexpected error creating receiver") - assert.Equal(t, "localhost:14268", r.(*jReceiver).config.HTTPServerConfig.Endpoint, "http port should be default") + assert.Equal(t, "localhost:14268", r.(*jReceiver).config.ThriftHTTP.Endpoint, "http port should be default") } func TestCreateInvalidThriftBinaryEndpoint(t *testing.T) { factory := NewFactory() cfg := factory.CreateDefaultConfig() - cfg.(*Config).Protocols.ThriftBinary = &ProtocolUDP{ + cfg.(*Config).Protocols.ThriftBinaryUDP = &ProtocolUDP{ Endpoint: "0.0.0.0:6832", } set := receivertest.NewNopSettings() r, err := factory.CreateTraces(context.Background(), set, cfg, nil) assert.NoError(t, err, "unexpected error creating receiver") - assert.Equal(t, "0.0.0.0:6832", r.(*jReceiver).config.AgentBinaryThrift.Endpoint, "thrift port should be default") + assert.Equal(t, "0.0.0.0:6832", r.(*jReceiver).config.ThriftBinaryUDP.Endpoint, "thrift port should be default") } func TestCreateInvalidThriftCompactEndpoint(t *testing.T) { factory := NewFactory() cfg := factory.CreateDefaultConfig() - cfg.(*Config).Protocols.ThriftCompact = &ProtocolUDP{ + cfg.(*Config).Protocols.ThriftCompactUDP = &ProtocolUDP{ Endpoint: "0.0.0.0:6831", } set := receivertest.NewNopSettings() r, err := factory.CreateTraces(context.Background(), set, cfg, nil) assert.NoError(t, err, "unexpected error creating receiver") - assert.Equal(t, "0.0.0.0:6831", r.(*jReceiver).config.AgentCompactThrift.Endpoint, "thrift port should be default") + assert.Equal(t, "0.0.0.0:6831", r.(*jReceiver).config.ThriftCompactUDP.Endpoint, "thrift port should be default") } diff --git a/receiver/jaegerreceiver/go.sum b/receiver/jaegerreceiver/go.sum index 3931eafab10b..f07a7fe1dc19 100644 --- a/receiver/jaegerreceiver/go.sum +++ b/receiver/jaegerreceiver/go.sum @@ -189,8 +189,6 @@ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.57.0 h1:DheMAlT go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.57.0/go.mod h1:wZcGmeVO9nzP67aYSLDqXNWK87EZWhi7JWj1v7ZXf94= go.opentelemetry.io/otel v1.32.0 h1:WnBN+Xjcteh0zdk01SVqV55d/m62NJLJdIyb4y/WO5U= go.opentelemetry.io/otel v1.32.0/go.mod h1:00DCVSB0RQcnzlwyTfqtxSm+DRr9hpYrHjNGiBHVQIg= -go.opentelemetry.io/otel/exporters/prometheus v0.54.0 h1:rFwzp68QMgtzu9PgP3jm9XaMICI6TsofWWPcBDKwlsU= -go.opentelemetry.io/otel/exporters/prometheus v0.54.0/go.mod h1:QyjcV9qDP6VeK5qPyKETvNjmaaEc7+gqjh4SS0ZYzDU= go.opentelemetry.io/otel/metric v1.32.0 h1:xV2umtmNcThh2/a/aCP+h64Xx5wsj8qqnkYZktzNa0M= go.opentelemetry.io/otel/metric v1.32.0/go.mod h1:jH7CIbbK6SH2V2wE16W05BHCtIDzauciCRLoc/SyMv8= go.opentelemetry.io/otel/sdk v1.32.0 h1:RNxepc9vK59A8XsgZQouW8ue8Gkb4jpWtJm9ge5lEG4= diff --git a/receiver/jaegerreceiver/jaeger_agent_test.go b/receiver/jaegerreceiver/jaeger_agent_test.go index 1c0765052ef1..4e23cbda9696 100644 --- a/receiver/jaegerreceiver/jaeger_agent_test.go +++ b/receiver/jaegerreceiver/jaeger_agent_test.go @@ -5,9 +5,7 @@ package jaegerreceiver import ( "context" - "fmt" "net" - "net/http" "testing" "time" @@ -15,7 +13,6 @@ import ( "github.com/jaegertracing/jaeger/cmd/agent/app/servers/thriftudp" "github.com/jaegertracing/jaeger/model" jaegerconvert "github.com/jaegertracing/jaeger/model/converter/thrift/jaeger" - "github.com/jaegertracing/jaeger/proto-gen/api_v2" "github.com/jaegertracing/jaeger/thrift-gen/agent" jaegerthrift "github.com/jaegertracing/jaeger/thrift-gen/jaeger" "github.com/stretchr/testify/assert" @@ -26,7 +23,6 @@ import ( "go.opentelemetry.io/collector/pdata/ptrace" "go.opentelemetry.io/collector/receiver/receivertest" conventions "go.opentelemetry.io/collector/semconv/v1.27.0" - "google.golang.org/grpc" "github.com/open-telemetry/opentelemetry-collector-contrib/internal/common/testutil" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger" @@ -37,8 +33,8 @@ var jaegerAgent = component.NewIDWithName(metadata.Type, "agent_test") func TestJaegerAgentUDP_ThriftCompact(t *testing.T) { addr := testutil.GetAvailableLocalAddress(t) - testJaegerAgent(t, addr, &configuration{ - AgentCompactThrift: ProtocolUDP{ + testJaegerAgent(t, addr, Protocols{ + ThriftCompactUDP: &ProtocolUDP{ Endpoint: addr, ServerConfigUDP: defaultServerConfigUDP(), }, @@ -46,8 +42,8 @@ func TestJaegerAgentUDP_ThriftCompact(t *testing.T) { } func TestJaegerAgentUDP_ThriftCompact_InvalidPort(t *testing.T) { - config := &configuration{ - AgentCompactThrift: ProtocolUDP{ + config := Protocols{ + ThriftCompactUDP: &ProtocolUDP{ Endpoint: "0.0.0.0:999999", ServerConfigUDP: defaultServerConfigUDP(), }, @@ -63,8 +59,8 @@ func TestJaegerAgentUDP_ThriftCompact_InvalidPort(t *testing.T) { func TestJaegerAgentUDP_ThriftBinary(t *testing.T) { addr := testutil.GetAvailableLocalAddress(t) - testJaegerAgent(t, addr, &configuration{ - AgentBinaryThrift: ProtocolUDP{ + testJaegerAgent(t, addr, Protocols{ + ThriftBinaryUDP: &ProtocolUDP{ Endpoint: addr, ServerConfigUDP: defaultServerConfigUDP(), }, @@ -75,8 +71,8 @@ func TestJaegerAgentUDP_ThriftBinary_PortInUse(t *testing.T) { // This test confirms that the thrift binary port is opened correctly. This is all we can test at the moment. See above. addr := testutil.GetAvailableLocalAddress(t) - config := &configuration{ - AgentBinaryThrift: ProtocolUDP{ + config := Protocols{ + ThriftBinaryUDP: &ProtocolUDP{ Endpoint: addr, ServerConfigUDP: defaultServerConfigUDP(), }, @@ -85,7 +81,7 @@ func TestJaegerAgentUDP_ThriftBinary_PortInUse(t *testing.T) { jr, err := newJaegerReceiver(jaegerAgent, config, nil, set) require.NoError(t, err) - assert.NoError(t, jr.startAgent(componenttest.NewNopHost()), "Start failed") + assert.NoError(t, jr.startAgent(), "Start failed") t.Cleanup(func() { require.NoError(t, jr.Shutdown(context.Background())) }) l, err := net.Listen("udp", addr) @@ -97,8 +93,8 @@ func TestJaegerAgentUDP_ThriftBinary_PortInUse(t *testing.T) { } func TestJaegerAgentUDP_ThriftBinary_InvalidPort(t *testing.T) { - config := &configuration{ - AgentBinaryThrift: ProtocolUDP{ + config := Protocols{ + ThriftBinaryUDP: &ProtocolUDP{ Endpoint: "0.0.0.0:999999", ServerConfigUDP: defaultServerConfigUDP(), }, @@ -112,60 +108,7 @@ func TestJaegerAgentUDP_ThriftBinary_InvalidPort(t *testing.T) { require.NoError(t, jr.Shutdown(context.Background())) } -func initializeGRPCTestServer(t *testing.T, beforeServe func(server *grpc.Server), opts ...grpc.ServerOption) (*grpc.Server, net.Addr) { - server := grpc.NewServer(opts...) - lis, err := net.Listen("tcp", "localhost:0") - require.NoError(t, err) - beforeServe(server) - go func() { - err := server.Serve(lis) - assert.NoError(t, err) - }() - return server, lis.Addr() -} - -type mockSamplingHandler struct{} - -func (*mockSamplingHandler) GetSamplingStrategy(context.Context, *api_v2.SamplingStrategyParameters) (*api_v2.SamplingStrategyResponse, error) { - return &api_v2.SamplingStrategyResponse{StrategyType: api_v2.SamplingStrategyType_PROBABILISTIC}, nil -} - -func TestJaegerHTTP(t *testing.T) { - s, _ := initializeGRPCTestServer(t, func(s *grpc.Server) { - api_v2.RegisterSamplingManagerServer(s, &mockSamplingHandler{}) - }) - defer s.GracefulStop() - - endpoint := testutil.GetAvailableLocalAddress(t) - config := &configuration{ - AgentHTTPEndpoint: endpoint, - } - set := receivertest.NewNopSettings() - jr, err := newJaegerReceiver(jaegerAgent, config, nil, set) - require.NoError(t, err) - t.Cleanup(func() { require.NoError(t, jr.Shutdown(context.Background())) }) - - assert.NoError(t, jr.Start(context.Background(), componenttest.NewNopHost()), "Start failed") - - // allow http server to start - assert.Eventually(t, func() bool { - var conn net.Conn - conn, err = net.Dial("tcp", endpoint) - if err == nil && conn != nil { - conn.Close() - return true - } - return false - }, 10*time.Second, 5*time.Millisecond, "failed to wait for the port to be open") - - resp, err := http.Get(fmt.Sprintf("http://%s/sampling?service=test", endpoint)) - assert.NoError(t, err, "should not have failed to make request") - assert.NotNil(t, resp) - defer resp.Body.Close() - assert.Equal(t, 500, resp.StatusCode, "should have returned 200") -} - -func testJaegerAgent(t *testing.T, agentEndpoint string, receiverConfig *configuration) { +func testJaegerAgent(t *testing.T, agentEndpoint string, receiverConfig Protocols) { // 1. Create the Jaeger receiver aka "server" sink := new(consumertest.TracesSink) set := receivertest.NewNopSettings() @@ -184,7 +127,7 @@ func testJaegerAgent(t *testing.T, agentEndpoint string, receiverConfig *configu require.NoError(t, err, "Start failed") // 2. Then send spans to the Jaeger receiver. - jexp, err := newClientUDP(agentEndpoint, jr.config.AgentBinaryThrift.Endpoint != "") + jexp, err := newClientUDP(agentEndpoint, jr.config.ThriftBinaryUDP != nil) require.NoError(t, err, "Failed to create the Jaeger OpenTelemetry exporter for the live application") // 3. Now finally send some spans diff --git a/receiver/jaegerreceiver/trace_receiver.go b/receiver/jaegerreceiver/trace_receiver.go index 3e3b44c83e72..af204faa68f0 100644 --- a/receiver/jaegerreceiver/trace_receiver.go +++ b/receiver/jaegerreceiver/trace_receiver.go @@ -15,8 +15,6 @@ import ( apacheThrift "github.com/apache/thrift/lib/go/thrift" "github.com/gorilla/mux" - "github.com/jaegertracing/jaeger/cmd/agent/app/configmanager" - "github.com/jaegertracing/jaeger/cmd/agent/app/httpserver" "github.com/jaegertracing/jaeger/cmd/agent/app/processors" "github.com/jaegertracing/jaeger/cmd/agent/app/servers" "github.com/jaegertracing/jaeger/cmd/agent/app/servers/thriftudp" @@ -24,13 +22,10 @@ import ( "github.com/jaegertracing/jaeger/pkg/metrics" "github.com/jaegertracing/jaeger/proto-gen/api_v2" "github.com/jaegertracing/jaeger/thrift-gen/agent" - "github.com/jaegertracing/jaeger/thrift-gen/baggage" "github.com/jaegertracing/jaeger/thrift-gen/jaeger" "github.com/jaegertracing/jaeger/thrift-gen/zipkincore" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componentstatus" - "go.opentelemetry.io/collector/config/configgrpc" - "go.opentelemetry.io/collector/config/confighttp" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receiverhelper" @@ -40,24 +35,13 @@ import ( jaegertranslator "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger" ) -// configuration defines the behavior and the ports that -// the Jaeger receiver will use. -type configuration struct { - HTTPServerConfig confighttp.ServerConfig - GRPCServerConfig configgrpc.ServerConfig - - AgentCompactThrift ProtocolUDP - AgentBinaryThrift ProtocolUDP - AgentHTTPEndpoint string -} - // Receiver type is used to receive spans that were originally intended to be sent to Jaeger. // This receiver is basically a Jaeger collector. type jReceiver struct { nextConsumer consumer.Traces id component.ID - config *configuration + config Protocols grpc *grpc.Server collectorServer *http.Server @@ -92,7 +76,7 @@ var acceptedThriftFormats = map[string]struct{}{ // also as a Jaeger agent. func newJaegerReceiver( id component.ID, - config *configuration, + config Protocols, nextConsumer consumer.Traces, set receiver.Settings, ) (*jReceiver, error) { @@ -124,7 +108,7 @@ func newJaegerReceiver( } func (jr *jReceiver) Start(ctx context.Context, host component.Host) error { - if err := jr.startAgent(host); err != nil { + if err := jr.startAgent(); err != nil { return err } @@ -168,23 +152,10 @@ func consumeTraces(ctx context.Context, batch *jaeger.Batch, consumer consumer.T } var ( - _ agent.Agent = (*agentHandler)(nil) - _ api_v2.CollectorServiceServer = (*jReceiver)(nil) - _ configmanager.ClientConfigManager = (*notImplementedConfigManager)(nil) + _ agent.Agent = (*agentHandler)(nil) + _ api_v2.CollectorServiceServer = (*jReceiver)(nil) ) -var errNotImplemented = errors.New("not implemented") - -type notImplementedConfigManager struct{} - -func (notImplementedConfigManager) GetSamplingStrategy(_ context.Context, _ string) (*api_v2.SamplingStrategyResponse, error) { - return nil, errNotImplemented -} - -func (notImplementedConfigManager) GetBaggageRestrictions(_ context.Context, _ string) ([]*baggage.BaggageRestriction, error) { - return nil, errNotImplemented -} - type agentHandler struct { nextConsumer consumer.Traces obsrecv *receiverhelper.ObsReport @@ -223,12 +194,8 @@ func (jr *jReceiver) PostSpans(ctx context.Context, r *api_v2.PostSpansRequest) return &api_v2.PostSpansResponse{}, nil } -func (jr *jReceiver) startAgent(host component.Host) error { - if jr.config == nil { - return nil - } - - if jr.config.AgentBinaryThrift.Endpoint != "" { +func (jr *jReceiver) startAgent() error { + if jr.config.ThriftBinaryUDP != nil { obsrecv, err := receiverhelper.NewObsReport(receiverhelper.ObsReportSettings{ ReceiverID: jr.id, Transport: agentTransportBinary, @@ -242,14 +209,14 @@ func (jr *jReceiver) startAgent(host component.Host) error { nextConsumer: jr.nextConsumer, obsrecv: obsrecv, } - processor, err := jr.buildProcessor(jr.config.AgentBinaryThrift.Endpoint, jr.config.AgentBinaryThrift.ServerConfigUDP, apacheThrift.NewTBinaryProtocolFactoryConf(nil), h) + processor, err := jr.buildProcessor(jr.config.ThriftBinaryUDP.Endpoint, jr.config.ThriftBinaryUDP.ServerConfigUDP, apacheThrift.NewTBinaryProtocolFactoryConf(nil), h) if err != nil { return err } jr.agentProcessors = append(jr.agentProcessors, processor) } - if jr.config.AgentCompactThrift.Endpoint != "" { + if jr.config.ThriftCompactUDP != nil { obsrecv, err := receiverhelper.NewObsReport(receiverhelper.ObsReportSettings{ ReceiverID: jr.id, Transport: agentTransportCompact, @@ -262,7 +229,7 @@ func (jr *jReceiver) startAgent(host component.Host) error { nextConsumer: jr.nextConsumer, obsrecv: obsrecv, } - processor, err := jr.buildProcessor(jr.config.AgentCompactThrift.Endpoint, jr.config.AgentCompactThrift.ServerConfigUDP, apacheThrift.NewTCompactProtocolFactoryConf(nil), h) + processor, err := jr.buildProcessor(jr.config.ThriftCompactUDP.Endpoint, jr.config.ThriftCompactUDP.ServerConfigUDP, apacheThrift.NewTCompactProtocolFactoryConf(nil), h) if err != nil { return err } @@ -277,18 +244,6 @@ func (jr *jReceiver) startAgent(host component.Host) error { }(processor) } - if jr.config.AgentHTTPEndpoint != "" { - jr.agentServer = httpserver.NewHTTPServer(jr.config.AgentHTTPEndpoint, ¬ImplementedConfigManager{}, metrics.NullFactory, jr.settings.Logger) - - jr.goroutines.Add(1) - go func() { - defer jr.goroutines.Done() - if err := jr.agentServer.ListenAndServe(); !errors.Is(err, http.ErrServerClosed) && err != nil { - componentstatus.ReportStatus(host, componentstatus.NewFatalErrorEvent(fmt.Errorf("jaeger agent server error: %w", err))) - } - }() - } - return nil } @@ -370,20 +325,16 @@ func (jr *jReceiver) HandleThriftHTTPBatch(w http.ResponseWriter, r *http.Reques } func (jr *jReceiver) startCollector(ctx context.Context, host component.Host) error { - if jr.config == nil { - return nil - } - - if jr.config.HTTPServerConfig.Endpoint != "" { - cln, err := jr.config.HTTPServerConfig.ToListener(ctx) + if jr.config.ThriftHTTP != nil { + cln, err := jr.config.ThriftHTTP.ToListener(ctx) if err != nil { return fmt.Errorf("failed to bind to Collector address %q: %w", - jr.config.HTTPServerConfig.Endpoint, err) + jr.config.ThriftHTTP.Endpoint, err) } nr := mux.NewRouter() nr.HandleFunc("/api/traces", jr.HandleThriftHTTPBatch).Methods(http.MethodPost) - jr.collectorServer, err = jr.config.HTTPServerConfig.ToServer(ctx, host, jr.settings.TelemetrySettings, nr) + jr.collectorServer, err = jr.config.ThriftHTTP.ToServer(ctx, host, jr.settings.TelemetrySettings, nr) if err != nil { return err } @@ -397,16 +348,16 @@ func (jr *jReceiver) startCollector(ctx context.Context, host component.Host) er }() } - if jr.config.GRPCServerConfig.NetAddr.Endpoint != "" { + if jr.config.GRPC != nil { var err error - jr.grpc, err = jr.config.GRPCServerConfig.ToServer(ctx, host, jr.settings.TelemetrySettings) + jr.grpc, err = jr.config.GRPC.ToServer(ctx, host, jr.settings.TelemetrySettings) if err != nil { return fmt.Errorf("failed to build the options for the Jaeger gRPC Collector: %w", err) } - ln, err := jr.config.GRPCServerConfig.NetAddr.Listen(ctx) + ln, err := jr.config.GRPC.NetAddr.Listen(ctx) if err != nil { - return fmt.Errorf("failed to bind to gRPC address %q: %w", jr.config.GRPCServerConfig.NetAddr, err) + return fmt.Errorf("failed to bind to gRPC address %q: %w", jr.config.GRPC.NetAddr, err) } api_v2.RegisterCollectorServiceServer(jr.grpc, jr) diff --git a/receiver/jaegerreceiver/trace_receiver_test.go b/receiver/jaegerreceiver/trace_receiver_test.go index 31062bf57791..5377850bdc12 100644 --- a/receiver/jaegerreceiver/trace_receiver_test.go +++ b/receiver/jaegerreceiver/trace_receiver_test.go @@ -45,7 +45,7 @@ var jaegerReceiver = component.MustNewIDWithName("jaeger", "receiver_test") func TestTraceSource(t *testing.T) { set := receivertest.NewNopSettings() - jr, err := newJaegerReceiver(jaegerReceiver, &configuration{}, nil, set) + jr, err := newJaegerReceiver(jaegerReceiver, Protocols{}, nil, set) require.NoError(t, err) require.NotNil(t, jr) } @@ -77,8 +77,8 @@ func TestThriftHTTPBodyDecode(t *testing.T) { func TestReception(t *testing.T) { addr := testutil.GetAvailableLocalAddress(t) // 1. Create the Jaeger receiver aka "server" - config := &configuration{ - HTTPServerConfig: confighttp.ServerConfig{ + config := Protocols{ + ThriftHTTP: &confighttp.ServerConfig{ Endpoint: addr, }, } @@ -110,7 +110,7 @@ func TestReception(t *testing.T) { func TestPortsNotOpen(t *testing.T) { // an empty config should result in no open ports - config := &configuration{} + config := Protocols{} sink := new(consumertest.TracesSink) @@ -139,8 +139,8 @@ func TestPortsNotOpen(t *testing.T) { func TestGRPCReception(t *testing.T) { // prepare - config := &configuration{ - GRPCServerConfig: configgrpc.ServerConfig{ + config := Protocols{ + GRPC: &configgrpc.ServerConfig{ NetAddr: confignet.AddrConfig{ Endpoint: testutil.GetAvailableLocalAddress(t), Transport: confignet.TransportTypeTCP, @@ -156,7 +156,7 @@ func TestGRPCReception(t *testing.T) { require.NoError(t, jr.Start(context.Background(), componenttest.NewNopHost())) t.Cleanup(func() { require.NoError(t, jr.Shutdown(context.Background())) }) - conn, err := grpc.NewClient(config.GRPCServerConfig.NetAddr.Endpoint, grpc.WithTransportCredentials(insecure.NewCredentials())) + conn, err := grpc.NewClient(config.GRPC.NetAddr.Endpoint, grpc.WithTransportCredentials(insecure.NewCredentials())) require.NoError(t, err) defer conn.Close() @@ -194,7 +194,7 @@ func TestGRPCReceptionWithTLS(t *testing.T) { }, } - grpcServerSettings := configgrpc.ServerConfig{ + grpcServerSettings := &configgrpc.ServerConfig{ NetAddr: confignet.AddrConfig{ Endpoint: testutil.GetAvailableLocalAddress(t), Transport: confignet.TransportTypeTCP, @@ -202,8 +202,8 @@ func TestGRPCReceptionWithTLS(t *testing.T) { TLSSetting: tlsCreds, } - config := &configuration{ - GRPCServerConfig: grpcServerSettings, + config := Protocols{ + GRPC: grpcServerSettings, } sink := new(consumertest.TracesSink) @@ -335,8 +335,8 @@ func grpcFixture(t *testing.T, t1 time.Time, d1, d2 time.Duration) *api_v2.PostS } func TestSampling(t *testing.T) { - config := &configuration{ - GRPCServerConfig: configgrpc.ServerConfig{NetAddr: confignet.AddrConfig{ + config := Protocols{ + GRPC: &configgrpc.ServerConfig{NetAddr: confignet.AddrConfig{ Endpoint: testutil.GetAvailableLocalAddress(t), Transport: confignet.TransportTypeTCP, }}, @@ -350,7 +350,7 @@ func TestSampling(t *testing.T) { require.NoError(t, jr.Start(context.Background(), componenttest.NewNopHost())) t.Cleanup(func() { require.NoError(t, jr.Shutdown(context.Background())) }) - conn, err := grpc.NewClient(config.GRPCServerConfig.NetAddr.Endpoint, grpc.WithTransportCredentials(insecure.NewCredentials())) + conn, err := grpc.NewClient(config.GRPC.NetAddr.Endpoint, grpc.WithTransportCredentials(insecure.NewCredentials())) assert.NoError(t, err) defer conn.Close() diff --git a/receiver/journaldreceiver/go.mod b/receiver/journaldreceiver/go.mod index e9ea7aa334a6..66e2d55be767 100644 --- a/receiver/journaldreceiver/go.mod +++ b/receiver/journaldreceiver/go.mod @@ -64,7 +64,7 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.33.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect gonum.org/v1/gonum v0.15.1 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect diff --git a/receiver/journaldreceiver/go.sum b/receiver/journaldreceiver/go.sum index 8ea8ffa0ad26..81603af7634d 100644 --- a/receiver/journaldreceiver/go.sum +++ b/receiver/journaldreceiver/go.sum @@ -146,8 +146,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.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.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.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= diff --git a/receiver/kafkametricsreceiver/go.mod b/receiver/kafkametricsreceiver/go.mod index 42dc0a6c3535..c781a62be05e 100644 --- a/receiver/kafkametricsreceiver/go.mod +++ b/receiver/kafkametricsreceiver/go.mod @@ -3,7 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kafkam go 1.22.0 require ( - github.com/IBM/sarama v1.44.0 + github.com/IBM/sarama v1.45.0 github.com/google/go-cmp v0.6.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/kafka v0.117.0 github.com/stretchr/testify v1.10.0 @@ -60,7 +60,7 @@ require ( github.com/jcmturner/rpc/v2 v2.0.3 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.17.9 // indirect + github.com/klauspost/compress v1.17.11 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect github.com/knadh/koanf/providers/confmap v0.1.0 // indirect github.com/knadh/koanf/v2 v2.1.2 // indirect @@ -88,9 +88,9 @@ require ( go.opentelemetry.io/otel/sdk v1.32.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.32.0 // indirect go.opentelemetry.io/otel/trace v1.32.0 // indirect - golang.org/x/crypto v0.31.0 // indirect - golang.org/x/net v0.33.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/crypto v0.32.0 // indirect + golang.org/x/net v0.34.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.69.2 // indirect diff --git a/receiver/kafkametricsreceiver/go.sum b/receiver/kafkametricsreceiver/go.sum index 1af9d7372c5e..fe65083afd72 100644 --- a/receiver/kafkametricsreceiver/go.sum +++ b/receiver/kafkametricsreceiver/go.sum @@ -1,5 +1,5 @@ -github.com/IBM/sarama v1.44.0 h1:puNKqcScjSAgVLramjsuovZrS0nJZFVsrvuUymkWqhE= -github.com/IBM/sarama v1.44.0/go.mod h1:MxQ9SvGfvKIorbk077Ff6DUnBlGpidiQOtU2vuBaxVw= +github.com/IBM/sarama v1.45.0 h1:IzeBevTn809IJ/dhNKhP5mpxEXTmELuezO2tgHD9G5E= +github.com/IBM/sarama v1.45.0/go.mod h1:EEay63m8EZkeumco9TDXf2JT3uDnZsZqFgV46n4yZdY= github.com/aws/aws-msk-iam-sasl-signer-go v1.0.0 h1:UyjtGmO0Uwl/K+zpzPwLoXzMhcN9xmnR2nrqJoBrg3c= github.com/aws/aws-msk-iam-sasl-signer-go v1.0.0/go.mod h1:TJAXuFs2HcMib3sN5L0gUC+Q01Qvy3DemvA55WuC+iA= github.com/aws/aws-sdk-go v1.55.5 h1:KKUZBfBoyqy5d3swXyiC7Q76ic40rYcbqH7qjh59kzU= @@ -91,8 +91,8 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= -github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= +github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= +github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= @@ -203,8 +203,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= -golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= +golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= +golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= @@ -217,8 +217,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= -golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= 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= @@ -233,8 +233,8 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= diff --git a/receiver/kafkareceiver/go.mod b/receiver/kafkareceiver/go.mod index 8afc246414a6..28abc8446fa7 100644 --- a/receiver/kafkareceiver/go.mod +++ b/receiver/kafkareceiver/go.mod @@ -3,7 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kafkar go 1.22.7 require ( - github.com/IBM/sarama v1.44.0 + github.com/IBM/sarama v1.45.0 github.com/apache/thrift v0.21.0 github.com/gogo/protobuf v1.3.2 github.com/jaegertracing/jaeger v1.64.0 @@ -104,10 +104,10 @@ require ( go.opentelemetry.io/collector/receiver/xreceiver v0.117.0 // indirect go.opentelemetry.io/otel/sdk v1.32.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.31.0 // indirect + golang.org/x/crypto v0.32.0 // indirect golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect - golang.org/x/net v0.33.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/net v0.34.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.69.2 // indirect diff --git a/receiver/kafkareceiver/go.sum b/receiver/kafkareceiver/go.sum index 37fb62efb3f1..1b33d1161621 100644 --- a/receiver/kafkareceiver/go.sum +++ b/receiver/kafkareceiver/go.sum @@ -1,5 +1,5 @@ -github.com/IBM/sarama v1.44.0 h1:puNKqcScjSAgVLramjsuovZrS0nJZFVsrvuUymkWqhE= -github.com/IBM/sarama v1.44.0/go.mod h1:MxQ9SvGfvKIorbk077Ff6DUnBlGpidiQOtU2vuBaxVw= +github.com/IBM/sarama v1.45.0 h1:IzeBevTn809IJ/dhNKhP5mpxEXTmELuezO2tgHD9G5E= +github.com/IBM/sarama v1.45.0/go.mod h1:EEay63m8EZkeumco9TDXf2JT3uDnZsZqFgV46n4yZdY= github.com/apache/thrift v0.21.0 h1:tdPmh/ptjE1IJnhbhrcl2++TauVjy242rkV/UzJChnE= github.com/apache/thrift v0.21.0/go.mod h1:W1H8aR/QRtYNvrPeFXBtobyRkd0/YVhTc6i07XIAgDw= github.com/aws/aws-msk-iam-sasl-signer-go v1.0.0 h1:UyjtGmO0Uwl/K+zpzPwLoXzMhcN9xmnR2nrqJoBrg3c= @@ -228,8 +228,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= -golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= +golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= +golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= 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/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -244,8 +244,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= -golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= 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= @@ -260,8 +260,8 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= diff --git a/receiver/lokireceiver/factory.go b/receiver/lokireceiver/factory.go index 8faa7d0d128c..b645545f68f2 100644 --- a/receiver/lokireceiver/factory.go +++ b/receiver/lokireceiver/factory.go @@ -15,15 +15,12 @@ import ( "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/receiver" - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/common/testutil" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/lokireceiver/internal/metadata" ) const ( - defaultGRPCPort = 3600 - defaultHTTPPort = 3500 - defaultGRPCBindEndpoint = "0.0.0.0:3600" - defaultHTTPBindEndpoint = "0.0.0.0:3500" + defaultGRPCEndpoint = "localhost:3600" + defaultHTTPEndpoint = "localhost:3500" ) // NewFactory return a new receiver.Factory for loki receiver. @@ -39,12 +36,12 @@ func createDefaultConfig() component.Config { Protocols: Protocols{ GRPC: &configgrpc.ServerConfig{ NetAddr: confignet.AddrConfig{ - Endpoint: testutil.EndpointForPort(defaultGRPCPort), + Endpoint: defaultGRPCEndpoint, Transport: confignet.TransportTypeTCP, }, }, HTTP: &confighttp.ServerConfig{ - Endpoint: testutil.EndpointForPort(defaultHTTPPort), + Endpoint: defaultHTTPEndpoint, }, }, } diff --git a/receiver/lokireceiver/factory_test.go b/receiver/lokireceiver/factory_test.go index 608d57587dff..8866bffa9848 100644 --- a/receiver/lokireceiver/factory_test.go +++ b/receiver/lokireceiver/factory_test.go @@ -27,7 +27,7 @@ func TestCreateReceiver(t *testing.T) { cfg := factory.CreateDefaultConfig() cfg.(*Config).Protocols.GRPC = &configgrpc.ServerConfig{ NetAddr: confignet.AddrConfig{ - Endpoint: defaultGRPCBindEndpoint, + Endpoint: defaultGRPCEndpoint, Transport: confignet.TransportTypeTCP, }, } diff --git a/receiver/mongodbatlasreceiver/go.mod b/receiver/mongodbatlasreceiver/go.mod index 46c27731f399..27e29ff87e4f 100644 --- a/receiver/mongodbatlasreceiver/go.mod +++ b/receiver/mongodbatlasreceiver/go.mod @@ -81,7 +81,7 @@ require ( go.opentelemetry.io/otel/sdk v1.32.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.32.0 // indirect golang.org/x/net v0.33.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect gonum.org/v1/gonum v0.15.1 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect diff --git a/receiver/mongodbatlasreceiver/go.sum b/receiver/mongodbatlasreceiver/go.sum index 936db06d16c6..2be06add4acd 100644 --- a/receiver/mongodbatlasreceiver/go.sum +++ b/receiver/mongodbatlasreceiver/go.sum @@ -171,8 +171,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.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.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.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= diff --git a/receiver/mongodbreceiver/go.mod b/receiver/mongodbreceiver/go.mod index 551591c3b503..ce3b46ff3ac2 100644 --- a/receiver/mongodbreceiver/go.mod +++ b/receiver/mongodbreceiver/go.mod @@ -10,7 +10,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.117.0 github.com/stretchr/testify v1.10.0 github.com/testcontainers/testcontainers-go v0.34.0 - go.mongodb.org/mongo-driver v1.17.1 + go.mongodb.org/mongo-driver v1.17.2 go.opentelemetry.io/collector/component v0.117.0 go.opentelemetry.io/collector/component/componenttest v0.117.0 go.opentelemetry.io/collector/config/confignet v1.23.0 diff --git a/receiver/mongodbreceiver/go.sum b/receiver/mongodbreceiver/go.sum index 6aefc4fad708..5e8e068b7b19 100644 --- a/receiver/mongodbreceiver/go.sum +++ b/receiver/mongodbreceiver/go.sum @@ -149,8 +149,8 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= -go.mongodb.org/mongo-driver v1.17.1 h1:Wic5cJIwJgSpBhe3lx3+/RybR5PiYRMpVFgO7cOHyIM= -go.mongodb.org/mongo-driver v1.17.1/go.mod h1:wwWm/+BuOddhcq3n68LKRmgk2wXzmF6s0SFOa0GINL4= +go.mongodb.org/mongo-driver v1.17.2 h1:gvZyk8352qSfzyZ2UMWcpDpMSGEr1eqE4T793SqyhzM= +go.mongodb.org/mongo-driver v1.17.2/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ= go.opentelemetry.io/collector/component v0.117.0 h1:A3Im4PqLyfduAdVyUgbOZdUs7J/USegdpnkoIAOuN3Y= go.opentelemetry.io/collector/component v0.117.0/go.mod h1:+SxJgeMwNV6y3aKNR2sP0PfovcUlRwC0+pEv4tTYdXA= go.opentelemetry.io/collector/component/componenttest v0.117.0 h1:r3k0BsU/cJlqVQRtgFjxfduNEGaM2qCAU7JitIGkRds= diff --git a/receiver/namedpipereceiver/go.mod b/receiver/namedpipereceiver/go.mod index 7bc49f24c16d..fa23ed069afe 100644 --- a/receiver/namedpipereceiver/go.mod +++ b/receiver/namedpipereceiver/go.mod @@ -65,7 +65,7 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.33.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect gonum.org/v1/gonum v0.15.1 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect diff --git a/receiver/namedpipereceiver/go.sum b/receiver/namedpipereceiver/go.sum index a8feaefd7ab1..2ddd297b4b5b 100644 --- a/receiver/namedpipereceiver/go.sum +++ b/receiver/namedpipereceiver/go.sum @@ -148,8 +148,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.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.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.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= diff --git a/receiver/opencensusreceiver/factory.go b/receiver/opencensusreceiver/factory.go index d406b1d6e911..be1633df2088 100644 --- a/receiver/opencensusreceiver/factory.go +++ b/receiver/opencensusreceiver/factory.go @@ -12,12 +12,11 @@ import ( "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/receiver" - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/common/testutil" "github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/opencensusreceiver/internal/metadata" ) -const grpcPort = 55678 +const grpcEndpoint = "localhost:55678" // NewFactory creates a new OpenCensus receiver factory. func NewFactory() receiver.Factory { @@ -32,7 +31,7 @@ func createDefaultConfig() component.Config { return &Config{ ServerConfig: configgrpc.ServerConfig{ NetAddr: confignet.AddrConfig{ - Endpoint: testutil.EndpointForPort(grpcPort), + Endpoint: grpcEndpoint, Transport: confignet.TransportTypeTCP, }, // We almost write 0 bytes, so no need to tune WriteBufferSize. diff --git a/receiver/otelarrowreceiver/go.mod b/receiver/otelarrowreceiver/go.mod index 4f369b44cf28..5d07126071ea 100644 --- a/receiver/otelarrowreceiver/go.mod +++ b/receiver/otelarrowreceiver/go.mod @@ -32,7 +32,7 @@ require ( go.uber.org/mock v0.5.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.27.0 - golang.org/x/net v0.33.0 + golang.org/x/net v0.34.0 google.golang.org/grpc v1.69.2 ) @@ -81,7 +81,7 @@ require ( golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect golang.org/x/mod v0.18.0 // indirect golang.org/x/sync v0.10.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect golang.org/x/tools v0.22.0 // indirect golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect diff --git a/receiver/otelarrowreceiver/go.sum b/receiver/otelarrowreceiver/go.sum index 30d887de9887..6e112d02b9a8 100644 --- a/receiver/otelarrowreceiver/go.sum +++ b/receiver/otelarrowreceiver/go.sum @@ -197,8 +197,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.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= -golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= 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= @@ -209,8 +209,8 @@ golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7w 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.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.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.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= diff --git a/receiver/otlpjsonfilereceiver/go.mod b/receiver/otlpjsonfilereceiver/go.mod index 62819cc10f23..9513c6adaaae 100644 --- a/receiver/otlpjsonfilereceiver/go.mod +++ b/receiver/otlpjsonfilereceiver/go.mod @@ -68,7 +68,7 @@ require ( go.uber.org/zap v1.27.0 // indirect golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect golang.org/x/net v0.33.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect gonum.org/v1/gonum v0.15.1 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect diff --git a/receiver/otlpjsonfilereceiver/go.sum b/receiver/otlpjsonfilereceiver/go.sum index 53abbd332b91..988cbe052f8b 100644 --- a/receiver/otlpjsonfilereceiver/go.sum +++ b/receiver/otlpjsonfilereceiver/go.sum @@ -150,8 +150,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.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.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.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= diff --git a/receiver/podmanreceiver/go.mod b/receiver/podmanreceiver/go.mod index ae57df0369f7..d1a998982697 100644 --- a/receiver/podmanreceiver/go.mod +++ b/receiver/podmanreceiver/go.mod @@ -21,7 +21,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/crypto v0.31.0 + golang.org/x/crypto v0.32.0 ) require ( @@ -52,7 +52,7 @@ require ( go.opentelemetry.io/otel/sdk/metric v1.32.0 // indirect go.opentelemetry.io/otel/trace v1.32.0 // indirect golang.org/x/net v0.33.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.69.2 // indirect diff --git a/receiver/podmanreceiver/go.sum b/receiver/podmanreceiver/go.sum index b8b001f3faf7..1d1b075220e0 100644 --- a/receiver/podmanreceiver/go.sum +++ b/receiver/podmanreceiver/go.sum @@ -107,8 +107,8 @@ go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= -golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= +golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= +golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -123,10 +123,10 @@ 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.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= -golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg= +golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek= 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.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= diff --git a/receiver/receivercreator/config_test.go b/receiver/receivercreator/config_test.go index 1bb751939140..2a9a02ec0d74 100644 --- a/receiver/receivercreator/config_test.go +++ b/receiver/receivercreator/config_test.go @@ -90,7 +90,7 @@ func TestLoadConfig(t *testing.T) { Rule: `type == "port"`, ResourceAttributes: map[string]any{"one": "two"}, rule: portRule, - signals: receiverSignals{true, true, true}, + signals: receiverSignals{metrics: true, logs: true, traces: true}, }, "nop/1": { receiverConfig: receiverConfig{ @@ -103,7 +103,7 @@ func TestLoadConfig(t *testing.T) { Rule: `type == "port"`, ResourceAttributes: map[string]any{"two": "three"}, rule: portRule, - signals: receiverSignals{true, true, true}, + signals: receiverSignals{metrics: true, logs: true, traces: true}, }, }, WatchObservers: []component.ID{ diff --git a/receiver/receivercreator/discovery.go b/receiver/receivercreator/discovery.go index 1908be3da7f5..a640b1385440 100644 --- a/receiver/receivercreator/discovery.go +++ b/receiver/receivercreator/discovery.go @@ -124,7 +124,7 @@ func (builder *k8sHintsBuilder) createScraper( } recTemplate, err := newReceiverTemplate(fmt.Sprintf("%v/%v_%v", subreceiverKey, pod.UID, port), userConfMap) - recTemplate.signals = receiverSignals{true, false, false} + recTemplate.signals = receiverSignals{metrics: true, logs: false, traces: false} return &recTemplate, err } diff --git a/receiver/receivercreator/observerhandler_test.go b/receiver/receivercreator/observerhandler_test.go index c6575d371c9e..87ce5d9778e3 100644 --- a/receiver/receivercreator/observerhandler_test.go +++ b/receiver/receivercreator/observerhandler_test.go @@ -78,7 +78,7 @@ func TestOnAddForMetrics(t *testing.T) { rule: portRule, Rule: `type == "port"`, ResourceAttributes: map[string]any{}, - signals: receiverSignals{true, true, true}, + signals: receiverSignals{metrics: true, logs: true, traces: true}, }, } diff --git a/receiver/saphanareceiver/go.mod b/receiver/saphanareceiver/go.mod index cd5f1479cf81..d8e501521aca 100644 --- a/receiver/saphanareceiver/go.mod +++ b/receiver/saphanareceiver/go.mod @@ -3,7 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/receiver/saphan go 1.22.0 require ( - github.com/SAP/go-hdb v1.12.7 + github.com/SAP/go-hdb v1.12.9 github.com/google/go-cmp v0.6.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.117.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.117.0 @@ -59,9 +59,9 @@ require ( go.opentelemetry.io/otel/sdk v1.32.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.32.0 // indirect go.opentelemetry.io/otel/trace v1.32.0 // indirect - golang.org/x/crypto v0.31.0 // indirect + golang.org/x/crypto v0.32.0 // indirect golang.org/x/net v0.33.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.69.2 // indirect diff --git a/receiver/saphanareceiver/go.sum b/receiver/saphanareceiver/go.sum index 8b0f7c587276..bd6c8fe543e9 100644 --- a/receiver/saphanareceiver/go.sum +++ b/receiver/saphanareceiver/go.sum @@ -1,5 +1,5 @@ -github.com/SAP/go-hdb v1.12.7 h1:b6UAWiRxgGQwzcvQD1+tkmCl2Zda4Tjfjkry7FY+/mo= -github.com/SAP/go-hdb v1.12.7/go.mod h1:zb852z999jPL3nh7wOfJiXzAnFGeYMtVlruVg3eZdY8= +github.com/SAP/go-hdb v1.12.9 h1:49Sli0rtL0Gt26onpfFQvqC3TYEgtp1YtygpTVxW4Qo= +github.com/SAP/go-hdb v1.12.9/go.mod h1:0nsCnOB9TLKsoHT4ZthxHrVweXx7LCgll7SzLnfdXlc= 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= @@ -119,8 +119,8 @@ go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= -golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= +golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= +golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -135,8 +135,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.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.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.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= diff --git a/receiver/sapmreceiver/factory.go b/receiver/sapmreceiver/factory.go index dabaa4a6871d..f15b5e393e3d 100644 --- a/receiver/sapmreceiver/factory.go +++ b/receiver/sapmreceiver/factory.go @@ -17,13 +17,12 @@ import ( "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/receiver" - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/common/testutil" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/sapmreceiver/internal/metadata" ) const ( - // Default port to bind to. - defaultPort = 7276 + // Default endpoint to bind to. + defaultEndpoint = "localhost:7276" ) // NewFactory creates a factory for SAPM receiver. @@ -37,7 +36,7 @@ func NewFactory() receiver.Factory { func createDefaultConfig() component.Config { return &Config{ ServerConfig: confighttp.ServerConfig{ - Endpoint: testutil.EndpointForPort(defaultPort), + Endpoint: defaultEndpoint, }, } } diff --git a/receiver/signalfxreceiver/factory.go b/receiver/signalfxreceiver/factory.go index 428fdd2237cd..e115f1d8d9a4 100644 --- a/receiver/signalfxreceiver/factory.go +++ b/receiver/signalfxreceiver/factory.go @@ -16,7 +16,6 @@ import ( "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/receiver" - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/common/testutil" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/signalfxreceiver/internal/metadata" ) @@ -24,8 +23,8 @@ import ( const ( - // Default port to bind to. - defaultPort = 9943 + // Default endpoint to bind to. + defaultEndpoint = "localhost:9943" ) // NewFactory creates a factory for SignalFx receiver. @@ -40,7 +39,7 @@ func NewFactory() receiver.Factory { func createDefaultConfig() component.Config { return &Config{ ServerConfig: confighttp.ServerConfig{ - Endpoint: testutil.EndpointForPort(defaultPort), + Endpoint: defaultEndpoint, }, } } diff --git a/receiver/skywalkingreceiver/factory.go b/receiver/skywalkingreceiver/factory.go index 933e97ca06bd..e376718870a2 100644 --- a/receiver/skywalkingreceiver/factory.go +++ b/receiver/skywalkingreceiver/factory.go @@ -19,7 +19,6 @@ import ( "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/receiver" - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/common/testutil" "github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/skywalkingreceiver/internal/metadata" ) @@ -29,9 +28,9 @@ const ( protoGRPC = "grpc" protoHTTP = "http" - // Default ports to bind to. - defaultGRPCPort = 11800 - defaultHTTPPort = 12800 + // Default endpoints to bind to. + defaultGRPCEndpoint = "localhost:11800" + defaultHTTPEndpoint = "localhost:12800" ) // NewFactory creates a new Skywalking receiver factory. @@ -49,12 +48,12 @@ func createDefaultConfig() component.Config { Protocols: Protocols{ GRPC: &configgrpc.ServerConfig{ NetAddr: confignet.AddrConfig{ - Endpoint: testutil.EndpointForPort(defaultGRPCPort), + Endpoint: defaultGRPCEndpoint, Transport: confignet.TransportTypeTCP, }, }, HTTP: &confighttp.ServerConfig{ - Endpoint: testutil.EndpointForPort(defaultHTTPPort), + Endpoint: defaultHTTPEndpoint, }, }, } diff --git a/receiver/skywalkingreceiver/go.mod b/receiver/skywalkingreceiver/go.mod index 2a293a85dac9..fda15d3dcda4 100644 --- a/receiver/skywalkingreceiver/go.mod +++ b/receiver/skywalkingreceiver/go.mod @@ -4,7 +4,6 @@ go 1.22.0 require ( github.com/gorilla/mux v1.8.1 - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.117.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.117.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/skywalking v0.117.0 github.com/stretchr/testify v1.10.0 @@ -39,7 +38,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/hashicorp/go-version v1.7.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.17.11 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect @@ -62,7 +60,6 @@ require ( go.opentelemetry.io/collector/consumer/xconsumer v0.117.0 // indirect go.opentelemetry.io/collector/extension v0.117.0 // indirect go.opentelemetry.io/collector/extension/auth v0.117.0 // indirect - go.opentelemetry.io/collector/featuregate v1.23.0 // indirect go.opentelemetry.io/collector/pdata/pprofile v0.117.0 // indirect go.opentelemetry.io/collector/pipeline v0.117.0 // indirect go.opentelemetry.io/collector/receiver/xreceiver v0.117.0 // indirect @@ -90,5 +87,3 @@ retract ( v0.76.1 v0.65.0 ) - -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => ../../internal/common diff --git a/receiver/skywalkingreceiver/go.sum b/receiver/skywalkingreceiver/go.sum index 469a698a72aa..e79704677f1c 100644 --- a/receiver/skywalkingreceiver/go.sum +++ b/receiver/skywalkingreceiver/go.sum @@ -68,8 +68,6 @@ github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -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= @@ -157,8 +155,6 @@ go.opentelemetry.io/collector/extension/auth v0.117.0 h1:tXQdYIdcABXalWyFZP22pRE go.opentelemetry.io/collector/extension/auth v0.117.0/go.mod h1:ofrV2BuE46+k7Su/h0ccrMl5Zk5Y7NVlzOb3AwU7Dzw= go.opentelemetry.io/collector/extension/auth/authtest v0.117.0 h1:wV4OIiWrt7gteQrxL8MCmGvjGhMiu5TplKJHOfVZO6Y= go.opentelemetry.io/collector/extension/auth/authtest v0.117.0/go.mod h1:nHxcAOyo26JnuYwKIoQM9mDlSXpERQrbjIw3Dtp9hug= -go.opentelemetry.io/collector/featuregate v1.23.0 h1:N033ROo85qKrsK16QzR6RV+3UWOWF7kpOO8FSnX99s0= -go.opentelemetry.io/collector/featuregate v1.23.0/go.mod h1:3GaXqflNDVwWndNGBJ1+XJFy3Fv/XrFgjMN60N3z7yg= go.opentelemetry.io/collector/pdata v1.23.0 h1:tEk0dkfB8RdSukoOMfEa8duB938gfZowdfRkrJxGDrw= go.opentelemetry.io/collector/pdata v1.23.0/go.mod h1:I2jggpBMiO8A+7TXhzNpcJZkJtvi1cU0iVNIi+6bc+o= go.opentelemetry.io/collector/pdata/pprofile v0.117.0 h1:AyOK+rkNGeawmLGUqF84wYks22BSGJtEV++3YSfvD1I= diff --git a/receiver/splunkhecreceiver/factory.go b/receiver/splunkhecreceiver/factory.go index ffbd2ad9f534..916f2d8c651c 100644 --- a/receiver/splunkhecreceiver/factory.go +++ b/receiver/splunkhecreceiver/factory.go @@ -12,7 +12,6 @@ import ( "go.opentelemetry.io/collector/receiver" conventions "go.opentelemetry.io/collector/semconv/v1.27.0" - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/common/testutil" "github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent" "github.com/open-telemetry/opentelemetry-collector-contrib/internal/splunk" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/splunkhecreceiver/internal/metadata" @@ -21,8 +20,8 @@ import ( // This file implements factory for Splunk HEC receiver. const ( - // Default endpoints to bind to. - defaultPort = 8088 + // Default endpoint to bind to. + defaultEndpoint = "localhost:8088" ) // NewFactory creates a factory for Splunk HEC receiver. @@ -38,7 +37,7 @@ func NewFactory() receiver.Factory { func createDefaultConfig() component.Config { return &Config{ ServerConfig: confighttp.ServerConfig{ - Endpoint: testutil.EndpointForPort(defaultPort), + Endpoint: defaultEndpoint, }, AccessTokenPassthroughConfig: splunk.AccessTokenPassthroughConfig{}, HecToOtelAttrs: splunk.HecToOtelAttrs{ diff --git a/receiver/sqlqueryreceiver/README.md b/receiver/sqlqueryreceiver/README.md index 2540ddaeda61..4a10ec00daa1 100644 --- a/receiver/sqlqueryreceiver/README.md +++ b/receiver/sqlqueryreceiver/README.md @@ -1,4 +1,4 @@ -# SQL Query Receiver (Alpha) +# SQL Query Receiver | Status | | diff --git a/receiver/sqlqueryreceiver/go.mod b/receiver/sqlqueryreceiver/go.mod index 231de680eb79..e5eb8391e13a 100644 --- a/receiver/sqlqueryreceiver/go.mod +++ b/receiver/sqlqueryreceiver/go.mod @@ -44,7 +44,7 @@ require ( github.com/BurntSushi/toml v1.4.0 // indirect github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c // indirect github.com/Microsoft/go-winio v0.6.2 // indirect - github.com/SAP/go-hdb v1.12.7 // indirect + github.com/SAP/go-hdb v1.12.9 // indirect github.com/apache/arrow/go/v15 v15.0.0 // indirect github.com/aws/aws-sdk-go-v2 v1.26.1 // indirect github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2 // indirect @@ -156,13 +156,13 @@ require ( go.opentelemetry.io/otel/sdk/metric v1.32.0 // indirect go.opentelemetry.io/proto/otlp v1.0.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.31.0 // indirect + golang.org/x/crypto v0.32.0 // indirect golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect golang.org/x/mod v0.19.0 // indirect golang.org/x/net v0.33.0 // indirect golang.org/x/sync v0.10.0 // indirect - golang.org/x/sys v0.28.0 // indirect - golang.org/x/term v0.27.0 // indirect + golang.org/x/sys v0.29.0 // indirect + golang.org/x/term v0.28.0 // indirect golang.org/x/text v0.21.0 // indirect golang.org/x/tools v0.23.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect diff --git a/receiver/sqlqueryreceiver/go.sum b/receiver/sqlqueryreceiver/go.sum index 0880f6ddfe42..b95540c6533e 100644 --- a/receiver/sqlqueryreceiver/go.sum +++ b/receiver/sqlqueryreceiver/go.sum @@ -32,8 +32,8 @@ github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c h1:RGWPOewvK github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c/go.mod h1:X0CRv0ky0k6m906ixxpzmDRLvX58TFUKS2eePweuyxk= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= -github.com/SAP/go-hdb v1.12.7 h1:b6UAWiRxgGQwzcvQD1+tkmCl2Zda4Tjfjkry7FY+/mo= -github.com/SAP/go-hdb v1.12.7/go.mod h1:zb852z999jPL3nh7wOfJiXzAnFGeYMtVlruVg3eZdY8= +github.com/SAP/go-hdb v1.12.9 h1:49Sli0rtL0Gt26onpfFQvqC3TYEgtp1YtygpTVxW4Qo= +github.com/SAP/go-hdb v1.12.9/go.mod h1:0nsCnOB9TLKsoHT4ZthxHrVweXx7LCgll7SzLnfdXlc= github.com/apache/arrow/go/v15 v15.0.0 h1:1zZACWf85oEZY5/kd9dsQS7i+2G5zVQcbKTHgslqHNA= github.com/apache/arrow/go/v15 v15.0.0/go.mod h1:DGXsR3ajT524njufqf95822i+KTh+yea1jass9YXgjA= github.com/aws/aws-sdk-go-v2 v1.26.1 h1:5554eUqIYVWpU0YmeeYZ0wU64H2VLBs8TlhRB2L+EkA= @@ -363,8 +363,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= -golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= +golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= +golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= 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/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -405,13 +405,13 @@ golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 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.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= -golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= +golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg= +golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek= 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.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= diff --git a/receiver/sqlserverreceiver/go.mod b/receiver/sqlserverreceiver/go.mod index 5aeb5d9e4a86..ebd595de7568 100644 --- a/receiver/sqlserverreceiver/go.mod +++ b/receiver/sqlserverreceiver/go.mod @@ -35,7 +35,7 @@ require ( github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.0.0 // indirect github.com/BurntSushi/toml v1.4.0 // indirect github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c // indirect - github.com/SAP/go-hdb v1.12.7 // indirect + github.com/SAP/go-hdb v1.12.9 // indirect github.com/apache/arrow/go/v15 v15.0.0 // indirect github.com/aws/aws-sdk-go-v2 v1.26.1 // indirect github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2 // indirect @@ -109,13 +109,13 @@ require ( go.opentelemetry.io/otel/sdk v1.32.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.32.0 // indirect go.opentelemetry.io/otel/trace v1.32.0 // indirect - golang.org/x/crypto v0.31.0 // indirect + golang.org/x/crypto v0.32.0 // indirect golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3 // indirect golang.org/x/mod v0.17.0 // indirect golang.org/x/net v0.33.0 // indirect golang.org/x/sync v0.10.0 // indirect - golang.org/x/sys v0.28.0 // indirect - golang.org/x/term v0.27.0 // indirect + golang.org/x/sys v0.29.0 // indirect + golang.org/x/term v0.28.0 // indirect golang.org/x/text v0.21.0 // indirect golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect diff --git a/receiver/sqlserverreceiver/go.sum b/receiver/sqlserverreceiver/go.sum index 481c9a4dd6fc..ed25fef530e3 100644 --- a/receiver/sqlserverreceiver/go.sum +++ b/receiver/sqlserverreceiver/go.sum @@ -22,8 +22,8 @@ github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0 github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c h1:RGWPOewvKIROun94nF7v2cua9qP+thov/7M50KEoeSU= github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c/go.mod h1:X0CRv0ky0k6m906ixxpzmDRLvX58TFUKS2eePweuyxk= -github.com/SAP/go-hdb v1.12.7 h1:b6UAWiRxgGQwzcvQD1+tkmCl2Zda4Tjfjkry7FY+/mo= -github.com/SAP/go-hdb v1.12.7/go.mod h1:zb852z999jPL3nh7wOfJiXzAnFGeYMtVlruVg3eZdY8= +github.com/SAP/go-hdb v1.12.9 h1:49Sli0rtL0Gt26onpfFQvqC3TYEgtp1YtygpTVxW4Qo= +github.com/SAP/go-hdb v1.12.9/go.mod h1:0nsCnOB9TLKsoHT4ZthxHrVweXx7LCgll7SzLnfdXlc= github.com/apache/arrow/go/v15 v15.0.0 h1:1zZACWf85oEZY5/kd9dsQS7i+2G5zVQcbKTHgslqHNA= github.com/apache/arrow/go/v15 v15.0.0/go.mod h1:DGXsR3ajT524njufqf95822i+KTh+yea1jass9YXgjA= github.com/aws/aws-sdk-go-v2 v1.26.1 h1:5554eUqIYVWpU0YmeeYZ0wU64H2VLBs8TlhRB2L+EkA= @@ -261,8 +261,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= -golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= +golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= +golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3 h1:/RIbNt/Zr7rVhIkQhooTxCxFcdWLGIKnZA4IXNFSrvo= golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -298,13 +298,13 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= -golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= +golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg= +golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek= 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.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= diff --git a/receiver/sshcheckreceiver/go.mod b/receiver/sshcheckreceiver/go.mod index 5a39c7fc9666..86d858914031 100644 --- a/receiver/sshcheckreceiver/go.mod +++ b/receiver/sshcheckreceiver/go.mod @@ -23,7 +23,7 @@ require ( go.opentelemetry.io/collector/scraper/scraperhelper v0.117.0 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - golang.org/x/crypto v0.31.0 + golang.org/x/crypto v0.32.0 ) require ( @@ -68,7 +68,7 @@ require ( go.opentelemetry.io/otel/trace v1.32.0 // indirect go.uber.org/zap v1.27.0 golang.org/x/net v0.33.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect google.golang.org/grpc v1.69.2 // indirect google.golang.org/protobuf v1.36.2 // indirect diff --git a/receiver/sshcheckreceiver/go.sum b/receiver/sshcheckreceiver/go.sum index c8c4a5faee45..0bbdde9be4d1 100644 --- a/receiver/sshcheckreceiver/go.sum +++ b/receiver/sshcheckreceiver/go.sum @@ -123,8 +123,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= -golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= -golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= +golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= +golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= @@ -154,15 +154,15 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= -golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= -golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= +golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg= +golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek= 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.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= diff --git a/receiver/syslogreceiver/go.mod b/receiver/syslogreceiver/go.mod index 278b70e98631..2db99913e001 100644 --- a/receiver/syslogreceiver/go.mod +++ b/receiver/syslogreceiver/go.mod @@ -68,7 +68,7 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.33.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect gonum.org/v1/gonum v0.15.1 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect diff --git a/receiver/syslogreceiver/go.sum b/receiver/syslogreceiver/go.sum index 3d39140778af..297a5192deaf 100644 --- a/receiver/syslogreceiver/go.sum +++ b/receiver/syslogreceiver/go.sum @@ -154,8 +154,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.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.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.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= diff --git a/receiver/tcplogreceiver/go.mod b/receiver/tcplogreceiver/go.mod index 8d0a189abe23..51e9d9d44232 100644 --- a/receiver/tcplogreceiver/go.mod +++ b/receiver/tcplogreceiver/go.mod @@ -68,7 +68,7 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.33.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect gonum.org/v1/gonum v0.15.1 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect diff --git a/receiver/tcplogreceiver/go.sum b/receiver/tcplogreceiver/go.sum index 3d39140778af..297a5192deaf 100644 --- a/receiver/tcplogreceiver/go.sum +++ b/receiver/tcplogreceiver/go.sum @@ -154,8 +154,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.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.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.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= diff --git a/receiver/udplogreceiver/go.mod b/receiver/udplogreceiver/go.mod index 3d4928ec464b..690ac03e7295 100644 --- a/receiver/udplogreceiver/go.mod +++ b/receiver/udplogreceiver/go.mod @@ -64,7 +64,7 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.33.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect gonum.org/v1/gonum v0.15.1 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect diff --git a/receiver/udplogreceiver/go.sum b/receiver/udplogreceiver/go.sum index 8ea8ffa0ad26..81603af7634d 100644 --- a/receiver/udplogreceiver/go.sum +++ b/receiver/udplogreceiver/go.sum @@ -146,8 +146,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.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.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.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= diff --git a/receiver/windowseventlogreceiver/go.mod b/receiver/windowseventlogreceiver/go.mod index 5612558ddc78..bb958f1a4a39 100644 --- a/receiver/windowseventlogreceiver/go.mod +++ b/receiver/windowseventlogreceiver/go.mod @@ -14,7 +14,7 @@ require ( go.opentelemetry.io/otel/metric v1.32.0 // indirect go.opentelemetry.io/otel/trace v1.32.0 // indirect go.uber.org/goleak v1.3.0 - golang.org/x/sys v0.28.0 + golang.org/x/sys v0.29.0 ) require ( diff --git a/receiver/windowseventlogreceiver/go.sum b/receiver/windowseventlogreceiver/go.sum index 8ea8ffa0ad26..81603af7634d 100644 --- a/receiver/windowseventlogreceiver/go.sum +++ b/receiver/windowseventlogreceiver/go.sum @@ -146,8 +146,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.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.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.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= diff --git a/receiver/windowsperfcountersreceiver/go.mod b/receiver/windowsperfcountersreceiver/go.mod index 2ab85931e39a..fba122deecd0 100644 --- a/receiver/windowsperfcountersreceiver/go.mod +++ b/receiver/windowsperfcountersreceiver/go.mod @@ -53,7 +53,7 @@ require ( go.opentelemetry.io/otel/sdk/metric v1.32.0 // indirect go.opentelemetry.io/otel/trace v1.32.0 // indirect golang.org/x/net v0.33.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.69.2 // indirect diff --git a/receiver/windowsperfcountersreceiver/go.sum b/receiver/windowsperfcountersreceiver/go.sum index 8448a867a3d2..9b11a63a5729 100644 --- a/receiver/windowsperfcountersreceiver/go.sum +++ b/receiver/windowsperfcountersreceiver/go.sum @@ -119,8 +119,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.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.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.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= diff --git a/receiver/zipkinreceiver/config_test.go b/receiver/zipkinreceiver/config_test.go index fb0117ba6d15..bd648c540dd0 100644 --- a/receiver/zipkinreceiver/config_test.go +++ b/receiver/zipkinreceiver/config_test.go @@ -43,7 +43,7 @@ func TestLoadConfig(t *testing.T) { id: component.NewIDWithName(metadata.Type, "parse_strings"), expected: &Config{ ServerConfig: confighttp.ServerConfig{ - Endpoint: defaultBindEndpoint, + Endpoint: defaultHTTPEndpoint, }, ParseStringTags: true, }, diff --git a/receiver/zipkinreceiver/factory.go b/receiver/zipkinreceiver/factory.go index dd86d7d9c477..d4bdbf9342db 100644 --- a/receiver/zipkinreceiver/factory.go +++ b/receiver/zipkinreceiver/factory.go @@ -11,15 +11,13 @@ import ( "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/receiver" - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/common/testutil" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver/internal/metadata" ) // This file implements factory for Zipkin receiver. const ( - defaultHTTPPort = 9411 - defaultBindEndpoint = "localhost:9411" + defaultHTTPEndpoint = "localhost:9411" ) // NewFactory creates a new Zipkin receiver factory @@ -35,7 +33,7 @@ func NewFactory() receiver.Factory { func createDefaultConfig() component.Config { return &Config{ ServerConfig: confighttp.ServerConfig{ - Endpoint: testutil.EndpointForPort(defaultHTTPPort), + Endpoint: defaultHTTPEndpoint, }, ParseStringTags: false, } diff --git a/receiver/zipkinreceiver/go.mod b/receiver/zipkinreceiver/go.mod index ca61613e0330..385185bd535a 100644 --- a/receiver/zipkinreceiver/go.mod +++ b/receiver/zipkinreceiver/go.mod @@ -4,7 +4,6 @@ go 1.22.7 require ( github.com/jaegertracing/jaeger v1.64.0 - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.117.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.117.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.117.0 github.com/openzipkin/zipkin-go v0.4.3 @@ -36,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/hashicorp/go-version v1.7.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.17.11 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect @@ -58,7 +56,6 @@ require ( go.opentelemetry.io/collector/consumer/xconsumer v0.117.0 // indirect go.opentelemetry.io/collector/extension v0.117.0 // indirect go.opentelemetry.io/collector/extension/auth v0.117.0 // indirect - go.opentelemetry.io/collector/featuregate v1.23.0 // indirect go.opentelemetry.io/collector/pdata/pprofile v0.117.0 // indirect go.opentelemetry.io/collector/pipeline v0.117.0 // indirect go.opentelemetry.io/collector/receiver/xreceiver v0.117.0 // indirect @@ -80,8 +77,6 @@ require ( replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal => ../../internal/coreinternal -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => ../../internal/common - replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin => ../../pkg/translator/zipkin retract ( diff --git a/receiver/zipkinreceiver/go.sum b/receiver/zipkinreceiver/go.sum index 6f0fad0a299d..3295d23c5f72 100644 --- a/receiver/zipkinreceiver/go.sum +++ b/receiver/zipkinreceiver/go.sum @@ -26,8 +26,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/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= -github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/jaegertracing/jaeger v1.64.0 h1:fc45qwaBZpBE2DeXwJlm8hK1q2PACrzGKXKgIcHLPMw= github.com/jaegertracing/jaeger v1.64.0/go.mod h1:9yVeL3z2Q9AGrW7j7TTeqohUy7Bbp9XWXgUDG3rVdO0= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= @@ -109,8 +107,6 @@ go.opentelemetry.io/collector/extension/auth v0.117.0 h1:tXQdYIdcABXalWyFZP22pRE go.opentelemetry.io/collector/extension/auth v0.117.0/go.mod h1:ofrV2BuE46+k7Su/h0ccrMl5Zk5Y7NVlzOb3AwU7Dzw= go.opentelemetry.io/collector/extension/auth/authtest v0.117.0 h1:wV4OIiWrt7gteQrxL8MCmGvjGhMiu5TplKJHOfVZO6Y= go.opentelemetry.io/collector/extension/auth/authtest v0.117.0/go.mod h1:nHxcAOyo26JnuYwKIoQM9mDlSXpERQrbjIw3Dtp9hug= -go.opentelemetry.io/collector/featuregate v1.23.0 h1:N033ROo85qKrsK16QzR6RV+3UWOWF7kpOO8FSnX99s0= -go.opentelemetry.io/collector/featuregate v1.23.0/go.mod h1:3GaXqflNDVwWndNGBJ1+XJFy3Fv/XrFgjMN60N3z7yg= go.opentelemetry.io/collector/pdata v1.23.0 h1:tEk0dkfB8RdSukoOMfEa8duB938gfZowdfRkrJxGDrw= go.opentelemetry.io/collector/pdata v1.23.0/go.mod h1:I2jggpBMiO8A+7TXhzNpcJZkJtvi1cU0iVNIi+6bc+o= go.opentelemetry.io/collector/pdata/pprofile v0.117.0 h1:AyOK+rkNGeawmLGUqF84wYks22BSGJtEV++3YSfvD1I= diff --git a/receiver/zookeeperreceiver/factory.go b/receiver/zookeeperreceiver/factory.go index 57cdbf82276a..2aded7155e7f 100644 --- a/receiver/zookeeperreceiver/factory.go +++ b/receiver/zookeeperreceiver/factory.go @@ -14,12 +14,11 @@ import ( "go.opentelemetry.io/collector/scraper" "go.opentelemetry.io/collector/scraper/scraperhelper" - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/common/testutil" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zookeeperreceiver/internal/metadata" ) const ( - defaultPort = 2181 + defaultEndpoint = "localhost:2181" defaultCollectionInterval = 10 * time.Second defaultTimeout = 10 * time.Second ) @@ -40,7 +39,7 @@ func createDefaultConfig() component.Config { return &Config{ ControllerConfig: cfg, TCPAddrConfig: confignet.TCPAddrConfig{ - Endpoint: testutil.EndpointForPort(defaultPort), + Endpoint: defaultEndpoint, }, MetricsBuilderConfig: metadata.DefaultMetricsBuilderConfig(), } diff --git a/renovate.json b/renovate.json index 86fd15fd4eef..9ac1b7013873 100644 --- a/renovate.json +++ b/renovate.json @@ -1,129 +1,219 @@ { - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "labels": [ - "renovatebot", - "dependencies" - ], - "constraints": { - "go": "1.22.0" - }, - "schedule": ["every tuesday"], - "extends": [ - "config:recommended", - "customManagers:githubActionsVersions" - ], - "ignorePaths": [ - "**/receiver/apachesparkreceiver/testdata/integration/Dockerfile.apache-spark", - "**/receiver/elasticsearchreceiver/testdata/integration/Dockerfile.elasticsearch.7_16_3", - "**/receiver/elasticsearchreceiver/testdata/integration/Dockerfile.elasticsearch.7_9_3", - "**/receiver/mongodbreceiver/testdata/integration/Dockerfile.mongodb.4_0", - "**/receiver/mongodbreceiver/testdata/integration/Dockerfile.mongodb.4_4.lpu", - "**/receiver/mongodbreceiver/testdata/integration/Dockerfile.mongodb.4_4lpu", - "**/receiver/mongodbreceiver/testdata/integration/Dockerfile.mongodb.5_0" - ], - "packageRules": [ - { - "matchManagers": ["gomod"], - "matchUpdateTypes": ["pin", "pinDigest", "digest", "lockFileMaintenance", "rollback", "bump", "replacement"], - "enabled": false - }, - { - "matchManagers": ["gomod"], - "matchUpdateTypes": ["major"], - "prBodyNotes": [":warning: MAJOR VERSION UPDATE :warning: - please manually update this package"], - "labels": ["dependency-major-update"] - }, - { - "matchManagers": ["dockerfile"], - "groupName": "dockerfile deps" - }, - { - "matchManagers": ["docker-compose"], - "groupName": "docker-compose deps" - }, - { - "matchManagers": ["github-actions"], - "groupName": "github-actions deps" - }, - { - "matchManagers": ["gomod"], - "matchSourceUrlPrefixes": ["https://github.com/aws"], - "groupName": "All github.com/aws packages" - }, - { - "matchManagers": ["gomod"], - "matchSourceUrlPrefixes": ["https://github.com/azure"], - "groupName": "All github.com/azure packages" - }, - { - "matchManagers": ["gomod"], - "matchSourceUrlPrefixes": ["https://github.com/datadog"], - "groupName": "All github.com/datadog packages" - }, - { - "matchManagers": ["gomod"], - "matchSourceUrlPrefixes": ["https://google.golang.org"], - "groupName": "All google.golang.org packages" - }, - { - "matchManagers": ["gomod"], - "matchPackagePrefixes": ["golang.org/x"], - "groupName": "All golang.org/x packages" - }, - { - "matchManagers": ["gomod"], - "matchPackagePrefixes": ["go.opentelemetry.io/build-tools"], - "groupName": "All go.opentelemetry.io/build-tools packages" - }, - { - "matchManagers": ["gomod"], - "matchSourceUrlPrefixes": ["https://go.opentelemetry.io/otel"], - "groupName": "All go.opentelemetry.io/otel packages" - }, - { - "matchManagers": ["gomod"], - "matchPackagePrefixes": ["cloud.google.com/go"], - "groupName": "All cloud.google.com/go packages" - }, - { - "matchManagers": ["gomod"], - "matchSourceUrlPrefixes": ["https://github.com/googlecloudplatform"], - "groupName": "All github.com/googlecloudplatform packages" - }, - { - "matchManagers": ["gomod"], - "matchSourceUrls": ["https://github.com/open-telemetry/opentelemetry-collector"], - "groupName": "All OpenTelemetry Collector dev packages", - "matchUpdateTypes": ["digest"] - }, - { - "matchManagers": ["gomod"], - "matchSourceUrls": ["https://github.com/open-telemetry/opentelemetry-collector"], - "groupName": "All OpenTelemetry Collector packages", - "matchUpdateTypes": ["major", "minor", "patch"] - }, - { - "matchManagers": ["gomod"], - "matchSourceUrls": ["https://github.com/open-telemetry/opentelemetry-collector-contrib"], - "groupName": "All OpenTelemetry Collector Contrib packages", - "matchUpdateTypes": ["major", "minor", "patch"] - }, - { - "matchManagers": ["gomod"], - "matchSourceUrls": [ - "https://github.com/open-telemetry/opentelemetry-go-contrib" - ], - "groupName": "All opentelemetry-go-contrib packages" - }, - { - "matchPackageNames": ["google.golang.org/grpc"], - "allowedVersions": "!/v1.68.0$/" - } - ], - "ignoreDeps": [ - "github.com/DataDog/datadog-agent/pkg/trace/exportable", - "github.com/DataDog/datadog-api-client-go" - ], - "prConcurrentLimit": 200, - "suppressNotifications": ["prEditedNotification"] - } + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "labels": [ + "renovatebot", + "dependencies" + ], + "constraints": { + "go": "1.22.0" + }, + "schedule": [ + "on tuesday" + ], + "extends": [ + "config:recommended", + "customManagers:githubActionsVersions" + ], + "ignorePaths": [ + "**/receiver/apachesparkreceiver/testdata/integration/Dockerfile.apache-spark", + "**/receiver/elasticsearchreceiver/testdata/integration/Dockerfile.elasticsearch.7_16_3", + "**/receiver/elasticsearchreceiver/testdata/integration/Dockerfile.elasticsearch.7_9_3", + "**/receiver/mongodbreceiver/testdata/integration/Dockerfile.mongodb.4_0", + "**/receiver/mongodbreceiver/testdata/integration/Dockerfile.mongodb.4_4.lpu", + "**/receiver/mongodbreceiver/testdata/integration/Dockerfile.mongodb.4_4lpu", + "**/receiver/mongodbreceiver/testdata/integration/Dockerfile.mongodb.5_0" + ], + "packageRules": [ + { + "matchManagers": [ + "gomod" + ], + "matchUpdateTypes": [ + "pin", + "pinDigest", + "digest", + "lockFileMaintenance", + "rollback", + "bump", + "replacement" + ], + "enabled": false + }, + { + "matchManagers": [ + "gomod" + ], + "matchUpdateTypes": [ + "major" + ], + "prBodyNotes": [ + ":warning: MAJOR VERSION UPDATE :warning: - please manually update this package" + ], + "labels": [ + "dependency-major-update" + ] + }, + { + "matchManagers": [ + "dockerfile" + ], + "groupName": "dockerfile deps" + }, + { + "matchManagers": [ + "docker-compose" + ], + "groupName": "docker-compose deps" + }, + { + "matchManagers": [ + "github-actions" + ], + "groupName": "github-actions deps" + }, + { + "matchManagers": [ + "gomod" + ], + "groupName": "All github.com/aws packages", + "matchSourceUrls": [ + "https://github.com/aws{/,}**" + ] + }, + { + "matchManagers": [ + "gomod" + ], + "groupName": "All github.com/azure packages", + "matchSourceUrls": [ + "https://github.com/azure{/,}**" + ] + }, + { + "matchManagers": [ + "gomod" + ], + "groupName": "All github.com/datadog packages", + "matchSourceUrls": [ + "https://github.com/datadog{/,}**" + ] + }, + { + "matchManagers": [ + "gomod" + ], + "groupName": "All google.golang.org packages", + "matchSourceUrls": [ + "https://google.golang.org{/,}**" + ] + }, + { + "matchManagers": [ + "gomod" + ], + "groupName": "All golang.org/x packages", + "matchPackageNames": [ + "golang.org/x{/,}**" + ] + }, + { + "matchManagers": [ + "gomod" + ], + "groupName": "All go.opentelemetry.io/build-tools packages", + "matchPackageNames": [ + "go.opentelemetry.io/build-tools{/,}**" + ] + }, + { + "matchManagers": [ + "gomod" + ], + "groupName": "All go.opentelemetry.io/otel packages", + "matchSourceUrls": [ + "https://go.opentelemetry.io/otel{/,}**" + ] + }, + { + "matchManagers": [ + "gomod" + ], + "groupName": "All cloud.google.com/go packages", + "matchPackageNames": [ + "cloud.google.com/go{/,}**" + ] + }, + { + "matchManagers": [ + "gomod" + ], + "groupName": "All github.com/googlecloudplatform packages", + "matchSourceUrls": [ + "https://github.com/googlecloudplatform{/,}**" + ] + }, + { + "matchManagers": [ + "gomod" + ], + "matchSourceUrls": [ + "https://github.com/open-telemetry/opentelemetry-collector" + ], + "groupName": "All OpenTelemetry Collector dev packages", + "matchUpdateTypes": [ + "digest" + ] + }, + { + "matchManagers": [ + "gomod" + ], + "matchSourceUrls": [ + "https://github.com/open-telemetry/opentelemetry-collector" + ], + "groupName": "All OpenTelemetry Collector packages", + "matchUpdateTypes": [ + "major", + "minor", + "patch" + ] + }, + { + "matchManagers": [ + "gomod" + ], + "matchSourceUrls": [ + "https://github.com/open-telemetry/opentelemetry-collector-contrib" + ], + "groupName": "All OpenTelemetry Collector Contrib packages", + "matchUpdateTypes": [ + "major", + "minor", + "patch" + ] + }, + { + "matchManagers": [ + "gomod" + ], + "matchSourceUrls": [ + "https://github.com/open-telemetry/opentelemetry-go-contrib" + ], + "groupName": "All opentelemetry-go-contrib packages" + }, + { + "matchPackageNames": [ + "google.golang.org/grpc" + ], + "allowedVersions": "!/v1.68.0$/" + } + ], + "ignoreDeps": [ + "github.com/DataDog/datadog-agent/pkg/trace/exportable", + "github.com/DataDog/datadog-api-client-go" + ], + "prConcurrentLimit": 200, + "suppressNotifications": [ + "prEditedNotification" + ] +} diff --git a/reports/distributions/contrib.yaml b/reports/distributions/contrib.yaml index a4f0c3b4b075..fa773bb7a364 100644 --- a/reports/distributions/contrib.yaml +++ b/reports/distributions/contrib.yaml @@ -91,6 +91,7 @@ components: - geoip - groupbyattrs - groupbytrace + - interval - k8sattributes - logdedup - metricsgeneration diff --git a/reports/distributions/k8s.yaml b/reports/distributions/k8s.yaml index 2e1bcadb32f3..8dd0986df2c5 100644 --- a/reports/distributions/k8s.yaml +++ b/reports/distributions/k8s.yaml @@ -36,6 +36,7 @@ components: - filter - groupbyattrs - groupbytrace + - interval - k8sattributes - logdedup - metricstransform