diff --git a/.chloggen/andrew.glaude_ddexporter-add-agent-version.yaml b/.chloggen/andrew.glaude_ddexporter-add-agent-version.yaml new file mode 100755 index 000000000000..e3dbd99955f4 --- /dev/null +++ b/.chloggen/andrew.glaude_ddexporter-add-agent-version.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: datadogexporter + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Attach the collector version to stats payloads to improve the debugging experience. + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [31454] + +# (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/aws-xray-exporter-http-semconv-stable.yaml b/.chloggen/aws-xray-exporter-http-semconv-stable.yaml new file mode 100644 index 000000000000..ae61c668d6a7 --- /dev/null +++ b/.chloggen/aws-xray-exporter-http-semconv-stable.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: awsxrayexporter + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: support both deprecated and stable http attributes translation for backward compatibility. + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [30935] + +# (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/azuremonitorexporter-connectionstring-envvar-support.yaml b/.chloggen/azuremonitorexporter-connectionstring-envvar-support.yaml new file mode 100755 index 000000000000..25c614ae76e0 --- /dev/null +++ b/.chloggen/azuremonitorexporter-connectionstring-envvar-support.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: azuremonitorexporter + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Added support for configuring the Azure Monitor Exporter connection string via the `APPLICATIONINSIGHTS_CONNECTION_STRING` environment variable. + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [31523] + +# (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/chronyreceiver_lifecycle.yaml b/.chloggen/chronyreceiver_lifecycle.yaml new file mode 100755 index 000000000000..e0eef769689b --- /dev/null +++ b/.chloggen/chronyreceiver_lifecycle.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: chronyreceiver + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: move initialization of the chrony client to the start function + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [27849] + +# (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/codeboten_rm-deprecated.yaml b/.chloggen/codeboten_rm-deprecated.yaml new file mode 100755 index 000000000000..b0e6eba8a40c --- /dev/null +++ b/.chloggen/codeboten_rm-deprecated.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: f5cloudexporter + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Remove deprecated module + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [31531] + +# (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/datadogconnector-feature-gate.yaml b/.chloggen/datadogconnector-feature-gate.yaml new file mode 100644 index 000000000000..aa7c6165d4dd --- /dev/null +++ b/.chloggen/datadogconnector-feature-gate.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: datadogconnector + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: "Move feature gate `connector.datadogconnector.performance` to stable stage." + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [31414] + +# (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: "`connector.datadogconnector.performance` will be removed in the next release" + +# 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/datadogconnector-mutates-data.yaml b/.chloggen/datadogconnector-mutates-data.yaml new file mode 100644 index 000000000000..40a19ead22f4 --- /dev/null +++ b/.chloggen/datadogconnector-mutates-data.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: datadogconnector + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: datadogconnector no longer mutates the input traces in trace-to-trace pipelines. + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [31414] + +# (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/deltatocumulative-advancing-starttime.yaml b/.chloggen/deltatocumulative-advancing-starttime.yaml new file mode 100644 index 000000000000..b8138d3059b3 --- /dev/null +++ b/.chloggen/deltatocumulative-advancing-starttime.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: deltatocumulativeprocessor + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: permits advancing delta start timestamps, as required by spec. + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [31365] + +# (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/drosiek-sumologicextension-2.yaml b/.chloggen/drosiek-sumologicextension-2.yaml new file mode 100755 index 000000000000..caf1218296fb --- /dev/null +++ b/.chloggen/drosiek-sumologicextension-2.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: sumologicextension + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: add implementation of Sumo Logic Extension + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [29601] + +# (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/feat_support-latest-dogstatsd.yaml b/.chloggen/feat_support-latest-dogstatsd.yaml new file mode 100755 index 000000000000..3a49cc43a682 --- /dev/null +++ b/.chloggen/feat_support-latest-dogstatsd.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: statsdreceiver + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Add support for the latest version of DogStatsD protocol (v1.3) + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [31295] + +# (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/fileexporter_lifecycle.yaml b/.chloggen/fileexporter_lifecycle.yaml new file mode 100755 index 000000000000..5eb92b7b5bb6 --- /dev/null +++ b/.chloggen/fileexporter_lifecycle.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: fileexporter + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Scope the behavior of the fileexporter to its lifecycle, so it is safe to shut it down or restart it. + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [27489] + +# (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/fix-31130.yaml b/.chloggen/fix-31130.yaml new file mode 100755 index 000000000000..091edb363c8b --- /dev/null +++ b/.chloggen/fix-31130.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: syslogexporter + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: fix setting network connection, do not load TLS configuration for UDP + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [31130] + +# (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/fix_cpu_stepping_type.yaml b/.chloggen/fix_cpu_stepping_type.yaml new file mode 100755 index 000000000000..537694e41380 --- /dev/null +++ b/.chloggen/fix_cpu_stepping_type.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: enhancement + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: processor/resourcedetection + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Add `processor.resourcedetection.hostCPUSteppingAsString` feature gate to change the type of `host.cpu.stepping` from `int` to `string`. + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [31136] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: | + This feature gate will graduate to beta in the next release. + +# 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/goleak_signalfx_correlations.yaml b/.chloggen/goleak_signalfx_correlations.yaml new file mode 100755 index 000000000000..d20b4d2ccc73 --- /dev/null +++ b/.chloggen/goleak_signalfx_correlations.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: signalfxexporter + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Fix memory leak in shutdown + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [30864, 30438] + +# (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/kristofgyuracz-routing-table-warning.yaml b/.chloggen/kristofgyuracz-routing-table-warning.yaml new file mode 100755 index 000000000000..bc07b97a8fa6 --- /dev/null +++ b/.chloggen/kristofgyuracz-routing-table-warning.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: routingconnector + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: "a warning is logged if there are two or more routing items with the same routing statement" + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [ 30663 ] + +# (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/mdata-gen-generate-lifecycle-tests-by-default.yaml b/.chloggen/mdata-gen-generate-lifecycle-tests-by-default.yaml new file mode 100755 index 000000000000..325895a4b208 --- /dev/null +++ b/.chloggen/mdata-gen-generate-lifecycle-tests-by-default.yaml @@ -0,0 +1,22 @@ +# 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: 'cmd/mdatagen' + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Make lifecycle tests generated by default + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [31532] + +# 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/mdatagen-use-enums-for-stability-levels.yaml b/.chloggen/mdatagen-use-enums-for-stability-levels.yaml new file mode 100755 index 000000000000..801b55ba7533 --- /dev/null +++ b/.chloggen/mdatagen-use-enums-for-stability-levels.yaml @@ -0,0 +1,22 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: 'breaking' + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: 'cmd/mdatagen' + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: "Use enum for stability levels in the Metadata struct" + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [31530] + +# 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/mx-psi_remove-pspanmetricsprocessor.yaml b/.chloggen/mx-psi_remove-pspanmetricsprocessor.yaml new file mode 100755 index 000000000000..ec04b911b991 --- /dev/null +++ b/.chloggen/mx-psi_remove-pspanmetricsprocessor.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: spanmetricsprocessor + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Remove spanmetrics processor + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [29567] + +# (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: | + - You can use the spanmetrics connector as a replacement + +# 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/opamp-http.yaml b/.chloggen/opamp-http.yaml new file mode 100755 index 000000000000..9d5857815b30 --- /dev/null +++ b/.chloggen/opamp-http.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: opampextension + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: enables creating and using an http client + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [31389] + +# (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/oracledb_scraper_id.yaml b/.chloggen/oracledb_scraper_id.yaml new file mode 100755 index 000000000000..d32db9a460c0 --- /dev/null +++ b/.chloggen/oracledb_scraper_id.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: oracledbreceiver + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Use metadata.Type for the scraper id to avoid invalid scraper IDs. + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [31457] + +# (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/pkg-stanza-reader-offset-update.yaml b/.chloggen/pkg-stanza-reader-offset-update.yaml new file mode 100755 index 000000000000..d49867d3cb79 --- /dev/null +++ b/.chloggen/pkg-stanza-reader-offset-update.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: receiver/filelog + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Fix issue where file fingerprint could be corrupted while reading. + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [22936] + +# (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/pkg-stanza-timestamp-docs.yaml b/.chloggen/pkg-stanza-timestamp-docs.yaml new file mode 100755 index 000000000000..77caa68263a2 --- /dev/null +++ b/.chloggen/pkg-stanza-timestamp-docs.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/stanza + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Improve timestamp parsing documentation + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [31490] + +# (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/remove_httpforwarder.yaml b/.chloggen/remove_httpforwarder.yaml new file mode 100755 index 000000000000..6d0aae4ecf71 --- /dev/null +++ b/.chloggen/remove_httpforwarder.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: httpforwarder + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Remove extension named httpforwarder, use httpforwarderextension instead. + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [24171] + +# (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: [api, user] diff --git a/.chloggen/rm-kube-proxy.yaml b/.chloggen/rm-kube-proxy.yaml new file mode 100755 index 000000000000..dbb891304642 --- /dev/null +++ b/.chloggen/rm-kube-proxy.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: k8sclusterreceiver + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: "Remove deprecated k8s.kubeproxy.version resource attribute" + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [29748] + +# (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/stanley.liu_update-mapping-go.yaml b/.chloggen/stanley.liu_update-mapping-go.yaml new file mode 100755 index 000000000000..71a6aeca1bd0 --- /dev/null +++ b/.chloggen/stanley.liu_update-mapping-go.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: datadogexporter + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Automatically map `cloud.region`, `cloud.availability_zone` and `cloud.provider` to the `region`, `zone` and `cloud_provider` host tags. + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [31372] + +# (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/telemetrygen-fix-log-incorrect-error.yaml b/.chloggen/telemetrygen-fix-log-incorrect-error.yaml new file mode 100644 index 000000000000..bddd0037fe0f --- /dev/null +++ b/.chloggen/telemetrygen-fix-log-incorrect-error.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: cmd/telemetrygen + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Fix incorrect error logged in traces batch span processor shutdown + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [31362] + +# (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/.github/ALLOWLIST b/.github/ALLOWLIST index c40931599175..ce6ca0aecae0 100644 --- a/.github/ALLOWLIST +++ b/.github/ALLOWLIST @@ -22,8 +22,6 @@ internal/common ## DEPRECATED components -exporter/f5cloudexporter/ -processor/spanmetricsprocessor/ ## UNMAINTAINED components exporter/alibabacloudlogserviceexporter/ diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index bef4e507f87f..7f8fc4d52e3d 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -52,7 +52,6 @@ exporter/datadogexporter/ @open-telemetry/collect exporter/datasetexporter/ @open-telemetry/collector-contrib-approvers @atoulme @martin-majlis-s1 @zdaratom-s1 @tomaz-s1 exporter/dynatraceexporter/ @open-telemetry/collector-contrib-approvers @dyladan @arminru @evan-bradley exporter/elasticsearchexporter/ @open-telemetry/collector-contrib-approvers @JaredTan95 -exporter/f5cloudexporter/ @open-telemetry/collector-contrib-approvers exporter/fileexporter/ @open-telemetry/collector-contrib-approvers @atingchen exporter/googlecloudexporter/ @open-telemetry/collector-contrib-approvers @aabmass @dashpole @jsuereth @punya @damemi @psx95 exporter/googlecloudpubsubexporter/ @open-telemetry/collector-contrib-approvers @alexvanboxel @@ -95,7 +94,6 @@ extension/encoding/textencodingextension/ @open-telemetry/collect extension/encoding/zipkinencodingextension/ @open-telemetry/collector-contrib-approvers @MovieStoreGuy @dao-jun extension/headerssetterextension/ @open-telemetry/collector-contrib-approvers @jpkrohling extension/healthcheckextension/ @open-telemetry/collector-contrib-approvers @jpkrohling -extension/httpforwarder/ @open-telemetry/collector-contrib-approvers @atoulme @rmfitzpatrick extension/httpforwarderextension/ @open-telemetry/collector-contrib-approvers @atoulme @rmfitzpatrick extension/jaegerremotesampling/ @open-telemetry/collector-contrib-approvers @yurishkuro @frzifus extension/oauth2clientauthextension/ @open-telemetry/collector-contrib-approvers @pavankrish123 @jpkrohling @@ -176,7 +174,6 @@ processor/resourcedetectionprocessor/internal/openshift/ @open-telemetry/collect processor/resourceprocessor/ @open-telemetry/collector-contrib-approvers @dmitryax processor/routingprocessor/ @open-telemetry/collector-contrib-approvers @jpkrohling processor/schemaprocessor/ @open-telemetry/collector-contrib-approvers @MovieStoreGuy -processor/spanmetricsprocessor/ @open-telemetry/collector-contrib-approvers processor/spanprocessor/ @open-telemetry/collector-contrib-approvers @boostchicken processor/sumologicprocessor/ @open-telemetry/collector-contrib-approvers @aboguszewski-sumo @astencel-sumo @sumo-drosiek processor/tailsamplingprocessor/ @open-telemetry/collector-contrib-approvers @jpkrohling diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index b57c6d05dc0e..a678734c1abb 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -21,6 +21,7 @@ body: - cmd/configschema - cmd/githubgen - cmd/mdatagen + - cmd/mdatagen/internal/samplereceiver - cmd/opampsupervisor - cmd/otelcontribcol - cmd/oteltestbedcol @@ -52,7 +53,6 @@ body: - exporter/dataset - exporter/dynatrace - exporter/elasticsearch - - exporter/f5cloud - exporter/file - exporter/googlecloud - exporter/googlecloudpubsub @@ -173,7 +173,6 @@ body: - processor/routing - processor/schema - processor/span - - processor/spanmetrics - processor/sumologic - processor/tailsampling - processor/transform diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml index 8c832a203dad..0e0d4f402489 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yaml +++ b/.github/ISSUE_TEMPLATE/feature_request.yaml @@ -15,6 +15,7 @@ body: - cmd/configschema - cmd/githubgen - cmd/mdatagen + - cmd/mdatagen/internal/samplereceiver - cmd/opampsupervisor - cmd/otelcontribcol - cmd/oteltestbedcol @@ -46,7 +47,6 @@ body: - exporter/dataset - exporter/dynatrace - exporter/elasticsearch - - exporter/f5cloud - exporter/file - exporter/googlecloud - exporter/googlecloudpubsub @@ -167,7 +167,6 @@ body: - processor/routing - processor/schema - processor/span - - processor/spanmetrics - processor/sumologic - processor/tailsampling - processor/transform diff --git a/.github/ISSUE_TEMPLATE/other.yaml b/.github/ISSUE_TEMPLATE/other.yaml index 87e6d43a704b..5f3ec4b5ae40 100644 --- a/.github/ISSUE_TEMPLATE/other.yaml +++ b/.github/ISSUE_TEMPLATE/other.yaml @@ -15,6 +15,7 @@ body: - cmd/configschema - cmd/githubgen - cmd/mdatagen + - cmd/mdatagen/internal/samplereceiver - cmd/opampsupervisor - cmd/otelcontribcol - cmd/oteltestbedcol @@ -46,7 +47,6 @@ body: - exporter/dataset - exporter/dynatrace - exporter/elasticsearch - - exporter/f5cloud - exporter/file - exporter/googlecloud - exporter/googlecloudpubsub @@ -167,7 +167,6 @@ body: - processor/routing - processor/schema - processor/span - - processor/spanmetrics - processor/sumologic - processor/tailsampling - processor/transform diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 284136b921e0..c93ed852d574 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -318,7 +318,7 @@ jobs: merge-multiple: true pattern: coverage-artifacts-* - name: Upload coverage report - uses: Wandalen/wretry.action@v1.4.4 + uses: Wandalen/wretry.action@v1.4.5 with: action: codecov/codecov-action@v3 with: | diff --git a/README.md b/README.md index 7b2ec3490aa2..30ae0d004809 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ Emeritus Approvers: Maintainers ([@open-telemetry/collector-contrib-maintainer](https://github.com/orgs/open-telemetry/teams/collector-contrib-maintainer)): -- [Alex Boten](https://github.com/codeboten), ServiceNow +- [Alex Boten](https://github.com/codeboten), Honeycomb - [Bogdan Drutu](https://github.com/bogdandrutu), Snowflake - [Daniel Jaglowski](https://github.com/djaglowski), observIQ - [Dmitrii Anoshin](https://github.com/dmitryax), Splunk diff --git a/cmd/configschema/go.mod b/cmd/configschema/go.mod index 7179221fbe3d..b024b2953ab8 100644 --- a/cmd/configschema/go.mod +++ b/cmd/configschema/go.mod @@ -25,8 +25,8 @@ require ( github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor v0.11.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1 // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.13.3 // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.13.3 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.13.4 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.13.4 // indirect github.com/gocql/gocql v1.6.0 // indirect github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed // indirect github.com/open-telemetry/opentelemetry-collector-contrib/exporter/alibabacloudlogserviceexporter v0.95.0 // indirect @@ -61,7 +61,6 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/exporter/tencentcloudlogserviceexporter v0.95.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/exporter/zipkinexporter v0.95.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.95.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/extension/httpforwarder v0.95.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/extension/oauth2clientauthextension v0.95.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecstaskobserver v0.95.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/k8sobserver v0.95.0 // indirect @@ -104,7 +103,6 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.95.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.95.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.95.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanmetricsprocessor v0.95.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanprocessor v0.95.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.95.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.95.0 // indirect @@ -218,22 +216,22 @@ require ( github.com/ClickHouse/ch-go v0.58.2 // indirect github.com/ClickHouse/clickhouse-go/v2 v2.17.1 // indirect github.com/DataDog/agent-payload/v5 v5.0.104 // indirect - github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.2 // indirect + github.com/DataDog/datadog-agent/pkg/obfuscate v0.51.1-0.20240301173728-334e775e420a // indirect github.com/DataDog/datadog-agent/pkg/proto v0.52.0-devel // indirect - github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.2 // indirect - github.com/DataDog/datadog-agent/pkg/trace v0.50.2 // indirect - github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.2 // indirect - github.com/DataDog/datadog-agent/pkg/util/log v0.50.2 // indirect - github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.2 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.2 // indirect + github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.51.1-0.20240301173728-334e775e420a // indirect + github.com/DataDog/datadog-agent/pkg/trace v0.51.1-0.20240301173728-334e775e420a // indirect + github.com/DataDog/datadog-agent/pkg/util/cgroups v0.51.1-0.20240301173728-334e775e420a // indirect + github.com/DataDog/datadog-agent/pkg/util/log v0.51.1-0.20240301173728-334e775e420a // indirect + github.com/DataDog/datadog-agent/pkg/util/pointer v0.51.1-0.20240301173728-334e775e420a // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.51.1-0.20240301173728-334e775e420a // indirect github.com/DataDog/datadog-api-client-go/v2 v2.22.0 // indirect - github.com/DataDog/datadog-go/v5 v5.1.1 // indirect - github.com/DataDog/go-sqllexer v0.0.8 // indirect + github.com/DataDog/datadog-go/v5 v5.5.0 // indirect + github.com/DataDog/go-sqllexer v0.0.9 // indirect github.com/DataDog/go-tuf v1.0.2-0.5.2 // indirect github.com/DataDog/gohai v0.0.0-20230524154621-4316413895ee // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.13.3 // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.13.3 // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.13.3 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.13.4 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.13.4 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.13.4 // indirect github.com/DataDog/sketches-go v1.4.4 // indirect github.com/DataDog/zstd v1.5.2 // indirect github.com/GehirnInc/crypt v0.0.0-20200316065508-bb7000b8a962 // indirect @@ -242,7 +240,7 @@ require ( github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/collector/googlemanagedprometheus v0.45.0 // indirect github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace v1.21.0 // indirect github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.45.0 // indirect - github.com/IBM/sarama v1.42.2 // indirect + github.com/IBM/sarama v1.43.0 // indirect github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/ReneKroon/ttlcache/v2 v2.11.0 // indirect @@ -260,27 +258,27 @@ require ( github.com/apache/thrift v0.19.0 // indirect github.com/ardielle/ardielle-go v1.5.2 // indirect github.com/armon/go-metrics v0.4.1 // indirect - github.com/aws/aws-sdk-go v1.50.17 // indirect - github.com/aws/aws-sdk-go-v2 v1.25.0 // indirect - github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.0 // indirect - github.com/aws/aws-sdk-go-v2/config v1.27.0 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.17.0 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.0 // indirect + github.com/aws/aws-sdk-go v1.50.27 // indirect + github.com/aws/aws-sdk-go-v2 v1.25.2 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.1 // indirect + github.com/aws/aws-sdk-go-v2/config v1.27.4 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.17.4 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.2 // indirect github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.59 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.0 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.0 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.2 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.2 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.23 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.0 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.1 // indirect github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.26 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.0 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.2 // indirect github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.14.0 // indirect - github.com/aws/aws-sdk-go-v2/service/kinesis v1.25.0 // indirect + github.com/aws/aws-sdk-go-v2/service/kinesis v1.27.1 // indirect github.com/aws/aws-sdk-go-v2/service/s3 v1.31.0 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.19.0 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.22.0 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.27.0 // indirect - github.com/aws/smithy-go v1.20.0 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.20.1 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.1 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.28.1 // indirect + github.com/aws/smithy-go v1.20.1 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/blang/semver/v4 v4.0.0 // indirect github.com/bmatcuk/doublestar/v4 v4.6.1 // indirect @@ -315,7 +313,7 @@ require ( github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.6.0 // indirect github.com/dynatrace-oss/dynatrace-metric-utils-go v0.5.0 // indirect - github.com/eapache/go-resiliency v1.5.0 // indirect + github.com/eapache/go-resiliency v1.6.0 // indirect github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 // indirect github.com/eapache/queue v1.1.0 // indirect github.com/elastic/go-elasticsearch/v7 v7.17.10 // indirect @@ -381,7 +379,7 @@ require ( github.com/grobie/gomemcache v0.0.0-20230213081705-239240bbc445 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect - github.com/haimrubinstein/go-syslog/v3 v3.0.3 // indirect + github.com/haimrubinstein/go-syslog/v3 v3.0.0 // indirect github.com/hashicorp/consul/api v1.27.0 // indirect github.com/hashicorp/cronexpr v1.1.2 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect @@ -428,7 +426,7 @@ require ( github.com/json-iterator/go v1.1.12 // indirect github.com/julienschmidt/httprouter v1.3.0 // indirect github.com/karrick/godirwalk v1.17.0 // indirect - github.com/klauspost/compress v1.17.6 // indirect + github.com/klauspost/compress v1.17.7 // indirect github.com/klauspost/cpuid/v2 v2.2.5 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect github.com/knadh/koanf/providers/confmap v0.1.0 // indirect @@ -452,7 +450,7 @@ require ( github.com/mattn/go-isatty v0.0.19 // indirect github.com/mattn/go-sqlite3 v1.14.22 // indirect github.com/microsoft/ApplicationInsights-Go v0.4.4 // indirect - github.com/microsoft/go-mssqldb v1.6.0 // indirect + github.com/microsoft/go-mssqldb v1.7.0 // indirect github.com/miekg/dns v1.1.56 // indirect github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible // indirect github.com/mitchellh/copystructure v1.2.0 // indirect @@ -557,9 +555,9 @@ require ( github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect github.com/pquerna/cachecontrol v0.1.0 // indirect - github.com/prometheus/client_golang v1.18.0 // indirect + github.com/prometheus/client_golang v1.19.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect - github.com/prometheus/common v0.46.0 // indirect + github.com/prometheus/common v0.48.0 // indirect github.com/prometheus/common/sigv4 v0.1.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/prometheus/prometheus v0.48.1 // indirect @@ -580,7 +578,7 @@ require ( github.com/signalfx/sapm-proto v0.14.0 // indirect github.com/sijms/go-ora/v2 v2.8.8 // indirect github.com/sirupsen/logrus v1.9.3 // indirect - github.com/snowflakedb/gosnowflake v1.7.2 // indirect + github.com/snowflakedb/gosnowflake v1.8.0 // indirect github.com/soheilhy/cmux v0.1.5 // indirect github.com/sourcegraph/conc v0.3.0 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect @@ -617,9 +615,9 @@ require ( github.com/yuin/gopher-lua v0.0.0-20220504180219-658193537a64 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect github.com/zeebo/xxh3 v1.0.2 // indirect - go.etcd.io/bbolt v1.3.8 // indirect + go.etcd.io/bbolt v1.3.9 // indirect go.mongodb.org/atlas v0.36.0 // indirect - go.mongodb.org/mongo-driver v1.13.1 // indirect + go.mongodb.org/mongo-driver v1.14.0 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/collector v0.95.0 // indirect go.opentelemetry.io/collector/config/configauth v0.95.0 // indirect @@ -678,8 +676,8 @@ require ( go.opentelemetry.io/proto/otlp v1.1.0 // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.26.0 // indirect - golang.org/x/crypto v0.19.0 // indirect + go.uber.org/zap v1.27.0 // indirect + golang.org/x/crypto v0.20.0 // indirect golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3 // indirect golang.org/x/net v0.21.0 // indirect golang.org/x/oauth2 v0.17.0 // indirect @@ -847,8 +845,6 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/head replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension => ../../extension/healthcheckextension -replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/httpforwarder => ../../extension/httpforwarder - replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/oauth2clientauthextension => ../../extension/oauth2clientauthextension replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer => ../../extension/observer @@ -927,8 +923,6 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/processor/reso replace github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor => ../../processor/routingprocessor/ -replace github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanmetricsprocessor => ../../processor/spanmetricsprocessor/ - replace github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanprocessor => ../../processor/spanprocessor/ replace github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor => ../../processor/tailsamplingprocessor diff --git a/cmd/configschema/go.sum b/cmd/configschema/go.sum index f50646d9c89d..71f17bb82d3c 100644 --- a/cmd/configschema/go.sum +++ b/cmd/configschema/go.sum @@ -112,10 +112,10 @@ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1. github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0/go.mod h1:5kakwfW5CjC9KK+Q4wjXAg+ShuIm2mBMua0ZFj2C8PE= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.5.0 h1:AifHbc4mg0x9zW52WOpKbsHaDKuRhlI7TVl47thgQ70= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.5.0/go.mod h1:T5RfihdXtBDxt1Ch2wobif3TvzTdumDy29kahv6AV9A= -github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.0.0 h1:yfJe15aSwEQ6Oo6J+gdfdulPNoZ3TEhmbhLIoxZcA+U= -github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.0.0/go.mod h1:Q28U+75mpCaSCDowNEmhIo/rmgdkqmkmzI7N6TGR4UY= -github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v0.8.0 h1:T028gtTPiYt/RMUfs8nVsAL7FDQrfLlrm/NnRG/zcC4= -github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v0.8.0/go.mod h1:cw4zVQgBby0Z5f2v0itn6se2dDP17nTjbZFXW5uPyHA= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.0.1 h1:MyVTgWR8qd/Jw1Le0NZebGBUCLbtak3bJ3z1OlqZBpw= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.0.1/go.mod h1:GpPjLhVR9dnUoJMyHWSPy71xY9/lcmpzIPZXmF0FCVY= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.0.0 h1:D3occbWoio4EBLkbkevetNMAVX197GkzbUMtqjGWn80= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.0.0/go.mod h1:bTSOgj05NGRuHHhQwAdPnYr9TOdNmKlZTgGLL6nyAdI= github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.3.0 h1:IfFdxTUDiV58iZqPKgyWiz4X4fCxZeQ1pTQPImLYXpY= github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.3.0/go.mod h1:SUZc9YRRHfx2+FAQKNDGrssXehqLpxmwRv2mC/5ntj4= github.com/Azure/azure-storage-queue-go v0.0.0-20230531184854-c06a8eff66fe h1:HGuouUM1533rBXmMtR7qh5pYNSSjUZG90b/MgJAnb/A= @@ -163,45 +163,45 @@ github.com/DATA-DOG/go-sqlmock v1.5.2 h1:OcvFkGmslmlZibjAjaHm3L//6LiuBgolP7Oputl github.com/DATA-DOG/go-sqlmock v1.5.2/go.mod h1:88MAG/4G7SMwSE3CeA0ZKzrT5CiOU3OJ+JlNzwDqpNU= github.com/DataDog/agent-payload/v5 v5.0.104 h1:uxTIaLthyKB4CxBKe+2FeMgL6ca3KVxpeYxlJGNcoJg= github.com/DataDog/agent-payload/v5 v5.0.104/go.mod h1:COngtbYYCncpIPiE5D93QlXDH/3VAKk10jDNwGHcMRE= -github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.2 h1:y08IzbpFM/HBaKfgayFZe1FpcbZn6bVPXoZ++93vxv8= -github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.2/go.mod h1:A4nLJvxlg6BO/8/zg81til9yT0uRPuXDFMAzDMpmgn4= +github.com/DataDog/datadog-agent/pkg/obfuscate v0.51.1-0.20240301173728-334e775e420a h1:8t9jpJHbq3WosQmXCVDjqNfGFFPBxBT7/9mbyQqHMi0= +github.com/DataDog/datadog-agent/pkg/obfuscate v0.51.1-0.20240301173728-334e775e420a/go.mod h1:Ai57GjsZUn9AOo4L9ZOdu5uTuGaAxXMh0kin544Lgw0= github.com/DataDog/datadog-agent/pkg/proto v0.52.0-devel h1:nBejGNIU6Jk7bPBxz2bAO+f+kahAXWBXPecebY3R+Zo= github.com/DataDog/datadog-agent/pkg/proto v0.52.0-devel/go.mod h1:wjr5YlVvGip6VmAGzHrdBaGUu1LaA9B6gHvInm5kHiY= -github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.2 h1:7jn5EOu84uph4sd+pB3vF8LnsdTjhh+1/NnCvfNpG4A= -github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.2/go.mod h1:Vc+snp0Bey4MrrJyiV2tVxxJb6BmLomPvN1RgAvjGaQ= -github.com/DataDog/datadog-agent/pkg/trace v0.50.2 h1:eyjTZx3yupppiND/qwiUj6VuWHfyGfPMrqQwRgE41Rw= -github.com/DataDog/datadog-agent/pkg/trace v0.50.2/go.mod h1:SWNRcgZoBNoiyRrECEEe3xQGNCXfqzZVOB43WxDAMlc= -github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.2 h1:f+dYKVwMoGHZpOQM33Wogb/er8ZXeo4aUcbkSk17lM8= -github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.2/go.mod h1:4DalvbtHzT0nqpbj/36FP0IwfKWCSB5Zap7O/SGfPKI= -github.com/DataDog/datadog-agent/pkg/util/log v0.50.2 h1:D4jzhoZtZikiugOr2pl6Xm+MMfrwkjnZziGHgTNpBLk= -github.com/DataDog/datadog-agent/pkg/util/log v0.50.2/go.mod h1:0vyUsWVWDdIRzd6Itim0ZkjCvOF7V8Yi4IzpE5q/UPo= -github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.2 h1:yq97sYsulZz/qyl/bogRigvUskqXPSrt8c7b+xKDs4I= -github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.2/go.mod h1:eTXti9mx7qhkoi+Qg3mMmvVY5McghUUgsf4Hrk9zY8k= -github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.2 h1:xFGXfIsTyHC0VlrrfoAVaZ1pBAJUh2ARZrS7gcdAooY= -github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.2/go.mod h1:EOGgNrSPskIxY3+KgCl+yEggMjrGqrA2oL5va+/p2jM= +github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.51.1-0.20240301173728-334e775e420a h1:7Wijer1rhN7tsEm6mVjXaYZ2XjmKM8cgJKc0hkr57V8= +github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.51.1-0.20240301173728-334e775e420a/go.mod h1:Vc+snp0Bey4MrrJyiV2tVxxJb6BmLomPvN1RgAvjGaQ= +github.com/DataDog/datadog-agent/pkg/trace v0.51.1-0.20240301173728-334e775e420a h1:6ko5fCAcwToPALbUZiqR2tpjIzzqYR+uVXR7t1khRuE= +github.com/DataDog/datadog-agent/pkg/trace v0.51.1-0.20240301173728-334e775e420a/go.mod h1:qMvCrksIQC0czvZB72YdtVfxAK6/Vq2iPNJT7k6q+Bo= +github.com/DataDog/datadog-agent/pkg/util/cgroups v0.51.1-0.20240301173728-334e775e420a h1:95lqMrZdzqfrxxcLUepiEw2zHv7JCFSQhTr3/z1aKl4= +github.com/DataDog/datadog-agent/pkg/util/cgroups v0.51.1-0.20240301173728-334e775e420a/go.mod h1:m4jQb4BdnVTi7jaSETmJ0dQchgOphmZqPuMuwzjpFeM= +github.com/DataDog/datadog-agent/pkg/util/log v0.51.1-0.20240301173728-334e775e420a h1:IW8buCp4IiU0b1lC7x7W0hHlc+ADwV/hmistYtFogL0= +github.com/DataDog/datadog-agent/pkg/util/log v0.51.1-0.20240301173728-334e775e420a/go.mod h1:KdMEnEsO0dn53y3DLcbInK8NaMWnPgo+MunQsQ4cGF8= +github.com/DataDog/datadog-agent/pkg/util/pointer v0.51.1-0.20240301173728-334e775e420a h1:7FUY9948Nsrdfh1P/F1RkJ/gcUZVbTz9ippSbtl3cxo= +github.com/DataDog/datadog-agent/pkg/util/pointer v0.51.1-0.20240301173728-334e775e420a/go.mod h1:eTXti9mx7qhkoi+Qg3mMmvVY5McghUUgsf4Hrk9zY8k= +github.com/DataDog/datadog-agent/pkg/util/scrubber v0.51.1-0.20240301173728-334e775e420a h1:ENeNLL5ItDcd4400kGP148+IMzMlaIZGRfFLa3GJNdY= +github.com/DataDog/datadog-agent/pkg/util/scrubber v0.51.1-0.20240301173728-334e775e420a/go.mod h1:EOGgNrSPskIxY3+KgCl+yEggMjrGqrA2oL5va+/p2jM= github.com/DataDog/datadog-api-client-go/v2 v2.22.0 h1:+DtWu4PjGxsJU8FESjPi7C2rTDMojNungejsIzNFe70= github.com/DataDog/datadog-api-client-go/v2 v2.22.0/go.mod h1:QKOu6vscsh87fMY1lHfLEmNSunyXImj8BUaUWJXOehc= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/DataDog/datadog-go/v5 v5.1.1 h1:JLZ6s2K1pG2h9GkvEvMdEGqMDyVLEAccdX5TltWcLMU= -github.com/DataDog/datadog-go/v5 v5.1.1/go.mod h1:KhiYb2Badlv9/rofz+OznKoEF5XKTonWyhx5K83AP8E= -github.com/DataDog/go-sqllexer v0.0.8 h1:vfC8R9PhmJfeOKcFYAX9UOd890A3wu3KrjU9Kr7nM0E= -github.com/DataDog/go-sqllexer v0.0.8/go.mod h1:nB4Ea2YNsqMwtbWMc4Fm/oP98IIrSPapqwOwPioMspY= +github.com/DataDog/datadog-go/v5 v5.5.0 h1:G5KHeB8pWBNXT4Jtw0zAkhdxEAWSpWH00geHI6LDrKU= +github.com/DataDog/datadog-go/v5 v5.5.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw= +github.com/DataDog/go-sqllexer v0.0.9 h1:Cx2Cu1S0hfj4coCCA8hzjM9+UNFRkcu1avIV//RU5Qw= +github.com/DataDog/go-sqllexer v0.0.9/go.mod h1:nB4Ea2YNsqMwtbWMc4Fm/oP98IIrSPapqwOwPioMspY= github.com/DataDog/go-tuf v1.0.2-0.5.2 h1:EeZr937eKAWPxJ26IykAdWA4A0jQXJgkhUjqEI/w7+I= github.com/DataDog/go-tuf v1.0.2-0.5.2/go.mod h1:zBcq6f654iVqmkk8n2Cx81E1JnNTMOAx1UEO/wZR+P0= github.com/DataDog/gohai v0.0.0-20230524154621-4316413895ee h1:tXibLZk3G6HncIFJKaNItsdzcrk4YqILNDZlXPTNt4k= github.com/DataDog/gohai v0.0.0-20230524154621-4316413895ee/go.mod h1:nTot/Iy0kW16bXgXr6blEc8gFeAS7vTqYlhAxh+dbc0= -github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.13.3 h1:XEhjylKpZec5tUQyw+fOYYBIEnktiCr/TKsrvFUB7uA= -github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.13.3/go.mod h1:63BBpcn68W2K89ZaLzYtzUiEit49+Rf2ZsEYza2TAcc= -github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.13.3 h1:hnzEiqocvnt6U1QGxfeDFf5xhE77jt4LOjZAXW9ueWo= -github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.13.3/go.mod h1:Tk2wwdBgWeSvDPtrGGyym8CdVWSuphiToGc/tRvFoNQ= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.13.3 h1:hcYZMgGDMUz8Dz6PcOhgk6FF0yG4N7KErS5J3O/MpeU= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.13.3/go.mod h1:Z2FPxYhi8GIFkS4WLC7RrRaGolyB9TqS2RMSwNcmczk= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.13.3 h1:oaYprbAr8/mPEyFNfqnm668bxg8IG000sQ6uNuuffro= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.13.3/go.mod h1:dmNsrdpbegG62b7/ETcRi53OsOmYlfshuTThx9BAiQI= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.13.3 h1:QelZO3ixjVqlqzTa+wxIDFvYnnzy/SG9iqXci1nhouc= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.13.3/go.mod h1:AObll3Cj7UJK56bc7HRrpbGWc98C1Io0ChpFEoxS2f8= -github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.13.3 h1:9fdt/9NeSUtypPT4du2/5TTQic9nL1YqDSIaq5Ttsi4= -github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.13.3/go.mod h1:P8Tr/1BSm0vQ0UXVOtIKmJKXCgb84jdFe9HuBKJPwkc= +github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.13.4 h1:PTIZJAsfnr2XLB3V3duL+mSbZvYV8G3XQ9e57KyOuOA= +github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.13.4/go.mod h1:5yS6i90MEZS3NG+o7PrQQ8i7OaEMzwQvn4bCZ9h9Rao= +github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.13.4 h1:B2R7Wh791uphpltmorbvvdKk0rJOhoExwM4NnE7hXTg= +github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.13.4/go.mod h1:Tk2wwdBgWeSvDPtrGGyym8CdVWSuphiToGc/tRvFoNQ= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.13.4 h1:GcJUxjunnJEL62K+fY7pjyvcb4Cvqr5VtD0DFc8rp+w= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.13.4/go.mod h1:/9yo8Scnf6R0KufxJIHfQD+GAbT9cyINxaTPMDgl2Wk= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.13.4 h1:dU9oPMbAr/wYMNdzhu0pxIhAJOn1Btj1T3ZSyY6RvY0= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.13.4/go.mod h1:ud/Xr5TWUopcaGHdkh9RN8lhnCAFa95X16Rb5mrkE18= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.13.4 h1:ZuYc5Ql/GSyAEMgpKkbQiHOtIHkEpYujITW1wIVFgLE= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.13.4/go.mod h1:YSntkplFoUM1mepnPeJFsoblqD0Wdi+Avg1/d1upgZQ= +github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.13.4 h1:t/Zh8ztLDBOMRMiuVNFthWMMG5F4POgc5M6+Y3DTX9g= +github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.13.4/go.mod h1:JfdBBDreQfbIN5FYrAtZV3VmQMXnf9o4tMbaMxWqe40= github.com/DataDog/sketches-go v1.4.4 h1:dF52vzXRFSPOj2IjXSWLvXq3jubL4CI69kwYjJ1w5Z8= github.com/DataDog/sketches-go v1.4.4/go.mod h1:XR0ns2RtEEF09mDKXiKZiQg+nfZStrq1ZuL1eezeZe0= github.com/DataDog/zstd v1.5.0/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= @@ -223,8 +223,8 @@ github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapp github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.45.0/go.mod h1:qkFPtMouQjW5ugdHIOthiTbweVHUTqbS0Qsu55KqXks= github.com/HdrHistogram/hdrhistogram-go v1.1.2 h1:5IcZpTvzydCQeHzK4Ef/D5rrSqwxob0t8PQPMybUNFM= github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= -github.com/IBM/sarama v1.42.2 h1:VoY4hVIZ+WQJ8G9KNY/SQlWguBQXQ9uvFPOnrcu8hEw= -github.com/IBM/sarama v1.42.2/go.mod h1:FLPGUGwYqEs62hq2bVG6Io2+5n+pS6s/WOXVKWSLFtE= +github.com/IBM/sarama v1.43.0 h1:YFFDn8mMI2QL0wOrG0J2sFoVIAFl7hS9JQi2YZsXtJc= +github.com/IBM/sarama v1.43.0/go.mod h1:zlE6HEbC/SMQ9mhEYaF7nNLYOUyrs0obySKCckWP9BM= 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/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= @@ -333,38 +333,38 @@ github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN github.com/aws/aws-sdk-go v1.32.6/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.38.35/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go v1.44.263/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= -github.com/aws/aws-sdk-go v1.50.17 h1:KsbzUKDgGNlkDHGvoQDhiJ63a9jtZd+O+/s3pTOr/ns= -github.com/aws/aws-sdk-go v1.50.17/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.50.27 h1:96ifhrSuja+AzdP3W/T2337igqVQ2FcSIJYkk+0rCeA= +github.com/aws/aws-sdk-go v1.50.27/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/aws/aws-sdk-go-v2 v1.17.7/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= github.com/aws/aws-sdk-go-v2 v1.18.0/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= -github.com/aws/aws-sdk-go-v2 v1.25.0 h1:sv7+1JVJxOu/dD/sz/csHX7jFqmP001TIY7aytBWDSQ= -github.com/aws/aws-sdk-go-v2 v1.25.0/go.mod h1:G104G1Aho5WqF+SR3mDIobTABQzpYV0WxMsKxlMggOA= +github.com/aws/aws-sdk-go-v2 v1.25.2 h1:/uiG1avJRgLGiQM9X3qJM8+Qa6KRGK5rRPuXE0HUM+w= +github.com/aws/aws-sdk-go-v2 v1.25.2/go.mod h1:Evoc5AsmtveRt1komDwIsjHFyrP5tDuF1D1U+6z6pNo= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10/go.mod h1:VeTZetY5KRJLuD/7fkQXMU6Mw7H5m/KP2J5Iy9osMno= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.0 h1:2UO6/nT1lCZq1LqM67Oa4tdgP1CvL1sLSxvuD+VrOeE= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.0/go.mod h1:5zGj2eA85ClyedTDK+Whsu+w9yimnVIZvhvBKrDquM8= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.1 h1:gTK2uhtAPtFcdRRJilZPx8uJLL2J85xK11nKtWL0wfU= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.1/go.mod h1:sxpLb+nZk7tIfCWChfd+h4QwHNUR57d8hA1cleTkjJo= github.com/aws/aws-sdk-go-v2/config v1.18.19/go.mod h1:XvTmGMY8d52ougvakOv1RpiTLPz9dlG/OQHsKU/cMmY= github.com/aws/aws-sdk-go-v2/config v1.18.25/go.mod h1:dZnYpD5wTW/dQF0rRNLVypB396zWCcPiBIvdvSWHEg4= -github.com/aws/aws-sdk-go-v2/config v1.27.0 h1:J5sdGCAHuWKIXLeXiqr8II/adSvetkx0qdZwdbXXpb0= -github.com/aws/aws-sdk-go-v2/config v1.27.0/go.mod h1:cfh8v69nuSUohNFMbIISP2fhmblGmYEOKs5V53HiHnk= +github.com/aws/aws-sdk-go-v2/config v1.27.4 h1:AhfWb5ZwimdsYTgP7Od8E9L1u4sKmDW2ZVeLcf2O42M= +github.com/aws/aws-sdk-go-v2/config v1.27.4/go.mod h1:zq2FFXK3A416kiukwpsd+rD4ny6JC7QSkp4QdN1Mp2g= github.com/aws/aws-sdk-go-v2/credentials v1.13.18/go.mod h1:vnwlwjIe+3XJPBYKu1et30ZPABG3VaXJYr8ryohpIyM= github.com/aws/aws-sdk-go-v2/credentials v1.13.24/go.mod h1:jYPYi99wUOPIFi0rhiOvXeSEReVOzBqFNOX5bXYoG2o= -github.com/aws/aws-sdk-go-v2/credentials v1.17.0 h1:lMW2x6sKBsiAJrpi1doOXqWFyEPoE886DTb1X0wb7So= -github.com/aws/aws-sdk-go-v2/credentials v1.17.0/go.mod h1:uT41FIH8cCIxOdUYIL0PYyHlL1NoneDuDSCwg5VE/5o= +github.com/aws/aws-sdk-go-v2/credentials v1.17.4 h1:h5Vztbd8qLppiPwX+y0Q6WiwMZgpd9keKe2EAENgAuI= +github.com/aws/aws-sdk-go-v2/credentials v1.17.4/go.mod h1:+30tpwrkOgvkJL1rUZuRLoxcJwtI/OkeBLYnHxJtVe0= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.1/go.mod h1:lfUx8puBRdM5lVVMQlwt2v+ofiG/X6Ms+dy0UkG/kXw= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.3/go.mod h1:4Q0UFP0YJf0NrsEuEYHpM9fTSEVnD16Z3uyEF7J9JGM= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.0 h1:xWCwjjvVz2ojYTP4kBKUuUh9ZrXfcAXpflhOUUeXg1k= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.0/go.mod h1:j3fACuqXg4oMTQOR2yY7m0NmJY0yBK4L4sLsRXq1Ins= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.2 h1:AK0J8iYBFeUk2Ax7O8YpLtFsfhdOByh2QIkHmigpRYk= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.2/go.mod h1:iRlGzMix0SExQEviAyptRWRGdYNo3+ufW/lCzvKVTUc= github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.59 h1:E3Y+OfzOK1+rmRo/K2G0ml8Vs+Xqk0kOnf4nS0kUtBc= github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.59/go.mod h1:1M4PLSBUVfBI0aP+C9XI7SM6kZPCGYyI6izWz0TGprE= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.31/go.mod h1:QT0BqUvX1Bh2ABdTGnjqEjvjzrCfIniM9Sc8zn9Yndo= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.33/go.mod h1:7i0PF1ME/2eUPFcjkVIwq+DOygHEoK92t5cDqNgYbIw= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.0 h1:NPs/EqVO+ajwOoq56EfcGKa3L3ruWuazkIw1BqxwOPw= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.0/go.mod h1:D+duLy2ylgatV+yTlQ8JTuLfDD0BnFvnQRc+o6tbZ4M= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.2 h1:bNo4LagzUKbjdxE0tIcR9pMzLR2U/Tgie1Hq1HQ3iH8= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.2/go.mod h1:wRQv0nN6v9wDXuWThpovGQjqF1HFdcgWjporw14lS8k= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.25/go.mod h1:zBHOPwhBc3FlQjQJE/D3IfPWiWaQmT06Vq9aNukDo0k= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.27/go.mod h1:UrHnn3QV/d0pBZ6QBAEQcqFLf8FAzLmoUfPVIueOvoM= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.0 h1:ks7KGMVUMoDzcxNWUlEdI+/lokMFD136EL6DWmUOV80= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.0/go.mod h1:hL6BWM/d/qz113fVitZjbXR0E+RCTU1+x+1Idyn5NgE= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.2 h1:EtOU5jsPdIQNP+6Q2C5e3d65NKT1PeCiQk+9OdzO12Q= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.2/go.mod h1:tyF5sKccmDz0Bv4NrstEr+/9YkSPJHrcO7UsUKf7pWM= github.com/aws/aws-sdk-go-v2/internal/ini v1.3.32/go.mod h1:XGhIBZDEgfqmFIugclZ6FU7v75nHhBDtzuB4xB/tEi4= github.com/aws/aws-sdk-go-v2/internal/ini v1.3.34/go.mod h1:Etz2dj6UHYuw+Xw830KfzCfWGMzqvUTCjUj5b76GVDc= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 h1:hT8rVHwugYE2lEfdFE0QWVo81lF7jMrYJVDWI+f+VxU= @@ -372,35 +372,35 @@ github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0/go.mod h1:8tu/lYfQfFe6IGnaOdrpV github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.23 h1:DWYZIsyqagnWL00f8M/SOr9fN063OEQWn9LLTbdYXsk= github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.23/go.mod h1:uIiFgURZbACBEQJfqTZPb/jxO7R+9LeoHUFudtIdeQI= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.11/go.mod h1:iV4q2hsqtNECrfmlXyord9u4zyuFEJX9eLgLpSPzWA8= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.0 h1:a33HuFlO0KsveiP90IUJh8Xr/cx9US2PqkSroaLc+o8= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.0/go.mod h1:SxIkWpByiGbhbHYTo9CMTUnx2G4p4ZQMrDPcRRy//1c= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.1 h1:EyBZibRTVAs6ECHZOw5/wlylS9OcTzwyjeQMudmREjE= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.1/go.mod h1:JKpmtYhhPs7D97NL/ltqz7yCkERFW5dOlHyVl66ZYF8= github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.26 h1:CeuSeq/8FnYpPtnuIeLQEEvDv9zUjneuYi8EghMBdwQ= github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.26/go.mod h1:2UqAAwMUXKeRkAHIlDJqvMVgOWkUi/AUXPk/YIe+Dg4= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.25/go.mod h1:/95IA+0lMnzW6XzqYJRpjjsAbKEORVeO0anQqjd2CNU= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.27/go.mod h1:EOwBD4J4S5qYszS5/3DpkejfuK+Z5/1uzICfPaZLtqw= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.0 h1:SHN/umDLTmFTmYfI+gkanz6da3vK8Kvj/5wkqnTHbuA= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.0/go.mod h1:l8gPU5RYGOFHJqWEpPMoRTP0VoaWQSkJdKo+hwWnnDA= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.2 h1:5ffmXjPtwRExp1zc7gENLgCPyHFbhEPwVTkTiH9niSk= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.2/go.mod h1:Ru7vg1iQ7cR4i7SZ/JTLYN9kaXtbL69UdgG0OQWQxW0= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.14.0 h1:e2ooMhpYGhDnBfSvIyusvAwX7KexuZaHbQY2Dyei7VU= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.14.0/go.mod h1:bh2E0CXKZsQN+faiKVqC40vfNMAWheoULBCnEgO9K+8= -github.com/aws/aws-sdk-go-v2/service/kinesis v1.25.0 h1:tUC1pAD2bV/FbEFuTSoxGi8IVds3NL3G7epibWHHIFU= -github.com/aws/aws-sdk-go-v2/service/kinesis v1.25.0/go.mod h1:q9d/nloLNFGbRkDJJTwSFntbsKUgODmg6I0sPFx2ugo= +github.com/aws/aws-sdk-go-v2/service/kinesis v1.27.1 h1:p8dOJ/UKXOwttc1Cxw1Ek52klVmMuiaCUkhsUGxce1I= +github.com/aws/aws-sdk-go-v2/service/kinesis v1.27.1/go.mod h1:VpH1IBG1YYZHPu5qShNt7EGaqUQbHAJZrbDtEpqDvvY= github.com/aws/aws-sdk-go-v2/service/s3 v1.31.0 h1:B1G2pSPvbAtQjilPq+Y7jLIzCOwKzuVEl+aBBaNG0AQ= github.com/aws/aws-sdk-go-v2/service/s3 v1.31.0/go.mod h1:ncltU6n4Nof5uJttDtcNQ537uNuwYqsZZQcpkd2/GUQ= github.com/aws/aws-sdk-go-v2/service/sso v1.12.6/go.mod h1:Y1VOmit/Fn6Tz1uFAeCO6Q7M2fmfXSCLeL5INVYsLuY= github.com/aws/aws-sdk-go-v2/service/sso v1.12.10/go.mod h1:ouy2P4z6sJN70fR3ka3wD3Ro3KezSxU6eKGQI2+2fjI= -github.com/aws/aws-sdk-go-v2/service/sso v1.19.0 h1:u6OkVDxtBPnxPkZ9/63ynEe+8kHbtS5IfaC4PzVxzWM= -github.com/aws/aws-sdk-go-v2/service/sso v1.19.0/go.mod h1:YqbU3RS/pkDVu+v+Nwxvn0i1WB0HkNWEePWbmODEbbs= +github.com/aws/aws-sdk-go-v2/service/sso v1.20.1 h1:utEGkfdQ4L6YW/ietH7111ZYglLJvS+sLriHJ1NBJEQ= +github.com/aws/aws-sdk-go-v2/service/sso v1.20.1/go.mod h1:RsYqzYr2F2oPDdpy+PdhephuZxTfjHQe7SOBcZGoAU8= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.6/go.mod h1:Lh/bc9XUf8CfOY6Jp5aIkQtN+j1mc+nExc+KXj9jx2s= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.10/go.mod h1:AFvkxc8xfBe8XA+5St5XIHHrQQtkxqrRincx4hmMHOk= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.22.0 h1:6DL0qu5+315wbsAEEmzK+P9leRwNbkp+lGjPC+CEvb8= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.22.0/go.mod h1:olUAyg+FaoFaL/zFaeQQONjOZ9HXoxgvI/c7mQTYz7M= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.1 h1:9/GylMS45hGGFCcMrUZDVayQE1jYSIN6da9jo7RAYIw= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.1/go.mod h1:YjAPFn4kGFqKC54VsHs5fn5B6d+PCY2tziEa3U/GB5Y= github.com/aws/aws-sdk-go-v2/service/sts v1.18.7/go.mod h1:JuTnSoeePXmMVe9G8NcjjwgOKEfZ4cOjMuT2IBT/2eI= github.com/aws/aws-sdk-go-v2/service/sts v1.19.0/go.mod h1:BgQOMsg8av8jset59jelyPW7NoZcZXLVpDsXunGDrk8= -github.com/aws/aws-sdk-go-v2/service/sts v1.27.0 h1:cjTRjh700H36MQ8M0LnDn33W3JmwC77mdxIIyPWCdpM= -github.com/aws/aws-sdk-go-v2/service/sts v1.27.0/go.mod h1:nXfOBMWPokIbOY+Gi7a1psWMSvskUCemZzI+SMB7Akc= +github.com/aws/aws-sdk-go-v2/service/sts v1.28.1 h1:3I2cBEYgKhrWlwyZgfpSO2BpaMY1LHPqXYk/QGlu2ew= +github.com/aws/aws-sdk-go-v2/service/sts v1.28.1/go.mod h1:uQ7YYKZt3adCRrdCBREm1CD3efFLOUNH77MrUCvx5oA= github.com/aws/smithy-go v1.13.5/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= -github.com/aws/smithy-go v1.20.0 h1:6+kZsCXZwKxZS9RfISnPc4EXlHoyAkm2hPuM8X2BrrQ= -github.com/aws/smithy-go v1.20.0/go.mod h1:uo5RKksAl4PzhqaAbjd4rLgFoq5koTsQKYuGe7dklGc= +github.com/aws/smithy-go v1.20.1 h1:4SZlSlMr36UEqC7XOyRVb27XMeZubNcBNN+9IgEPIQw= +github.com/aws/smithy-go v1.20.1/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E= github.com/basgys/goxml2json v1.1.0 h1:4ln5i4rseYfXNd86lGEB+Vi652IsIXIvggKM/BhUKVw= github.com/basgys/goxml2json v1.1.0/go.mod h1:wH7a5Np/Q4QoECFIU8zTQlZwZkrilY0itPfecMw41Dw= github.com/beefsack/go-rate v0.0.0-20220214233405-116f4ca011a0/go.mod h1:6YNgTHLutezwnBvyneBbwvB8C82y3dcoOj5EQJIdGXA= @@ -549,8 +549,8 @@ github.com/dvsekhvalnov/jose2go v1.6.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB github.com/dynatrace-oss/dynatrace-metric-utils-go v0.5.0 h1:wHGPJSXvwKQVf/XfhjUPyrhpcPKWNy8F3ikH+eiwoBg= github.com/dynatrace-oss/dynatrace-metric-utils-go v0.5.0/go.mod h1:PseHFo8Leko7J4A/TfZ6kkHdkzKBLUta6hRZR/OEbbc= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= -github.com/eapache/go-resiliency v1.5.0 h1:dRsaR00whmQD+SgVKlq/vCRFNgtEb5yppyeVos3Yce0= -github.com/eapache/go-resiliency v1.5.0/go.mod h1:5yPzW0MIvSe0JDsv0v+DvcjEv2FyD6iZYSs1ZI+iQho= +github.com/eapache/go-resiliency v1.6.0 h1:CqGDTLtpwuWKn6Nj3uNUdflaq+/kIPsg0gfNzHton30= +github.com/eapache/go-resiliency v1.6.0/go.mod h1:5yPzW0MIvSe0JDsv0v+DvcjEv2FyD6iZYSs1ZI+iQho= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 h1:Oy0F4ALJ04o5Qqpdz8XLIpNA3WM/iSIXqxtqo7UGVws= github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3/go.mod h1:YvSRo5mw33fLEx1+DlK6L2VV43tJt5Eyel9n9XBcR+0= @@ -869,8 +869,8 @@ github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8 github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed h1:5upAirOpQc1Q53c0bnx2ufif5kANL7bfZWcc6VJWJd8= github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed/go.mod h1:tMWxXQ9wFIaZeTI9F+hmhFiGpFmhOHzyShyFUhRm0H4= -github.com/haimrubinstein/go-syslog/v3 v3.0.3 h1:6vHBlaBT7QYW3Lg3SRH6ktd4RXDtysxtJ2sbbmnR984= -github.com/haimrubinstein/go-syslog/v3 v3.0.3/go.mod h1:eoxN4jiSgfvW5ZozHBsvBMVVOa8kUBnCghxP5PRL2Hs= +github.com/haimrubinstein/go-syslog/v3 v3.0.0 h1:wuTrxJE60wx2pfwdERdbLNlcXEk3hk1MPagAaD2fq2g= +github.com/haimrubinstein/go-syslog/v3 v3.0.0/go.mod h1:/IKKpe5PS9pB5vJY1APQQM0ZPBrm95HWE1SQwsXWmVI= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= github.com/hashicorp/consul/api v1.27.0 h1:gmJ6DPKQog1426xsdmgk5iqDyoRiNc+ipBdJOqKQFjc= @@ -955,6 +955,7 @@ github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+h github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/influxdata/go-syslog/v3 v3.0.0/go.mod h1:tulsOp+CecTAYC27u9miMgq21GqXRW6VdKbOG+QSP4Q= github.com/influxdata/go-syslog/v3 v3.0.1-0.20230911200830-875f5bc594a4 h1:2r2WiFeAwiJ/uyx1qIKnV1L4C9w/2V8ehlbJY4gjFaM= github.com/influxdata/go-syslog/v3 v3.0.1-0.20230911200830-875f5bc594a4/go.mod h1:1yEQhaLb/cETXCqQmdh7lDjupNAReO7c83AHyK2dJ48= github.com/influxdata/influxdb-client-go/v2 v2.13.0 h1:ioBbLmR5NMbAjP4UVA5r9b5xGjpABD7j65pI8kFphDM= @@ -1080,8 +1081,8 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.10.8/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.17.6 h1:60eq2E/jlfwQXtvZEeBUYADs+BwKBWURIY+Gj2eRGjI= -github.com/klauspost/compress v1.17.6/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLAKQQg= +github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= @@ -1177,8 +1178,8 @@ github.com/maxatome/go-testdeep v1.12.0 h1:Ql7Go8Tg0C1D/uMMX59LAoYK7LffeJQ6X2T04 github.com/maxatome/go-testdeep v1.12.0/go.mod h1:lPZc/HAcJMP92l7yI6TRz1aZN5URwUBUAfUNvrclaNM= github.com/microsoft/ApplicationInsights-Go v0.4.4 h1:G4+H9WNs6ygSCe6sUyxRc2U81TI5Es90b2t/MwX5KqY= github.com/microsoft/ApplicationInsights-Go v0.4.4/go.mod h1:fKRUseBqkw6bDiXTs3ESTiU/4YTIHsQS4W3fP2ieF4U= -github.com/microsoft/go-mssqldb v1.6.0 h1:mM3gYdVwEPFrlg/Dvr2DNVEgYFG7L42l+dGc67NNNpc= -github.com/microsoft/go-mssqldb v1.6.0/go.mod h1:00mDtPbeQCRGC1HwOOR5K/gr30P1NcEG0vx6Kbv2aJU= +github.com/microsoft/go-mssqldb v1.7.0 h1:sgMPW0HA6Ihd37Yx0MzHyKD726C2kY/8KJsQtXHNaAs= +github.com/microsoft/go-mssqldb v1.7.0/go.mod h1:kOvZKUdrhhFQmxLZqbwUV0rHkNkZpthMITIb2Ko1IoA= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= @@ -1375,8 +1376,8 @@ github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3O github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= -github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= +github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= +github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -1393,8 +1394,8 @@ github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB8 github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.29.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.31.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.46.0 h1:doXzt5ybi1HBKpsZOL0sSkaNHJJqkyfEWZGGqqScV0Y= -github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1BTn+g2pa/hQ= +github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE= +github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= github.com/prometheus/common/sigv4 v0.1.0 h1:qoVebwtwwEhS85Czm2dSROY5fTo2PAPEVdDeppTwGX4= github.com/prometheus/common/sigv4 v0.1.0/go.mod h1:2Jkxxk9yYvCkE5G1sQT7GuEXm57JrvHu9k5YwTjsNtI= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= @@ -1477,8 +1478,8 @@ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVs github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/assertions v1.1.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/snowflakedb/gosnowflake v1.7.2 h1:HRSwva8YXC64WUppfmHcMNVVzSE1+EwXXaJxgS0EkTo= -github.com/snowflakedb/gosnowflake v1.7.2/go.mod h1:03tW856vc3ceM4rJuj7KO4dzqN7qoezTm+xw7aPIIFo= +github.com/snowflakedb/gosnowflake v1.8.0 h1:4bQj8eAYGMkou/nICiIEb9jSbBLDDp5cB6JaKx9WwiA= +github.com/snowflakedb/gosnowflake v1.8.0/go.mod h1:7yyY2MxtDti2eXgtvlZ8QxzCN6KV2B4qb1HuygMI+0U= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js= github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= @@ -1624,8 +1625,8 @@ github.com/zorkian/go-datadog-api v2.30.0+incompatible/go.mod h1:PkXwHX9CUQa/FpB go.einride.tech/aip v0.66.0 h1:XfV+NQX6L7EOYK11yoHHFtndeaWh3KbD9/cN/6iWEt8= go.einride.tech/aip v0.66.0/go.mod h1:qAhMsfT7plxBX+Oy7Huol6YUvZ0ZzdUz26yZsQwfl1M= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA= -go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= +go.etcd.io/bbolt v1.3.9 h1:8x7aARPEXiXbHmtUwAIv7eV2fQFHrLLavdiJ3uzJXoI= +go.etcd.io/bbolt v1.3.9/go.mod h1:zaO32+Ti0PK1ivdPtgMESzuzL2VPoIG1PCQNvOdo/dE= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= @@ -1633,8 +1634,8 @@ go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsX go.mongodb.org/atlas v0.36.0 h1:m05S3AO7zkl+bcG1qaNsEKBnAqnKx2FDwLooHpIG3j4= go.mongodb.org/atlas v0.36.0/go.mod h1:nfPldE9dSama6G2IbIzmEza02Ly7yFZjMMVscaM0uEc= go.mongodb.org/mongo-driver v1.11.4/go.mod h1:PTSz5yu21bkT/wXpkS7WR5f0ddqw5quethTUn9WM+2g= -go.mongodb.org/mongo-driver v1.13.1 h1:YIc7HTYsKndGK4RFzJ3covLz1byri52x0IoMB0Pt/vk= -go.mongodb.org/mongo-driver v1.13.1/go.mod h1:wcDf1JBCXy2mOW0bWHwO/IOYqdca1MPCwDtFu/Z9+eo= +go.mongodb.org/mongo-driver v1.14.0 h1:P98w8egYRjYe3XDjxhYJagTokP/H6HzlsnojRgZRd80= +go.mongodb.org/mongo-driver v1.14.0/go.mod h1:Vzb0Mk/pa7e6cWw85R4F/endUC3u0U9jGcNU603k65c= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= @@ -1791,8 +1792,8 @@ go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -1819,8 +1820,8 @@ golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= -golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +golang.org/x/crypto v0.20.0 h1:jmAMJJZXr5KiCw05dfYK9QnqaqKLYXijU23lsEdcQqg= +golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZPQ= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= diff --git a/cmd/mdatagen/go.mod b/cmd/mdatagen/go.mod index 20306ff892c8..e5a75faa0f69 100644 --- a/cmd/mdatagen/go.mod +++ b/cmd/mdatagen/go.mod @@ -9,6 +9,7 @@ require ( go.opentelemetry.io/collector/component v0.95.0 go.opentelemetry.io/collector/confmap v0.95.0 go.opentelemetry.io/collector/confmap/provider/fileprovider v0.95.0 + go.opentelemetry.io/collector/consumer v0.95.0 go.opentelemetry.io/collector/pdata v1.2.0 go.opentelemetry.io/collector/receiver v0.95.0 go.opentelemetry.io/collector/semconv v0.95.0 @@ -16,7 +17,7 @@ require ( go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 golang.org/x/text v0.14.0 ) @@ -44,7 +45,6 @@ require ( github.com/prometheus/common v0.46.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.95.0 // indirect - go.opentelemetry.io/collector/consumer v0.95.0 // indirect go.opentelemetry.io/otel v1.23.1 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.45.2 // indirect go.opentelemetry.io/otel/sdk v1.23.1 // indirect diff --git a/cmd/mdatagen/go.sum b/cmd/mdatagen/go.sum index ff4d90fcb5b7..17df2439854c 100644 --- a/cmd/mdatagen/go.sum +++ b/cmd/mdatagen/go.sum @@ -98,8 +98,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/cmd/mdatagen/doc.go b/cmd/mdatagen/internal/samplereceiver/doc.go similarity index 74% rename from cmd/mdatagen/doc.go rename to cmd/mdatagen/internal/samplereceiver/doc.go index 61e6ac8f7d59..12febf6e4aa2 100644 --- a/cmd/mdatagen/doc.go +++ b/cmd/mdatagen/internal/samplereceiver/doc.go @@ -2,8 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 // Generate a test metrics builder from a sample metrics set covering all configuration options. -//go:generate mdatagen metadata-sample.yaml +//go:generate mdatagen metadata.yaml // Deprecated: This package is moving to https://github.com/open-telemetry/opentelemetry-collector and will eventually be removed. // Please see https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/30497 -package main +// This is a sample receiver package used to showcase how mdatagen is applied. +package samplereceiver diff --git a/cmd/mdatagen/documentation.md b/cmd/mdatagen/internal/samplereceiver/documentation.md similarity index 99% rename from cmd/mdatagen/documentation.md rename to cmd/mdatagen/internal/samplereceiver/documentation.md index 1955e0815351..0e29d896d669 100644 --- a/cmd/mdatagen/documentation.md +++ b/cmd/mdatagen/internal/samplereceiver/documentation.md @@ -1,6 +1,6 @@ [comment]: <> (Code generated by mdatagen. DO NOT EDIT.) -# file +# sample ## Default Metrics diff --git a/cmd/mdatagen/internal/samplereceiver/factory.go b/cmd/mdatagen/internal/samplereceiver/factory.go new file mode 100644 index 000000000000..375010bf3f24 --- /dev/null +++ b/cmd/mdatagen/internal/samplereceiver/factory.go @@ -0,0 +1,43 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package samplereceiver + +import ( + "context" + + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/consumer" + "go.opentelemetry.io/collector/receiver" + + "github.com/open-telemetry/opentelemetry-collector-contrib/cmd/mdatagen/internal/samplereceiver/internal/metadata" +) + +// NewFactory returns a receiver.Factory for sample receiver. +func NewFactory() receiver.Factory { + return receiver.NewFactory( + metadata.Type, + func() component.Config { return &struct{}{} }, + receiver.WithTraces(createTraces, metadata.TracesStability), + receiver.WithMetrics(createMetrics, metadata.MetricsStability), + receiver.WithLogs(createLogs, metadata.LogsStability)) +} + +func createTraces(context.Context, receiver.CreateSettings, component.Config, consumer.Traces) (receiver.Traces, error) { + return nopInstance, nil +} + +func createMetrics(context.Context, receiver.CreateSettings, component.Config, consumer.Metrics) (receiver.Metrics, error) { + return nopInstance, nil +} + +func createLogs(context.Context, receiver.CreateSettings, component.Config, consumer.Logs) (receiver.Logs, error) { + return nopInstance, nil +} + +var nopInstance = &nopReceiver{} + +type nopReceiver struct { + component.StartFunc + component.ShutdownFunc +} diff --git a/receiver/googlecloudpubsubreceiver/generated_component_test.go b/cmd/mdatagen/internal/samplereceiver/generated_component_test.go similarity index 89% rename from receiver/googlecloudpubsubreceiver/generated_component_test.go rename to cmd/mdatagen/internal/samplereceiver/generated_component_test.go index 1797af621a2f..e6a844c113bf 100644 --- a/receiver/googlecloudpubsubreceiver/generated_component_test.go +++ b/cmd/mdatagen/internal/samplereceiver/generated_component_test.go @@ -1,6 +1,6 @@ // Code generated by mdatagen. DO NOT EDIT. -package googlecloudpubsubreceiver +package samplereceiver import ( "context" @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -69,12 +59,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/cmd/mdatagen/internal/metadata/generated_config.go b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_config.go similarity index 94% rename from cmd/mdatagen/internal/metadata/generated_config.go rename to cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_config.go index 92937f48dbfd..eb00e302065c 100644 --- a/cmd/mdatagen/internal/metadata/generated_config.go +++ b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_config.go @@ -23,7 +23,7 @@ func (ms *MetricConfig) Unmarshal(parser *confmap.Conf) error { return nil } -// MetricsConfig provides config for file metrics. +// MetricsConfig provides config for sample metrics. type MetricsConfig struct { DefaultMetric MetricConfig `mapstructure:"default.metric"` DefaultMetricToBeRemoved MetricConfig `mapstructure:"default.metric.to_be_removed"` @@ -67,7 +67,7 @@ func (rac *ResourceAttributeConfig) Unmarshal(parser *confmap.Conf) error { return nil } -// ResourceAttributesConfig provides config for file resource attributes. +// ResourceAttributesConfig provides config for sample resource attributes. type ResourceAttributesConfig struct { MapResourceAttr ResourceAttributeConfig `mapstructure:"map.resource.attr"` OptionalResourceAttr ResourceAttributeConfig `mapstructure:"optional.resource.attr"` @@ -108,7 +108,7 @@ func DefaultResourceAttributesConfig() ResourceAttributesConfig { } } -// MetricsBuilderConfig is a configuration for file metrics builder. +// MetricsBuilderConfig is a configuration for sample metrics builder. type MetricsBuilderConfig struct { Metrics MetricsConfig `mapstructure:"metrics"` ResourceAttributes ResourceAttributesConfig `mapstructure:"resource_attributes"` diff --git a/cmd/mdatagen/internal/metadata/generated_config_test.go b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_config_test.go similarity index 100% rename from cmd/mdatagen/internal/metadata/generated_config_test.go rename to cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_config_test.go diff --git a/cmd/mdatagen/internal/metadata/generated_metrics.go b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_metrics.go similarity index 99% rename from cmd/mdatagen/internal/metadata/generated_metrics.go rename to cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_metrics.go index a52195c69df9..b9b9c65da0bb 100644 --- a/cmd/mdatagen/internal/metadata/generated_metrics.go +++ b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_metrics.go @@ -368,7 +368,7 @@ func (mb *MetricsBuilder) EmitForResource(rmo ...ResourceMetricsOption) { rm := pmetric.NewResourceMetrics() rm.SetSchemaUrl(conventions.SchemaURL) ils := rm.ScopeMetrics().AppendEmpty() - ils.Scope().SetName("otelcol") + ils.Scope().SetName("otelcol/samplereceiver") ils.Scope().SetVersion(mb.buildInfo.Version) ils.Metrics().EnsureCapacity(mb.metricsCapacity) mb.metricDefaultMetric.emit(ils.Metrics()) diff --git a/cmd/mdatagen/internal/metadata/generated_metrics_test.go b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_metrics_test.go similarity index 100% rename from cmd/mdatagen/internal/metadata/generated_metrics_test.go rename to cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_metrics_test.go diff --git a/cmd/mdatagen/internal/metadata/generated_resource.go b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_resource.go similarity index 100% rename from cmd/mdatagen/internal/metadata/generated_resource.go rename to cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_resource.go diff --git a/cmd/mdatagen/internal/metadata/generated_resource_test.go b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_resource_test.go similarity index 100% rename from cmd/mdatagen/internal/metadata/generated_resource_test.go rename to cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_resource_test.go diff --git a/cmd/mdatagen/internal/metadata/generated_status.go b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_status.go similarity index 74% rename from cmd/mdatagen/internal/metadata/generated_status.go rename to cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_status.go index 429ff354c01b..e596fb2915d4 100644 --- a/cmd/mdatagen/internal/metadata/generated_status.go +++ b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_status.go @@ -9,19 +9,19 @@ import ( ) var ( - Type = component.MustNewType("file") + Type = component.MustNewType("sample") ) const ( - TracesStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelDevelopment + TracesStability = component.StabilityLevelBeta MetricsStability = component.StabilityLevelStable ) func Meter(settings component.TelemetrySettings) metric.Meter { - return settings.MeterProvider.Meter("otelcol") + return settings.MeterProvider.Meter("otelcol/samplereceiver") } func Tracer(settings component.TelemetrySettings) trace.Tracer { - return settings.TracerProvider.Tracer("otelcol") + return settings.TracerProvider.Tracer("otelcol/samplereceiver") } diff --git a/cmd/mdatagen/internal/metadata/testdata/config.yaml b/cmd/mdatagen/internal/samplereceiver/internal/metadata/testdata/config.yaml similarity index 100% rename from cmd/mdatagen/internal/metadata/testdata/config.yaml rename to cmd/mdatagen/internal/samplereceiver/internal/metadata/testdata/config.yaml diff --git a/cmd/mdatagen/metadata-sample.yaml b/cmd/mdatagen/internal/samplereceiver/metadata.yaml similarity index 95% rename from cmd/mdatagen/metadata-sample.yaml rename to cmd/mdatagen/internal/samplereceiver/metadata.yaml index b9a5f8f6c908..8c32d9f382b8 100644 --- a/cmd/mdatagen/metadata-sample.yaml +++ b/cmd/mdatagen/internal/samplereceiver/metadata.yaml @@ -1,6 +1,6 @@ -# Sample metric metadata file with all available configurations. +# Sample metadata file with all available configurations for a receiver. -type: file +type: sample sem_conv_version: 1.9.0 @@ -10,7 +10,9 @@ status: development: [logs] beta: [traces] stable: [metrics] - distributions: [contrib] + distributions: [] + codeowners: + active: [dmitryax] warnings: - Any additional information that should be brought to the consumer's attention @@ -134,3 +136,6 @@ metrics: aggregation_temporality: delta warnings: if_enabled: This metric is deprecated and will be removed soon. + +tests: + config: diff --git a/cmd/mdatagen/internal/samplereceiver/metrics_test.go b/cmd/mdatagen/internal/samplereceiver/metrics_test.go new file mode 100644 index 000000000000..668e493a9f39 --- /dev/null +++ b/cmd/mdatagen/internal/samplereceiver/metrics_test.go @@ -0,0 +1,20 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package samplereceiver + +import ( + "testing" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/receiver/receivertest" + + "github.com/open-telemetry/opentelemetry-collector-contrib/cmd/mdatagen/internal/samplereceiver/internal/metadata" +) + +// TestGeneratedMetrics verifies that the internal/metadata API is generated correctly. +func TestGeneratedMetrics(t *testing.T) { + mb := metadata.NewMetricsBuilder(metadata.DefaultMetricsBuilderConfig(), receivertest.NewNopCreateSettings()) + m := mb.Emit() + require.Equal(t, 0, m.ResourceMetrics().Len()) +} diff --git a/cmd/mdatagen/loader.go b/cmd/mdatagen/loader.go index ab558aecb2e8..0521a58386de 100644 --- a/cmd/mdatagen/loader.go +++ b/cmd/mdatagen/loader.go @@ -202,6 +202,7 @@ func (a attribute) TestValue() string { type tests struct { Config any `mapstructure:"config"` SkipLifecycle bool `mapstructure:"skip_lifecycle"` + SkipShutdown bool `mapstructure:"skip_shutdown"` ExpectConsumerError bool `mapstructure:"expect_consumer_error"` } @@ -225,7 +226,7 @@ type metadata struct { // ShortFolderName is the shortened folder name of the component, removing class if present ShortFolderName string `mapstructure:"-"` - Tests *tests `mapstructure:"tests"` + Tests tests `mapstructure:"tests"` } func setAttributesFullName(attrs map[attributeName]attribute) { diff --git a/cmd/mdatagen/loader_test.go b/cmd/mdatagen/loader_test.go index 4ebedb44c156..8997dbc04747 100644 --- a/cmd/mdatagen/loader_test.go +++ b/cmd/mdatagen/loader_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/pmetric" ) @@ -18,19 +19,22 @@ func TestLoadMetadata(t *testing.T) { wantErr string }{ { - name: "metadata-sample.yaml", + name: "internal/samplereceiver/metadata.yaml", want: metadata{ - Type: "file", + Type: "sample", SemConvVersion: "1.9.0", Status: &Status{ Class: "receiver", - Stability: map[string][]string{ - "development": {"logs"}, - "beta": {"traces"}, - "stable": {"metrics"}, + Stability: map[component.StabilityLevel][]string{ + component.StabilityLevelDevelopment: {"logs"}, + component.StabilityLevelBeta: {"traces"}, + component.StabilityLevelStable: {"metrics"}, }, - Distributions: []string{"contrib"}, - Warnings: []string{"Any additional information that should be brought to the consumer's attention"}, + Distributions: []string{}, + Codeowners: &Codeowners{ + Active: []string{"dmitryax"}, + }, + Warnings: []string{"Any additional information that should be brought to the consumer's attention"}, }, ResourceAttributes: map[attributeName]attribute{ "string.resource.attr": { @@ -213,8 +217,8 @@ func TestLoadMetadata(t *testing.T) { }, }, }, - ScopeName: "otelcol", - ShortFolderName: ".", + ScopeName: "otelcol/samplereceiver", + ShortFolderName: "sample", }, }, { diff --git a/cmd/mdatagen/main.go b/cmd/mdatagen/main.go index 2aa239b5ad8c..96b04d210535 100644 --- a/cmd/mdatagen/main.go +++ b/cmd/mdatagen/main.go @@ -43,6 +43,7 @@ func run(ymlPath string) error { } ymlDir := filepath.Dir(ymlPath) + packageName := filepath.Base(ymlDir) md, err := loadMetadata(ymlPath) if err != nil { @@ -61,6 +62,12 @@ func run(ymlPath string) error { filepath.Join(codeDir, "generated_status.go"), md, "metadata"); err != nil { return err } + if !md.Tests.SkipLifecycle || !md.Tests.SkipShutdown { + if err = generateFile(filepath.Join(tmplDir, "component_test.go.tmpl"), + filepath.Join(ymlDir, "generated_component_test.go"), md, packageName); err != nil { + return err + } + } } if _, err = os.Stat(filepath.Join(ymlDir, "README.md")); err == nil { @@ -73,13 +80,6 @@ func run(ymlPath string) error { } } - if md.Tests != nil { - if err = generateFile(filepath.Join(tmplDir, "component_test.go.tmpl"), - filepath.Join(ymlDir, "generated_component_test.go"), md, md.ShortFolderName+md.Status.Class); err != nil { - return err - } - } - if len(md.Metrics) == 0 && len(md.ResourceAttributes) == 0 { return nil } @@ -164,7 +164,8 @@ func templatize(tmplFile string, md metadata) *template.Template { } return result }, - "casesTitle": cases.Title(language.English).String, + "casesTitle": cases.Title(language.English).String, + "toLowerCase": strings.ToLower, "toCamelCase": func(s string) string { caser := cases.Title(language.English).String parts := strings.Split(s, "_") @@ -193,9 +194,6 @@ func templatize(tmplFile string, md metadata) *template.Template { "isConnector": func() bool { return md.Status.Class == "connector" }, - "skipLifecycle": func() bool { - return md.Tests.SkipLifecycle - }, "supportsLogs": func() bool { for _, signals := range md.Status.Stability { for _, s := range signals { diff --git a/cmd/mdatagen/main_test.go b/cmd/mdatagen/main_test.go index 03d56343a231..e0411d80c392 100644 --- a/cmd/mdatagen/main_test.go +++ b/cmd/mdatagen/main_test.go @@ -11,9 +11,7 @@ import ( "testing" "github.com/stretchr/testify/require" - "go.opentelemetry.io/collector/receiver/receivertest" - - md "github.com/open-telemetry/opentelemetry-collector-contrib/cmd/mdatagen/internal/metadata" + "go.opentelemetry.io/collector/component" ) func TestRunContents(t *testing.T) { @@ -132,7 +130,7 @@ func TestInlineReplace(t *testing.T) { outputFile string componentClass string warnings []string - stability map[string][]string + stability map[component.StabilityLevel][]string distros []string codeowners *Codeowners }{ @@ -261,8 +259,11 @@ Some warning there. Some info about a component `, outputFile: "readme_with_multiple_signals.md", - stability: map[string][]string{"beta": {"metrics"}, "alpha": {"logs"}}, - distros: []string{"contrib"}, + stability: map[component.StabilityLevel][]string{ + component.StabilityLevelBeta: {"metrics"}, + component.StabilityLevelAlpha: {"logs"}, + }, + distros: []string{"contrib"}, }, { name: "readme with cmd class", @@ -273,15 +274,18 @@ Some info about a component Some info about a component `, - outputFile: "readme_with_cmd_class.md", - stability: map[string][]string{"beta": {"metrics"}, "alpha": {"logs"}}, + outputFile: "readme_with_cmd_class.md", + stability: map[component.StabilityLevel][]string{ + component.StabilityLevelBeta: {"metrics"}, + component.StabilityLevelAlpha: {"logs"}, + }, componentClass: "cmd", distros: []string{}, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - stability := map[string][]string{"beta": {"metrics"}} + stability := map[component.StabilityLevel][]string{component.StabilityLevelBeta: {"metrics"}} if len(tt.stability) > 0 { stability = tt.stability } @@ -330,7 +334,9 @@ func TestGenerateStatusMetadata(t *testing.T) { md: metadata{ Type: "foo", Status: &Status{ - Stability: map[string][]string{"beta": {"metrics"}}, + Stability: map[component.StabilityLevel][]string{ + component.StabilityLevelBeta: {"metrics"}, + }, Distributions: []string{"contrib"}, Class: "receiver", }, @@ -367,7 +373,9 @@ func Tracer(settings component.TelemetrySettings) trace.Tracer { md: metadata{ Type: "foo", Status: &Status{ - Stability: map[string][]string{"alpha": {"metrics"}}, + Stability: map[component.StabilityLevel][]string{ + component.StabilityLevelAlpha: {"metrics"}, + }, Distributions: []string{"contrib"}, Class: "receiver", }, @@ -413,10 +421,3 @@ func Tracer(settings component.TelemetrySettings) trace.Tracer { }) } } - -// TestGenerated verifies that the internal/metadata API is generated correctly. -func TestGenerated(t *testing.T) { - mb := md.NewMetricsBuilder(md.DefaultMetricsBuilderConfig(), receivertest.NewNopCreateSettings()) - m := mb.Emit() - require.Equal(t, 0, m.ResourceMetrics().Len()) -} diff --git a/cmd/mdatagen/metadata-schema.yaml b/cmd/mdatagen/metadata-schema.yaml index 879307fdd3da..2a42a7191e8f 100644 --- a/cmd/mdatagen/metadata-schema.yaml +++ b/cmd/mdatagen/metadata-schema.yaml @@ -109,5 +109,9 @@ metrics: # Lifecycle tests generated for this component. tests: config: # {} by default, specific testing configuration for lifecycle tests. + # Skip lifecycle tests for this component. Not recommended for components that are not in development. skip_lifecycle: false # false by default + # Skip shutdown tests for this component. Not recommended for components that are not in development. + skip_shutdown: false # false by default + # Whether it's expected that the Consume[Logs|Metrics|Traces] method will return an error with the given configuration. expect_consumer_error: true # false by default diff --git a/cmd/mdatagen/metricdata.go b/cmd/mdatagen/metricdata.go index f4515136aaed..5bf77985cc95 100644 --- a/cmd/mdatagen/metricdata.go +++ b/cmd/mdatagen/metricdata.go @@ -125,7 +125,7 @@ func (d *gauge) Unmarshal(parser *confmap.Conf) error { if err := d.MetricValueType.Unmarshal(parser); err != nil { return err } - return parser.Unmarshal(d) + return parser.Unmarshal(d, confmap.WithIgnoreUnused()) } func (d gauge) Type() string { @@ -155,7 +155,7 @@ func (d *sum) Unmarshal(parser *confmap.Conf) error { if err := d.MetricValueType.Unmarshal(parser); err != nil { return err } - return parser.Unmarshal(d) + return parser.Unmarshal(d, confmap.WithIgnoreUnused()) } // TODO: Currently, this func will not be called because of https://github.com/open-telemetry/opentelemetry-collector/issues/6671. Uncomment function and diff --git a/processor/spanmetricsprocessor/internal/cache/package_test.go b/cmd/mdatagen/package_test.go similarity index 92% rename from processor/spanmetricsprocessor/internal/cache/package_test.go rename to cmd/mdatagen/package_test.go index f8a293b2ad92..5cd502ca564b 100644 --- a/processor/spanmetricsprocessor/internal/cache/package_test.go +++ b/cmd/mdatagen/package_test.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package cache +package main import ( "testing" diff --git a/cmd/mdatagen/statusdata.go b/cmd/mdatagen/statusdata.go index d65a5c20f586..05ca2b164717 100644 --- a/cmd/mdatagen/statusdata.go +++ b/cmd/mdatagen/statusdata.go @@ -4,7 +4,12 @@ package main import ( + "errors" "sort" + "strings" + + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/confmap" ) // distros is a collection of distributions that can be referenced in the metadata.yaml files. @@ -32,13 +37,15 @@ type Codeowners struct { SeekingNew bool `mapstructure:"seeking_new"` } +type StabilityMap map[component.StabilityLevel][]string + type Status struct { - Stability map[string][]string `mapstructure:"stability"` - Distributions []string `mapstructure:"distributions"` - Class string `mapstructure:"class"` - Warnings []string `mapstructure:"warnings"` - Codeowners *Codeowners `mapstructure:"codeowners"` - UnsupportedPlatforms []string `mapstructure:"unsupported_platforms"` + Stability StabilityMap `mapstructure:"stability"` + Distributions []string `mapstructure:"distributions"` + Class string `mapstructure:"class"` + Warnings []string `mapstructure:"warnings"` + Codeowners *Codeowners `mapstructure:"codeowners"` + UnsupportedPlatforms []string `mapstructure:"unsupported_platforms"` } func (s *Status) SortedDistributions() []string { @@ -60,3 +67,31 @@ func (s *Status) SortedDistributions() []string { }) return sorted } + +func (ms *StabilityMap) Unmarshal(parser *confmap.Conf) error { + *ms = make(StabilityMap) + raw := make(map[string][]string) + err := parser.Unmarshal(&raw) + if err != nil { + return err + } + for k, v := range raw { + switch strings.ToLower(k) { + case strings.ToLower(component.StabilityLevelUnmaintained.String()): + (*ms)[component.StabilityLevelUnmaintained] = v + case strings.ToLower(component.StabilityLevelDeprecated.String()): + (*ms)[component.StabilityLevelDeprecated] = v + case strings.ToLower(component.StabilityLevelDevelopment.String()): + (*ms)[component.StabilityLevelDevelopment] = v + case strings.ToLower(component.StabilityLevelAlpha.String()): + (*ms)[component.StabilityLevelAlpha] = v + case strings.ToLower(component.StabilityLevelBeta.String()): + (*ms)[component.StabilityLevelBeta] = v + case strings.ToLower(component.StabilityLevelStable.String()): + (*ms)[component.StabilityLevelStable] = v + default: + return errors.New("invalid stability level: " + k) + } + } + return nil +} diff --git a/cmd/mdatagen/templates/component_test.go.tmpl b/cmd/mdatagen/templates/component_test.go.tmpl index 0aa122a1c022..3a8fd72dd3ca 100644 --- a/cmd/mdatagen/templates/component_test.go.tmpl +++ b/cmd/mdatagen/templates/component_test.go.tmpl @@ -1,6 +1,6 @@ // Code generated by mdatagen. DO NOT EDIT. -{{ if len .Status.UnsupportedPlatforms -}} +{{- if len .Status.UnsupportedPlatforms }} //go:build {{ range $i, $v := .Status.UnsupportedPlatforms }}{{ if $i }} && {{ end }}!{{ . }}{{ end }} {{- end }} @@ -9,47 +9,47 @@ package {{ .Package }} import ( "context" "testing" + {{- if or isExporter isProcessor }} + "time" + {{- end }} "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" + {{- if not .Tests.SkipLifecycle }} "go.opentelemetry.io/collector/component/componenttest" -{{ if isExporter }} + {{- end }} + {{- if isExporter }} "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" -{{ end }} -{{ if isProcessor }} + {{- end }} + {{- if isProcessor }} "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/processor" "go.opentelemetry.io/collector/processor/processortest" -{{ end }} -{{ if isReceiver }} + {{- end }} + {{- if isReceiver }} "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" -{{ end }} -{{ if isExtension }} + {{- end }} + {{- if isExtension }} "go.opentelemetry.io/collector/extension/extensiontest" -{{ end }} -{{ if isConnector }} + {{- end }} + {{- if isConnector }} "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/connector" "go.opentelemetry.io/collector/connector/connectortest" -{{ end }} + {{- end }} "go.opentelemetry.io/collector/confmap/confmaptest" -{{ if or (isExporter) (isProcessor) }} - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" -{{ end }} + {{- if or isExporter isProcessor }} + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" + {{- end }} ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - -{{ if isExporter }} +{{ if isExporter -}} func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -91,18 +91,17 @@ func TestComponentLifecycle(t *testing.T) { require.NoError(t, component.UnmarshalConfig(sub, cfg)) for _, test := range tests { + {{- if not .Tests.SkipShutdown }} t.Run(test.name + "-shutdown", func(t *testing.T) { c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) err = c.Shutdown(context.Background()) require.NoError(t, err) }) + {{- end }} + {{- if not .Tests.SkipLifecycle }} t.Run(test.name + "-lifecycle", func(t *testing.T) { - {{ if skipLifecycle }} - // TODO support lifecycle - t.SkipNow() - {{ end }} c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -111,19 +110,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case exporter.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case exporter.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case exporter.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -136,6 +135,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) + {{- end }} } } {{ end }} @@ -182,18 +182,17 @@ func TestComponentLifecycle(t *testing.T) { require.NoError(t, component.UnmarshalConfig(sub, cfg)) for _, test := range tests { + {{- if not .Tests.SkipShutdown }} t.Run(test.name + "-shutdown", func(t *testing.T) { c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) err = c.Shutdown(context.Background()) require.NoError(t, err) }) + {{- end }} + {{- if not .Tests.SkipLifecycle }} t.Run(test.name + "-lifecycle", func(t *testing.T) { - {{ if skipLifecycle }} - // TODO support lifecycle - t.SkipNow() - {{ end }} c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -202,19 +201,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case processor.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case processor.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case processor.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -225,6 +224,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) + {{- end }} } } {{ end }} @@ -271,18 +271,17 @@ func TestComponentLifecycle(t *testing.T) { require.NoError(t, component.UnmarshalConfig(sub, cfg)) for _, test := range tests { + {{- if not .Tests.SkipShutdown }} t.Run(test.name + "-shutdown", func(t *testing.T) { c, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) err = c.Shutdown(context.Background()) require.NoError(t, err) }) + {{- end }} + {{- if not .Tests.SkipLifecycle }} t.Run(test.name + "-lifecycle", func(t *testing.T) { - {{ if skipLifecycle }} - // TODO support lifecycle - t.SkipNow() - {{ end }} firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -294,6 +293,7 @@ func TestComponentLifecycle(t *testing.T) { require.NoError(t, secondRcvr.Start(context.Background(), host)) require.NoError(t, secondRcvr.Shutdown(context.Background())) }) + {{- end }} } } {{ end }} @@ -309,18 +309,17 @@ func TestComponentLifecycle(t *testing.T) { require.NoError(t, err) require.NoError(t, component.UnmarshalConfig(sub, cfg)) + {{- if not .Tests.SkipShutdown }} t.Run("shutdown", func(t *testing.T) { e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) err = e.Shutdown(context.Background()) require.NoError(t, err) }) + {{- end }} + {{- if not .Tests.SkipLifecycle }} t.Run("lifecycle", func(t *testing.T) { - {{ if skipLifecycle }} - // TODO support lifecycle - t.SkipNow() - {{ end }} firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost())) @@ -331,6 +330,7 @@ func TestComponentLifecycle(t *testing.T) { require.NoError(t, secondExt.Start(context.Background(), componenttest.NewNopHost())) require.NoError(t, secondExt.Shutdown(context.Background())) }) + {{- end }} } {{ end }} @@ -424,18 +424,17 @@ func TestComponentLifecycle(t *testing.T) { require.NoError(t, component.UnmarshalConfig(sub, cfg)) for _, test := range tests { + {{- if not .Tests.SkipShutdown }} t.Run(test.name + "-shutdown", func(t *testing.T) { c, err := test.createFn(context.Background(), connectortest.NewNopCreateSettings(), cfg) require.NoError(t, err) err = c.Shutdown(context.Background()) require.NoError(t, err) }) + {{- end }} + {{- if not .Tests.SkipLifecycle }} t.Run(test.name + "-lifecycle", func(t *testing.T) { - {{ if skipLifecycle }} - // TODO support lifecycle - t.SkipNow() - {{ end }} firstConnector, err := test.createFn(context.Background(), connectortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -447,6 +446,44 @@ func TestComponentLifecycle(t *testing.T) { require.NoError(t, secondConnector.Start(context.Background(), host)) require.NoError(t, secondConnector.Shutdown(context.Background())) }) + {{- end }} } } -{{ end }} \ No newline at end of file +{{ end }} + +{{ if or isExporter isProcessor -}} +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} +{{- end }} diff --git a/cmd/mdatagen/templates/readme.md.tmpl b/cmd/mdatagen/templates/readme.md.tmpl index ad41f11dd42c..268ff5888e58 100644 --- a/cmd/mdatagen/templates/readme.md.tmpl +++ b/cmd/mdatagen/templates/readme.md.tmpl @@ -7,7 +7,7 @@ {{- if ne $class "connector" }} {{- $idx := 0 }} {{- range $stability, $value := .Status.Stability }} -| {{ if not $idx }}Stability{{ else }} {{ end }} | [{{ $stability }}]{{ if ne $class "extension" }}: {{ stringsJoin $value ", " }} {{ end }} | +| {{ if not $idx }}Stability{{ else }} {{ end }} | [{{ toLowerCase $stability.String }}]{{ if ne $class "extension" }}: {{ stringsJoin $value ", " }} {{ end }} | {{- $idx = inc $idx }} {{- end }} {{- end}} @@ -29,7 +29,7 @@ {{- end }} {{- end }} {{range $stability, $val := .Status.Stability}} -[{{ $stability }}]: https://github.com/open-telemetry/opentelemetry-collector#{{ $stability }} +[{{ toLowerCase $stability.String }}]: https://github.com/open-telemetry/opentelemetry-collector#{{ toLowerCase $stability.String }} {{- end }} {{- range .Status.SortedDistributions }} [{{.}}]: {{ distroURL . }} @@ -43,7 +43,7 @@ {{- range $stability, $pipelines := .Status.Stability }} {{- range $pipeline := $pipelines }} {{- $parts := stringsSplit $pipeline "_to_" }} -| {{index $parts 0}} | {{index $parts 1}} | [{{$stability}}] | +| {{index $parts 0}} | {{index $parts 1}} | [{{ toLowerCase $stability.String }}] | {{- end }} {{- end }} diff --git a/cmd/mdatagen/templates/status.go.tmpl b/cmd/mdatagen/templates/status.go.tmpl index e90f678853b0..12730e31db78 100644 --- a/cmd/mdatagen/templates/status.go.tmpl +++ b/cmd/mdatagen/templates/status.go.tmpl @@ -3,12 +3,12 @@ package {{ .Package }} import ( - "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/component" "go.opentelemetry.io/otel/metric" "go.opentelemetry.io/otel/trace" ) -{{ if eq .Parent "" }} +{{ if eq .Parent "" -}} var ( Type = component.MustNewType("{{ .Type }}") ) @@ -17,7 +17,7 @@ var ( const ( {{- range $stability, $signals := .Status.Stability }} {{- range $signal := $signals }} - {{ toCamelCase $signal }}Stability = component.StabilityLevel{{ casesTitle $stability }} + {{ toCamelCase $signal }}Stability = component.StabilityLevel{{ $stability.String }} {{- end }} {{- end }} ) diff --git a/cmd/mdatagen/testdata/metrics_and_type.yaml b/cmd/mdatagen/testdata/metrics_and_type.yaml index 81d66bde9c13..2306a08b35ee 100644 --- a/cmd/mdatagen/testdata/metrics_and_type.yaml +++ b/cmd/mdatagen/testdata/metrics_and_type.yaml @@ -17,3 +17,7 @@ metrics: unit: s gauge: value_type: double + +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/cmd/mdatagen/testdata/resource_attributes_only.yaml b/cmd/mdatagen/testdata/resource_attributes_only.yaml index 05e031bcf455..a6fe611fe866 100644 --- a/cmd/mdatagen/testdata/resource_attributes_only.yaml +++ b/cmd/mdatagen/testdata/resource_attributes_only.yaml @@ -15,3 +15,7 @@ resource_attributes: description: Resource attribute 1. type: string enabled: true + +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/cmd/mdatagen/testdata/status_only.yaml b/cmd/mdatagen/testdata/status_only.yaml index 2365b43f1d95..d66977249dd0 100644 --- a/cmd/mdatagen/testdata/status_only.yaml +++ b/cmd/mdatagen/testdata/status_only.yaml @@ -4,3 +4,7 @@ status: stability: beta: [traces, metrics, logs] distributions: [contrib] + +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/cmd/mdatagen/validate.go b/cmd/mdatagen/validate.go index ae3990f97a6d..ded85137d16b 100644 --- a/cmd/mdatagen/validate.go +++ b/cmd/mdatagen/validate.go @@ -89,10 +89,7 @@ func (s *Status) validateStability() error { return errors.New("missing stability") } for stability, component := range s.Stability { - if stability != "development" && stability != "alpha" && stability != "beta" && stability != "stable" && stability != "deprecated" && stability != "unmaintained" { - errs = multierr.Append(errs, fmt.Errorf("invalid stability: %v", stability)) - } - if component == nil { + if len(component) == 0 { errs = multierr.Append(errs, fmt.Errorf("missing component for stability: %v", stability)) } for _, c := range component { diff --git a/cmd/mdatagen/validate_test.go b/cmd/mdatagen/validate_test.go index 12871a4ab8c5..8a4e94f5b376 100644 --- a/cmd/mdatagen/validate_test.go +++ b/cmd/mdatagen/validate_test.go @@ -40,11 +40,11 @@ func TestValidate(t *testing.T) { }, { name: "testdata/invalid_stability.yaml", - wantErr: "invalid stability: incorrectstability", + wantErr: "1 error(s) decoding:\n\n* error decoding 'status.stability': invalid stability level: incorrectstability", }, { name: "testdata/no_stability_component.yaml", - wantErr: "missing component for stability: beta", + wantErr: "missing component for stability: Beta", }, { name: "testdata/invalid_stability_component.yaml", diff --git a/cmd/opampsupervisor/README.md b/cmd/opampsupervisor/README.md index fcdeb091672f..136e36153971 100644 --- a/cmd/opampsupervisor/README.md +++ b/cmd/opampsupervisor/README.md @@ -18,7 +18,7 @@ The supervisor is currently undergoing heavy development and is not ready for an 3. Run the supervisor, substituting `` for your platform: ```shell - go run . --config testdata/supervisor_.yaml + go run . --config examples/supervisor_.yaml ``` 4. The supervisor should connect to the OpAMP server and start a Collector instance. diff --git a/cmd/opampsupervisor/go.mod b/cmd/opampsupervisor/go.mod index eae2390622ed..cd6b9e916653 100644 --- a/cmd/opampsupervisor/go.mod +++ b/cmd/opampsupervisor/go.mod @@ -14,7 +14,7 @@ require ( go.opentelemetry.io/collector/config/configtls v0.95.0 go.opentelemetry.io/collector/semconv v0.95.0 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/cmd/opampsupervisor/go.sum b/cmd/opampsupervisor/go.sum index 4c3d8e4d4459..0a276573c79e 100644 --- a/cmd/opampsupervisor/go.sum +++ b/cmd/opampsupervisor/go.sum @@ -55,8 +55,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= diff --git a/cmd/otelcontribcol/builder-config.yaml b/cmd/otelcontribcol/builder-config.yaml index eb54590d12b5..af4d768d6829 100644 --- a/cmd/otelcontribcol/builder-config.yaml +++ b/cmd/otelcontribcol/builder-config.yaml @@ -108,7 +108,6 @@ processors: - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.95.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.95.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.95.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanmetricsprocessor v0.95.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/sumologicprocessor v0.95.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanprocessor v0.95.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.95.0 @@ -347,7 +346,6 @@ replaces: - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/cloudfoundryreceiver => ../../receiver/cloudfoundryreceiver - github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter => ../../internal/filter - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/activedirectorydsreceiver => ../../receiver/activedirectorydsreceiver - - github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanmetricsprocessor => ../../processor/spanmetricsprocessor - github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor => ../../processor/routingprocessor - github.com/open-telemetry/opentelemetry-collector-contrib/processor/deltatorateprocessor => ../../processor/deltatorateprocessor - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/datadogexporter => ../../exporter/datadogexporter diff --git a/cmd/otelcontribcol/components.go b/cmd/otelcontribcol/components.go index 705ff37b967b..7c91bf81f859 100644 --- a/cmd/otelcontribcol/components.go +++ b/cmd/otelcontribcol/components.go @@ -112,7 +112,6 @@ import ( resourcedetectionprocessor "github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor" resourceprocessor "github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor" routingprocessor "github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor" - spanmetricsprocessor "github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanmetricsprocessor" spanprocessor "github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanprocessor" sumologicprocessor "github.com/open-telemetry/opentelemetry-collector-contrib/processor/sumologicprocessor" tailsamplingprocessor "github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor" @@ -408,7 +407,6 @@ func components() (otelcol.Factories, error) { resourcedetectionprocessor.NewFactory(), resourceprocessor.NewFactory(), routingprocessor.NewFactory(), - spanmetricsprocessor.NewFactory(), sumologicprocessor.NewFactory(), spanprocessor.NewFactory(), tailsamplingprocessor.NewFactory(), diff --git a/cmd/otelcontribcol/exporters_test.go b/cmd/otelcontribcol/exporters_test.go index 85c98ed8665a..6355a1e4d328 100644 --- a/cmd/otelcontribcol/exporters_test.go +++ b/cmd/otelcontribcol/exporters_test.go @@ -9,6 +9,7 @@ import ( "path/filepath" "runtime" "testing" + "time" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -20,6 +21,10 @@ import ( "go.opentelemetry.io/collector/exporter/exportertest" "go.opentelemetry.io/collector/exporter/otlpexporter" "go.opentelemetry.io/collector/exporter/otlphttpexporter" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/alertmanagerexporter" "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/alibabacloudlogserviceexporter" @@ -62,7 +67,6 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/tencentcloudlogserviceexporter" "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/zipkinexporter" "github.com/open-telemetry/opentelemetry-collector-contrib/internal/common/testutil" - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" ) func TestDefaultExporters(t *testing.T) { @@ -631,19 +635,19 @@ func verifyExporterLifecycle(t *testing.T, factory exporter.Factory, getConfigFn assert.NotPanics(t, func() { switch e := exp.(type) { case exporter.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(ctx, logs) case exporter.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(ctx, metrics) case exporter.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -658,6 +662,41 @@ func verifyExporterLifecycle(t *testing.T, factory exporter.Factory, getConfigFn } } +func generateTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.Gauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} + // verifyExporterShutdown is used to test if an exporter type can be shutdown without being started first. func verifyExporterShutdown(tb testing.TB, factory exporter.Factory, getConfigFn getExporterConfigFn) { ctx := context.Background() diff --git a/cmd/otelcontribcol/go.mod b/cmd/otelcontribcol/go.mod index 528e1d7640ea..3887ec4de342 100644 --- a/cmd/otelcontribcol/go.mod +++ b/cmd/otelcontribcol/go.mod @@ -83,7 +83,6 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage/dbstorage v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage/filestorage v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.95.0 - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/processor/cumulativetodeltaprocessor v0.95.0 @@ -101,7 +100,6 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.95.0 - github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanmetricsprocessor v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanprocessor v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/processor/sumologicprocessor v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.95.0 @@ -211,6 +209,7 @@ require ( go.opentelemetry.io/collector/extension/ballastextension v0.95.0 go.opentelemetry.io/collector/extension/zpagesextension v0.95.0 go.opentelemetry.io/collector/otelcol v0.95.0 + go.opentelemetry.io/collector/pdata v1.2.0 go.opentelemetry.io/collector/processor v0.95.0 go.opentelemetry.io/collector/processor/batchprocessor v0.95.0 go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.95.0 @@ -265,24 +264,24 @@ require ( github.com/ClickHouse/ch-go v0.58.2 // indirect github.com/ClickHouse/clickhouse-go/v2 v2.17.1 // indirect github.com/DataDog/agent-payload/v5 v5.0.104 // indirect - github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.2 // indirect + github.com/DataDog/datadog-agent/pkg/obfuscate v0.51.1-0.20240301173728-334e775e420a // indirect github.com/DataDog/datadog-agent/pkg/proto v0.52.0-devel // indirect - github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.2 // indirect - github.com/DataDog/datadog-agent/pkg/trace v0.50.2 // indirect - github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.2 // indirect - github.com/DataDog/datadog-agent/pkg/util/log v0.50.2 // indirect - github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.2 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.2 // indirect + github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.51.1-0.20240301173728-334e775e420a // indirect + github.com/DataDog/datadog-agent/pkg/trace v0.51.1-0.20240301173728-334e775e420a // indirect + github.com/DataDog/datadog-agent/pkg/util/cgroups v0.51.1-0.20240301173728-334e775e420a // indirect + github.com/DataDog/datadog-agent/pkg/util/log v0.51.1-0.20240301173728-334e775e420a // indirect + github.com/DataDog/datadog-agent/pkg/util/pointer v0.51.1-0.20240301173728-334e775e420a // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.51.1-0.20240301173728-334e775e420a // indirect github.com/DataDog/datadog-api-client-go/v2 v2.22.0 // indirect - github.com/DataDog/datadog-go/v5 v5.1.1 // indirect - github.com/DataDog/go-sqllexer v0.0.8 // indirect + github.com/DataDog/datadog-go/v5 v5.5.0 // indirect + github.com/DataDog/go-sqllexer v0.0.9 // indirect github.com/DataDog/go-tuf v1.0.2-0.5.2 // indirect github.com/DataDog/gohai v0.0.0-20230524154621-4316413895ee // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.13.3 // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.13.3 // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.13.3 // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.13.3 // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.13.3 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.13.4 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.13.4 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.13.4 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.13.4 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.13.4 // indirect github.com/DataDog/sketches-go v1.4.4 // indirect github.com/DataDog/zstd v1.5.2 // indirect github.com/GehirnInc/crypt v0.0.0-20200316065508-bb7000b8a962 // indirect @@ -291,7 +290,7 @@ require ( github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/collector/googlemanagedprometheus v0.45.0 // indirect github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace v1.21.0 // indirect github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.45.0 // indirect - github.com/IBM/sarama v1.42.2 // indirect + github.com/IBM/sarama v1.43.0 // indirect github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/ReneKroon/ttlcache/v2 v2.11.0 // indirect @@ -309,27 +308,27 @@ require ( github.com/apache/thrift v0.19.0 // indirect github.com/ardielle/ardielle-go v1.5.2 // indirect github.com/armon/go-metrics v0.4.1 // indirect - github.com/aws/aws-sdk-go v1.50.17 // indirect - github.com/aws/aws-sdk-go-v2 v1.25.0 // indirect - github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.0 // indirect - github.com/aws/aws-sdk-go-v2/config v1.27.0 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.17.0 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.0 // indirect + github.com/aws/aws-sdk-go v1.50.27 // indirect + github.com/aws/aws-sdk-go-v2 v1.25.2 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.1 // indirect + github.com/aws/aws-sdk-go-v2/config v1.27.4 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.17.4 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.2 // indirect github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.59 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.0 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.0 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.2 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.2 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.23 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.0 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.1 // indirect github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.26 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.0 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.2 // indirect github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.14.0 // indirect - github.com/aws/aws-sdk-go-v2/service/kinesis v1.25.0 // indirect + github.com/aws/aws-sdk-go-v2/service/kinesis v1.27.1 // indirect github.com/aws/aws-sdk-go-v2/service/s3 v1.31.0 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.19.0 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.22.0 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.27.0 // indirect - github.com/aws/smithy-go v1.20.0 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.20.1 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.1 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.28.1 // indirect + github.com/aws/smithy-go v1.20.1 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/blang/semver/v4 v4.0.0 // indirect github.com/bmatcuk/doublestar/v4 v4.6.1 // indirect @@ -364,7 +363,7 @@ require ( github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.6.0 // indirect github.com/dynatrace-oss/dynatrace-metric-utils-go v0.5.0 // indirect - github.com/eapache/go-resiliency v1.5.0 // indirect + github.com/eapache/go-resiliency v1.6.0 // indirect github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 // indirect github.com/eapache/queue v1.1.0 // indirect github.com/elastic/go-elasticsearch/v7 v7.17.10 // indirect @@ -480,7 +479,7 @@ require ( github.com/json-iterator/go v1.1.12 // indirect github.com/julienschmidt/httprouter v1.3.0 // indirect github.com/karrick/godirwalk v1.17.0 // indirect - github.com/klauspost/compress v1.17.6 // indirect + github.com/klauspost/compress v1.17.7 // indirect github.com/klauspost/cpuid/v2 v2.2.5 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect github.com/knadh/koanf/providers/confmap v0.1.0 // indirect @@ -504,7 +503,7 @@ require ( github.com/mattn/go-isatty v0.0.19 // indirect github.com/mattn/go-sqlite3 v1.14.22 // indirect github.com/microsoft/ApplicationInsights-Go v0.4.4 // indirect - github.com/microsoft/go-mssqldb v1.6.0 // indirect + github.com/microsoft/go-mssqldb v1.7.0 // indirect github.com/miekg/dns v1.1.56 // indirect github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible // indirect github.com/mitchellh/copystructure v1.2.0 // indirect @@ -537,6 +536,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/proxy v0.95.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xray v0.95.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/collectd v0.95.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.95.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/datadog v0.95.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/docker v0.95.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.95.0 // indirect @@ -586,9 +586,9 @@ require ( github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect github.com/pquerna/cachecontrol v0.1.0 // indirect - github.com/prometheus/client_golang v1.18.0 // indirect + github.com/prometheus/client_golang v1.19.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect - github.com/prometheus/common v0.46.0 // indirect + github.com/prometheus/common v0.48.0 // indirect github.com/prometheus/common/sigv4 v0.1.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect @@ -610,7 +610,7 @@ require ( github.com/signalfx/sapm-proto v0.14.0 // indirect github.com/sijms/go-ora/v2 v2.8.8 // indirect github.com/sirupsen/logrus v1.9.3 // indirect - github.com/snowflakedb/gosnowflake v1.7.2 // indirect + github.com/snowflakedb/gosnowflake v1.8.0 // indirect github.com/soheilhy/cmux v0.1.5 // indirect github.com/sourcegraph/conc v0.3.0 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect @@ -647,9 +647,9 @@ require ( github.com/yuin/gopher-lua v0.0.0-20220504180219-658193537a64 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect github.com/zeebo/xxh3 v1.0.2 // indirect - go.etcd.io/bbolt v1.3.8 // indirect + go.etcd.io/bbolt v1.3.9 // indirect go.mongodb.org/atlas v0.36.0 // indirect - go.mongodb.org/mongo-driver v1.13.1 // indirect + go.mongodb.org/mongo-driver v1.14.0 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/collector v0.95.0 // indirect go.opentelemetry.io/collector/config/configauth v0.95.0 // indirect @@ -666,7 +666,6 @@ require ( go.opentelemetry.io/collector/confmap/provider/yamlprovider v0.95.0 // indirect go.opentelemetry.io/collector/extension/auth v0.95.0 // indirect go.opentelemetry.io/collector/featuregate v1.2.0 // indirect - go.opentelemetry.io/collector/pdata v1.2.0 // indirect go.opentelemetry.io/collector/semconv v0.95.0 // indirect go.opentelemetry.io/collector/service v0.95.0 // indirect go.opentelemetry.io/contrib/config v0.3.0 // indirect @@ -691,8 +690,8 @@ require ( go.opentelemetry.io/proto/otlp v1.1.0 // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.26.0 // indirect - golang.org/x/crypto v0.19.0 // indirect + go.uber.org/zap v1.27.0 // indirect + golang.org/x/crypto v0.20.0 // indirect golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3 // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.21.0 // indirect @@ -999,8 +998,6 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/filte replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/activedirectorydsreceiver => ../../receiver/activedirectorydsreceiver -replace github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanmetricsprocessor => ../../processor/spanmetricsprocessor - replace github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor => ../../processor/routingprocessor replace github.com/open-telemetry/opentelemetry-collector-contrib/processor/deltatorateprocessor => ../../processor/deltatorateprocessor diff --git a/cmd/otelcontribcol/go.sum b/cmd/otelcontribcol/go.sum index 744aa2b20b04..7f622f6d1fe6 100644 --- a/cmd/otelcontribcol/go.sum +++ b/cmd/otelcontribcol/go.sum @@ -111,10 +111,10 @@ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1. github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0/go.mod h1:5kakwfW5CjC9KK+Q4wjXAg+ShuIm2mBMua0ZFj2C8PE= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.5.0 h1:AifHbc4mg0x9zW52WOpKbsHaDKuRhlI7TVl47thgQ70= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.5.0/go.mod h1:T5RfihdXtBDxt1Ch2wobif3TvzTdumDy29kahv6AV9A= -github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.0.0 h1:yfJe15aSwEQ6Oo6J+gdfdulPNoZ3TEhmbhLIoxZcA+U= -github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.0.0/go.mod h1:Q28U+75mpCaSCDowNEmhIo/rmgdkqmkmzI7N6TGR4UY= -github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v0.8.0 h1:T028gtTPiYt/RMUfs8nVsAL7FDQrfLlrm/NnRG/zcC4= -github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v0.8.0/go.mod h1:cw4zVQgBby0Z5f2v0itn6se2dDP17nTjbZFXW5uPyHA= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.0.1 h1:MyVTgWR8qd/Jw1Le0NZebGBUCLbtak3bJ3z1OlqZBpw= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.0.1/go.mod h1:GpPjLhVR9dnUoJMyHWSPy71xY9/lcmpzIPZXmF0FCVY= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.0.0 h1:D3occbWoio4EBLkbkevetNMAVX197GkzbUMtqjGWn80= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.0.0/go.mod h1:bTSOgj05NGRuHHhQwAdPnYr9TOdNmKlZTgGLL6nyAdI= github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.3.0 h1:IfFdxTUDiV58iZqPKgyWiz4X4fCxZeQ1pTQPImLYXpY= github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.3.0/go.mod h1:SUZc9YRRHfx2+FAQKNDGrssXehqLpxmwRv2mC/5ntj4= github.com/Azure/azure-storage-queue-go v0.0.0-20230531184854-c06a8eff66fe h1:HGuouUM1533rBXmMtR7qh5pYNSSjUZG90b/MgJAnb/A= @@ -162,45 +162,45 @@ github.com/DATA-DOG/go-sqlmock v1.5.2 h1:OcvFkGmslmlZibjAjaHm3L//6LiuBgolP7Oputl github.com/DATA-DOG/go-sqlmock v1.5.2/go.mod h1:88MAG/4G7SMwSE3CeA0ZKzrT5CiOU3OJ+JlNzwDqpNU= github.com/DataDog/agent-payload/v5 v5.0.104 h1:uxTIaLthyKB4CxBKe+2FeMgL6ca3KVxpeYxlJGNcoJg= github.com/DataDog/agent-payload/v5 v5.0.104/go.mod h1:COngtbYYCncpIPiE5D93QlXDH/3VAKk10jDNwGHcMRE= -github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.2 h1:y08IzbpFM/HBaKfgayFZe1FpcbZn6bVPXoZ++93vxv8= -github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.2/go.mod h1:A4nLJvxlg6BO/8/zg81til9yT0uRPuXDFMAzDMpmgn4= +github.com/DataDog/datadog-agent/pkg/obfuscate v0.51.1-0.20240301173728-334e775e420a h1:8t9jpJHbq3WosQmXCVDjqNfGFFPBxBT7/9mbyQqHMi0= +github.com/DataDog/datadog-agent/pkg/obfuscate v0.51.1-0.20240301173728-334e775e420a/go.mod h1:Ai57GjsZUn9AOo4L9ZOdu5uTuGaAxXMh0kin544Lgw0= github.com/DataDog/datadog-agent/pkg/proto v0.52.0-devel h1:nBejGNIU6Jk7bPBxz2bAO+f+kahAXWBXPecebY3R+Zo= github.com/DataDog/datadog-agent/pkg/proto v0.52.0-devel/go.mod h1:wjr5YlVvGip6VmAGzHrdBaGUu1LaA9B6gHvInm5kHiY= -github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.2 h1:7jn5EOu84uph4sd+pB3vF8LnsdTjhh+1/NnCvfNpG4A= -github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.2/go.mod h1:Vc+snp0Bey4MrrJyiV2tVxxJb6BmLomPvN1RgAvjGaQ= -github.com/DataDog/datadog-agent/pkg/trace v0.50.2 h1:eyjTZx3yupppiND/qwiUj6VuWHfyGfPMrqQwRgE41Rw= -github.com/DataDog/datadog-agent/pkg/trace v0.50.2/go.mod h1:SWNRcgZoBNoiyRrECEEe3xQGNCXfqzZVOB43WxDAMlc= -github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.2 h1:f+dYKVwMoGHZpOQM33Wogb/er8ZXeo4aUcbkSk17lM8= -github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.2/go.mod h1:4DalvbtHzT0nqpbj/36FP0IwfKWCSB5Zap7O/SGfPKI= -github.com/DataDog/datadog-agent/pkg/util/log v0.50.2 h1:D4jzhoZtZikiugOr2pl6Xm+MMfrwkjnZziGHgTNpBLk= -github.com/DataDog/datadog-agent/pkg/util/log v0.50.2/go.mod h1:0vyUsWVWDdIRzd6Itim0ZkjCvOF7V8Yi4IzpE5q/UPo= -github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.2 h1:yq97sYsulZz/qyl/bogRigvUskqXPSrt8c7b+xKDs4I= -github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.2/go.mod h1:eTXti9mx7qhkoi+Qg3mMmvVY5McghUUgsf4Hrk9zY8k= -github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.2 h1:xFGXfIsTyHC0VlrrfoAVaZ1pBAJUh2ARZrS7gcdAooY= -github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.2/go.mod h1:EOGgNrSPskIxY3+KgCl+yEggMjrGqrA2oL5va+/p2jM= +github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.51.1-0.20240301173728-334e775e420a h1:7Wijer1rhN7tsEm6mVjXaYZ2XjmKM8cgJKc0hkr57V8= +github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.51.1-0.20240301173728-334e775e420a/go.mod h1:Vc+snp0Bey4MrrJyiV2tVxxJb6BmLomPvN1RgAvjGaQ= +github.com/DataDog/datadog-agent/pkg/trace v0.51.1-0.20240301173728-334e775e420a h1:6ko5fCAcwToPALbUZiqR2tpjIzzqYR+uVXR7t1khRuE= +github.com/DataDog/datadog-agent/pkg/trace v0.51.1-0.20240301173728-334e775e420a/go.mod h1:qMvCrksIQC0czvZB72YdtVfxAK6/Vq2iPNJT7k6q+Bo= +github.com/DataDog/datadog-agent/pkg/util/cgroups v0.51.1-0.20240301173728-334e775e420a h1:95lqMrZdzqfrxxcLUepiEw2zHv7JCFSQhTr3/z1aKl4= +github.com/DataDog/datadog-agent/pkg/util/cgroups v0.51.1-0.20240301173728-334e775e420a/go.mod h1:m4jQb4BdnVTi7jaSETmJ0dQchgOphmZqPuMuwzjpFeM= +github.com/DataDog/datadog-agent/pkg/util/log v0.51.1-0.20240301173728-334e775e420a h1:IW8buCp4IiU0b1lC7x7W0hHlc+ADwV/hmistYtFogL0= +github.com/DataDog/datadog-agent/pkg/util/log v0.51.1-0.20240301173728-334e775e420a/go.mod h1:KdMEnEsO0dn53y3DLcbInK8NaMWnPgo+MunQsQ4cGF8= +github.com/DataDog/datadog-agent/pkg/util/pointer v0.51.1-0.20240301173728-334e775e420a h1:7FUY9948Nsrdfh1P/F1RkJ/gcUZVbTz9ippSbtl3cxo= +github.com/DataDog/datadog-agent/pkg/util/pointer v0.51.1-0.20240301173728-334e775e420a/go.mod h1:eTXti9mx7qhkoi+Qg3mMmvVY5McghUUgsf4Hrk9zY8k= +github.com/DataDog/datadog-agent/pkg/util/scrubber v0.51.1-0.20240301173728-334e775e420a h1:ENeNLL5ItDcd4400kGP148+IMzMlaIZGRfFLa3GJNdY= +github.com/DataDog/datadog-agent/pkg/util/scrubber v0.51.1-0.20240301173728-334e775e420a/go.mod h1:EOGgNrSPskIxY3+KgCl+yEggMjrGqrA2oL5va+/p2jM= github.com/DataDog/datadog-api-client-go/v2 v2.22.0 h1:+DtWu4PjGxsJU8FESjPi7C2rTDMojNungejsIzNFe70= github.com/DataDog/datadog-api-client-go/v2 v2.22.0/go.mod h1:QKOu6vscsh87fMY1lHfLEmNSunyXImj8BUaUWJXOehc= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/DataDog/datadog-go/v5 v5.1.1 h1:JLZ6s2K1pG2h9GkvEvMdEGqMDyVLEAccdX5TltWcLMU= -github.com/DataDog/datadog-go/v5 v5.1.1/go.mod h1:KhiYb2Badlv9/rofz+OznKoEF5XKTonWyhx5K83AP8E= -github.com/DataDog/go-sqllexer v0.0.8 h1:vfC8R9PhmJfeOKcFYAX9UOd890A3wu3KrjU9Kr7nM0E= -github.com/DataDog/go-sqllexer v0.0.8/go.mod h1:nB4Ea2YNsqMwtbWMc4Fm/oP98IIrSPapqwOwPioMspY= +github.com/DataDog/datadog-go/v5 v5.5.0 h1:G5KHeB8pWBNXT4Jtw0zAkhdxEAWSpWH00geHI6LDrKU= +github.com/DataDog/datadog-go/v5 v5.5.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw= +github.com/DataDog/go-sqllexer v0.0.9 h1:Cx2Cu1S0hfj4coCCA8hzjM9+UNFRkcu1avIV//RU5Qw= +github.com/DataDog/go-sqllexer v0.0.9/go.mod h1:nB4Ea2YNsqMwtbWMc4Fm/oP98IIrSPapqwOwPioMspY= github.com/DataDog/go-tuf v1.0.2-0.5.2 h1:EeZr937eKAWPxJ26IykAdWA4A0jQXJgkhUjqEI/w7+I= github.com/DataDog/go-tuf v1.0.2-0.5.2/go.mod h1:zBcq6f654iVqmkk8n2Cx81E1JnNTMOAx1UEO/wZR+P0= github.com/DataDog/gohai v0.0.0-20230524154621-4316413895ee h1:tXibLZk3G6HncIFJKaNItsdzcrk4YqILNDZlXPTNt4k= github.com/DataDog/gohai v0.0.0-20230524154621-4316413895ee/go.mod h1:nTot/Iy0kW16bXgXr6blEc8gFeAS7vTqYlhAxh+dbc0= -github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.13.3 h1:XEhjylKpZec5tUQyw+fOYYBIEnktiCr/TKsrvFUB7uA= -github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.13.3/go.mod h1:63BBpcn68W2K89ZaLzYtzUiEit49+Rf2ZsEYza2TAcc= -github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.13.3 h1:hnzEiqocvnt6U1QGxfeDFf5xhE77jt4LOjZAXW9ueWo= -github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.13.3/go.mod h1:Tk2wwdBgWeSvDPtrGGyym8CdVWSuphiToGc/tRvFoNQ= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.13.3 h1:hcYZMgGDMUz8Dz6PcOhgk6FF0yG4N7KErS5J3O/MpeU= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.13.3/go.mod h1:Z2FPxYhi8GIFkS4WLC7RrRaGolyB9TqS2RMSwNcmczk= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.13.3 h1:oaYprbAr8/mPEyFNfqnm668bxg8IG000sQ6uNuuffro= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.13.3/go.mod h1:dmNsrdpbegG62b7/ETcRi53OsOmYlfshuTThx9BAiQI= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.13.3 h1:QelZO3ixjVqlqzTa+wxIDFvYnnzy/SG9iqXci1nhouc= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.13.3/go.mod h1:AObll3Cj7UJK56bc7HRrpbGWc98C1Io0ChpFEoxS2f8= -github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.13.3 h1:9fdt/9NeSUtypPT4du2/5TTQic9nL1YqDSIaq5Ttsi4= -github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.13.3/go.mod h1:P8Tr/1BSm0vQ0UXVOtIKmJKXCgb84jdFe9HuBKJPwkc= +github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.13.4 h1:PTIZJAsfnr2XLB3V3duL+mSbZvYV8G3XQ9e57KyOuOA= +github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.13.4/go.mod h1:5yS6i90MEZS3NG+o7PrQQ8i7OaEMzwQvn4bCZ9h9Rao= +github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.13.4 h1:B2R7Wh791uphpltmorbvvdKk0rJOhoExwM4NnE7hXTg= +github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.13.4/go.mod h1:Tk2wwdBgWeSvDPtrGGyym8CdVWSuphiToGc/tRvFoNQ= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.13.4 h1:GcJUxjunnJEL62K+fY7pjyvcb4Cvqr5VtD0DFc8rp+w= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.13.4/go.mod h1:/9yo8Scnf6R0KufxJIHfQD+GAbT9cyINxaTPMDgl2Wk= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.13.4 h1:dU9oPMbAr/wYMNdzhu0pxIhAJOn1Btj1T3ZSyY6RvY0= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.13.4/go.mod h1:ud/Xr5TWUopcaGHdkh9RN8lhnCAFa95X16Rb5mrkE18= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.13.4 h1:ZuYc5Ql/GSyAEMgpKkbQiHOtIHkEpYujITW1wIVFgLE= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.13.4/go.mod h1:YSntkplFoUM1mepnPeJFsoblqD0Wdi+Avg1/d1upgZQ= +github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.13.4 h1:t/Zh8ztLDBOMRMiuVNFthWMMG5F4POgc5M6+Y3DTX9g= +github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.13.4/go.mod h1:JfdBBDreQfbIN5FYrAtZV3VmQMXnf9o4tMbaMxWqe40= github.com/DataDog/sketches-go v1.4.4 h1:dF52vzXRFSPOj2IjXSWLvXq3jubL4CI69kwYjJ1w5Z8= github.com/DataDog/sketches-go v1.4.4/go.mod h1:XR0ns2RtEEF09mDKXiKZiQg+nfZStrq1ZuL1eezeZe0= github.com/DataDog/zstd v1.5.0/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= @@ -222,8 +222,8 @@ github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapp github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.45.0/go.mod h1:qkFPtMouQjW5ugdHIOthiTbweVHUTqbS0Qsu55KqXks= github.com/HdrHistogram/hdrhistogram-go v1.1.2 h1:5IcZpTvzydCQeHzK4Ef/D5rrSqwxob0t8PQPMybUNFM= github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= -github.com/IBM/sarama v1.42.2 h1:VoY4hVIZ+WQJ8G9KNY/SQlWguBQXQ9uvFPOnrcu8hEw= -github.com/IBM/sarama v1.42.2/go.mod h1:FLPGUGwYqEs62hq2bVG6Io2+5n+pS6s/WOXVKWSLFtE= +github.com/IBM/sarama v1.43.0 h1:YFFDn8mMI2QL0wOrG0J2sFoVIAFl7hS9JQi2YZsXtJc= +github.com/IBM/sarama v1.43.0/go.mod h1:zlE6HEbC/SMQ9mhEYaF7nNLYOUyrs0obySKCckWP9BM= 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/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= @@ -331,38 +331,38 @@ github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN github.com/aws/aws-sdk-go v1.32.6/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.38.35/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go v1.44.263/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= -github.com/aws/aws-sdk-go v1.50.17 h1:KsbzUKDgGNlkDHGvoQDhiJ63a9jtZd+O+/s3pTOr/ns= -github.com/aws/aws-sdk-go v1.50.17/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.50.27 h1:96ifhrSuja+AzdP3W/T2337igqVQ2FcSIJYkk+0rCeA= +github.com/aws/aws-sdk-go v1.50.27/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/aws/aws-sdk-go-v2 v1.17.7/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= github.com/aws/aws-sdk-go-v2 v1.18.0/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= -github.com/aws/aws-sdk-go-v2 v1.25.0 h1:sv7+1JVJxOu/dD/sz/csHX7jFqmP001TIY7aytBWDSQ= -github.com/aws/aws-sdk-go-v2 v1.25.0/go.mod h1:G104G1Aho5WqF+SR3mDIobTABQzpYV0WxMsKxlMggOA= +github.com/aws/aws-sdk-go-v2 v1.25.2 h1:/uiG1avJRgLGiQM9X3qJM8+Qa6KRGK5rRPuXE0HUM+w= +github.com/aws/aws-sdk-go-v2 v1.25.2/go.mod h1:Evoc5AsmtveRt1komDwIsjHFyrP5tDuF1D1U+6z6pNo= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10/go.mod h1:VeTZetY5KRJLuD/7fkQXMU6Mw7H5m/KP2J5Iy9osMno= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.0 h1:2UO6/nT1lCZq1LqM67Oa4tdgP1CvL1sLSxvuD+VrOeE= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.0/go.mod h1:5zGj2eA85ClyedTDK+Whsu+w9yimnVIZvhvBKrDquM8= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.1 h1:gTK2uhtAPtFcdRRJilZPx8uJLL2J85xK11nKtWL0wfU= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.1/go.mod h1:sxpLb+nZk7tIfCWChfd+h4QwHNUR57d8hA1cleTkjJo= github.com/aws/aws-sdk-go-v2/config v1.18.19/go.mod h1:XvTmGMY8d52ougvakOv1RpiTLPz9dlG/OQHsKU/cMmY= github.com/aws/aws-sdk-go-v2/config v1.18.25/go.mod h1:dZnYpD5wTW/dQF0rRNLVypB396zWCcPiBIvdvSWHEg4= -github.com/aws/aws-sdk-go-v2/config v1.27.0 h1:J5sdGCAHuWKIXLeXiqr8II/adSvetkx0qdZwdbXXpb0= -github.com/aws/aws-sdk-go-v2/config v1.27.0/go.mod h1:cfh8v69nuSUohNFMbIISP2fhmblGmYEOKs5V53HiHnk= +github.com/aws/aws-sdk-go-v2/config v1.27.4 h1:AhfWb5ZwimdsYTgP7Od8E9L1u4sKmDW2ZVeLcf2O42M= +github.com/aws/aws-sdk-go-v2/config v1.27.4/go.mod h1:zq2FFXK3A416kiukwpsd+rD4ny6JC7QSkp4QdN1Mp2g= github.com/aws/aws-sdk-go-v2/credentials v1.13.18/go.mod h1:vnwlwjIe+3XJPBYKu1et30ZPABG3VaXJYr8ryohpIyM= github.com/aws/aws-sdk-go-v2/credentials v1.13.24/go.mod h1:jYPYi99wUOPIFi0rhiOvXeSEReVOzBqFNOX5bXYoG2o= -github.com/aws/aws-sdk-go-v2/credentials v1.17.0 h1:lMW2x6sKBsiAJrpi1doOXqWFyEPoE886DTb1X0wb7So= -github.com/aws/aws-sdk-go-v2/credentials v1.17.0/go.mod h1:uT41FIH8cCIxOdUYIL0PYyHlL1NoneDuDSCwg5VE/5o= +github.com/aws/aws-sdk-go-v2/credentials v1.17.4 h1:h5Vztbd8qLppiPwX+y0Q6WiwMZgpd9keKe2EAENgAuI= +github.com/aws/aws-sdk-go-v2/credentials v1.17.4/go.mod h1:+30tpwrkOgvkJL1rUZuRLoxcJwtI/OkeBLYnHxJtVe0= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.1/go.mod h1:lfUx8puBRdM5lVVMQlwt2v+ofiG/X6Ms+dy0UkG/kXw= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.3/go.mod h1:4Q0UFP0YJf0NrsEuEYHpM9fTSEVnD16Z3uyEF7J9JGM= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.0 h1:xWCwjjvVz2ojYTP4kBKUuUh9ZrXfcAXpflhOUUeXg1k= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.0/go.mod h1:j3fACuqXg4oMTQOR2yY7m0NmJY0yBK4L4sLsRXq1Ins= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.2 h1:AK0J8iYBFeUk2Ax7O8YpLtFsfhdOByh2QIkHmigpRYk= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.2/go.mod h1:iRlGzMix0SExQEviAyptRWRGdYNo3+ufW/lCzvKVTUc= github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.59 h1:E3Y+OfzOK1+rmRo/K2G0ml8Vs+Xqk0kOnf4nS0kUtBc= github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.59/go.mod h1:1M4PLSBUVfBI0aP+C9XI7SM6kZPCGYyI6izWz0TGprE= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.31/go.mod h1:QT0BqUvX1Bh2ABdTGnjqEjvjzrCfIniM9Sc8zn9Yndo= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.33/go.mod h1:7i0PF1ME/2eUPFcjkVIwq+DOygHEoK92t5cDqNgYbIw= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.0 h1:NPs/EqVO+ajwOoq56EfcGKa3L3ruWuazkIw1BqxwOPw= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.0/go.mod h1:D+duLy2ylgatV+yTlQ8JTuLfDD0BnFvnQRc+o6tbZ4M= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.2 h1:bNo4LagzUKbjdxE0tIcR9pMzLR2U/Tgie1Hq1HQ3iH8= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.2/go.mod h1:wRQv0nN6v9wDXuWThpovGQjqF1HFdcgWjporw14lS8k= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.25/go.mod h1:zBHOPwhBc3FlQjQJE/D3IfPWiWaQmT06Vq9aNukDo0k= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.27/go.mod h1:UrHnn3QV/d0pBZ6QBAEQcqFLf8FAzLmoUfPVIueOvoM= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.0 h1:ks7KGMVUMoDzcxNWUlEdI+/lokMFD136EL6DWmUOV80= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.0/go.mod h1:hL6BWM/d/qz113fVitZjbXR0E+RCTU1+x+1Idyn5NgE= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.2 h1:EtOU5jsPdIQNP+6Q2C5e3d65NKT1PeCiQk+9OdzO12Q= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.2/go.mod h1:tyF5sKccmDz0Bv4NrstEr+/9YkSPJHrcO7UsUKf7pWM= github.com/aws/aws-sdk-go-v2/internal/ini v1.3.32/go.mod h1:XGhIBZDEgfqmFIugclZ6FU7v75nHhBDtzuB4xB/tEi4= github.com/aws/aws-sdk-go-v2/internal/ini v1.3.34/go.mod h1:Etz2dj6UHYuw+Xw830KfzCfWGMzqvUTCjUj5b76GVDc= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 h1:hT8rVHwugYE2lEfdFE0QWVo81lF7jMrYJVDWI+f+VxU= @@ -370,35 +370,35 @@ github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0/go.mod h1:8tu/lYfQfFe6IGnaOdrpV github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.23 h1:DWYZIsyqagnWL00f8M/SOr9fN063OEQWn9LLTbdYXsk= github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.23/go.mod h1:uIiFgURZbACBEQJfqTZPb/jxO7R+9LeoHUFudtIdeQI= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.11/go.mod h1:iV4q2hsqtNECrfmlXyord9u4zyuFEJX9eLgLpSPzWA8= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.0 h1:a33HuFlO0KsveiP90IUJh8Xr/cx9US2PqkSroaLc+o8= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.0/go.mod h1:SxIkWpByiGbhbHYTo9CMTUnx2G4p4ZQMrDPcRRy//1c= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.1 h1:EyBZibRTVAs6ECHZOw5/wlylS9OcTzwyjeQMudmREjE= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.1/go.mod h1:JKpmtYhhPs7D97NL/ltqz7yCkERFW5dOlHyVl66ZYF8= github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.26 h1:CeuSeq/8FnYpPtnuIeLQEEvDv9zUjneuYi8EghMBdwQ= github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.26/go.mod h1:2UqAAwMUXKeRkAHIlDJqvMVgOWkUi/AUXPk/YIe+Dg4= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.25/go.mod h1:/95IA+0lMnzW6XzqYJRpjjsAbKEORVeO0anQqjd2CNU= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.27/go.mod h1:EOwBD4J4S5qYszS5/3DpkejfuK+Z5/1uzICfPaZLtqw= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.0 h1:SHN/umDLTmFTmYfI+gkanz6da3vK8Kvj/5wkqnTHbuA= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.0/go.mod h1:l8gPU5RYGOFHJqWEpPMoRTP0VoaWQSkJdKo+hwWnnDA= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.2 h1:5ffmXjPtwRExp1zc7gENLgCPyHFbhEPwVTkTiH9niSk= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.2/go.mod h1:Ru7vg1iQ7cR4i7SZ/JTLYN9kaXtbL69UdgG0OQWQxW0= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.14.0 h1:e2ooMhpYGhDnBfSvIyusvAwX7KexuZaHbQY2Dyei7VU= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.14.0/go.mod h1:bh2E0CXKZsQN+faiKVqC40vfNMAWheoULBCnEgO9K+8= -github.com/aws/aws-sdk-go-v2/service/kinesis v1.25.0 h1:tUC1pAD2bV/FbEFuTSoxGi8IVds3NL3G7epibWHHIFU= -github.com/aws/aws-sdk-go-v2/service/kinesis v1.25.0/go.mod h1:q9d/nloLNFGbRkDJJTwSFntbsKUgODmg6I0sPFx2ugo= +github.com/aws/aws-sdk-go-v2/service/kinesis v1.27.1 h1:p8dOJ/UKXOwttc1Cxw1Ek52klVmMuiaCUkhsUGxce1I= +github.com/aws/aws-sdk-go-v2/service/kinesis v1.27.1/go.mod h1:VpH1IBG1YYZHPu5qShNt7EGaqUQbHAJZrbDtEpqDvvY= github.com/aws/aws-sdk-go-v2/service/s3 v1.31.0 h1:B1G2pSPvbAtQjilPq+Y7jLIzCOwKzuVEl+aBBaNG0AQ= github.com/aws/aws-sdk-go-v2/service/s3 v1.31.0/go.mod h1:ncltU6n4Nof5uJttDtcNQ537uNuwYqsZZQcpkd2/GUQ= github.com/aws/aws-sdk-go-v2/service/sso v1.12.6/go.mod h1:Y1VOmit/Fn6Tz1uFAeCO6Q7M2fmfXSCLeL5INVYsLuY= github.com/aws/aws-sdk-go-v2/service/sso v1.12.10/go.mod h1:ouy2P4z6sJN70fR3ka3wD3Ro3KezSxU6eKGQI2+2fjI= -github.com/aws/aws-sdk-go-v2/service/sso v1.19.0 h1:u6OkVDxtBPnxPkZ9/63ynEe+8kHbtS5IfaC4PzVxzWM= -github.com/aws/aws-sdk-go-v2/service/sso v1.19.0/go.mod h1:YqbU3RS/pkDVu+v+Nwxvn0i1WB0HkNWEePWbmODEbbs= +github.com/aws/aws-sdk-go-v2/service/sso v1.20.1 h1:utEGkfdQ4L6YW/ietH7111ZYglLJvS+sLriHJ1NBJEQ= +github.com/aws/aws-sdk-go-v2/service/sso v1.20.1/go.mod h1:RsYqzYr2F2oPDdpy+PdhephuZxTfjHQe7SOBcZGoAU8= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.6/go.mod h1:Lh/bc9XUf8CfOY6Jp5aIkQtN+j1mc+nExc+KXj9jx2s= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.10/go.mod h1:AFvkxc8xfBe8XA+5St5XIHHrQQtkxqrRincx4hmMHOk= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.22.0 h1:6DL0qu5+315wbsAEEmzK+P9leRwNbkp+lGjPC+CEvb8= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.22.0/go.mod h1:olUAyg+FaoFaL/zFaeQQONjOZ9HXoxgvI/c7mQTYz7M= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.1 h1:9/GylMS45hGGFCcMrUZDVayQE1jYSIN6da9jo7RAYIw= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.1/go.mod h1:YjAPFn4kGFqKC54VsHs5fn5B6d+PCY2tziEa3U/GB5Y= github.com/aws/aws-sdk-go-v2/service/sts v1.18.7/go.mod h1:JuTnSoeePXmMVe9G8NcjjwgOKEfZ4cOjMuT2IBT/2eI= github.com/aws/aws-sdk-go-v2/service/sts v1.19.0/go.mod h1:BgQOMsg8av8jset59jelyPW7NoZcZXLVpDsXunGDrk8= -github.com/aws/aws-sdk-go-v2/service/sts v1.27.0 h1:cjTRjh700H36MQ8M0LnDn33W3JmwC77mdxIIyPWCdpM= -github.com/aws/aws-sdk-go-v2/service/sts v1.27.0/go.mod h1:nXfOBMWPokIbOY+Gi7a1psWMSvskUCemZzI+SMB7Akc= +github.com/aws/aws-sdk-go-v2/service/sts v1.28.1 h1:3I2cBEYgKhrWlwyZgfpSO2BpaMY1LHPqXYk/QGlu2ew= +github.com/aws/aws-sdk-go-v2/service/sts v1.28.1/go.mod h1:uQ7YYKZt3adCRrdCBREm1CD3efFLOUNH77MrUCvx5oA= github.com/aws/smithy-go v1.13.5/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= -github.com/aws/smithy-go v1.20.0 h1:6+kZsCXZwKxZS9RfISnPc4EXlHoyAkm2hPuM8X2BrrQ= -github.com/aws/smithy-go v1.20.0/go.mod h1:uo5RKksAl4PzhqaAbjd4rLgFoq5koTsQKYuGe7dklGc= +github.com/aws/smithy-go v1.20.1 h1:4SZlSlMr36UEqC7XOyRVb27XMeZubNcBNN+9IgEPIQw= +github.com/aws/smithy-go v1.20.1/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E= github.com/basgys/goxml2json v1.1.0 h1:4ln5i4rseYfXNd86lGEB+Vi652IsIXIvggKM/BhUKVw= github.com/basgys/goxml2json v1.1.0/go.mod h1:wH7a5Np/Q4QoECFIU8zTQlZwZkrilY0itPfecMw41Dw= github.com/beefsack/go-rate v0.0.0-20220214233405-116f4ca011a0/go.mod h1:6YNgTHLutezwnBvyneBbwvB8C82y3dcoOj5EQJIdGXA= @@ -547,8 +547,8 @@ github.com/dvsekhvalnov/jose2go v1.6.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB github.com/dynatrace-oss/dynatrace-metric-utils-go v0.5.0 h1:wHGPJSXvwKQVf/XfhjUPyrhpcPKWNy8F3ikH+eiwoBg= github.com/dynatrace-oss/dynatrace-metric-utils-go v0.5.0/go.mod h1:PseHFo8Leko7J4A/TfZ6kkHdkzKBLUta6hRZR/OEbbc= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= -github.com/eapache/go-resiliency v1.5.0 h1:dRsaR00whmQD+SgVKlq/vCRFNgtEb5yppyeVos3Yce0= -github.com/eapache/go-resiliency v1.5.0/go.mod h1:5yPzW0MIvSe0JDsv0v+DvcjEv2FyD6iZYSs1ZI+iQho= +github.com/eapache/go-resiliency v1.6.0 h1:CqGDTLtpwuWKn6Nj3uNUdflaq+/kIPsg0gfNzHton30= +github.com/eapache/go-resiliency v1.6.0/go.mod h1:5yPzW0MIvSe0JDsv0v+DvcjEv2FyD6iZYSs1ZI+iQho= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 h1:Oy0F4ALJ04o5Qqpdz8XLIpNA3WM/iSIXqxtqo7UGVws= github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3/go.mod h1:YvSRo5mw33fLEx1+DlK6L2VV43tJt5Eyel9n9XBcR+0= @@ -1077,8 +1077,8 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.10.8/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.17.6 h1:60eq2E/jlfwQXtvZEeBUYADs+BwKBWURIY+Gj2eRGjI= -github.com/klauspost/compress v1.17.6/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLAKQQg= +github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= @@ -1173,8 +1173,8 @@ github.com/maxatome/go-testdeep v1.12.0 h1:Ql7Go8Tg0C1D/uMMX59LAoYK7LffeJQ6X2T04 github.com/maxatome/go-testdeep v1.12.0/go.mod h1:lPZc/HAcJMP92l7yI6TRz1aZN5URwUBUAfUNvrclaNM= github.com/microsoft/ApplicationInsights-Go v0.4.4 h1:G4+H9WNs6ygSCe6sUyxRc2U81TI5Es90b2t/MwX5KqY= github.com/microsoft/ApplicationInsights-Go v0.4.4/go.mod h1:fKRUseBqkw6bDiXTs3ESTiU/4YTIHsQS4W3fP2ieF4U= -github.com/microsoft/go-mssqldb v1.6.0 h1:mM3gYdVwEPFrlg/Dvr2DNVEgYFG7L42l+dGc67NNNpc= -github.com/microsoft/go-mssqldb v1.6.0/go.mod h1:00mDtPbeQCRGC1HwOOR5K/gr30P1NcEG0vx6Kbv2aJU= +github.com/microsoft/go-mssqldb v1.7.0 h1:sgMPW0HA6Ihd37Yx0MzHyKD726C2kY/8KJsQtXHNaAs= +github.com/microsoft/go-mssqldb v1.7.0/go.mod h1:kOvZKUdrhhFQmxLZqbwUV0rHkNkZpthMITIb2Ko1IoA= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= @@ -1376,8 +1376,8 @@ github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3O github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= -github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= +github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= +github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -1394,8 +1394,8 @@ github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB8 github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.29.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.31.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.46.0 h1:doXzt5ybi1HBKpsZOL0sSkaNHJJqkyfEWZGGqqScV0Y= -github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1BTn+g2pa/hQ= +github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE= +github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= github.com/prometheus/common/sigv4 v0.1.0 h1:qoVebwtwwEhS85Czm2dSROY5fTo2PAPEVdDeppTwGX4= github.com/prometheus/common/sigv4 v0.1.0/go.mod h1:2Jkxxk9yYvCkE5G1sQT7GuEXm57JrvHu9k5YwTjsNtI= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= @@ -1478,8 +1478,8 @@ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVs github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/assertions v1.1.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/snowflakedb/gosnowflake v1.7.2 h1:HRSwva8YXC64WUppfmHcMNVVzSE1+EwXXaJxgS0EkTo= -github.com/snowflakedb/gosnowflake v1.7.2/go.mod h1:03tW856vc3ceM4rJuj7KO4dzqN7qoezTm+xw7aPIIFo= +github.com/snowflakedb/gosnowflake v1.8.0 h1:4bQj8eAYGMkou/nICiIEb9jSbBLDDp5cB6JaKx9WwiA= +github.com/snowflakedb/gosnowflake v1.8.0/go.mod h1:7yyY2MxtDti2eXgtvlZ8QxzCN6KV2B4qb1HuygMI+0U= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js= github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= @@ -1623,8 +1623,8 @@ github.com/zorkian/go-datadog-api v2.30.0+incompatible/go.mod h1:PkXwHX9CUQa/FpB go.einride.tech/aip v0.66.0 h1:XfV+NQX6L7EOYK11yoHHFtndeaWh3KbD9/cN/6iWEt8= go.einride.tech/aip v0.66.0/go.mod h1:qAhMsfT7plxBX+Oy7Huol6YUvZ0ZzdUz26yZsQwfl1M= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA= -go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= +go.etcd.io/bbolt v1.3.9 h1:8x7aARPEXiXbHmtUwAIv7eV2fQFHrLLavdiJ3uzJXoI= +go.etcd.io/bbolt v1.3.9/go.mod h1:zaO32+Ti0PK1ivdPtgMESzuzL2VPoIG1PCQNvOdo/dE= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= @@ -1632,8 +1632,8 @@ go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsX go.mongodb.org/atlas v0.36.0 h1:m05S3AO7zkl+bcG1qaNsEKBnAqnKx2FDwLooHpIG3j4= go.mongodb.org/atlas v0.36.0/go.mod h1:nfPldE9dSama6G2IbIzmEza02Ly7yFZjMMVscaM0uEc= go.mongodb.org/mongo-driver v1.11.4/go.mod h1:PTSz5yu21bkT/wXpkS7WR5f0ddqw5quethTUn9WM+2g= -go.mongodb.org/mongo-driver v1.13.1 h1:YIc7HTYsKndGK4RFzJ3covLz1byri52x0IoMB0Pt/vk= -go.mongodb.org/mongo-driver v1.13.1/go.mod h1:wcDf1JBCXy2mOW0bWHwO/IOYqdca1MPCwDtFu/Z9+eo= +go.mongodb.org/mongo-driver v1.14.0 h1:P98w8egYRjYe3XDjxhYJagTokP/H6HzlsnojRgZRd80= +go.mongodb.org/mongo-driver v1.14.0/go.mod h1:Vzb0Mk/pa7e6cWw85R4F/endUC3u0U9jGcNU603k65c= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= @@ -1788,8 +1788,8 @@ go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -1816,8 +1816,8 @@ golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= -golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +golang.org/x/crypto v0.20.0 h1:jmAMJJZXr5KiCw05dfYK9QnqaqKLYXijU23lsEdcQqg= +golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZPQ= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= diff --git a/cmd/oteltestbedcol/go.mod b/cmd/oteltestbedcol/go.mod index 8670697eb28e..bd600866c822 100644 --- a/cmd/oteltestbedcol/go.mod +++ b/cmd/oteltestbedcol/go.mod @@ -142,7 +142,7 @@ require ( github.com/josharian/intern v1.0.0 // indirect github.com/jpillora/backoff v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.17.6 // indirect + github.com/klauspost/compress v1.17.7 // 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.0 // indirect @@ -191,9 +191,9 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect - github.com/prometheus/client_golang v1.18.0 // indirect + github.com/prometheus/client_golang v1.19.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect - github.com/prometheus/common v0.46.0 // indirect + github.com/prometheus/common v0.48.0 // indirect github.com/prometheus/common/sigv4 v0.1.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/prometheus/prometheus v0.48.1 // indirect @@ -212,7 +212,7 @@ require ( github.com/valyala/fastjson v1.6.4 // indirect github.com/vultr/govultr/v2 v2.17.2 // indirect github.com/yusufpapurcu/wmi v1.2.3 // indirect - go.etcd.io/bbolt v1.3.8 // indirect + go.etcd.io/bbolt v1.3.9 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/collector v0.95.0 // indirect go.opentelemetry.io/collector/config/configauth v0.95.0 // indirect @@ -260,7 +260,7 @@ require ( go.opentelemetry.io/proto/otlp v1.1.0 // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.26.0 // indirect + go.uber.org/zap v1.27.0 // indirect golang.org/x/crypto v0.19.0 // indirect golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc // indirect golang.org/x/mod v0.14.0 // indirect diff --git a/cmd/oteltestbedcol/go.sum b/cmd/oteltestbedcol/go.sum index b58db5f3ccfd..d4b73cd5a4b7 100644 --- a/cmd/oteltestbedcol/go.sum +++ b/cmd/oteltestbedcol/go.sum @@ -424,8 +424,8 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= 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.6 h1:60eq2E/jlfwQXtvZEeBUYADs+BwKBWURIY+Gj2eRGjI= -github.com/klauspost/compress v1.17.6/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLAKQQg= +github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= @@ -559,8 +559,8 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= -github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= +github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= +github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -572,8 +572,8 @@ github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8b github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.29.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.46.0 h1:doXzt5ybi1HBKpsZOL0sSkaNHJJqkyfEWZGGqqScV0Y= -github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1BTn+g2pa/hQ= +github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE= +github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= github.com/prometheus/common/sigv4 v0.1.0 h1:qoVebwtwwEhS85Czm2dSROY5fTo2PAPEVdDeppTwGX4= github.com/prometheus/common/sigv4 v0.1.0/go.mod h1:2Jkxxk9yYvCkE5G1sQT7GuEXm57JrvHu9k5YwTjsNtI= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= @@ -678,8 +678,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.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw= github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= -go.etcd.io/bbolt v1.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA= -go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= +go.etcd.io/bbolt v1.3.9 h1:8x7aARPEXiXbHmtUwAIv7eV2fQFHrLLavdiJ3uzJXoI= +go.etcd.io/bbolt v1.3.9/go.mod h1:zaO32+Ti0PK1ivdPtgMESzuzL2VPoIG1PCQNvOdo/dE= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -811,8 +811,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= diff --git a/cmd/telemetrygen/README.md b/cmd/telemetrygen/README.md index 58d2b8d5a8d0..272a286f5868 100644 --- a/cmd/telemetrygen/README.md +++ b/cmd/telemetrygen/README.md @@ -3,13 +3,13 @@ | Status | | | ------------- |-----------| -| Stability | [alpha]: traces | -| | [development]: metrics, logs | +| 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) | -[alpha]: https://github.com/open-telemetry/opentelemetry-collector#alpha [development]: https://github.com/open-telemetry/opentelemetry-collector#development +[alpha]: https://github.com/open-telemetry/opentelemetry-collector#alpha This utility simulates a client generating **traces**, **metrics**, and **logs**. It is useful for testing and demonstration purposes. diff --git a/cmd/telemetrygen/go.mod b/cmd/telemetrygen/go.mod index 5194ed24766a..c2722f88a7f0 100644 --- a/cmd/telemetrygen/go.mod +++ b/cmd/telemetrygen/go.mod @@ -20,7 +20,7 @@ require ( go.opentelemetry.io/otel/sdk/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 golang.org/x/time v0.5.0 google.golang.org/grpc v1.61.0 ) diff --git a/cmd/telemetrygen/go.sum b/cmd/telemetrygen/go.sum index 529942c9c36d..b26025035571 100644 --- a/cmd/telemetrygen/go.sum +++ b/cmd/telemetrygen/go.sum @@ -137,8 +137,8 @@ go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9i 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.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/cmd/telemetrygen/internal/e2etest/go.mod b/cmd/telemetrygen/internal/e2etest/go.mod index 0cfd5951308a..a5e2b5f89cac 100644 --- a/cmd/telemetrygen/internal/e2etest/go.mod +++ b/cmd/telemetrygen/internal/e2etest/go.mod @@ -3,7 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/cmd/telemetryge go 1.21 require ( - github.com/open-telemetry/opentelemetry-collector-contrib/cmd/telemetrygen v0.94.0 + github.com/open-telemetry/opentelemetry-collector-contrib/cmd/telemetrygen v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.94.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.95.0 @@ -75,7 +75,7 @@ require ( go.opentelemetry.io/otel/trace v1.23.1 // indirect go.opentelemetry.io/proto/otlp v1.1.0 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.26.0 // indirect + go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.21.0 // indirect golang.org/x/sys v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/cmd/telemetrygen/internal/e2etest/go.sum b/cmd/telemetrygen/internal/e2etest/go.sum index 12b74782256a..82e8ef1fb726 100644 --- a/cmd/telemetrygen/internal/e2etest/go.sum +++ b/cmd/telemetrygen/internal/e2etest/go.sum @@ -200,8 +200,8 @@ go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9i 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.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/cmd/telemetrygen/internal/traces/traces.go b/cmd/telemetrygen/internal/traces/traces.go index 5f3529253cf1..02817577b915 100644 --- a/cmd/telemetrygen/internal/traces/traces.go +++ b/cmd/telemetrygen/internal/traces/traces.go @@ -73,7 +73,7 @@ func Start(cfg *Config) error { defer func() { logger.Info("stop the batch span processor") if tempError := ssp.Shutdown(context.Background()); tempError != nil { - logger.Error("failed to stop the batch span processor", zap.Error(err)) + logger.Error("failed to stop the batch span processor", zap.Error(tempError)) } }() } diff --git a/confmap/provider/s3provider/go.mod b/confmap/provider/s3provider/go.mod index 6b634458d632..51fb441ae9ab 100644 --- a/confmap/provider/s3provider/go.mod +++ b/confmap/provider/s3provider/go.mod @@ -3,9 +3,9 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/confmap/provide go 1.21 require ( - github.com/aws/aws-sdk-go-v2 v1.25.0 - github.com/aws/aws-sdk-go-v2/config v1.27.0 - github.com/aws/aws-sdk-go-v2/service/s3 v1.49.0 + github.com/aws/aws-sdk-go-v2 v1.25.2 + github.com/aws/aws-sdk-go-v2/config v1.27.4 + github.com/aws/aws-sdk-go-v2/service/s3 v1.51.1 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/confmap v0.95.0 go.uber.org/goleak v1.3.0 @@ -13,21 +13,21 @@ require ( ) require ( - github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.0 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.17.0 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.0 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.0 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.0 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.1 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.17.4 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.2 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.2 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.2 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.0 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.0 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.0 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.0 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.0 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.19.0 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.22.0 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.27.0 // indirect - github.com/aws/smithy-go v1.20.0 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.2 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.1 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.2 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.2 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.2 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.20.1 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.1 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.28.1 // indirect + github.com/aws/smithy-go v1.20.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect diff --git a/confmap/provider/s3provider/go.sum b/confmap/provider/s3provider/go.sum index 293df4bb314c..c9da9e1ca2d0 100644 --- a/confmap/provider/s3provider/go.sum +++ b/confmap/provider/s3provider/go.sum @@ -1,39 +1,39 @@ -github.com/aws/aws-sdk-go-v2 v1.25.0 h1:sv7+1JVJxOu/dD/sz/csHX7jFqmP001TIY7aytBWDSQ= -github.com/aws/aws-sdk-go-v2 v1.25.0/go.mod h1:G104G1Aho5WqF+SR3mDIobTABQzpYV0WxMsKxlMggOA= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.0 h1:2UO6/nT1lCZq1LqM67Oa4tdgP1CvL1sLSxvuD+VrOeE= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.0/go.mod h1:5zGj2eA85ClyedTDK+Whsu+w9yimnVIZvhvBKrDquM8= -github.com/aws/aws-sdk-go-v2/config v1.27.0 h1:J5sdGCAHuWKIXLeXiqr8II/adSvetkx0qdZwdbXXpb0= -github.com/aws/aws-sdk-go-v2/config v1.27.0/go.mod h1:cfh8v69nuSUohNFMbIISP2fhmblGmYEOKs5V53HiHnk= -github.com/aws/aws-sdk-go-v2/credentials v1.17.0 h1:lMW2x6sKBsiAJrpi1doOXqWFyEPoE886DTb1X0wb7So= -github.com/aws/aws-sdk-go-v2/credentials v1.17.0/go.mod h1:uT41FIH8cCIxOdUYIL0PYyHlL1NoneDuDSCwg5VE/5o= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.0 h1:xWCwjjvVz2ojYTP4kBKUuUh9ZrXfcAXpflhOUUeXg1k= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.0/go.mod h1:j3fACuqXg4oMTQOR2yY7m0NmJY0yBK4L4sLsRXq1Ins= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.0 h1:NPs/EqVO+ajwOoq56EfcGKa3L3ruWuazkIw1BqxwOPw= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.0/go.mod h1:D+duLy2ylgatV+yTlQ8JTuLfDD0BnFvnQRc+o6tbZ4M= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.0 h1:ks7KGMVUMoDzcxNWUlEdI+/lokMFD136EL6DWmUOV80= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.0/go.mod h1:hL6BWM/d/qz113fVitZjbXR0E+RCTU1+x+1Idyn5NgE= +github.com/aws/aws-sdk-go-v2 v1.25.2 h1:/uiG1avJRgLGiQM9X3qJM8+Qa6KRGK5rRPuXE0HUM+w= +github.com/aws/aws-sdk-go-v2 v1.25.2/go.mod h1:Evoc5AsmtveRt1komDwIsjHFyrP5tDuF1D1U+6z6pNo= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.1 h1:gTK2uhtAPtFcdRRJilZPx8uJLL2J85xK11nKtWL0wfU= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.1/go.mod h1:sxpLb+nZk7tIfCWChfd+h4QwHNUR57d8hA1cleTkjJo= +github.com/aws/aws-sdk-go-v2/config v1.27.4 h1:AhfWb5ZwimdsYTgP7Od8E9L1u4sKmDW2ZVeLcf2O42M= +github.com/aws/aws-sdk-go-v2/config v1.27.4/go.mod h1:zq2FFXK3A416kiukwpsd+rD4ny6JC7QSkp4QdN1Mp2g= +github.com/aws/aws-sdk-go-v2/credentials v1.17.4 h1:h5Vztbd8qLppiPwX+y0Q6WiwMZgpd9keKe2EAENgAuI= +github.com/aws/aws-sdk-go-v2/credentials v1.17.4/go.mod h1:+30tpwrkOgvkJL1rUZuRLoxcJwtI/OkeBLYnHxJtVe0= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.2 h1:AK0J8iYBFeUk2Ax7O8YpLtFsfhdOByh2QIkHmigpRYk= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.2/go.mod h1:iRlGzMix0SExQEviAyptRWRGdYNo3+ufW/lCzvKVTUc= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.2 h1:bNo4LagzUKbjdxE0tIcR9pMzLR2U/Tgie1Hq1HQ3iH8= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.2/go.mod h1:wRQv0nN6v9wDXuWThpovGQjqF1HFdcgWjporw14lS8k= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.2 h1:EtOU5jsPdIQNP+6Q2C5e3d65NKT1PeCiQk+9OdzO12Q= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.2/go.mod h1:tyF5sKccmDz0Bv4NrstEr+/9YkSPJHrcO7UsUKf7pWM= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 h1:hT8rVHwugYE2lEfdFE0QWVo81lF7jMrYJVDWI+f+VxU= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0/go.mod h1:8tu/lYfQfFe6IGnaOdrpVgEL2IrrDOf6/m9RQum4NkY= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.0 h1:TkbRExyKSVHELwG9gz2+gql37jjec2R5vus9faTomwE= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.0/go.mod h1:T3/9xMKudHhnj8it5EqIrhvv11tVZqWYkKcot+BFStc= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.0 h1:a33HuFlO0KsveiP90IUJh8Xr/cx9US2PqkSroaLc+o8= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.0/go.mod h1:SxIkWpByiGbhbHYTo9CMTUnx2G4p4ZQMrDPcRRy//1c= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.0 h1:UiSyK6ent6OKpkMJN3+k5HZ4sk4UfchEaaW5wv7SblQ= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.0/go.mod h1:l7kzl8n8DXoRyFz5cIMG70HnPauWa649TUhgw8Rq6lo= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.0 h1:SHN/umDLTmFTmYfI+gkanz6da3vK8Kvj/5wkqnTHbuA= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.0/go.mod h1:l8gPU5RYGOFHJqWEpPMoRTP0VoaWQSkJdKo+hwWnnDA= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.0 h1:l5puwOHr7IxECuPMIuZG7UKOzAnF24v6t4l+Z5Moay4= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.0/go.mod h1:Oov79flWa/n7Ni+lQC3z+VM7PoRM47omRqbJU9B5Y7E= -github.com/aws/aws-sdk-go-v2/service/s3 v1.49.0 h1:VfU15izXQjz4m9y1DkbY79iylIiuPwWtrram4cSpWEI= -github.com/aws/aws-sdk-go-v2/service/s3 v1.49.0/go.mod h1:1o/W6JFUuREj2ExoQ21vHJgO7wakvjhol91M9eknFgs= -github.com/aws/aws-sdk-go-v2/service/sso v1.19.0 h1:u6OkVDxtBPnxPkZ9/63ynEe+8kHbtS5IfaC4PzVxzWM= -github.com/aws/aws-sdk-go-v2/service/sso v1.19.0/go.mod h1:YqbU3RS/pkDVu+v+Nwxvn0i1WB0HkNWEePWbmODEbbs= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.22.0 h1:6DL0qu5+315wbsAEEmzK+P9leRwNbkp+lGjPC+CEvb8= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.22.0/go.mod h1:olUAyg+FaoFaL/zFaeQQONjOZ9HXoxgvI/c7mQTYz7M= -github.com/aws/aws-sdk-go-v2/service/sts v1.27.0 h1:cjTRjh700H36MQ8M0LnDn33W3JmwC77mdxIIyPWCdpM= -github.com/aws/aws-sdk-go-v2/service/sts v1.27.0/go.mod h1:nXfOBMWPokIbOY+Gi7a1psWMSvskUCemZzI+SMB7Akc= -github.com/aws/smithy-go v1.20.0 h1:6+kZsCXZwKxZS9RfISnPc4EXlHoyAkm2hPuM8X2BrrQ= -github.com/aws/smithy-go v1.20.0/go.mod h1:uo5RKksAl4PzhqaAbjd4rLgFoq5koTsQKYuGe7dklGc= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.2 h1:en92G0Z7xlksoOylkUhuBSfJgijC7rHVLRdnIlHEs0E= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.2/go.mod h1:HgtQ/wN5G+8QSlK62lbOtNwQ3wTSByJ4wH2rCkPt+AE= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.1 h1:EyBZibRTVAs6ECHZOw5/wlylS9OcTzwyjeQMudmREjE= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.1/go.mod h1:JKpmtYhhPs7D97NL/ltqz7yCkERFW5dOlHyVl66ZYF8= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.2 h1:zSdTXYLwuXDNPUS+V41i1SFDXG7V0ITp0D9UT9Cvl18= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.2/go.mod h1:v8m8k+qVy95nYi7d56uP1QImleIIY25BPiNJYzPBdFE= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.2 h1:5ffmXjPtwRExp1zc7gENLgCPyHFbhEPwVTkTiH9niSk= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.2/go.mod h1:Ru7vg1iQ7cR4i7SZ/JTLYN9kaXtbL69UdgG0OQWQxW0= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.2 h1:1oY1AVEisRI4HNuFoLdRUB0hC63ylDAN6Me3MrfclEg= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.2/go.mod h1:KZ03VgvZwSjkT7fOetQ/wF3MZUvYFirlI1H5NklUNsY= +github.com/aws/aws-sdk-go-v2/service/s3 v1.51.1 h1:juZ+uGargZOrQGNxkVHr9HHR/0N+Yu8uekQnV7EAVRs= +github.com/aws/aws-sdk-go-v2/service/s3 v1.51.1/go.mod h1:SoR0c7Jnq8Tpmt0KSLXIavhjmaagRqQpe9r70W3POJg= +github.com/aws/aws-sdk-go-v2/service/sso v1.20.1 h1:utEGkfdQ4L6YW/ietH7111ZYglLJvS+sLriHJ1NBJEQ= +github.com/aws/aws-sdk-go-v2/service/sso v1.20.1/go.mod h1:RsYqzYr2F2oPDdpy+PdhephuZxTfjHQe7SOBcZGoAU8= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.1 h1:9/GylMS45hGGFCcMrUZDVayQE1jYSIN6da9jo7RAYIw= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.1/go.mod h1:YjAPFn4kGFqKC54VsHs5fn5B6d+PCY2tziEa3U/GB5Y= +github.com/aws/aws-sdk-go-v2/service/sts v1.28.1 h1:3I2cBEYgKhrWlwyZgfpSO2BpaMY1LHPqXYk/QGlu2ew= +github.com/aws/aws-sdk-go-v2/service/sts v1.28.1/go.mod h1:uQ7YYKZt3adCRrdCBREm1CD3efFLOUNH77MrUCvx5oA= +github.com/aws/smithy-go v1.20.1 h1:4SZlSlMr36UEqC7XOyRVb27XMeZubNcBNN+9IgEPIQw= +github.com/aws/smithy-go v1.20.1/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c= diff --git a/confmap/provider/secretsmanagerprovider/go.mod b/confmap/provider/secretsmanagerprovider/go.mod index 0253a7a80337..82824ff24856 100644 --- a/confmap/provider/secretsmanagerprovider/go.mod +++ b/confmap/provider/secretsmanagerprovider/go.mod @@ -2,19 +2,17 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/confmap/provide go 1.21 -toolchain go1.21.6 - require ( - github.com/aws/aws-sdk-go-v2 v1.21.1 - github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.21.4 - github.com/aws/smithy-go v1.15.0 + github.com/aws/aws-sdk-go-v2 v1.25.2 + github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.28.1 + github.com/aws/smithy-go v1.20.1 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/confmap v0.95.0 ) require ( - github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.42 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.36 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.2 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.2 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect github.com/knadh/koanf v1.5.0 // indirect diff --git a/confmap/provider/secretsmanagerprovider/go.sum b/confmap/provider/secretsmanagerprovider/go.sum index 896d76b344e7..d598d5d088ef 100644 --- a/confmap/provider/secretsmanagerprovider/go.sum +++ b/confmap/provider/secretsmanagerprovider/go.sum @@ -12,25 +12,25 @@ github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmV 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/aws/aws-sdk-go-v2 v1.9.2/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= -github.com/aws/aws-sdk-go-v2 v1.21.1 h1:wjHYshtPpYOZm+/mu3NhVgRRc0baM6LJZOmxPZ5Cwzs= -github.com/aws/aws-sdk-go-v2 v1.21.1/go.mod h1:ErQhvNuEMhJjweavOYhxVkn2RUx7kQXVATHrjKtxIpM= +github.com/aws/aws-sdk-go-v2 v1.25.2 h1:/uiG1avJRgLGiQM9X3qJM8+Qa6KRGK5rRPuXE0HUM+w= +github.com/aws/aws-sdk-go-v2 v1.25.2/go.mod h1:Evoc5AsmtveRt1komDwIsjHFyrP5tDuF1D1U+6z6pNo= github.com/aws/aws-sdk-go-v2/config v1.8.3/go.mod h1:4AEiLtAb8kLs7vgw2ZV3p2VZ1+hBavOc84hqxVNpCyw= github.com/aws/aws-sdk-go-v2/credentials v1.4.3/go.mod h1:FNNC6nQZQUuyhq5aE5c7ata8o9e4ECGmS4lAXC7o1mQ= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.6.0/go.mod h1:gqlclDEZp4aqJOancXK6TN24aKhT0W0Ae9MHk3wzTMM= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.42 h1:817VqVe6wvwE46xXy6YF5RywvjOX6U2zRQQ6IbQFK0s= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.42/go.mod h1:oDfgXoBBmj+kXnqxDDnIDnC56QBosglKp8ftRCTxR+0= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.36 h1:7ZApaXzWbo8slc+W5TynuUlB4z66g44h7uqa3/d/BsY= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.36/go.mod h1:rwr4WnmFi3RJO0M4dxbJtgi9BPLMpVBMX1nUte5ha9U= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.2 h1:bNo4LagzUKbjdxE0tIcR9pMzLR2U/Tgie1Hq1HQ3iH8= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.2/go.mod h1:wRQv0nN6v9wDXuWThpovGQjqF1HFdcgWjporw14lS8k= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.2 h1:EtOU5jsPdIQNP+6Q2C5e3d65NKT1PeCiQk+9OdzO12Q= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.2/go.mod h1:tyF5sKccmDz0Bv4NrstEr+/9YkSPJHrcO7UsUKf7pWM= github.com/aws/aws-sdk-go-v2/internal/ini v1.2.4/go.mod h1:ZcBrrI3zBKlhGFNYWvju0I3TR93I7YIgAfy82Fh4lcQ= github.com/aws/aws-sdk-go-v2/service/appconfig v1.4.2/go.mod h1:FZ3HkCe+b10uFZZkFdvf98LHW21k49W8o8J366lqVKY= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.3.2/go.mod h1:72HRZDLMtmVQiLG2tLfQcaWLCssELvGl+Zf2WVxMmR8= -github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.21.4 h1:LUtjmUxYPkiFkiVyvLmHVcuthVPnEKd0hEprTOVRTS0= -github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.21.4/go.mod h1:Bph0xA97xjEciochtR3JKrgGHt1psILMtFgu3KAbiBE= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.28.1 h1:DtKw4TxZT3VrzYupXQJPBqT9ImyobZZE+JIQPPAVxqs= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.28.1/go.mod h1:bit9G2ORpSjUTr4PA4usvbBfbOyvMj0LbE1dXF14Sug= github.com/aws/aws-sdk-go-v2/service/sso v1.4.2/go.mod h1:NBvT9R1MEF+Ud6ApJKM0G+IkPchKS7p7c2YPKwHmBOk= github.com/aws/aws-sdk-go-v2/service/sts v1.7.2/go.mod h1:8EzeIqfWt2wWT4rJVu3f21TfrhJ8AEMzVybRNSb/b4g= github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= -github.com/aws/smithy-go v1.15.0 h1:PS/durmlzvAFpQHDs4wi4sNNP9ExsqZh6IlfdHXgKK8= -github.com/aws/smithy-go v1.15.0/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= +github.com/aws/smithy-go v1.20.1 h1:4SZlSlMr36UEqC7XOyRVb27XMeZubNcBNN+9IgEPIQw= +github.com/aws/smithy-go v1.20.1/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E= 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/connector/countconnector/generated_component_test.go b/connector/countconnector/generated_component_test.go index 4ecfd930fc5d..cab0dfd4d829 100644 --- a/connector/countconnector/generated_component_test.go +++ b/connector/countconnector/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/connector" "go.opentelemetry.io/collector/connector/connectortest" "go.opentelemetry.io/collector/consumer/consumertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -69,9 +59,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstConnector, err := test.createFn(context.Background(), connectortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/connector/countconnector/go.mod b/connector/countconnector/go.mod index df07f3149cca..44f746373aa0 100644 --- a/connector/countconnector/go.mod +++ b/connector/countconnector/go.mod @@ -17,7 +17,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/connector/countconnector/go.sum b/connector/countconnector/go.sum index 2abcda7183e0..1fa5b8cff35a 100644 --- a/connector/countconnector/go.sum +++ b/connector/countconnector/go.sum @@ -110,8 +110,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/connector/datadogconnector/connector.go b/connector/datadogconnector/connector.go index 51df15427d6f..27b26f46405a 100644 --- a/connector/datadogconnector/connector.go +++ b/connector/datadogconnector/connector.go @@ -9,6 +9,8 @@ import ( pb "github.com/DataDog/datadog-agent/pkg/proto/pbgo/trace" traceconfig "github.com/DataDog/datadog-agent/pkg/trace/config" + "github.com/DataDog/datadog-agent/pkg/trace/timing" + "github.com/DataDog/datadog-go/v5/statsd" "github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes" "github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics" "go.opentelemetry.io/collector/component" @@ -45,7 +47,7 @@ type traceToMetricConnector struct { var _ component.Component = (*traceToMetricConnector)(nil) // testing that the connectorImp properly implements the type Component interface // function to create a new connector -func newTraceToMetricConnector(set component.TelemetrySettings, cfg component.Config, metricsConsumer consumer.Metrics) (*traceToMetricConnector, error) { +func newTraceToMetricConnector(set component.TelemetrySettings, cfg component.Config, metricsConsumer consumer.Metrics, metricsClient statsd.ClientInterface, timingReporter timing.Reporter) (*traceToMetricConnector, error) { set.Logger.Info("Building datadog connector for traces to metrics") in := make(chan *pb.StatsPayload, 100) set.MeterProvider = noop.NewMeterProvider() // disable metrics for the connector @@ -61,7 +63,7 @@ func newTraceToMetricConnector(set component.TelemetrySettings, cfg component.Co ctx := context.Background() return &traceToMetricConnector{ logger: set.Logger, - agent: datadog.NewAgentWithConfig(ctx, getTraceAgentCfg(cfg.(*Config).Traces), in), + agent: datadog.NewAgentWithConfig(ctx, getTraceAgentCfg(cfg.(*Config).Traces, attributesTranslator), in, metricsClient, timingReporter), translator: trans, in: in, metricsConsumer: metricsConsumer, @@ -69,8 +71,9 @@ func newTraceToMetricConnector(set component.TelemetrySettings, cfg component.Co }, nil } -func getTraceAgentCfg(cfg TracesConfig) *traceconfig.AgentConfig { +func getTraceAgentCfg(cfg TracesConfig, attributesTranslator *attributes.Translator) *traceconfig.AgentConfig { acfg := traceconfig.New() + acfg.OTLPReceiver.AttributesTranslator = attributesTranslator acfg.OTLPReceiver.SpanNameRemappings = cfg.SpanNameRemappings acfg.OTLPReceiver.SpanNameAsResourceName = cfg.SpanNameAsResourceName acfg.Ignore["resource"] = cfg.IgnoreResources @@ -125,15 +128,11 @@ func (c *traceToMetricConnector) run() { } var mx pmetric.Metrics var err error - if datadog.ConnectorPerformanceFeatureGate.IsEnabled() { - c.logger.Debug("Received stats payload", zap.Any("stats", stats)) - mx, err = c.translator.StatsToMetrics(stats) - if err != nil { - c.logger.Error("Failed to convert stats to metrics", zap.Error(err)) - continue - } - } else { - mx = c.translator.StatsPayloadToMetrics(stats) + c.logger.Debug("Received stats payload", zap.Any("stats", stats)) + mx, err = c.translator.StatsToMetrics(stats) + if err != nil { + c.logger.Error("Failed to convert stats to metrics", zap.Error(err)) + continue } // APM stats as metrics ctx := context.TODO() diff --git a/connector/datadogconnector/factory.go b/connector/datadogconnector/factory.go index 1df91c245108..d91db0f1a38b 100644 --- a/connector/datadogconnector/factory.go +++ b/connector/datadogconnector/factory.go @@ -8,6 +8,7 @@ package datadogconnector // import "github.com/open-telemetry/opentelemetry-coll import ( "context" + "github.com/DataDog/datadog-agent/pkg/trace/timing" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/connector" "go.opentelemetry.io/collector/consumer" @@ -38,8 +39,9 @@ func createDefaultConfig() component.Config { // defines the consumer type of the connector // we want to consume traces and export metrics therefore define nextConsumer as metrics, consumer is the next component in the pipeline func createTracesToMetricsConnector(_ context.Context, params connector.CreateSettings, cfg component.Config, nextConsumer consumer.Metrics) (connector.Traces, error) { - initializeMetricsClient(params) - c, err := newTraceToMetricConnector(params.TelemetrySettings, cfg, nextConsumer) + metricsClient := datadog.InitializeMetricClient(params.MeterProvider) + timingReporter := timing.New(metricsClient) + c, err := newTraceToMetricConnector(params.TelemetrySettings, cfg, nextConsumer, metricsClient, timingReporter) if err != nil { return nil, err } @@ -47,10 +49,5 @@ func createTracesToMetricsConnector(_ context.Context, params connector.CreateSe } func createTracesToTracesConnector(_ context.Context, params connector.CreateSettings, _ component.Config, nextConsumer consumer.Traces) (connector.Traces, error) { - initializeMetricsClient(params) return newTraceToTraceConnector(params.Logger, nextConsumer), nil } - -func initializeMetricsClient(params connector.CreateSettings) { - datadog.InitializeMetricClient(params.MeterProvider) -} diff --git a/connector/datadogconnector/go.mod b/connector/datadogconnector/go.mod index 69b20c03f3cb..11cbaf66c33d 100644 --- a/connector/datadogconnector/go.mod +++ b/connector/datadogconnector/go.mod @@ -4,9 +4,10 @@ go 1.21 require ( github.com/DataDog/datadog-agent/pkg/proto v0.52.0-devel - github.com/DataDog/datadog-agent/pkg/trace v0.50.2 - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.13.3 - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.13.3 + github.com/DataDog/datadog-agent/pkg/trace v0.51.1-0.20240301173728-334e775e420a + github.com/DataDog/datadog-go/v5 v5.5.0 + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.13.4 + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.13.4 github.com/open-telemetry/opentelemetry-collector-contrib/exporter/datadogexporter v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/datadog v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.95.0 @@ -24,33 +25,32 @@ require ( go.opentelemetry.io/collector/receiver/otlpreceiver v0.95.0 go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( cloud.google.com/go/compute v1.23.3 // indirect cloud.google.com/go/compute/metadata v0.2.4-0.20230617002413-005d2dfb6b68 // indirect github.com/DataDog/agent-payload/v5 v5.0.104 // indirect - github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.2 // indirect - github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.2 // indirect - github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.2 // indirect - github.com/DataDog/datadog-agent/pkg/util/log v0.50.2 // indirect - github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.2 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.2 // indirect + github.com/DataDog/datadog-agent/pkg/obfuscate v0.51.1-0.20240301173728-334e775e420a // indirect + github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.51.1-0.20240301173728-334e775e420a // indirect + github.com/DataDog/datadog-agent/pkg/util/cgroups v0.51.1-0.20240301173728-334e775e420a // indirect + github.com/DataDog/datadog-agent/pkg/util/log v0.51.1-0.20240301173728-334e775e420a // indirect + github.com/DataDog/datadog-agent/pkg/util/pointer v0.51.1-0.20240301173728-334e775e420a // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.51.1-0.20240301173728-334e775e420a // indirect github.com/DataDog/datadog-api-client-go/v2 v2.22.0 // indirect - github.com/DataDog/datadog-go/v5 v5.1.1 // indirect - github.com/DataDog/go-sqllexer v0.0.8 // indirect + github.com/DataDog/go-sqllexer v0.0.9 // indirect github.com/DataDog/go-tuf v1.0.2-0.5.2 // indirect github.com/DataDog/gohai v0.0.0-20230524154621-4316413895ee // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.13.3 // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.13.3 // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.13.3 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.13.4 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.13.4 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.13.4 // indirect github.com/DataDog/sketches-go v1.4.4 // indirect github.com/DataDog/zstd v1.5.2 // indirect github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.21.0 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/alecthomas/participle/v2 v2.1.1 // indirect - github.com/aws/aws-sdk-go v1.50.17 // indirect + github.com/aws/aws-sdk-go v1.50.27 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cenkalti/backoff v2.2.1+incompatible // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect diff --git a/connector/datadogconnector/go.sum b/connector/datadogconnector/go.sum index c33ffe520c3b..b1aee4ec774b 100644 --- a/connector/datadogconnector/go.sum +++ b/connector/datadogconnector/go.sum @@ -48,44 +48,44 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DataDog/agent-payload/v5 v5.0.104 h1:uxTIaLthyKB4CxBKe+2FeMgL6ca3KVxpeYxlJGNcoJg= github.com/DataDog/agent-payload/v5 v5.0.104/go.mod h1:COngtbYYCncpIPiE5D93QlXDH/3VAKk10jDNwGHcMRE= -github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.2 h1:y08IzbpFM/HBaKfgayFZe1FpcbZn6bVPXoZ++93vxv8= -github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.2/go.mod h1:A4nLJvxlg6BO/8/zg81til9yT0uRPuXDFMAzDMpmgn4= +github.com/DataDog/datadog-agent/pkg/obfuscate v0.51.1-0.20240301173728-334e775e420a h1:8t9jpJHbq3WosQmXCVDjqNfGFFPBxBT7/9mbyQqHMi0= +github.com/DataDog/datadog-agent/pkg/obfuscate v0.51.1-0.20240301173728-334e775e420a/go.mod h1:Ai57GjsZUn9AOo4L9ZOdu5uTuGaAxXMh0kin544Lgw0= github.com/DataDog/datadog-agent/pkg/proto v0.52.0-devel h1:nBejGNIU6Jk7bPBxz2bAO+f+kahAXWBXPecebY3R+Zo= github.com/DataDog/datadog-agent/pkg/proto v0.52.0-devel/go.mod h1:wjr5YlVvGip6VmAGzHrdBaGUu1LaA9B6gHvInm5kHiY= -github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.2 h1:7jn5EOu84uph4sd+pB3vF8LnsdTjhh+1/NnCvfNpG4A= -github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.2/go.mod h1:Vc+snp0Bey4MrrJyiV2tVxxJb6BmLomPvN1RgAvjGaQ= -github.com/DataDog/datadog-agent/pkg/trace v0.50.2 h1:eyjTZx3yupppiND/qwiUj6VuWHfyGfPMrqQwRgE41Rw= -github.com/DataDog/datadog-agent/pkg/trace v0.50.2/go.mod h1:SWNRcgZoBNoiyRrECEEe3xQGNCXfqzZVOB43WxDAMlc= -github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.2 h1:f+dYKVwMoGHZpOQM33Wogb/er8ZXeo4aUcbkSk17lM8= -github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.2/go.mod h1:4DalvbtHzT0nqpbj/36FP0IwfKWCSB5Zap7O/SGfPKI= -github.com/DataDog/datadog-agent/pkg/util/log v0.50.2 h1:D4jzhoZtZikiugOr2pl6Xm+MMfrwkjnZziGHgTNpBLk= -github.com/DataDog/datadog-agent/pkg/util/log v0.50.2/go.mod h1:0vyUsWVWDdIRzd6Itim0ZkjCvOF7V8Yi4IzpE5q/UPo= -github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.2 h1:yq97sYsulZz/qyl/bogRigvUskqXPSrt8c7b+xKDs4I= -github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.2/go.mod h1:eTXti9mx7qhkoi+Qg3mMmvVY5McghUUgsf4Hrk9zY8k= -github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.2 h1:xFGXfIsTyHC0VlrrfoAVaZ1pBAJUh2ARZrS7gcdAooY= -github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.2/go.mod h1:EOGgNrSPskIxY3+KgCl+yEggMjrGqrA2oL5va+/p2jM= +github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.51.1-0.20240301173728-334e775e420a h1:7Wijer1rhN7tsEm6mVjXaYZ2XjmKM8cgJKc0hkr57V8= +github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.51.1-0.20240301173728-334e775e420a/go.mod h1:Vc+snp0Bey4MrrJyiV2tVxxJb6BmLomPvN1RgAvjGaQ= +github.com/DataDog/datadog-agent/pkg/trace v0.51.1-0.20240301173728-334e775e420a h1:6ko5fCAcwToPALbUZiqR2tpjIzzqYR+uVXR7t1khRuE= +github.com/DataDog/datadog-agent/pkg/trace v0.51.1-0.20240301173728-334e775e420a/go.mod h1:qMvCrksIQC0czvZB72YdtVfxAK6/Vq2iPNJT7k6q+Bo= +github.com/DataDog/datadog-agent/pkg/util/cgroups v0.51.1-0.20240301173728-334e775e420a h1:95lqMrZdzqfrxxcLUepiEw2zHv7JCFSQhTr3/z1aKl4= +github.com/DataDog/datadog-agent/pkg/util/cgroups v0.51.1-0.20240301173728-334e775e420a/go.mod h1:m4jQb4BdnVTi7jaSETmJ0dQchgOphmZqPuMuwzjpFeM= +github.com/DataDog/datadog-agent/pkg/util/log v0.51.1-0.20240301173728-334e775e420a h1:IW8buCp4IiU0b1lC7x7W0hHlc+ADwV/hmistYtFogL0= +github.com/DataDog/datadog-agent/pkg/util/log v0.51.1-0.20240301173728-334e775e420a/go.mod h1:KdMEnEsO0dn53y3DLcbInK8NaMWnPgo+MunQsQ4cGF8= +github.com/DataDog/datadog-agent/pkg/util/pointer v0.51.1-0.20240301173728-334e775e420a h1:7FUY9948Nsrdfh1P/F1RkJ/gcUZVbTz9ippSbtl3cxo= +github.com/DataDog/datadog-agent/pkg/util/pointer v0.51.1-0.20240301173728-334e775e420a/go.mod h1:eTXti9mx7qhkoi+Qg3mMmvVY5McghUUgsf4Hrk9zY8k= +github.com/DataDog/datadog-agent/pkg/util/scrubber v0.51.1-0.20240301173728-334e775e420a h1:ENeNLL5ItDcd4400kGP148+IMzMlaIZGRfFLa3GJNdY= +github.com/DataDog/datadog-agent/pkg/util/scrubber v0.51.1-0.20240301173728-334e775e420a/go.mod h1:EOGgNrSPskIxY3+KgCl+yEggMjrGqrA2oL5va+/p2jM= github.com/DataDog/datadog-api-client-go/v2 v2.22.0 h1:+DtWu4PjGxsJU8FESjPi7C2rTDMojNungejsIzNFe70= github.com/DataDog/datadog-api-client-go/v2 v2.22.0/go.mod h1:QKOu6vscsh87fMY1lHfLEmNSunyXImj8BUaUWJXOehc= -github.com/DataDog/datadog-go/v5 v5.1.1 h1:JLZ6s2K1pG2h9GkvEvMdEGqMDyVLEAccdX5TltWcLMU= -github.com/DataDog/datadog-go/v5 v5.1.1/go.mod h1:KhiYb2Badlv9/rofz+OznKoEF5XKTonWyhx5K83AP8E= -github.com/DataDog/go-sqllexer v0.0.8 h1:vfC8R9PhmJfeOKcFYAX9UOd890A3wu3KrjU9Kr7nM0E= -github.com/DataDog/go-sqllexer v0.0.8/go.mod h1:nB4Ea2YNsqMwtbWMc4Fm/oP98IIrSPapqwOwPioMspY= +github.com/DataDog/datadog-go/v5 v5.5.0 h1:G5KHeB8pWBNXT4Jtw0zAkhdxEAWSpWH00geHI6LDrKU= +github.com/DataDog/datadog-go/v5 v5.5.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw= +github.com/DataDog/go-sqllexer v0.0.9 h1:Cx2Cu1S0hfj4coCCA8hzjM9+UNFRkcu1avIV//RU5Qw= +github.com/DataDog/go-sqllexer v0.0.9/go.mod h1:nB4Ea2YNsqMwtbWMc4Fm/oP98IIrSPapqwOwPioMspY= github.com/DataDog/go-tuf v1.0.2-0.5.2 h1:EeZr937eKAWPxJ26IykAdWA4A0jQXJgkhUjqEI/w7+I= github.com/DataDog/go-tuf v1.0.2-0.5.2/go.mod h1:zBcq6f654iVqmkk8n2Cx81E1JnNTMOAx1UEO/wZR+P0= github.com/DataDog/gohai v0.0.0-20230524154621-4316413895ee h1:tXibLZk3G6HncIFJKaNItsdzcrk4YqILNDZlXPTNt4k= github.com/DataDog/gohai v0.0.0-20230524154621-4316413895ee/go.mod h1:nTot/Iy0kW16bXgXr6blEc8gFeAS7vTqYlhAxh+dbc0= -github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.13.3 h1:XEhjylKpZec5tUQyw+fOYYBIEnktiCr/TKsrvFUB7uA= -github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.13.3/go.mod h1:63BBpcn68W2K89ZaLzYtzUiEit49+Rf2ZsEYza2TAcc= -github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.13.3 h1:hnzEiqocvnt6U1QGxfeDFf5xhE77jt4LOjZAXW9ueWo= -github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.13.3/go.mod h1:Tk2wwdBgWeSvDPtrGGyym8CdVWSuphiToGc/tRvFoNQ= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.13.3 h1:hcYZMgGDMUz8Dz6PcOhgk6FF0yG4N7KErS5J3O/MpeU= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.13.3/go.mod h1:Z2FPxYhi8GIFkS4WLC7RrRaGolyB9TqS2RMSwNcmczk= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.13.3 h1:oaYprbAr8/mPEyFNfqnm668bxg8IG000sQ6uNuuffro= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.13.3/go.mod h1:dmNsrdpbegG62b7/ETcRi53OsOmYlfshuTThx9BAiQI= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.13.3 h1:QelZO3ixjVqlqzTa+wxIDFvYnnzy/SG9iqXci1nhouc= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.13.3/go.mod h1:AObll3Cj7UJK56bc7HRrpbGWc98C1Io0ChpFEoxS2f8= -github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.13.3 h1:9fdt/9NeSUtypPT4du2/5TTQic9nL1YqDSIaq5Ttsi4= -github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.13.3/go.mod h1:P8Tr/1BSm0vQ0UXVOtIKmJKXCgb84jdFe9HuBKJPwkc= +github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.13.4 h1:PTIZJAsfnr2XLB3V3duL+mSbZvYV8G3XQ9e57KyOuOA= +github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.13.4/go.mod h1:5yS6i90MEZS3NG+o7PrQQ8i7OaEMzwQvn4bCZ9h9Rao= +github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.13.4 h1:B2R7Wh791uphpltmorbvvdKk0rJOhoExwM4NnE7hXTg= +github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.13.4/go.mod h1:Tk2wwdBgWeSvDPtrGGyym8CdVWSuphiToGc/tRvFoNQ= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.13.4 h1:GcJUxjunnJEL62K+fY7pjyvcb4Cvqr5VtD0DFc8rp+w= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.13.4/go.mod h1:/9yo8Scnf6R0KufxJIHfQD+GAbT9cyINxaTPMDgl2Wk= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.13.4 h1:dU9oPMbAr/wYMNdzhu0pxIhAJOn1Btj1T3ZSyY6RvY0= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.13.4/go.mod h1:ud/Xr5TWUopcaGHdkh9RN8lhnCAFa95X16Rb5mrkE18= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.13.4 h1:ZuYc5Ql/GSyAEMgpKkbQiHOtIHkEpYujITW1wIVFgLE= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.13.4/go.mod h1:YSntkplFoUM1mepnPeJFsoblqD0Wdi+Avg1/d1upgZQ= +github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.13.4 h1:t/Zh8ztLDBOMRMiuVNFthWMMG5F4POgc5M6+Y3DTX9g= +github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.13.4/go.mod h1:JfdBBDreQfbIN5FYrAtZV3VmQMXnf9o4tMbaMxWqe40= github.com/DataDog/sketches-go v1.4.4 h1:dF52vzXRFSPOj2IjXSWLvXq3jubL4CI69kwYjJ1w5Z8= github.com/DataDog/sketches-go v1.4.4/go.mod h1:XR0ns2RtEEF09mDKXiKZiQg+nfZStrq1ZuL1eezeZe0= github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= @@ -111,8 +111,8 @@ github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8V github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/aws/aws-sdk-go v1.50.17 h1:KsbzUKDgGNlkDHGvoQDhiJ63a9jtZd+O+/s3pTOr/ns= -github.com/aws/aws-sdk-go v1.50.17/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.50.27 h1:96ifhrSuja+AzdP3W/T2337igqVQ2FcSIJYkk+0rCeA= +github.com/aws/aws-sdk-go v1.50.27/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= 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/bmatcuk/doublestar/v4 v4.6.1 h1:FH9SifrbvJhnlQpztAx++wlkk70QBf0iBWDwNy7PA4I= @@ -708,8 +708,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= diff --git a/connector/datadogconnector/metadata.yaml b/connector/datadogconnector/metadata.yaml index 907ef0b3c104..537fd8ea5336 100644 --- a/connector/datadogconnector/metadata.yaml +++ b/connector/datadogconnector/metadata.yaml @@ -8,3 +8,7 @@ status: codeowners: active: [mx-psi, dineshg13] emeritus: [gbbr] + +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/connector/datadogconnector/traces_connector.go b/connector/datadogconnector/traces_connector.go index dfa32f7b94b2..34e57eb65d20 100644 --- a/connector/datadogconnector/traces_connector.go +++ b/connector/datadogconnector/traces_connector.go @@ -12,10 +12,6 @@ import ( "go.uber.org/zap" ) -// keyStatsComputed specifies the resource attribute key which indicates if stats have been -// computed for the resource spans. -const keyStatsComputed = "_dd.stats_computed" - type traceToTraceConnector struct { logger *zap.Logger tracesConsumer consumer.Traces // the next component in the pipeline to ingest traces after connector @@ -42,17 +38,10 @@ func (c *traceToTraceConnector) Shutdown(_ context.Context) error { // Capabilities implements the consumer interface. // tells use whether the component(connector) will mutate the data passed into it. if set to true the connector does modify the data func (c *traceToTraceConnector) Capabilities() consumer.Capabilities { - return consumer.Capabilities{MutatesData: true} // ConsumeTraces puts a new attribute _dd.stats_computed + return consumer.Capabilities{MutatesData: false} } // ConsumeTraces implements the consumer interface. func (c *traceToTraceConnector) ConsumeTraces(ctx context.Context, traces ptrace.Traces) error { - for i := 0; i < traces.ResourceSpans().Len(); i++ { - rs := traces.ResourceSpans().At(i) - // Stats will be computed for p. Mark the original resource spans to ensure that they don't - // get computed twice in case these spans pass through here again. - rs.Resource().Attributes().PutBool(keyStatsComputed, true) - - } return c.tracesConsumer.ConsumeTraces(ctx, traces) } diff --git a/connector/exceptionsconnector/generated_component_test.go b/connector/exceptionsconnector/generated_component_test.go index 15f22c35cbad..5e7ce302158c 100644 --- a/connector/exceptionsconnector/generated_component_test.go +++ b/connector/exceptionsconnector/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/connector" "go.opentelemetry.io/collector/connector/connectortest" "go.opentelemetry.io/collector/consumer/consumertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -62,9 +52,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstConnector, err := test.createFn(context.Background(), connectortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/connector/exceptionsconnector/go.mod b/connector/exceptionsconnector/go.mod index 9e555090192f..08a2d17974aa 100644 --- a/connector/exceptionsconnector/go.mod +++ b/connector/exceptionsconnector/go.mod @@ -16,7 +16,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 google.golang.org/grpc v1.61.0 ) diff --git a/connector/exceptionsconnector/go.sum b/connector/exceptionsconnector/go.sum index bac92808fc7f..0f54c8a2e447 100644 --- a/connector/exceptionsconnector/go.sum +++ b/connector/exceptionsconnector/go.sum @@ -96,8 +96,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/connector/failoverconnector/go.mod b/connector/failoverconnector/go.mod index 6364a80efb92..2ce222781350 100644 --- a/connector/failoverconnector/go.mod +++ b/connector/failoverconnector/go.mod @@ -12,7 +12,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/connector/failoverconnector/go.sum b/connector/failoverconnector/go.sum index bbc21a027d88..a5c97b8babe2 100644 --- a/connector/failoverconnector/go.sum +++ b/connector/failoverconnector/go.sum @@ -96,8 +96,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/connector/failoverconnector/metadata.yaml b/connector/failoverconnector/metadata.yaml index ba84bb8be32c..5dbf922136ff 100644 --- a/connector/failoverconnector/metadata.yaml +++ b/connector/failoverconnector/metadata.yaml @@ -7,3 +7,7 @@ status: distributions: [] codeowners: active: [akats7, djaglowski, fatsheep9146] + +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/connector/routingconnector/go.mod b/connector/routingconnector/go.mod index cd685224a5b0..e4330887e26d 100644 --- a/connector/routingconnector/go.mod +++ b/connector/routingconnector/go.mod @@ -13,7 +13,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/connector/routingconnector/go.sum b/connector/routingconnector/go.sum index 97e4b281f0b1..cc77c63278e7 100644 --- a/connector/routingconnector/go.sum +++ b/connector/routingconnector/go.sum @@ -110,8 +110,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/connector/routingconnector/metadata.yaml b/connector/routingconnector/metadata.yaml index b65774a79be5..25fbfbde06a2 100644 --- a/connector/routingconnector/metadata.yaml +++ b/connector/routingconnector/metadata.yaml @@ -7,3 +7,7 @@ status: distributions: [contrib] codeowners: active: [jpkrohling, mwear] + +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/connector/routingconnector/router.go b/connector/routingconnector/router.go index 53558c6ff71a..24fc5978a0b6 100644 --- a/connector/routingconnector/router.go +++ b/connector/routingconnector/router.go @@ -6,6 +6,7 @@ package routingconnector // import "github.com/open-telemetry/opentelemetry-coll import ( "errors" "fmt" + "strings" "go.opentelemetry.io/collector/component" "go.uber.org/zap" @@ -119,6 +120,13 @@ func (r *router[C]) registerRouteConsumers() error { route, ok := r.routes[key(item)] if !ok { route.statement = statement + } else { + pipelineNames := []string{} + for _, pipeline := range item.Pipelines { + pipelineNames = append(pipelineNames, pipeline.String()) + } + exporters := strings.Join(pipelineNames, ", ") + r.logger.Warn(fmt.Sprintf(`Statement %q already exists in the routing table, the route with target pipeline(s) %q will be ignored.`, item.Statement, exporters)) } consumer, err := r.consumerProvider(item.Pipelines...) diff --git a/connector/servicegraphconnector/generated_component_test.go b/connector/servicegraphconnector/generated_component_test.go index 0d2f00e021ea..773a46625861 100644 --- a/connector/servicegraphconnector/generated_component_test.go +++ b/connector/servicegraphconnector/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/connector" "go.opentelemetry.io/collector/connector/connectortest" "go.opentelemetry.io/collector/consumer/consumertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstConnector, err := test.createFn(context.Background(), connectortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/connector/servicegraphconnector/go.mod b/connector/servicegraphconnector/go.mod index 298b6b188ded..5eda3edae3ef 100644 --- a/connector/servicegraphconnector/go.mod +++ b/connector/servicegraphconnector/go.mod @@ -2,8 +2,6 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/connector/servi go 1.21 -toolchain go1.21.6 - require ( github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.95.0 @@ -21,7 +19,7 @@ require ( go.opentelemetry.io/otel/sdk/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/connector/servicegraphconnector/go.sum b/connector/servicegraphconnector/go.sum index de939a1e42e1..925ee8cc431a 100644 --- a/connector/servicegraphconnector/go.sum +++ b/connector/servicegraphconnector/go.sum @@ -226,8 +226,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/connector/spanmetricsconnector/README.md b/connector/spanmetricsconnector/README.md index ac8d1c559300..98414e7896c0 100644 --- a/connector/spanmetricsconnector/README.md +++ b/connector/spanmetricsconnector/README.md @@ -5,7 +5,7 @@ | ------------- |-----------| | Distributions | [contrib], [grafana], [liatrio], [splunk], [sumo] | | Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Aconnector%2Fspanmetrics%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Aconnector%2Fspanmetrics) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Aconnector%2Fspanmetrics%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Aconnector%2Fspanmetrics) | -| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@portertech](https://www.github.com/portertech) | +| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@portertech](https://www.github.com/portertech) \| Seeking more code owners! | | Emeritus | [@albertteoh](https://www.github.com/albertteoh) | [alpha]: https://github.com/open-telemetry/opentelemetry-collector#alpha @@ -62,7 +62,7 @@ across all spans: ## Span to Metrics processor to Span to metrics connector -The spanmetrics connector is a port of the [spanmetrics](../../processor/spanmetricsprocessor/README.md) processor, but with multiple improvements +The spanmetrics connector is a port of the [spanmetrics](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/processor/spanmetricsprocessor/v0.95.0/processor/spanmetricsprocessor/README.md) processor, but with multiple improvements and breaking changes. It was done to bring the `spanmetrics` connector closer to the OpenTelemetry specification and make the component agnostic to exporters logic. The `spanmetrics` processor essentially was mixing the OTel with Prometheus conventions by using the OTel data model and diff --git a/connector/spanmetricsconnector/generated_component_test.go b/connector/spanmetricsconnector/generated_component_test.go index d670b00df1ab..81cf90b69a7e 100644 --- a/connector/spanmetricsconnector/generated_component_test.go +++ b/connector/spanmetricsconnector/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/connector" "go.opentelemetry.io/collector/connector/connectortest" "go.opentelemetry.io/collector/consumer/consumertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstConnector, err := test.createFn(context.Background(), connectortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/connector/spanmetricsconnector/go.mod b/connector/spanmetricsconnector/go.mod index a1c9c0261c8a..61913de4000c 100644 --- a/connector/spanmetricsconnector/go.mod +++ b/connector/spanmetricsconnector/go.mod @@ -18,7 +18,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 google.golang.org/grpc v1.61.0 ) diff --git a/connector/spanmetricsconnector/go.sum b/connector/spanmetricsconnector/go.sum index c4f7b540599f..8957092d67a2 100644 --- a/connector/spanmetricsconnector/go.sum +++ b/connector/spanmetricsconnector/go.sum @@ -102,8 +102,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/connector/spanmetricsconnector/metadata.yaml b/connector/spanmetricsconnector/metadata.yaml index 57b71a0501ba..aedbc7bdd63d 100644 --- a/connector/spanmetricsconnector/metadata.yaml +++ b/connector/spanmetricsconnector/metadata.yaml @@ -8,6 +8,7 @@ status: codeowners: active: [portertech] emeritus: [albertteoh] + seeking_new: true tests: config: diff --git a/examples/couchbase/docker-compose.yaml b/examples/couchbase/docker-compose.yaml index 98283a859800..38237b0685e1 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.94.0 + image: otel/opentelemetry-collector-contrib:0.95.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:v2.49.1 + image: prom/prometheus:v2.50.1 volumes: - ./prometheus-config.yaml:/etc/prometheus/prometheus.yml ports: diff --git a/examples/secure-tracing/docker-compose.yaml b/examples/secure-tracing/docker-compose.yaml index 6f0a851bc011..1e6b7035c9d7 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.94.0 + image: otel/opentelemetry-collector:0.95.0 command: ["--config=/etc/otel-collector-config.yaml"] volumes: - ./certs/otel-collector.crt:/etc/otel-collector.crt diff --git a/exporter/alertmanagerexporter/generated_component_test.go b/exporter/alertmanagerexporter/generated_component_test.go index dd33c783234d..c4f131b980fd 100644 --- a/exporter/alertmanagerexporter/generated_component_test.go +++ b/exporter/alertmanagerexporter/generated_component_test.go @@ -5,27 +5,20 @@ package alertmanagerexporter import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -56,9 +49,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -67,19 +58,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case exporter.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case exporter.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case exporter.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -92,3 +83,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/exporter/alertmanagerexporter/go.mod b/exporter/alertmanagerexporter/go.mod index 121fa7986069..9816e4be33e3 100644 --- a/exporter/alertmanagerexporter/go.mod +++ b/exporter/alertmanagerexporter/go.mod @@ -5,7 +5,6 @@ go 1.21 require ( github.com/cenkalti/backoff/v4 v4.2.1 github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.95.0 - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.95.0 github.com/prometheus/common v0.46.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.95.0 @@ -21,7 +20,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( @@ -83,11 +82,3 @@ retract ( ) replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => ../../internal/common - -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal => ../../internal/coreinternal - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil => ../../pkg/pdatautil - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden diff --git a/exporter/alertmanagerexporter/go.sum b/exporter/alertmanagerexporter/go.sum index 89124de8e5ba..7c5a725a2c5f 100644 --- a/exporter/alertmanagerexporter/go.sum +++ b/exporter/alertmanagerexporter/go.sum @@ -134,8 +134,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/exporter/alibabacloudlogserviceexporter/generated_component_test.go b/exporter/alibabacloudlogserviceexporter/generated_component_test.go index dd18c25f2ef1..e0e39450530a 100644 --- a/exporter/alibabacloudlogserviceexporter/generated_component_test.go +++ b/exporter/alibabacloudlogserviceexporter/generated_component_test.go @@ -5,27 +5,20 @@ package alibabacloudlogserviceexporter import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -70,9 +63,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -81,19 +72,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case exporter.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case exporter.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case exporter.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -108,3 +99,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/exporter/alibabacloudlogserviceexporter/go.mod b/exporter/alibabacloudlogserviceexporter/go.mod index 1d7f500de03b..3153a9c92507 100644 --- a/exporter/alibabacloudlogserviceexporter/go.mod +++ b/exporter/alibabacloudlogserviceexporter/go.mod @@ -15,7 +15,7 @@ require ( go.opentelemetry.io/collector/semconv v0.95.0 go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/exporter/alibabacloudlogserviceexporter/go.sum b/exporter/alibabacloudlogserviceexporter/go.sum index f5138229abb3..6f17cdb0b295 100644 --- a/exporter/alibabacloudlogserviceexporter/go.sum +++ b/exporter/alibabacloudlogserviceexporter/go.sum @@ -404,8 +404,8 @@ go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN8 go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= diff --git a/exporter/awscloudwatchlogsexporter/generated_component_test.go b/exporter/awscloudwatchlogsexporter/generated_component_test.go index 9151822f1465..6a0daa99272d 100644 --- a/exporter/awscloudwatchlogsexporter/generated_component_test.go +++ b/exporter/awscloudwatchlogsexporter/generated_component_test.go @@ -5,27 +5,20 @@ package awscloudwatchlogsexporter import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -56,9 +49,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -67,19 +58,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case exporter.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case exporter.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case exporter.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -92,3 +83,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/exporter/awscloudwatchlogsexporter/go.mod b/exporter/awscloudwatchlogsexporter/go.mod index 3acf296db03c..03d2f92cac83 100644 --- a/exporter/awscloudwatchlogsexporter/go.mod +++ b/exporter/awscloudwatchlogsexporter/go.mod @@ -3,12 +3,11 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awsclo go 1.21 require ( - github.com/aws/aws-sdk-go v1.50.17 + github.com/aws/aws-sdk-go v1.50.27 github.com/cenkalti/backoff/v4 v4.2.1 github.com/google/uuid v1.6.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/awsutil v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/cwlogs v0.95.0 - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.95.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.95.0 go.opentelemetry.io/collector/config/configretry v0.95.0 @@ -19,7 +18,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( @@ -68,16 +67,8 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/a replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/cwlogs => ../../internal/aws/cwlogs -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal => ../../internal/coreinternal - retract ( v0.76.2 v0.76.1 v0.65.0 ) - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil => ../../pkg/pdatautil - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest diff --git a/exporter/awscloudwatchlogsexporter/go.sum b/exporter/awscloudwatchlogsexporter/go.sum index 5230c233789a..18ac90786d77 100644 --- a/exporter/awscloudwatchlogsexporter/go.sum +++ b/exporter/awscloudwatchlogsexporter/go.sum @@ -1,5 +1,5 @@ -github.com/aws/aws-sdk-go v1.50.17 h1:KsbzUKDgGNlkDHGvoQDhiJ63a9jtZd+O+/s3pTOr/ns= -github.com/aws/aws-sdk-go v1.50.17/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.50.27 h1:96ifhrSuja+AzdP3W/T2337igqVQ2FcSIJYkk+0rCeA= +github.com/aws/aws-sdk-go v1.50.27/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= @@ -115,8 +115,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/exporter/awsemfexporter/generated_component_test.go b/exporter/awsemfexporter/generated_component_test.go index fbfc5f7fff25..38476727c15b 100644 --- a/exporter/awsemfexporter/generated_component_test.go +++ b/exporter/awsemfexporter/generated_component_test.go @@ -5,27 +5,20 @@ package awsemfexporter import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -56,9 +49,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -67,19 +58,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case exporter.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case exporter.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case exporter.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -92,3 +83,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/exporter/awsemfexporter/go.mod b/exporter/awsemfexporter/go.mod index 607abcb7cea3..4acfc68e9216 100644 --- a/exporter/awsemfexporter/go.mod +++ b/exporter/awsemfexporter/go.mod @@ -3,7 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awsemf go 1.21 require ( - github.com/aws/aws-sdk-go v1.50.17 + github.com/aws/aws-sdk-go v1.50.27 github.com/google/uuid v1.6.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/awsutil v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/cwlogs v0.95.0 @@ -21,7 +21,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc ) diff --git a/exporter/awsemfexporter/go.sum b/exporter/awsemfexporter/go.sum index 62a1c84c963f..5abf15978c6a 100644 --- a/exporter/awsemfexporter/go.sum +++ b/exporter/awsemfexporter/go.sum @@ -1,5 +1,5 @@ -github.com/aws/aws-sdk-go v1.50.17 h1:KsbzUKDgGNlkDHGvoQDhiJ63a9jtZd+O+/s3pTOr/ns= -github.com/aws/aws-sdk-go v1.50.17/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.50.27 h1:96ifhrSuja+AzdP3W/T2337igqVQ2FcSIJYkk+0rCeA= +github.com/aws/aws-sdk-go v1.50.27/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= @@ -121,8 +121,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/exporter/awskinesisexporter/generated_component_test.go b/exporter/awskinesisexporter/generated_component_test.go new file mode 100644 index 000000000000..597a3eb9754f --- /dev/null +++ b/exporter/awskinesisexporter/generated_component_test.go @@ -0,0 +1,101 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package awskinesisexporter + +import ( + "context" + "testing" + "time" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/exporter" + "go.opentelemetry.io/collector/exporter/exportertest" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" +) + +func TestComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "logs", + createFn: func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateLogsExporter(ctx, set, cfg) + }, + }, + + { + name: "metrics", + createFn: func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateMetricsExporter(ctx, set, cfg) + }, + }, + + { + name: "traces", + createFn: func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateTracesExporter(ctx, set, cfg) + }, + }, + } + + cm, err := confmaptest.LoadConf("metadata.yaml") + require.NoError(t, err) + cfg := factory.CreateDefaultConfig() + sub, err := cm.Sub("tests::config") + require.NoError(t, err) + require.NoError(t, component.UnmarshalConfig(sub, cfg)) + + for _, test := range tests { + t.Run(test.name+"-shutdown", func(t *testing.T) { + c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + } +} + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/exporter/awskinesisexporter/go.mod b/exporter/awskinesisexporter/go.mod index 626fd1da67ec..3158ff539081 100644 --- a/exporter/awskinesisexporter/go.mod +++ b/exporter/awskinesisexporter/go.mod @@ -3,11 +3,11 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awskin go 1.21 require ( - github.com/aws/aws-sdk-go-v2 v1.25.0 - github.com/aws/aws-sdk-go-v2/config v1.27.0 - github.com/aws/aws-sdk-go-v2/credentials v1.17.0 - github.com/aws/aws-sdk-go-v2/service/kinesis v1.25.0 - github.com/aws/aws-sdk-go-v2/service/sts v1.27.0 + github.com/aws/aws-sdk-go-v2 v1.25.2 + github.com/aws/aws-sdk-go-v2/config v1.27.4 + github.com/aws/aws-sdk-go-v2/credentials v1.17.4 + github.com/aws/aws-sdk-go-v2/service/kinesis v1.27.1 + github.com/aws/aws-sdk-go-v2/service/sts v1.28.1 github.com/cenkalti/backoff/v4 v4.2.1 github.com/gogo/protobuf v1.3.2 github.com/google/uuid v1.6.0 @@ -25,21 +25,21 @@ require ( go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( github.com/apache/thrift v0.19.0 // indirect - github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.0 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.0 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.0 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.0 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.1 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.2 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.2 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.2 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.0 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.0 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.19.0 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.22.0 // indirect - github.com/aws/smithy-go v1.20.0 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.1 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.2 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.20.1 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.1 // indirect + github.com/aws/smithy-go v1.20.1 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect @@ -67,6 +67,7 @@ require ( go.opentelemetry.io/collector v0.95.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.95.0 // indirect go.opentelemetry.io/collector/extension v0.95.0 // indirect + go.opentelemetry.io/collector/receiver v0.95.0 // indirect go.opentelemetry.io/collector/semconv v0.95.0 // indirect go.opentelemetry.io/otel v1.23.1 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.45.2 // indirect diff --git a/exporter/awskinesisexporter/go.sum b/exporter/awskinesisexporter/go.sum index 01490b2fd2f8..e6e370f30136 100644 --- a/exporter/awskinesisexporter/go.sum +++ b/exporter/awskinesisexporter/go.sum @@ -1,35 +1,35 @@ github.com/apache/thrift v0.19.0 h1:sOqkWPzMj7w6XaYbJQG7m4sGqVolaW/0D28Ln7yPzMk= github.com/apache/thrift v0.19.0/go.mod h1:SUALL216IiaOw2Oy+5Vs9lboJ/t9g40C+G07Dc0QC1I= -github.com/aws/aws-sdk-go-v2 v1.25.0 h1:sv7+1JVJxOu/dD/sz/csHX7jFqmP001TIY7aytBWDSQ= -github.com/aws/aws-sdk-go-v2 v1.25.0/go.mod h1:G104G1Aho5WqF+SR3mDIobTABQzpYV0WxMsKxlMggOA= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.0 h1:2UO6/nT1lCZq1LqM67Oa4tdgP1CvL1sLSxvuD+VrOeE= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.0/go.mod h1:5zGj2eA85ClyedTDK+Whsu+w9yimnVIZvhvBKrDquM8= -github.com/aws/aws-sdk-go-v2/config v1.27.0 h1:J5sdGCAHuWKIXLeXiqr8II/adSvetkx0qdZwdbXXpb0= -github.com/aws/aws-sdk-go-v2/config v1.27.0/go.mod h1:cfh8v69nuSUohNFMbIISP2fhmblGmYEOKs5V53HiHnk= -github.com/aws/aws-sdk-go-v2/credentials v1.17.0 h1:lMW2x6sKBsiAJrpi1doOXqWFyEPoE886DTb1X0wb7So= -github.com/aws/aws-sdk-go-v2/credentials v1.17.0/go.mod h1:uT41FIH8cCIxOdUYIL0PYyHlL1NoneDuDSCwg5VE/5o= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.0 h1:xWCwjjvVz2ojYTP4kBKUuUh9ZrXfcAXpflhOUUeXg1k= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.0/go.mod h1:j3fACuqXg4oMTQOR2yY7m0NmJY0yBK4L4sLsRXq1Ins= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.0 h1:NPs/EqVO+ajwOoq56EfcGKa3L3ruWuazkIw1BqxwOPw= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.0/go.mod h1:D+duLy2ylgatV+yTlQ8JTuLfDD0BnFvnQRc+o6tbZ4M= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.0 h1:ks7KGMVUMoDzcxNWUlEdI+/lokMFD136EL6DWmUOV80= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.0/go.mod h1:hL6BWM/d/qz113fVitZjbXR0E+RCTU1+x+1Idyn5NgE= +github.com/aws/aws-sdk-go-v2 v1.25.2 h1:/uiG1avJRgLGiQM9X3qJM8+Qa6KRGK5rRPuXE0HUM+w= +github.com/aws/aws-sdk-go-v2 v1.25.2/go.mod h1:Evoc5AsmtveRt1komDwIsjHFyrP5tDuF1D1U+6z6pNo= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.1 h1:gTK2uhtAPtFcdRRJilZPx8uJLL2J85xK11nKtWL0wfU= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.1/go.mod h1:sxpLb+nZk7tIfCWChfd+h4QwHNUR57d8hA1cleTkjJo= +github.com/aws/aws-sdk-go-v2/config v1.27.4 h1:AhfWb5ZwimdsYTgP7Od8E9L1u4sKmDW2ZVeLcf2O42M= +github.com/aws/aws-sdk-go-v2/config v1.27.4/go.mod h1:zq2FFXK3A416kiukwpsd+rD4ny6JC7QSkp4QdN1Mp2g= +github.com/aws/aws-sdk-go-v2/credentials v1.17.4 h1:h5Vztbd8qLppiPwX+y0Q6WiwMZgpd9keKe2EAENgAuI= +github.com/aws/aws-sdk-go-v2/credentials v1.17.4/go.mod h1:+30tpwrkOgvkJL1rUZuRLoxcJwtI/OkeBLYnHxJtVe0= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.2 h1:AK0J8iYBFeUk2Ax7O8YpLtFsfhdOByh2QIkHmigpRYk= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.2/go.mod h1:iRlGzMix0SExQEviAyptRWRGdYNo3+ufW/lCzvKVTUc= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.2 h1:bNo4LagzUKbjdxE0tIcR9pMzLR2U/Tgie1Hq1HQ3iH8= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.2/go.mod h1:wRQv0nN6v9wDXuWThpovGQjqF1HFdcgWjporw14lS8k= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.2 h1:EtOU5jsPdIQNP+6Q2C5e3d65NKT1PeCiQk+9OdzO12Q= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.2/go.mod h1:tyF5sKccmDz0Bv4NrstEr+/9YkSPJHrcO7UsUKf7pWM= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 h1:hT8rVHwugYE2lEfdFE0QWVo81lF7jMrYJVDWI+f+VxU= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0/go.mod h1:8tu/lYfQfFe6IGnaOdrpVgEL2IrrDOf6/m9RQum4NkY= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.0 h1:a33HuFlO0KsveiP90IUJh8Xr/cx9US2PqkSroaLc+o8= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.0/go.mod h1:SxIkWpByiGbhbHYTo9CMTUnx2G4p4ZQMrDPcRRy//1c= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.0 h1:SHN/umDLTmFTmYfI+gkanz6da3vK8Kvj/5wkqnTHbuA= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.0/go.mod h1:l8gPU5RYGOFHJqWEpPMoRTP0VoaWQSkJdKo+hwWnnDA= -github.com/aws/aws-sdk-go-v2/service/kinesis v1.25.0 h1:tUC1pAD2bV/FbEFuTSoxGi8IVds3NL3G7epibWHHIFU= -github.com/aws/aws-sdk-go-v2/service/kinesis v1.25.0/go.mod h1:q9d/nloLNFGbRkDJJTwSFntbsKUgODmg6I0sPFx2ugo= -github.com/aws/aws-sdk-go-v2/service/sso v1.19.0 h1:u6OkVDxtBPnxPkZ9/63ynEe+8kHbtS5IfaC4PzVxzWM= -github.com/aws/aws-sdk-go-v2/service/sso v1.19.0/go.mod h1:YqbU3RS/pkDVu+v+Nwxvn0i1WB0HkNWEePWbmODEbbs= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.22.0 h1:6DL0qu5+315wbsAEEmzK+P9leRwNbkp+lGjPC+CEvb8= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.22.0/go.mod h1:olUAyg+FaoFaL/zFaeQQONjOZ9HXoxgvI/c7mQTYz7M= -github.com/aws/aws-sdk-go-v2/service/sts v1.27.0 h1:cjTRjh700H36MQ8M0LnDn33W3JmwC77mdxIIyPWCdpM= -github.com/aws/aws-sdk-go-v2/service/sts v1.27.0/go.mod h1:nXfOBMWPokIbOY+Gi7a1psWMSvskUCemZzI+SMB7Akc= -github.com/aws/smithy-go v1.20.0 h1:6+kZsCXZwKxZS9RfISnPc4EXlHoyAkm2hPuM8X2BrrQ= -github.com/aws/smithy-go v1.20.0/go.mod h1:uo5RKksAl4PzhqaAbjd4rLgFoq5koTsQKYuGe7dklGc= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.1 h1:EyBZibRTVAs6ECHZOw5/wlylS9OcTzwyjeQMudmREjE= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.1/go.mod h1:JKpmtYhhPs7D97NL/ltqz7yCkERFW5dOlHyVl66ZYF8= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.2 h1:5ffmXjPtwRExp1zc7gENLgCPyHFbhEPwVTkTiH9niSk= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.2/go.mod h1:Ru7vg1iQ7cR4i7SZ/JTLYN9kaXtbL69UdgG0OQWQxW0= +github.com/aws/aws-sdk-go-v2/service/kinesis v1.27.1 h1:p8dOJ/UKXOwttc1Cxw1Ek52klVmMuiaCUkhsUGxce1I= +github.com/aws/aws-sdk-go-v2/service/kinesis v1.27.1/go.mod h1:VpH1IBG1YYZHPu5qShNt7EGaqUQbHAJZrbDtEpqDvvY= +github.com/aws/aws-sdk-go-v2/service/sso v1.20.1 h1:utEGkfdQ4L6YW/ietH7111ZYglLJvS+sLriHJ1NBJEQ= +github.com/aws/aws-sdk-go-v2/service/sso v1.20.1/go.mod h1:RsYqzYr2F2oPDdpy+PdhephuZxTfjHQe7SOBcZGoAU8= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.1 h1:9/GylMS45hGGFCcMrUZDVayQE1jYSIN6da9jo7RAYIw= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.1/go.mod h1:YjAPFn4kGFqKC54VsHs5fn5B6d+PCY2tziEa3U/GB5Y= +github.com/aws/aws-sdk-go-v2/service/sts v1.28.1 h1:3I2cBEYgKhrWlwyZgfpSO2BpaMY1LHPqXYk/QGlu2ew= +github.com/aws/aws-sdk-go-v2/service/sts v1.28.1/go.mod h1:uQ7YYKZt3adCRrdCBREm1CD3efFLOUNH77MrUCvx5oA= +github.com/aws/smithy-go v1.20.1 h1:4SZlSlMr36UEqC7XOyRVb27XMeZubNcBNN+9IgEPIQw= +github.com/aws/smithy-go v1.20.1/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= @@ -148,8 +148,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/exporter/awskinesisexporter/metadata.yaml b/exporter/awskinesisexporter/metadata.yaml index c35b07494fc0..a487740f3777 100644 --- a/exporter/awskinesisexporter/metadata.yaml +++ b/exporter/awskinesisexporter/metadata.yaml @@ -7,3 +7,8 @@ status: distributions: [contrib, observiq] codeowners: active: [Aneurysm9, MovieStoreGuy] + +# TODO: Update the exporter to pass the tests +tests: + skip_lifecycle: true + diff --git a/exporter/awss3exporter/generated_component_test.go b/exporter/awss3exporter/generated_component_test.go index b9cf5058a1ed..c9b8a9eff686 100644 --- a/exporter/awss3exporter/generated_component_test.go +++ b/exporter/awss3exporter/generated_component_test.go @@ -5,27 +5,20 @@ package awss3exporter import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -70,9 +63,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -81,19 +72,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case exporter.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case exporter.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case exporter.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -106,3 +97,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/exporter/awss3exporter/go.mod b/exporter/awss3exporter/go.mod index 75384e657147..242c23b59561 100644 --- a/exporter/awss3exporter/go.mod +++ b/exporter/awss3exporter/go.mod @@ -3,8 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awss3e go 1.21 require ( - github.com/aws/aws-sdk-go v1.50.17 - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.95.0 + github.com/aws/aws-sdk-go v1.50.27 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.95.0 go.opentelemetry.io/collector/confmap v0.95.0 @@ -15,7 +14,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( @@ -90,6 +89,7 @@ require ( go.opentelemetry.io/otel/sdk v1.23.1 // indirect go.opentelemetry.io/otel/sdk/metric v1.23.1 // indirect go.opentelemetry.io/proto/otlp v1.1.0 // indirect + golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 // indirect golang.org/x/net v0.20.0 // indirect golang.org/x/sys v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect @@ -101,15 +101,7 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect ) -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal => ../../internal/coreinternal - retract ( v0.76.2 v0.76.1 ) - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil => ../../pkg/pdatautil - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden diff --git a/exporter/awss3exporter/go.sum b/exporter/awss3exporter/go.sum index 114456adcfb5..1d92c8efb8c5 100644 --- a/exporter/awss3exporter/go.sum +++ b/exporter/awss3exporter/go.sum @@ -1,7 +1,7 @@ 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/aws/aws-sdk-go v1.50.17 h1:KsbzUKDgGNlkDHGvoQDhiJ63a9jtZd+O+/s3pTOr/ns= -github.com/aws/aws-sdk-go v1.50.17/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.50.27 h1:96ifhrSuja+AzdP3W/T2337igqVQ2FcSIJYkk+0rCeA= +github.com/aws/aws-sdk-go v1.50.27/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= @@ -232,8 +232,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/exporter/awss3exporter/metadata.yaml b/exporter/awss3exporter/metadata.yaml index 6e419a23de2b..ec044eb76393 100644 --- a/exporter/awss3exporter/metadata.yaml +++ b/exporter/awss3exporter/metadata.yaml @@ -7,6 +7,6 @@ status: distributions: [contrib, observiq, sumo, splunk] codeowners: active: [atoulme, pdelewski] + tests: - config: expect_consumer_error: true diff --git a/exporter/awsxrayexporter/generated_component_test.go b/exporter/awsxrayexporter/generated_component_test.go index 584949e3f904..692caacf546c 100644 --- a/exporter/awsxrayexporter/generated_component_test.go +++ b/exporter/awsxrayexporter/generated_component_test.go @@ -5,27 +5,20 @@ package awsxrayexporter import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -56,9 +49,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -67,19 +58,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case exporter.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case exporter.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case exporter.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -92,3 +83,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/exporter/awsxrayexporter/go.mod b/exporter/awsxrayexporter/go.mod index 24737454d3eb..54cde2bad334 100644 --- a/exporter/awsxrayexporter/go.mod +++ b/exporter/awsxrayexporter/go.mod @@ -3,7 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awsxra go 1.21 require ( - github.com/aws/aws-sdk-go v1.50.17 + github.com/aws/aws-sdk-go v1.50.27 github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/awsutil v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xray v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.95.0 @@ -18,7 +18,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/exporter/awsxrayexporter/go.sum b/exporter/awsxrayexporter/go.sum index dfb42f3ebdbf..bbd0d81e8488 100644 --- a/exporter/awsxrayexporter/go.sum +++ b/exporter/awsxrayexporter/go.sum @@ -1,5 +1,5 @@ -github.com/aws/aws-sdk-go v1.50.17 h1:KsbzUKDgGNlkDHGvoQDhiJ63a9jtZd+O+/s3pTOr/ns= -github.com/aws/aws-sdk-go v1.50.17/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.50.27 h1:96ifhrSuja+AzdP3W/T2337igqVQ2FcSIJYkk+0rCeA= +github.com/aws/aws-sdk-go v1.50.27/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= @@ -116,8 +116,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/exporter/awsxrayexporter/internal/translator/http.go b/exporter/awsxrayexporter/internal/translator/http.go index d6a1795c1502..f1f135dafe62 100644 --- a/exporter/awsxrayexporter/internal/translator/http.go +++ b/exporter/awsxrayexporter/internal/translator/http.go @@ -4,6 +4,7 @@ package translator // import "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awsxrayexporter/internal/translator" import ( + "net" "strconv" "github.com/aws/aws-sdk-go/aws" @@ -14,6 +15,19 @@ import ( awsxray "github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xray" ) +const ( + AttributeHTTPRequestMethod = "http.request.method" + AttributeHTTPResponseStatusCode = "http.response.status_code" + AttributeServerAddress = "server.address" + AttributeServerPort = "server.port" + AttributeNetworkPeerAddress = "network.peer.address" + AttributeClientAddress = "client.address" + AttributeURLScheme = "url.scheme" + AttributeURLFull = "url.full" + AttributeURLPath = "url.path" + AttributeUserAgentOriginal = "user_agent.original" +) + func makeHTTP(span ptrace.Span) (map[string]pcommon.Value, *awsxray.HTTPData) { var ( info = awsxray.HTTPData{ @@ -30,28 +44,28 @@ func makeHTTP(span ptrace.Span) (map[string]pcommon.Value, *awsxray.HTTPData) { hasHTTP := false hasHTTPRequestURLAttributes := false + hasNetPeerAddr := false span.Attributes().Range(func(key string, value pcommon.Value) bool { switch key { - case conventions.AttributeHTTPMethod: + case conventions.AttributeHTTPMethod, AttributeHTTPRequestMethod: info.Request.Method = awsxray.String(value.Str()) hasHTTP = true case conventions.AttributeHTTPClientIP: info.Request.ClientIP = awsxray.String(value.Str()) - info.Request.XForwardedFor = aws.Bool(true) hasHTTP = true - case conventions.AttributeHTTPUserAgent: + case conventions.AttributeHTTPUserAgent, AttributeUserAgentOriginal: info.Request.UserAgent = awsxray.String(value.Str()) hasHTTP = true - case conventions.AttributeHTTPStatusCode: + case conventions.AttributeHTTPStatusCode, AttributeHTTPResponseStatusCode: info.Response.Status = aws.Int64(value.Int()) hasHTTP = true - case conventions.AttributeHTTPURL: - urlParts[key] = value.Str() + case conventions.AttributeHTTPURL, AttributeURLFull: + urlParts[conventions.AttributeHTTPURL] = value.Str() hasHTTP = true hasHTTPRequestURLAttributes = true - case conventions.AttributeHTTPScheme: - urlParts[key] = value.Str() + case conventions.AttributeHTTPScheme, AttributeURLScheme: + urlParts[conventions.AttributeHTTPScheme] = value.Str() hasHTTP = true case conventions.AttributeHTTPHost: urlParts[key] = value.Str() @@ -90,12 +104,41 @@ func makeHTTP(span ptrace.Span) (map[string]pcommon.Value, *awsxray.HTTPData) { } urlParts[key] = value.Str() hasHTTPRequestURLAttributes = true + hasNetPeerAddr = true + case AttributeNetworkPeerAddress: + // Prefer HTTP forwarded information (AttributeHTTPClientIP) when present. + if net.ParseIP(value.Str()) != nil { + if info.Request.ClientIP == nil { + info.Request.ClientIP = awsxray.String(value.Str()) + } + hasHTTPRequestURLAttributes = true + hasNetPeerAddr = true + } + case AttributeClientAddress: + if net.ParseIP(value.Str()) != nil { + info.Request.ClientIP = awsxray.String(value.Str()) + } + case AttributeURLPath: + urlParts[key] = value.Str() + hasHTTP = true + case AttributeServerAddress: + urlParts[key] = value.Str() + hasHTTPRequestURLAttributes = true + case AttributeServerPort: + urlParts[key] = value.Str() + if len(urlParts[key]) == 0 { + urlParts[key] = strconv.FormatInt(value.Int(), 10) + } default: filtered[key] = value } return true }) + if !hasNetPeerAddr && info.Request.ClientIP != nil { + info.Request.XForwardedFor = aws.Bool(true) + } + if !hasHTTP { // Didn't have any HTTP-specific information so don't need to fill it in segment return filtered, nil @@ -142,7 +185,7 @@ func extractResponseSizeFromAttributes(attributes pcommon.Map) int64 { func constructClientURL(urlParts map[string]string) string { // follows OpenTelemetry specification-defined combinations for client spans described in - // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/http.md#http-client + // https://github.com/open-telemetry/semantic-conventions/blob/main/docs/http/http-spans.md#http-client url, ok := urlParts[conventions.AttributeHTTPURL] if ok { @@ -181,7 +224,7 @@ func constructClientURL(urlParts map[string]string) string { func constructServerURL(urlParts map[string]string) string { // follows OpenTelemetry specification-defined combinations for server spans described in - // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/http.md#http-server-semantic-conventions + // https://github.com/open-telemetry/semantic-conventions/blob/main/docs/http/http-spans.md#http-server url, ok := urlParts[conventions.AttributeHTTPURL] if ok { @@ -200,12 +243,18 @@ func constructServerURL(urlParts map[string]string) string { if !ok { host, ok = urlParts[conventions.AttributeNetHostName] if !ok { - host = urlParts[conventions.AttributeHostName] + host, ok = urlParts[conventions.AttributeHostName] + if !ok { + host = urlParts[AttributeServerAddress] + } } } port, ok = urlParts[conventions.AttributeNetHostPort] if !ok { - port = "" + port, ok = urlParts[AttributeServerPort] + if !ok { + port = "" + } } } url = scheme + "://" + host @@ -216,7 +265,12 @@ func constructServerURL(urlParts map[string]string) string { if ok { url += target } else { - url += "/" + path, ok := urlParts[AttributeURLPath] + if ok { + url += path + } else { + url += "/" + } } return url } diff --git a/exporter/awsxrayexporter/internal/translator/http_test.go b/exporter/awsxrayexporter/internal/translator/http_test.go index 8d9948eab050..0c5ff1b9983f 100644 --- a/exporter/awsxrayexporter/internal/translator/http_test.go +++ b/exporter/awsxrayexporter/internal/translator/http_test.go @@ -8,6 +8,7 @@ import ( "testing" "time" + "github.com/aws/aws-sdk-go/aws" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/pdata/pcommon" @@ -33,6 +34,24 @@ func TestClientSpanWithURLAttribute(t *testing.T) { assert.True(t, strings.Contains(jsonStr, "https://api.example.com/users/junit")) } +func TestClientSpanWithURLAttributeStable(t *testing.T) { + attributes := make(map[string]any) + attributes[AttributeHTTPRequestMethod] = "GET" + attributes[AttributeURLFull] = "https://api.example.com/users/junit" + attributes[AttributeHTTPResponseStatusCode] = 200 + span := constructHTTPClientSpan(attributes) + + filtered, httpData := makeHTTP(span) + + assert.NotNil(t, httpData) + assert.NotNil(t, filtered) + w := testWriters.borrow() + require.NoError(t, w.Encode(httpData)) + jsonStr := w.String() + testWriters.release(w) + assert.True(t, strings.Contains(jsonStr, "https://api.example.com/users/junit")) +} + func TestClientSpanWithSchemeHostTargetAttributes(t *testing.T) { attributes := make(map[string]any) attributes[conventions.AttributeHTTPMethod] = "GET" @@ -79,6 +98,31 @@ func TestClientSpanWithPeerAttributes(t *testing.T) { assert.True(t, strings.Contains(jsonStr, "http://kb234.example.com:8080/users/junit")) } +func TestClientSpanWithPeerAttributesStable(t *testing.T) { + attributes := make(map[string]any) + attributes[AttributeHTTPRequestMethod] = "GET" + attributes[AttributeURLScheme] = "http" + attributes[conventions.AttributeNetPeerName] = "kb234.example.com" + attributes[conventions.AttributeNetPeerPort] = 8080 + attributes[conventions.AttributeNetPeerIP] = "10.8.17.36" + attributes[conventions.AttributeHTTPTarget] = "/users/junit" + attributes[conventions.AttributeHTTPStatusCode] = 200 + span := constructHTTPClientSpan(attributes) + + filtered, httpData := makeHTTP(span) + + assert.NotNil(t, httpData) + assert.NotNil(t, filtered) + + assert.Equal(t, "10.8.17.36", *httpData.Request.ClientIP) + + w := testWriters.borrow() + require.NoError(t, w.Encode(httpData)) + jsonStr := w.String() + testWriters.release(w) + assert.True(t, strings.Contains(jsonStr, "http://kb234.example.com:8080/users/junit")) +} + func TestClientSpanWithHttpPeerAttributes(t *testing.T) { attributes := make(map[string]any) attributes[conventions.AttributeHTTPClientIP] = "1.2.3.4" @@ -93,6 +137,21 @@ func TestClientSpanWithHttpPeerAttributes(t *testing.T) { assert.Equal(t, "1.2.3.4", *httpData.Request.ClientIP) } +func TestClientSpanWithHttpPeerAttributesStable(t *testing.T) { + attributes := make(map[string]any) + attributes[AttributeURLFull] = "https://api.example.com/users/junit" + attributes[AttributeClientAddress] = "1.2.3.4" + attributes[AttributeNetworkPeerAddress] = "10.8.17.36" + span := constructHTTPClientSpan(attributes) + + filtered, httpData := makeHTTP(span) + + assert.NotNil(t, httpData) + assert.NotNil(t, filtered) + + assert.Equal(t, "1.2.3.4", *httpData.Request.ClientIP) +} + func TestClientSpanWithPeerIp4Attributes(t *testing.T) { attributes := make(map[string]any) attributes[conventions.AttributeHTTPMethod] = "GET" @@ -151,6 +210,26 @@ func TestServerSpanWithURLAttribute(t *testing.T) { assert.True(t, strings.Contains(jsonStr, "https://api.example.com/users/junit")) } +func TestServerSpanWithURLAttributeStable(t *testing.T) { + attributes := make(map[string]any) + attributes[AttributeHTTPRequestMethod] = "GET" + attributes[AttributeURLFull] = "https://api.example.com/users/junit" + attributes[AttributeClientAddress] = "192.168.15.32" + attributes[AttributeUserAgentOriginal] = "PostmanRuntime/7.21.0" + attributes[AttributeHTTPResponseStatusCode] = 200 + span := constructHTTPServerSpan(attributes) + + filtered, httpData := makeHTTP(span) + + assert.NotNil(t, httpData) + assert.NotNil(t, filtered) + w := testWriters.borrow() + require.NoError(t, w.Encode(httpData)) + jsonStr := w.String() + testWriters.release(w) + assert.True(t, strings.Contains(jsonStr, "https://api.example.com/users/junit")) +} + func TestServerSpanWithSchemeHostTargetAttributes(t *testing.T) { attributes := make(map[string]any) attributes[conventions.AttributeHTTPMethod] = "GET" @@ -172,6 +251,27 @@ func TestServerSpanWithSchemeHostTargetAttributes(t *testing.T) { assert.True(t, strings.Contains(jsonStr, "https://api.example.com/users/junit")) } +func TestServerSpanWithSchemeHostTargetAttributesStable(t *testing.T) { + attributes := make(map[string]any) + attributes[AttributeHTTPRequestMethod] = "GET" + attributes[AttributeURLScheme] = "https" + attributes[AttributeServerAddress] = "api.example.com" + attributes[AttributeURLPath] = "/users/junit" + attributes[AttributeClientAddress] = "192.168.15.32" + attributes[AttributeHTTPResponseStatusCode] = 200 + span := constructHTTPServerSpan(attributes) + + filtered, httpData := makeHTTP(span) + + assert.NotNil(t, httpData) + assert.NotNil(t, filtered) + w := testWriters.borrow() + require.NoError(t, w.Encode(httpData)) + jsonStr := w.String() + testWriters.release(w) + assert.True(t, strings.Contains(jsonStr, "https://api.example.com/users/junit")) +} + func TestServerSpanWithSchemeServernamePortTargetAttributes(t *testing.T) { attributes := make(map[string]any) attributes[conventions.AttributeHTTPMethod] = "GET" @@ -194,6 +294,28 @@ func TestServerSpanWithSchemeServernamePortTargetAttributes(t *testing.T) { assert.True(t, strings.Contains(jsonStr, "https://api.example.com/users/junit")) } +func TestServerSpanWithSchemeServernamePortTargetAttributesStable(t *testing.T) { + attributes := make(map[string]any) + attributes[AttributeHTTPRequestMethod] = "GET" + attributes[AttributeURLScheme] = "https" + attributes[AttributeServerAddress] = "api.example.com" + attributes[AttributeServerPort] = 443 + attributes[AttributeURLPath] = "/users/junit" + attributes[AttributeClientAddress] = "192.168.15.32" + attributes[AttributeHTTPResponseStatusCode] = 200 + span := constructHTTPServerSpan(attributes) + + filtered, httpData := makeHTTP(span) + + assert.NotNil(t, httpData) + assert.NotNil(t, filtered) + w := testWriters.borrow() + require.NoError(t, w.Encode(httpData)) + jsonStr := w.String() + testWriters.release(w) + assert.True(t, strings.Contains(jsonStr, "https://api.example.com/users/junit")) +} + func TestServerSpanWithSchemeNamePortTargetAttributes(t *testing.T) { attributes := make(map[string]any) attributes[conventions.AttributeHTTPMethod] = "GET" @@ -218,6 +340,30 @@ func TestServerSpanWithSchemeNamePortTargetAttributes(t *testing.T) { assert.True(t, strings.Contains(jsonStr, "http://kb234.example.com:8080/users/junit")) } +func TestServerSpanWithSchemeNamePortTargetAttributesStable(t *testing.T) { + attributes := make(map[string]any) + attributes[AttributeHTTPRequestMethod] = "GET" + attributes[AttributeURLScheme] = "http" + attributes[AttributeServerAddress] = "kb234.example.com" + attributes[AttributeServerPort] = 8080 + attributes[AttributeURLPath] = "/users/junit" + attributes[AttributeClientAddress] = "192.168.15.32" + attributes[AttributeHTTPResponseStatusCode] = 200 + span := constructHTTPServerSpan(attributes) + timeEvents := constructTimedEventsWithReceivedMessageEvent(span.EndTimestamp()) + timeEvents.CopyTo(span.Events()) + + filtered, httpData := makeHTTP(span) + + assert.NotNil(t, httpData) + assert.NotNil(t, filtered) + w := testWriters.borrow() + require.NoError(t, w.Encode(httpData)) + jsonStr := w.String() + testWriters.release(w) + assert.True(t, strings.Contains(jsonStr, "http://kb234.example.com:8080/users/junit")) +} + func TestSpanWithNotEnoughHTTPRequestURLAttributes(t *testing.T) { attributes := make(map[string]any) attributes[conventions.AttributeHTTPMethod] = "GET" @@ -244,6 +390,100 @@ func TestSpanWithNotEnoughHTTPRequestURLAttributes(t *testing.T) { assert.NotNil(t, filtered) } +func TestSpanWithNotEnoughHTTPRequestURLAttributesStable(t *testing.T) { + attributes := make(map[string]any) + attributes[AttributeHTTPRequestMethod] = "GET" + attributes[AttributeURLScheme] = "http" + attributes[AttributeClientAddress] = "192.168.15.32" + attributes[AttributeUserAgentOriginal] = "PostmanRuntime/7.21.0" + attributes[AttributeURLPath] = "/users/junit" + attributes[AttributeServerPort] = 443 + attributes[AttributeHTTPResponseStatusCode] = 200 + span := constructHTTPServerSpan(attributes) + timeEvents := constructTimedEventsWithReceivedMessageEvent(span.EndTimestamp()) + timeEvents.CopyTo(span.Events()) + + filtered, httpData := makeHTTP(span) + + assert.Nil(t, httpData.Request.URL) + assert.Equal(t, "192.168.15.32", *httpData.Request.ClientIP) + assert.Equal(t, "GET", *httpData.Request.Method) + assert.Equal(t, "PostmanRuntime/7.21.0", *httpData.Request.UserAgent) + contentLength := *httpData.Response.ContentLength.(*int64) + assert.Equal(t, int64(12452), contentLength) + assert.Equal(t, int64(200), *httpData.Response.Status) + assert.NotNil(t, filtered) +} + +func TestSpanWithNotEnoughHTTPRequestURLAttributesDuplicated(t *testing.T) { + attributes := make(map[string]any) + attributes[conventions.AttributeHTTPMethod] = "GET" + attributes[AttributeHTTPRequestMethod] = "GET" + attributes[conventions.AttributeHTTPScheme] = "http" + attributes[AttributeURLScheme] = "http" + attributes[conventions.AttributeHTTPClientIP] = "192.168.15.32" + attributes[AttributeClientAddress] = "192.168.15.32" + attributes[conventions.AttributeHTTPUserAgent] = "PostmanRuntime/7.21.0" + attributes[AttributeUserAgentOriginal] = "PostmanRuntime/7.21.0" + attributes[conventions.AttributeHTTPTarget] = "/users/junit" + attributes[AttributeURLPath] = "/users/junit" + attributes[conventions.AttributeNetHostPort] = 443 + attributes[AttributeServerPort] = 443 + attributes[conventions.AttributeNetPeerPort] = 8080 + attributes[conventions.AttributeHTTPStatusCode] = 200 + attributes[AttributeHTTPResponseStatusCode] = 200 + span := constructHTTPServerSpan(attributes) + timeEvents := constructTimedEventsWithReceivedMessageEvent(span.EndTimestamp()) + timeEvents.CopyTo(span.Events()) + + filtered, httpData := makeHTTP(span) + + assert.Nil(t, httpData.Request.URL) + assert.Equal(t, "192.168.15.32", *httpData.Request.ClientIP) + assert.Equal(t, "GET", *httpData.Request.Method) + assert.Equal(t, "PostmanRuntime/7.21.0", *httpData.Request.UserAgent) + contentLength := *httpData.Response.ContentLength.(*int64) + assert.Equal(t, int64(12452), contentLength) + assert.Equal(t, int64(200), *httpData.Response.Status) + assert.NotNil(t, filtered) +} + +func TestSpanWithClientAddrWithoutNetworkPeerAddr(t *testing.T) { + attributes := make(map[string]any) + attributes[AttributeURLFull] = "https://api.example.com/users/junit" + attributes[AttributeClientAddress] = "192.168.15.32" + span := constructHTTPServerSpan(attributes) + + _, httpData := makeHTTP(span) + + assert.Equal(t, aws.Bool(true), httpData.Request.XForwardedFor) +} +func TestSpanWithClientAddrAndNetworkPeerAddr(t *testing.T) { + attributes := make(map[string]any) + attributes[AttributeURLFull] = "https://api.example.com/users/junit" + attributes[AttributeClientAddress] = "192.168.15.32" + attributes[AttributeNetworkPeerAddress] = "192.168.15.32" + span := constructHTTPServerSpan(attributes) + + _, httpData := makeHTTP(span) + + assert.Equal(t, "192.168.15.32", *httpData.Request.ClientIP) + assert.Nil(t, httpData.Request.XForwardedFor) +} + +func TestSpanWithClientAddrNotIP(t *testing.T) { + attributes := make(map[string]any) + attributes[AttributeURLFull] = "https://api.example.com/users/junit" + attributes[AttributeClientAddress] = "api.example.com" + attributes[AttributeNetworkPeerAddress] = "api.example.com" + span := constructHTTPServerSpan(attributes) + + _, httpData := makeHTTP(span) + + assert.Nil(t, httpData.Request.ClientIP) + assert.Nil(t, httpData.Request.XForwardedFor) +} + func constructHTTPClientSpan(attributes map[string]any) ptrace.Span { endTime := time.Now().Round(time.Second) startTime := endTime.Add(-90 * time.Second) diff --git a/exporter/azuredataexplorerexporter/generated_component_test.go b/exporter/azuredataexplorerexporter/generated_component_test.go index ad0fdf341179..dff9e46e372b 100644 --- a/exporter/azuredataexplorerexporter/generated_component_test.go +++ b/exporter/azuredataexplorerexporter/generated_component_test.go @@ -5,27 +5,19 @@ package azuredataexplorerexporter import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -70,44 +62,40 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) + } +} - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - err = c.Start(context.Background(), host) - require.NoError(t, err) - require.NotPanics(t, func() { - switch e := c.(type) { - case exporter.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) - if !e.Capabilities().MutatesData { - logs.MarkReadOnly() - } - err = e.ConsumeLogs(context.Background(), logs) - case exporter.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() - if !e.Capabilities().MutatesData { - metrics.MarkReadOnly() - } - err = e.ConsumeMetrics(context.Background(), metrics) - case exporter.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() - if !e.Capabilities().MutatesData { - traces.MarkReadOnly() - } - err = e.ConsumeTraces(context.Background(), traces) - } - }) +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} - require.NoError(t, err) +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} - err = c.Shutdown(context.Background()) - require.NoError(t, err) - }) - } +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces } diff --git a/exporter/azuredataexplorerexporter/go.mod b/exporter/azuredataexplorerexporter/go.mod index 2948a9c9382b..ddd0c51e0674 100644 --- a/exporter/azuredataexplorerexporter/go.mod +++ b/exporter/azuredataexplorerexporter/go.mod @@ -17,7 +17,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/exporter/azuredataexplorerexporter/go.sum b/exporter/azuredataexplorerexporter/go.sum index 23aee674dde6..b4f1e4c3b03c 100644 --- a/exporter/azuredataexplorerexporter/go.sum +++ b/exporter/azuredataexplorerexporter/go.sum @@ -175,8 +175,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/exporter/azuredataexplorerexporter/metadata.yaml b/exporter/azuredataexplorerexporter/metadata.yaml index 942b3c6ffae6..34120f187a6c 100644 --- a/exporter/azuredataexplorerexporter/metadata.yaml +++ b/exporter/azuredataexplorerexporter/metadata.yaml @@ -8,6 +8,7 @@ status: codeowners: active: [asaharn, ag-ramachandran] +# TODO: Update the exporter to pass the tests tests: config: cluster_uri: "https://CLUSTER.kusto.windows.net" diff --git a/exporter/azuremonitorexporter/README.md b/exporter/azuremonitorexporter/README.md index d2d5f1ed4f25..168639863801 100644 --- a/exporter/azuremonitorexporter/README.md +++ b/exporter/azuremonitorexporter/README.md @@ -22,6 +22,14 @@ To configure the Azure Monitor Exporter, you must specify one of the following s - `connection_string` (recommended): The Azure Application Insights Connection String is required to send telemetry data to the monitoring service. It is the recommended method for configuring the exporter, aligning with Azure Monitor's best practices. If you need guidance on creating Azure resources, please refer to the step-by-step guides to [Create an Application Insights resource](https://docs.microsoft.com/azure/azure-monitor/app/create-new-resource) and [find your connection string](https://docs.microsoft.com/azure/azure-monitor/app/sdk-connection-string?tabs=net#find-your-connection-string). - `instrumentation_key`: Application Insights instrumentation key, which can be found in the Application Insights resource in the Azure Portal. While it is currently supported, its use is discouraged and it is slated for deprecation. It is highly encouraged to use the `connection_string` setting for new configurations and migrate existing configurations to use the `connection_string` as soon as possible. +### Environment Variable Support + +In addition to the above configuration options, the Azure Monitor Exporter now supports setting the connection string via the `APPLICATIONINSIGHTS_CONNECTION_STRING` environment variable. This method is particularly useful for cloud or containerized environments where managing configuration through environment variables is standard practice. + +**Note:** If both the environment variable and the `connection_string` configuration option are provided, the environment variable takes precedence. + +### Configuration Options + **Important**: Only one of `connection_string` or `instrumentation_key` should be specified in your configuration. If both are provided, `connection_string` will be used as the priority setting. The following settings can be optionally configured: @@ -58,6 +66,15 @@ exporters: instrumentation_key: b1cd0778-85fc-4677-a3fa-79d3c23e0efd ``` +Example using environment variable: + +Ensure `APPLICATIONINSIGHTS_CONNECTION_STRING` is set in your environment, then configure the exporter without specifying a connection string or instrumentation key: + +```yaml +exporters: + azuremonitor: +``` + ## Attribute mapping ### Traces diff --git a/exporter/azuremonitorexporter/connection_string_parser.go b/exporter/azuremonitorexporter/connection_string_parser.go index fd1a7d00e862..064f09c8a6f6 100644 --- a/exporter/azuremonitorexporter/connection_string_parser.go +++ b/exporter/azuremonitorexporter/connection_string_parser.go @@ -6,6 +6,7 @@ package azuremonitorexporter // import "github.com/open-telemetry/opentelemetry- import ( "fmt" "net/url" + "os" "path" "strings" ) @@ -16,14 +17,22 @@ type ConnectionVars struct { } const ( - DefaultIngestionEndpoint = "https://dc.services.visualstudio.com/" - IngestionEndpointKey = "IngestionEndpoint" - InstrumentationKey = "InstrumentationKey" - ConnectionStringMaxLength = 4096 + ApplicationInsightsConnectionString = "APPLICATIONINSIGHTS_CONNECTION_STRING" + DefaultIngestionEndpoint = "https://dc.services.visualstudio.com/" + IngestionEndpointKey = "IngestionEndpoint" + InstrumentationKey = "InstrumentationKey" + ConnectionStringMaxLength = 4096 ) func parseConnectionString(exporterConfig *Config) (*ConnectionVars, error) { - connectionString := string(exporterConfig.ConnectionString) + // First, try to get the connection string from the environment variable + connectionString := os.Getenv(ApplicationInsightsConnectionString) + + // If not found in the environment, use the one from the configuration + if connectionString == "" { + connectionString = string(exporterConfig.ConnectionString) + } + instrumentationKey := string(exporterConfig.InstrumentationKey) connectionVars := &ConnectionVars{} diff --git a/exporter/azuremonitorexporter/connection_string_parser_test.go b/exporter/azuremonitorexporter/connection_string_parser_test.go index cff893d4cd46..dd0adb373c0b 100644 --- a/exporter/azuremonitorexporter/connection_string_parser_test.go +++ b/exporter/azuremonitorexporter/connection_string_parser_test.go @@ -4,6 +4,7 @@ package azuremonitorexporter import ( + "os" "strings" "testing" @@ -15,6 +16,7 @@ import ( func TestParseConnectionString(t *testing.T) { tests := []struct { name string + envValue string config *Config want *ConnectionVars wantError bool @@ -116,10 +118,38 @@ func TestParseConnectionString(t *testing.T) { want: nil, wantError: true, }, + { + name: "Environment variable only", + envValue: "InstrumentationKey=00000000-0000-0000-0000-00000000ENV;IngestionEndpoint=https://ingestion.env.azuremonitor.com/", + config: &Config{}, + want: &ConnectionVars{ + InstrumentationKey: "00000000-0000-0000-0000-00000000ENV", + IngestionURL: "https://ingestion.env.azuremonitor.com/v2.1/track", + }, + wantError: false, + }, + { + name: "Environment variable override", + envValue: "InstrumentationKey=00000000-0000-0000-0000-00000000ENV;IngestionEndpoint=https://ingestion.override.azuremonitor.com/", + config: &Config{ + ConnectionString: "InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://ingestion.azuremonitor.com/", + InstrumentationKey: "00000000-0000-0000-0000-00000000IKEY", + }, + want: &ConnectionVars{ + InstrumentationKey: "00000000-0000-0000-0000-00000000ENV", + IngestionURL: "https://ingestion.override.azuremonitor.com/v2.1/track", + }, + wantError: false, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { + if tt.envValue != "" { + os.Setenv(ApplicationInsightsConnectionString, tt.envValue) + defer os.Unsetenv(ApplicationInsightsConnectionString) + } + got, err := parseConnectionString(tt.config) if tt.wantError { require.Error(t, err, "Expected an error but got none") diff --git a/exporter/azuremonitorexporter/generated_component_test.go b/exporter/azuremonitorexporter/generated_component_test.go index 75881fcdef0f..9e9048a6f007 100644 --- a/exporter/azuremonitorexporter/generated_component_test.go +++ b/exporter/azuremonitorexporter/generated_component_test.go @@ -5,27 +5,20 @@ package azuremonitorexporter import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -70,9 +63,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -81,19 +72,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case exporter.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case exporter.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case exporter.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -106,3 +97,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/exporter/azuremonitorexporter/go.mod b/exporter/azuremonitorexporter/go.mod index c5dc412313d5..da4cacba658a 100644 --- a/exporter/azuremonitorexporter/go.mod +++ b/exporter/azuremonitorexporter/go.mod @@ -15,7 +15,7 @@ require ( go.opentelemetry.io/collector/semconv v0.95.0 go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 golang.org/x/net v0.21.0 ) diff --git a/exporter/azuremonitorexporter/go.sum b/exporter/azuremonitorexporter/go.sum index ddf0adb05204..82954c0fea98 100644 --- a/exporter/azuremonitorexporter/go.sum +++ b/exporter/azuremonitorexporter/go.sum @@ -128,8 +128,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/exporter/carbonexporter/generated_component_test.go b/exporter/carbonexporter/generated_component_test.go new file mode 100644 index 000000000000..b4234639f099 --- /dev/null +++ b/exporter/carbonexporter/generated_component_test.go @@ -0,0 +1,120 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package carbonexporter + +import ( + "context" + "testing" + "time" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/exporter" + "go.opentelemetry.io/collector/exporter/exportertest" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" +) + +func TestComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "metrics", + createFn: func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateMetricsExporter(ctx, set, cfg) + }, + }, + } + + cm, err := confmaptest.LoadConf("metadata.yaml") + require.NoError(t, err) + cfg := factory.CreateDefaultConfig() + sub, err := cm.Sub("tests::config") + require.NoError(t, err) + require.NoError(t, component.UnmarshalConfig(sub, cfg)) + + for _, test := range tests { + t.Run(test.name+"-shutdown", func(t *testing.T) { + c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + t.Run(test.name+"-lifecycle", func(t *testing.T) { + c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := componenttest.NewNopHost() + err = c.Start(context.Background(), host) + require.NoError(t, err) + require.NotPanics(t, func() { + switch e := c.(type) { + case exporter.Logs: + logs := generateLifecycleTestLogs() + if !e.Capabilities().MutatesData { + logs.MarkReadOnly() + } + err = e.ConsumeLogs(context.Background(), logs) + case exporter.Metrics: + metrics := generateLifecycleTestMetrics() + if !e.Capabilities().MutatesData { + metrics.MarkReadOnly() + } + err = e.ConsumeMetrics(context.Background(), metrics) + case exporter.Traces: + traces := generateLifecycleTestTraces() + if !e.Capabilities().MutatesData { + traces.MarkReadOnly() + } + err = e.ConsumeTraces(context.Background(), traces) + } + }) + + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + } +} + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/exporter/carbonexporter/go.mod b/exporter/carbonexporter/go.mod index c5ecaa849f43..57716f12d745 100644 --- a/exporter/carbonexporter/go.mod +++ b/exporter/carbonexporter/go.mod @@ -54,7 +54,7 @@ require ( go.opentelemetry.io/otel/exporters/prometheus v0.45.2 // indirect go.opentelemetry.io/otel/sdk v1.23.1 // indirect go.opentelemetry.io/otel/sdk/metric v1.23.1 // indirect - go.uber.org/zap v1.26.0 // indirect + go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.20.0 // indirect golang.org/x/sys v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/exporter/carbonexporter/go.sum b/exporter/carbonexporter/go.sum index f3af55451556..b68468f7f848 100644 --- a/exporter/carbonexporter/go.sum +++ b/exporter/carbonexporter/go.sum @@ -110,8 +110,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/exporter/carbonexporter/metadata.yaml b/exporter/carbonexporter/metadata.yaml index 2985110e616b..68fcd20084aa 100644 --- a/exporter/carbonexporter/metadata.yaml +++ b/exporter/carbonexporter/metadata.yaml @@ -7,3 +7,6 @@ status: distributions: [contrib, observiq, sumo] codeowners: active: [aboguszewski-sumo] + +tests: + expect_consumer_error: true \ No newline at end of file diff --git a/exporter/cassandraexporter/generated_component_test.go b/exporter/cassandraexporter/generated_component_test.go index 8e29af758db9..3dcb72b4763c 100644 --- a/exporter/cassandraexporter/generated_component_test.go +++ b/exporter/cassandraexporter/generated_component_test.go @@ -5,27 +5,19 @@ package cassandraexporter import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -63,44 +55,40 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) + } +} - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - err = c.Start(context.Background(), host) - require.NoError(t, err) - require.NotPanics(t, func() { - switch e := c.(type) { - case exporter.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) - if !e.Capabilities().MutatesData { - logs.MarkReadOnly() - } - err = e.ConsumeLogs(context.Background(), logs) - case exporter.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() - if !e.Capabilities().MutatesData { - metrics.MarkReadOnly() - } - err = e.ConsumeMetrics(context.Background(), metrics) - case exporter.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() - if !e.Capabilities().MutatesData { - traces.MarkReadOnly() - } - err = e.ConsumeTraces(context.Background(), traces) - } - }) +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} - require.NoError(t, err) +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} - err = c.Shutdown(context.Background()) - require.NoError(t, err) - }) - } +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces } diff --git a/exporter/cassandraexporter/go.mod b/exporter/cassandraexporter/go.mod index d855973626b7..f9bb5accbe23 100644 --- a/exporter/cassandraexporter/go.mod +++ b/exporter/cassandraexporter/go.mod @@ -14,7 +14,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/exporter/cassandraexporter/go.sum b/exporter/cassandraexporter/go.sum index cfe1985b744d..938557e60f33 100644 --- a/exporter/cassandraexporter/go.sum +++ b/exporter/cassandraexporter/go.sum @@ -118,8 +118,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/exporter/cassandraexporter/metadata.yaml b/exporter/cassandraexporter/metadata.yaml index 65880b11f1aa..fe1aadab9901 100644 --- a/exporter/cassandraexporter/metadata.yaml +++ b/exporter/cassandraexporter/metadata.yaml @@ -8,6 +8,6 @@ status: codeowners: active: [atoulme, emreyalvac] +# TODO: Update the exporter to pass the tests tests: - config: skip_lifecycle: true \ No newline at end of file diff --git a/exporter/clickhouseexporter/generated_component_test.go b/exporter/clickhouseexporter/generated_component_test.go index 2884cf1302f4..f251d2cf9264 100644 --- a/exporter/clickhouseexporter/generated_component_test.go +++ b/exporter/clickhouseexporter/generated_component_test.go @@ -5,27 +5,19 @@ package clickhouseexporter import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -70,44 +62,40 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) + } +} - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - err = c.Start(context.Background(), host) - require.NoError(t, err) - require.NotPanics(t, func() { - switch e := c.(type) { - case exporter.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) - if !e.Capabilities().MutatesData { - logs.MarkReadOnly() - } - err = e.ConsumeLogs(context.Background(), logs) - case exporter.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() - if !e.Capabilities().MutatesData { - metrics.MarkReadOnly() - } - err = e.ConsumeMetrics(context.Background(), metrics) - case exporter.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() - if !e.Capabilities().MutatesData { - traces.MarkReadOnly() - } - err = e.ConsumeTraces(context.Background(), traces) - } - }) +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} - require.NoError(t, err) +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} - err = c.Shutdown(context.Background()) - require.NoError(t, err) - }) - } +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces } diff --git a/exporter/clickhouseexporter/go.mod b/exporter/clickhouseexporter/go.mod index cf58bac55035..8d589d85b25d 100644 --- a/exporter/clickhouseexporter/go.mod +++ b/exporter/clickhouseexporter/go.mod @@ -17,7 +17,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/exporter/clickhouseexporter/go.sum b/exporter/clickhouseexporter/go.sum index 084209016663..bf69b50f69d9 100644 --- a/exporter/clickhouseexporter/go.sum +++ b/exporter/clickhouseexporter/go.sum @@ -145,8 +145,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/exporter/clickhouseexporter/metadata.yaml b/exporter/clickhouseexporter/metadata.yaml index 7942f3775ca8..842ec148a226 100644 --- a/exporter/clickhouseexporter/metadata.yaml +++ b/exporter/clickhouseexporter/metadata.yaml @@ -8,6 +8,6 @@ status: codeowners: active: [hanjm, dmitryax, Frapschen] +# TODO: Update the exporter to pass the tests tests: - config: skip_lifecycle: true diff --git a/exporter/coralogixexporter/generated_component_test.go b/exporter/coralogixexporter/generated_component_test.go index 6ea095941f58..229c40148100 100644 --- a/exporter/coralogixexporter/generated_component_test.go +++ b/exporter/coralogixexporter/generated_component_test.go @@ -5,27 +5,20 @@ package coralogixexporter import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -70,9 +63,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -81,19 +72,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case exporter.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case exporter.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case exporter.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -106,3 +97,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/exporter/coralogixexporter/go.mod b/exporter/coralogixexporter/go.mod index 9db730786c5d..05ce6f323c2d 100644 --- a/exporter/coralogixexporter/go.mod +++ b/exporter/coralogixexporter/go.mod @@ -4,7 +4,6 @@ go 1.21 require ( github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.95.0 - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.95.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.95.0 go.opentelemetry.io/collector/config/configcompression v0.95.0 @@ -67,7 +66,7 @@ require ( go.opentelemetry.io/otel/sdk v1.23.1 // indirect go.opentelemetry.io/otel/sdk/metric v1.23.1 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.26.0 // indirect + go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.20.0 // indirect golang.org/x/sys v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect @@ -85,11 +84,3 @@ retract ( v0.76.1 v0.65.0 ) - -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal => ../../internal/coreinternal - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil => ../../pkg/pdatautil - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden diff --git a/exporter/coralogixexporter/go.sum b/exporter/coralogixexporter/go.sum index b4e22bfbe5c4..fd46b28631dc 100644 --- a/exporter/coralogixexporter/go.sum +++ b/exporter/coralogixexporter/go.sum @@ -140,8 +140,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/exporter/datadogexporter/factory.go b/exporter/datadogexporter/factory.go index 5cda467dcdab..cc338aedecfb 100644 --- a/exporter/datadogexporter/factory.go +++ b/exporter/datadogexporter/factory.go @@ -13,6 +13,7 @@ import ( pb "github.com/DataDog/datadog-agent/pkg/proto/pbgo/trace" "github.com/DataDog/datadog-agent/pkg/trace/agent" "github.com/DataDog/datadog-agent/pkg/trace/telemetry" + "github.com/DataDog/datadog-agent/pkg/trace/timing" "github.com/DataDog/datadog-agent/pkg/trace/writer" "github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata" "github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes" @@ -140,9 +141,8 @@ func (f *factory) StopReporter() { }) } -func (f *factory) TraceAgent(ctx context.Context, params exporter.CreateSettings, cfg *Config, sourceProvider source.Provider) (*agent.Agent, error) { - datadog.InitializeMetricClient(params.MeterProvider) - agnt, err := newTraceAgent(ctx, params, cfg, sourceProvider) +func (f *factory) TraceAgent(ctx context.Context, params exporter.CreateSettings, cfg *Config, sourceProvider source.Provider, attrsTranslator *attributes.Translator) (*agent.Agent, error) { + agnt, err := newTraceAgent(ctx, params, cfg, sourceProvider, datadog.InitializeMetricClient(params.MeterProvider), attrsTranslator) if err != nil { return nil, err } @@ -240,7 +240,7 @@ func checkAndCastConfig(c component.Config, logger *zap.Logger) *Config { return cfg } -func (f *factory) consumeStatsPayload(ctx context.Context, statsIn <-chan []byte, statsToAgent chan<- *pb.StatsPayload, tracerVersion string, logger *zap.Logger) { +func (f *factory) consumeStatsPayload(ctx context.Context, statsIn <-chan []byte, statsToAgent chan<- *pb.StatsPayload, tracerVersion string, agentVersion string, logger *zap.Logger) { for i := 0; i < runtime.NumCPU(); i++ { f.wg.Add(1) go func() { @@ -262,6 +262,8 @@ func (f *factory) consumeStatsPayload(ctx context.Context, statsIn <-chan []byte csp.TracerVersion = tracerVersion } } + // The DD Connector doesn't set the agent version, so we'll set it here + sp.AgentVersion = agentVersion statsToAgent <- sp } } @@ -283,24 +285,30 @@ func (f *factory) createMetricsExporter( ctx, cancel := context.WithCancel(ctx) // cancel() runs on shutdown + + attrsTranslator, err := f.AttributesTranslator(set.TelemetrySettings) + if err != nil { + cancel() + return nil, fmt.Errorf("failed to build attributes translator: %w", err) + } + var pushMetricsFn consumer.ConsumeMetricsFunc - acfg, err := newTraceAgentConfig(ctx, set, cfg, hostProvider) + acfg, err := newTraceAgentConfig(ctx, set, cfg, hostProvider, attrsTranslator) if err != nil { cancel() return nil, err } statsToAgent := make(chan *pb.StatsPayload) - statsWriter := writer.NewStatsWriter(acfg, statsToAgent, telemetry.NewNoopCollector()) + metricsClient := datadog.InitializeMetricClient(set.MeterProvider) + timingReporter := timing.New(metricsClient) + statsWriter := writer.NewStatsWriter(acfg, statsToAgent, telemetry.NewNoopCollector(), metricsClient, timingReporter) set.Logger.Debug("Starting Datadog Trace-Agent StatsWriter") go statsWriter.Run() - var statsIn chan []byte - if datadog.ConnectorPerformanceFeatureGate.IsEnabled() { - statsIn = make(chan []byte, 1000) - statsv := set.BuildInfo.Command + set.BuildInfo.Version - f.consumeStatsPayload(ctx, statsIn, statsToAgent, statsv, set.Logger) - } + statsIn := make(chan []byte, 1000) + statsv := set.BuildInfo.Command + set.BuildInfo.Version + f.consumeStatsPayload(ctx, statsIn, statsToAgent, statsv, acfg.AgentVersion, set.Logger) pcfg := newMetadataConfigfromConfig(cfg) metadataReporter, err := f.Reporter(set, pcfg) if err != nil { @@ -308,12 +316,6 @@ func (f *factory) createMetricsExporter( return nil, fmt.Errorf("failed to build host metadata reporter: %w", err) } - attrsTranslator, err := f.AttributesTranslator(set.TelemetrySettings) - if err != nil { - cancel() - return nil, fmt.Errorf("failed to build attributes translator: %w", err) - } - if cfg.OnlyMetadata { pushMetricsFn = func(_ context.Context, md pmetric.Metrics) error { // only sending metadata use only metrics @@ -393,7 +395,14 @@ func (f *factory) createTracesExporter( } ctx, cancel := context.WithCancel(ctx) // cancel() runs on shutdown - traceagent, err := f.TraceAgent(ctx, set, cfg, hostProvider) + + attrsTranslator, err := f.AttributesTranslator(set.TelemetrySettings) + if err != nil { + cancel() + return nil, fmt.Errorf("failed to build attributes translator: %w", err) + } + + traceagent, err := f.TraceAgent(ctx, set, cfg, hostProvider, attrsTranslator) if err != nil { cancel() return nil, fmt.Errorf("failed to start trace-agent: %w", err) diff --git a/exporter/datadogexporter/generated_component_test.go b/exporter/datadogexporter/generated_component_test.go index c0e112ff059c..0938f49b1bec 100644 --- a/exporter/datadogexporter/generated_component_test.go +++ b/exporter/datadogexporter/generated_component_test.go @@ -5,27 +5,20 @@ package datadogexporter import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -70,9 +63,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -81,19 +72,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case exporter.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case exporter.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case exporter.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -106,3 +97,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/exporter/datadogexporter/go.mod b/exporter/datadogexporter/go.mod index aff60a3808a1..cc272ddad5f2 100644 --- a/exporter/datadogexporter/go.mod +++ b/exporter/datadogexporter/go.mod @@ -5,17 +5,18 @@ go 1.21 require ( github.com/DataDog/agent-payload/v5 v5.0.104 github.com/DataDog/datadog-agent/pkg/proto v0.52.0-devel - github.com/DataDog/datadog-agent/pkg/trace v0.50.2 + github.com/DataDog/datadog-agent/pkg/trace v0.51.1-0.20240301173728-334e775e420a github.com/DataDog/datadog-api-client-go/v2 v2.22.0 + github.com/DataDog/datadog-go/v5 v5.5.0 github.com/DataDog/gohai v0.0.0-20230524154621-4316413895ee - github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.13.3 - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.13.3 - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.13.3 - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.13.3 - github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.13.3 + github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.13.4 + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.13.4 + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.13.4 + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.13.4 + github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.13.4 github.com/DataDog/sketches-go v1.4.4 github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.21.0 - github.com/aws/aws-sdk-go v1.50.17 + github.com/aws/aws-sdk-go v1.50.27 github.com/cenkalti/backoff/v4 v4.2.1 github.com/open-telemetry/opentelemetry-collector-contrib/connector/datadogconnector v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/ecsutil v0.95.0 @@ -52,7 +53,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 google.golang.org/protobuf v1.32.0 gopkg.in/yaml.v2 v2.4.0 gopkg.in/zorkian/go-datadog-api.v2 v2.30.0 @@ -69,14 +70,13 @@ require ( github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v4 v4.2.1 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2 v2.2.1 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1 // indirect - github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.2 // indirect - github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.2 // indirect - github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.2 // indirect - github.com/DataDog/datadog-agent/pkg/util/log v0.50.2 // indirect - github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.2 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.2 // indirect - github.com/DataDog/datadog-go/v5 v5.1.1 // indirect - github.com/DataDog/go-sqllexer v0.0.8 // indirect + github.com/DataDog/datadog-agent/pkg/obfuscate v0.51.1-0.20240301173728-334e775e420a // indirect + github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.51.1-0.20240301173728-334e775e420a // indirect + github.com/DataDog/datadog-agent/pkg/util/cgroups v0.51.1-0.20240301173728-334e775e420a // indirect + github.com/DataDog/datadog-agent/pkg/util/log v0.51.1-0.20240301173728-334e775e420a // indirect + github.com/DataDog/datadog-agent/pkg/util/pointer v0.51.1-0.20240301173728-334e775e420a // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.51.1-0.20240301173728-334e775e420a // indirect + github.com/DataDog/go-sqllexer v0.0.9 // indirect github.com/DataDog/go-tuf v1.0.2-0.5.2 // indirect github.com/DataDog/zstd v1.5.2 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect diff --git a/exporter/datadogexporter/go.sum b/exporter/datadogexporter/go.sum index 647aef8b5e64..36204a725fc7 100644 --- a/exporter/datadogexporter/go.sum +++ b/exporter/datadogexporter/go.sum @@ -68,45 +68,45 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DataDog/agent-payload/v5 v5.0.104 h1:uxTIaLthyKB4CxBKe+2FeMgL6ca3KVxpeYxlJGNcoJg= github.com/DataDog/agent-payload/v5 v5.0.104/go.mod h1:COngtbYYCncpIPiE5D93QlXDH/3VAKk10jDNwGHcMRE= -github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.2 h1:y08IzbpFM/HBaKfgayFZe1FpcbZn6bVPXoZ++93vxv8= -github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.2/go.mod h1:A4nLJvxlg6BO/8/zg81til9yT0uRPuXDFMAzDMpmgn4= +github.com/DataDog/datadog-agent/pkg/obfuscate v0.51.1-0.20240301173728-334e775e420a h1:8t9jpJHbq3WosQmXCVDjqNfGFFPBxBT7/9mbyQqHMi0= +github.com/DataDog/datadog-agent/pkg/obfuscate v0.51.1-0.20240301173728-334e775e420a/go.mod h1:Ai57GjsZUn9AOo4L9ZOdu5uTuGaAxXMh0kin544Lgw0= github.com/DataDog/datadog-agent/pkg/proto v0.52.0-devel h1:nBejGNIU6Jk7bPBxz2bAO+f+kahAXWBXPecebY3R+Zo= github.com/DataDog/datadog-agent/pkg/proto v0.52.0-devel/go.mod h1:wjr5YlVvGip6VmAGzHrdBaGUu1LaA9B6gHvInm5kHiY= -github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.2 h1:7jn5EOu84uph4sd+pB3vF8LnsdTjhh+1/NnCvfNpG4A= -github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.2/go.mod h1:Vc+snp0Bey4MrrJyiV2tVxxJb6BmLomPvN1RgAvjGaQ= -github.com/DataDog/datadog-agent/pkg/trace v0.50.2 h1:eyjTZx3yupppiND/qwiUj6VuWHfyGfPMrqQwRgE41Rw= -github.com/DataDog/datadog-agent/pkg/trace v0.50.2/go.mod h1:SWNRcgZoBNoiyRrECEEe3xQGNCXfqzZVOB43WxDAMlc= -github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.2 h1:f+dYKVwMoGHZpOQM33Wogb/er8ZXeo4aUcbkSk17lM8= -github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.2/go.mod h1:4DalvbtHzT0nqpbj/36FP0IwfKWCSB5Zap7O/SGfPKI= -github.com/DataDog/datadog-agent/pkg/util/log v0.50.2 h1:D4jzhoZtZikiugOr2pl6Xm+MMfrwkjnZziGHgTNpBLk= -github.com/DataDog/datadog-agent/pkg/util/log v0.50.2/go.mod h1:0vyUsWVWDdIRzd6Itim0ZkjCvOF7V8Yi4IzpE5q/UPo= -github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.2 h1:yq97sYsulZz/qyl/bogRigvUskqXPSrt8c7b+xKDs4I= -github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.2/go.mod h1:eTXti9mx7qhkoi+Qg3mMmvVY5McghUUgsf4Hrk9zY8k= -github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.2 h1:xFGXfIsTyHC0VlrrfoAVaZ1pBAJUh2ARZrS7gcdAooY= -github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.2/go.mod h1:EOGgNrSPskIxY3+KgCl+yEggMjrGqrA2oL5va+/p2jM= +github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.51.1-0.20240301173728-334e775e420a h1:7Wijer1rhN7tsEm6mVjXaYZ2XjmKM8cgJKc0hkr57V8= +github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.51.1-0.20240301173728-334e775e420a/go.mod h1:Vc+snp0Bey4MrrJyiV2tVxxJb6BmLomPvN1RgAvjGaQ= +github.com/DataDog/datadog-agent/pkg/trace v0.51.1-0.20240301173728-334e775e420a h1:6ko5fCAcwToPALbUZiqR2tpjIzzqYR+uVXR7t1khRuE= +github.com/DataDog/datadog-agent/pkg/trace v0.51.1-0.20240301173728-334e775e420a/go.mod h1:qMvCrksIQC0czvZB72YdtVfxAK6/Vq2iPNJT7k6q+Bo= +github.com/DataDog/datadog-agent/pkg/util/cgroups v0.51.1-0.20240301173728-334e775e420a h1:95lqMrZdzqfrxxcLUepiEw2zHv7JCFSQhTr3/z1aKl4= +github.com/DataDog/datadog-agent/pkg/util/cgroups v0.51.1-0.20240301173728-334e775e420a/go.mod h1:m4jQb4BdnVTi7jaSETmJ0dQchgOphmZqPuMuwzjpFeM= +github.com/DataDog/datadog-agent/pkg/util/log v0.51.1-0.20240301173728-334e775e420a h1:IW8buCp4IiU0b1lC7x7W0hHlc+ADwV/hmistYtFogL0= +github.com/DataDog/datadog-agent/pkg/util/log v0.51.1-0.20240301173728-334e775e420a/go.mod h1:KdMEnEsO0dn53y3DLcbInK8NaMWnPgo+MunQsQ4cGF8= +github.com/DataDog/datadog-agent/pkg/util/pointer v0.51.1-0.20240301173728-334e775e420a h1:7FUY9948Nsrdfh1P/F1RkJ/gcUZVbTz9ippSbtl3cxo= +github.com/DataDog/datadog-agent/pkg/util/pointer v0.51.1-0.20240301173728-334e775e420a/go.mod h1:eTXti9mx7qhkoi+Qg3mMmvVY5McghUUgsf4Hrk9zY8k= +github.com/DataDog/datadog-agent/pkg/util/scrubber v0.51.1-0.20240301173728-334e775e420a h1:ENeNLL5ItDcd4400kGP148+IMzMlaIZGRfFLa3GJNdY= +github.com/DataDog/datadog-agent/pkg/util/scrubber v0.51.1-0.20240301173728-334e775e420a/go.mod h1:EOGgNrSPskIxY3+KgCl+yEggMjrGqrA2oL5va+/p2jM= github.com/DataDog/datadog-api-client-go/v2 v2.22.0 h1:+DtWu4PjGxsJU8FESjPi7C2rTDMojNungejsIzNFe70= github.com/DataDog/datadog-api-client-go/v2 v2.22.0/go.mod h1:QKOu6vscsh87fMY1lHfLEmNSunyXImj8BUaUWJXOehc= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/DataDog/datadog-go/v5 v5.1.1 h1:JLZ6s2K1pG2h9GkvEvMdEGqMDyVLEAccdX5TltWcLMU= -github.com/DataDog/datadog-go/v5 v5.1.1/go.mod h1:KhiYb2Badlv9/rofz+OznKoEF5XKTonWyhx5K83AP8E= -github.com/DataDog/go-sqllexer v0.0.8 h1:vfC8R9PhmJfeOKcFYAX9UOd890A3wu3KrjU9Kr7nM0E= -github.com/DataDog/go-sqllexer v0.0.8/go.mod h1:nB4Ea2YNsqMwtbWMc4Fm/oP98IIrSPapqwOwPioMspY= +github.com/DataDog/datadog-go/v5 v5.5.0 h1:G5KHeB8pWBNXT4Jtw0zAkhdxEAWSpWH00geHI6LDrKU= +github.com/DataDog/datadog-go/v5 v5.5.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw= +github.com/DataDog/go-sqllexer v0.0.9 h1:Cx2Cu1S0hfj4coCCA8hzjM9+UNFRkcu1avIV//RU5Qw= +github.com/DataDog/go-sqllexer v0.0.9/go.mod h1:nB4Ea2YNsqMwtbWMc4Fm/oP98IIrSPapqwOwPioMspY= github.com/DataDog/go-tuf v1.0.2-0.5.2 h1:EeZr937eKAWPxJ26IykAdWA4A0jQXJgkhUjqEI/w7+I= github.com/DataDog/go-tuf v1.0.2-0.5.2/go.mod h1:zBcq6f654iVqmkk8n2Cx81E1JnNTMOAx1UEO/wZR+P0= github.com/DataDog/gohai v0.0.0-20230524154621-4316413895ee h1:tXibLZk3G6HncIFJKaNItsdzcrk4YqILNDZlXPTNt4k= github.com/DataDog/gohai v0.0.0-20230524154621-4316413895ee/go.mod h1:nTot/Iy0kW16bXgXr6blEc8gFeAS7vTqYlhAxh+dbc0= -github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.13.3 h1:XEhjylKpZec5tUQyw+fOYYBIEnktiCr/TKsrvFUB7uA= -github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.13.3/go.mod h1:63BBpcn68W2K89ZaLzYtzUiEit49+Rf2ZsEYza2TAcc= -github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.13.3 h1:hnzEiqocvnt6U1QGxfeDFf5xhE77jt4LOjZAXW9ueWo= -github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.13.3/go.mod h1:Tk2wwdBgWeSvDPtrGGyym8CdVWSuphiToGc/tRvFoNQ= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.13.3 h1:hcYZMgGDMUz8Dz6PcOhgk6FF0yG4N7KErS5J3O/MpeU= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.13.3/go.mod h1:Z2FPxYhi8GIFkS4WLC7RrRaGolyB9TqS2RMSwNcmczk= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.13.3 h1:oaYprbAr8/mPEyFNfqnm668bxg8IG000sQ6uNuuffro= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.13.3/go.mod h1:dmNsrdpbegG62b7/ETcRi53OsOmYlfshuTThx9BAiQI= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.13.3 h1:QelZO3ixjVqlqzTa+wxIDFvYnnzy/SG9iqXci1nhouc= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.13.3/go.mod h1:AObll3Cj7UJK56bc7HRrpbGWc98C1Io0ChpFEoxS2f8= -github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.13.3 h1:9fdt/9NeSUtypPT4du2/5TTQic9nL1YqDSIaq5Ttsi4= -github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.13.3/go.mod h1:P8Tr/1BSm0vQ0UXVOtIKmJKXCgb84jdFe9HuBKJPwkc= +github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.13.4 h1:PTIZJAsfnr2XLB3V3duL+mSbZvYV8G3XQ9e57KyOuOA= +github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.13.4/go.mod h1:5yS6i90MEZS3NG+o7PrQQ8i7OaEMzwQvn4bCZ9h9Rao= +github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.13.4 h1:B2R7Wh791uphpltmorbvvdKk0rJOhoExwM4NnE7hXTg= +github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.13.4/go.mod h1:Tk2wwdBgWeSvDPtrGGyym8CdVWSuphiToGc/tRvFoNQ= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.13.4 h1:GcJUxjunnJEL62K+fY7pjyvcb4Cvqr5VtD0DFc8rp+w= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.13.4/go.mod h1:/9yo8Scnf6R0KufxJIHfQD+GAbT9cyINxaTPMDgl2Wk= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.13.4 h1:dU9oPMbAr/wYMNdzhu0pxIhAJOn1Btj1T3ZSyY6RvY0= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.13.4/go.mod h1:ud/Xr5TWUopcaGHdkh9RN8lhnCAFa95X16Rb5mrkE18= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.13.4 h1:ZuYc5Ql/GSyAEMgpKkbQiHOtIHkEpYujITW1wIVFgLE= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.13.4/go.mod h1:YSntkplFoUM1mepnPeJFsoblqD0Wdi+Avg1/d1upgZQ= +github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.13.4 h1:t/Zh8ztLDBOMRMiuVNFthWMMG5F4POgc5M6+Y3DTX9g= +github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.13.4/go.mod h1:JfdBBDreQfbIN5FYrAtZV3VmQMXnf9o4tMbaMxWqe40= github.com/DataDog/sketches-go v1.4.4 h1:dF52vzXRFSPOj2IjXSWLvXq3jubL4CI69kwYjJ1w5Z8= github.com/DataDog/sketches-go v1.4.4/go.mod h1:XR0ns2RtEEF09mDKXiKZiQg+nfZStrq1ZuL1eezeZe0= github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= @@ -140,8 +140,8 @@ github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj 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.38.35/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= -github.com/aws/aws-sdk-go v1.50.17 h1:KsbzUKDgGNlkDHGvoQDhiJ63a9jtZd+O+/s3pTOr/ns= -github.com/aws/aws-sdk-go v1.50.17/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.50.27 h1:96ifhrSuja+AzdP3W/T2337igqVQ2FcSIJYkk+0rCeA= +github.com/aws/aws-sdk-go v1.50.27/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= 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 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -897,8 +897,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= diff --git a/exporter/datadogexporter/integrationtest/go.mod b/exporter/datadogexporter/integrationtest/go.mod index 0eb34aa75e63..05cd90385949 100644 --- a/exporter/datadogexporter/integrationtest/go.mod +++ b/exporter/datadogexporter/integrationtest/go.mod @@ -6,7 +6,6 @@ require ( github.com/DataDog/datadog-agent/pkg/proto v0.52.0-devel github.com/open-telemetry/opentelemetry-collector-contrib/connector/datadogconnector v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/exporter/datadogexporter v0.95.0 - github.com/open-telemetry/opentelemetry-collector-contrib/internal/datadog v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.95.0 github.com/stretchr/testify v1.8.4 github.com/tinylib/msgp v1.1.9 @@ -16,7 +15,6 @@ require ( go.opentelemetry.io/collector/connector v0.95.0 go.opentelemetry.io/collector/exporter v0.95.0 go.opentelemetry.io/collector/exporter/debugexporter v0.95.0 - go.opentelemetry.io/collector/featuregate v1.2.0 go.opentelemetry.io/collector/otelcol v0.95.0 go.opentelemetry.io/collector/processor v0.95.0 go.opentelemetry.io/collector/processor/batchprocessor v0.95.0 @@ -33,29 +31,29 @@ require ( cloud.google.com/go/compute v1.23.3 // indirect cloud.google.com/go/compute/metadata v0.2.4-0.20230617002413-005d2dfb6b68 // indirect github.com/DataDog/agent-payload/v5 v5.0.104 // indirect - github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.2 // indirect - github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.2 // indirect - github.com/DataDog/datadog-agent/pkg/trace v0.50.2 // indirect - github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.2 // indirect - github.com/DataDog/datadog-agent/pkg/util/log v0.50.2 // indirect - github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.2 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.2 // indirect + github.com/DataDog/datadog-agent/pkg/obfuscate v0.51.1-0.20240301173728-334e775e420a // indirect + github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.51.1-0.20240301173728-334e775e420a // indirect + github.com/DataDog/datadog-agent/pkg/trace v0.51.1-0.20240301173728-334e775e420a // indirect + github.com/DataDog/datadog-agent/pkg/util/cgroups v0.51.1-0.20240301173728-334e775e420a // indirect + github.com/DataDog/datadog-agent/pkg/util/log v0.51.1-0.20240301173728-334e775e420a // indirect + github.com/DataDog/datadog-agent/pkg/util/pointer v0.51.1-0.20240301173728-334e775e420a // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.51.1-0.20240301173728-334e775e420a // indirect github.com/DataDog/datadog-api-client-go/v2 v2.22.0 // indirect - github.com/DataDog/datadog-go/v5 v5.1.1 // indirect - github.com/DataDog/go-sqllexer v0.0.8 // indirect + github.com/DataDog/datadog-go/v5 v5.5.0 // indirect + github.com/DataDog/go-sqllexer v0.0.9 // indirect github.com/DataDog/go-tuf v1.0.2-0.5.2 // indirect github.com/DataDog/gohai v0.0.0-20230524154621-4316413895ee // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.13.3 // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.13.3 // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.13.3 // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.13.3 // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.13.3 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.13.4 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.13.4 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.13.4 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.13.4 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.13.4 // indirect github.com/DataDog/sketches-go v1.4.4 // indirect github.com/DataDog/zstd v1.5.2 // indirect github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.21.0 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/alecthomas/participle/v2 v2.1.1 // indirect - github.com/aws/aws-sdk-go v1.50.17 // indirect + github.com/aws/aws-sdk-go v1.50.27 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cenkalti/backoff v2.2.1+incompatible // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect @@ -88,6 +86,7 @@ require ( github.com/google/gofuzz v1.2.0 // indirect github.com/google/uuid v1.6.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 // indirect + github.com/haimrubinstein/go-syslog/v3 v3.0.3 // indirect github.com/hashicorp/go-version v1.6.0 // indirect github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/iancoleman/strcase v0.3.0 // indirect @@ -113,6 +112,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/ecsutil v0.95.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.95.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.95.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/datadog v0.95.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.95.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig v0.95.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders v0.95.0 // indirect @@ -161,6 +161,7 @@ require ( go.opentelemetry.io/collector/consumer v0.95.0 // indirect go.opentelemetry.io/collector/extension v0.95.0 // indirect go.opentelemetry.io/collector/extension/auth v0.95.0 // indirect + go.opentelemetry.io/collector/featuregate v1.2.0 // indirect go.opentelemetry.io/collector/pdata v1.2.0 // indirect go.opentelemetry.io/collector/semconv v0.95.0 // indirect go.opentelemetry.io/collector/service v0.95.0 // indirect @@ -181,7 +182,7 @@ require ( go.opentelemetry.io/proto/otlp v1.1.0 // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.26.0 // indirect + go.uber.org/zap v1.27.0 // indirect golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.21.0 // indirect diff --git a/exporter/datadogexporter/integrationtest/go.sum b/exporter/datadogexporter/integrationtest/go.sum index c33ffe520c3b..f327ccb2d110 100644 --- a/exporter/datadogexporter/integrationtest/go.sum +++ b/exporter/datadogexporter/integrationtest/go.sum @@ -48,44 +48,44 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DataDog/agent-payload/v5 v5.0.104 h1:uxTIaLthyKB4CxBKe+2FeMgL6ca3KVxpeYxlJGNcoJg= github.com/DataDog/agent-payload/v5 v5.0.104/go.mod h1:COngtbYYCncpIPiE5D93QlXDH/3VAKk10jDNwGHcMRE= -github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.2 h1:y08IzbpFM/HBaKfgayFZe1FpcbZn6bVPXoZ++93vxv8= -github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.2/go.mod h1:A4nLJvxlg6BO/8/zg81til9yT0uRPuXDFMAzDMpmgn4= +github.com/DataDog/datadog-agent/pkg/obfuscate v0.51.1-0.20240301173728-334e775e420a h1:8t9jpJHbq3WosQmXCVDjqNfGFFPBxBT7/9mbyQqHMi0= +github.com/DataDog/datadog-agent/pkg/obfuscate v0.51.1-0.20240301173728-334e775e420a/go.mod h1:Ai57GjsZUn9AOo4L9ZOdu5uTuGaAxXMh0kin544Lgw0= github.com/DataDog/datadog-agent/pkg/proto v0.52.0-devel h1:nBejGNIU6Jk7bPBxz2bAO+f+kahAXWBXPecebY3R+Zo= github.com/DataDog/datadog-agent/pkg/proto v0.52.0-devel/go.mod h1:wjr5YlVvGip6VmAGzHrdBaGUu1LaA9B6gHvInm5kHiY= -github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.2 h1:7jn5EOu84uph4sd+pB3vF8LnsdTjhh+1/NnCvfNpG4A= -github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.2/go.mod h1:Vc+snp0Bey4MrrJyiV2tVxxJb6BmLomPvN1RgAvjGaQ= -github.com/DataDog/datadog-agent/pkg/trace v0.50.2 h1:eyjTZx3yupppiND/qwiUj6VuWHfyGfPMrqQwRgE41Rw= -github.com/DataDog/datadog-agent/pkg/trace v0.50.2/go.mod h1:SWNRcgZoBNoiyRrECEEe3xQGNCXfqzZVOB43WxDAMlc= -github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.2 h1:f+dYKVwMoGHZpOQM33Wogb/er8ZXeo4aUcbkSk17lM8= -github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.2/go.mod h1:4DalvbtHzT0nqpbj/36FP0IwfKWCSB5Zap7O/SGfPKI= -github.com/DataDog/datadog-agent/pkg/util/log v0.50.2 h1:D4jzhoZtZikiugOr2pl6Xm+MMfrwkjnZziGHgTNpBLk= -github.com/DataDog/datadog-agent/pkg/util/log v0.50.2/go.mod h1:0vyUsWVWDdIRzd6Itim0ZkjCvOF7V8Yi4IzpE5q/UPo= -github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.2 h1:yq97sYsulZz/qyl/bogRigvUskqXPSrt8c7b+xKDs4I= -github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.2/go.mod h1:eTXti9mx7qhkoi+Qg3mMmvVY5McghUUgsf4Hrk9zY8k= -github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.2 h1:xFGXfIsTyHC0VlrrfoAVaZ1pBAJUh2ARZrS7gcdAooY= -github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.2/go.mod h1:EOGgNrSPskIxY3+KgCl+yEggMjrGqrA2oL5va+/p2jM= +github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.51.1-0.20240301173728-334e775e420a h1:7Wijer1rhN7tsEm6mVjXaYZ2XjmKM8cgJKc0hkr57V8= +github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.51.1-0.20240301173728-334e775e420a/go.mod h1:Vc+snp0Bey4MrrJyiV2tVxxJb6BmLomPvN1RgAvjGaQ= +github.com/DataDog/datadog-agent/pkg/trace v0.51.1-0.20240301173728-334e775e420a h1:6ko5fCAcwToPALbUZiqR2tpjIzzqYR+uVXR7t1khRuE= +github.com/DataDog/datadog-agent/pkg/trace v0.51.1-0.20240301173728-334e775e420a/go.mod h1:qMvCrksIQC0czvZB72YdtVfxAK6/Vq2iPNJT7k6q+Bo= +github.com/DataDog/datadog-agent/pkg/util/cgroups v0.51.1-0.20240301173728-334e775e420a h1:95lqMrZdzqfrxxcLUepiEw2zHv7JCFSQhTr3/z1aKl4= +github.com/DataDog/datadog-agent/pkg/util/cgroups v0.51.1-0.20240301173728-334e775e420a/go.mod h1:m4jQb4BdnVTi7jaSETmJ0dQchgOphmZqPuMuwzjpFeM= +github.com/DataDog/datadog-agent/pkg/util/log v0.51.1-0.20240301173728-334e775e420a h1:IW8buCp4IiU0b1lC7x7W0hHlc+ADwV/hmistYtFogL0= +github.com/DataDog/datadog-agent/pkg/util/log v0.51.1-0.20240301173728-334e775e420a/go.mod h1:KdMEnEsO0dn53y3DLcbInK8NaMWnPgo+MunQsQ4cGF8= +github.com/DataDog/datadog-agent/pkg/util/pointer v0.51.1-0.20240301173728-334e775e420a h1:7FUY9948Nsrdfh1P/F1RkJ/gcUZVbTz9ippSbtl3cxo= +github.com/DataDog/datadog-agent/pkg/util/pointer v0.51.1-0.20240301173728-334e775e420a/go.mod h1:eTXti9mx7qhkoi+Qg3mMmvVY5McghUUgsf4Hrk9zY8k= +github.com/DataDog/datadog-agent/pkg/util/scrubber v0.51.1-0.20240301173728-334e775e420a h1:ENeNLL5ItDcd4400kGP148+IMzMlaIZGRfFLa3GJNdY= +github.com/DataDog/datadog-agent/pkg/util/scrubber v0.51.1-0.20240301173728-334e775e420a/go.mod h1:EOGgNrSPskIxY3+KgCl+yEggMjrGqrA2oL5va+/p2jM= github.com/DataDog/datadog-api-client-go/v2 v2.22.0 h1:+DtWu4PjGxsJU8FESjPi7C2rTDMojNungejsIzNFe70= github.com/DataDog/datadog-api-client-go/v2 v2.22.0/go.mod h1:QKOu6vscsh87fMY1lHfLEmNSunyXImj8BUaUWJXOehc= -github.com/DataDog/datadog-go/v5 v5.1.1 h1:JLZ6s2K1pG2h9GkvEvMdEGqMDyVLEAccdX5TltWcLMU= -github.com/DataDog/datadog-go/v5 v5.1.1/go.mod h1:KhiYb2Badlv9/rofz+OznKoEF5XKTonWyhx5K83AP8E= -github.com/DataDog/go-sqllexer v0.0.8 h1:vfC8R9PhmJfeOKcFYAX9UOd890A3wu3KrjU9Kr7nM0E= -github.com/DataDog/go-sqllexer v0.0.8/go.mod h1:nB4Ea2YNsqMwtbWMc4Fm/oP98IIrSPapqwOwPioMspY= +github.com/DataDog/datadog-go/v5 v5.5.0 h1:G5KHeB8pWBNXT4Jtw0zAkhdxEAWSpWH00geHI6LDrKU= +github.com/DataDog/datadog-go/v5 v5.5.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw= +github.com/DataDog/go-sqllexer v0.0.9 h1:Cx2Cu1S0hfj4coCCA8hzjM9+UNFRkcu1avIV//RU5Qw= +github.com/DataDog/go-sqllexer v0.0.9/go.mod h1:nB4Ea2YNsqMwtbWMc4Fm/oP98IIrSPapqwOwPioMspY= github.com/DataDog/go-tuf v1.0.2-0.5.2 h1:EeZr937eKAWPxJ26IykAdWA4A0jQXJgkhUjqEI/w7+I= github.com/DataDog/go-tuf v1.0.2-0.5.2/go.mod h1:zBcq6f654iVqmkk8n2Cx81E1JnNTMOAx1UEO/wZR+P0= github.com/DataDog/gohai v0.0.0-20230524154621-4316413895ee h1:tXibLZk3G6HncIFJKaNItsdzcrk4YqILNDZlXPTNt4k= github.com/DataDog/gohai v0.0.0-20230524154621-4316413895ee/go.mod h1:nTot/Iy0kW16bXgXr6blEc8gFeAS7vTqYlhAxh+dbc0= -github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.13.3 h1:XEhjylKpZec5tUQyw+fOYYBIEnktiCr/TKsrvFUB7uA= -github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.13.3/go.mod h1:63BBpcn68W2K89ZaLzYtzUiEit49+Rf2ZsEYza2TAcc= -github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.13.3 h1:hnzEiqocvnt6U1QGxfeDFf5xhE77jt4LOjZAXW9ueWo= -github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.13.3/go.mod h1:Tk2wwdBgWeSvDPtrGGyym8CdVWSuphiToGc/tRvFoNQ= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.13.3 h1:hcYZMgGDMUz8Dz6PcOhgk6FF0yG4N7KErS5J3O/MpeU= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.13.3/go.mod h1:Z2FPxYhi8GIFkS4WLC7RrRaGolyB9TqS2RMSwNcmczk= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.13.3 h1:oaYprbAr8/mPEyFNfqnm668bxg8IG000sQ6uNuuffro= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.13.3/go.mod h1:dmNsrdpbegG62b7/ETcRi53OsOmYlfshuTThx9BAiQI= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.13.3 h1:QelZO3ixjVqlqzTa+wxIDFvYnnzy/SG9iqXci1nhouc= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.13.3/go.mod h1:AObll3Cj7UJK56bc7HRrpbGWc98C1Io0ChpFEoxS2f8= -github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.13.3 h1:9fdt/9NeSUtypPT4du2/5TTQic9nL1YqDSIaq5Ttsi4= -github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.13.3/go.mod h1:P8Tr/1BSm0vQ0UXVOtIKmJKXCgb84jdFe9HuBKJPwkc= +github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.13.4 h1:PTIZJAsfnr2XLB3V3duL+mSbZvYV8G3XQ9e57KyOuOA= +github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.13.4/go.mod h1:5yS6i90MEZS3NG+o7PrQQ8i7OaEMzwQvn4bCZ9h9Rao= +github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.13.4 h1:B2R7Wh791uphpltmorbvvdKk0rJOhoExwM4NnE7hXTg= +github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.13.4/go.mod h1:Tk2wwdBgWeSvDPtrGGyym8CdVWSuphiToGc/tRvFoNQ= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.13.4 h1:GcJUxjunnJEL62K+fY7pjyvcb4Cvqr5VtD0DFc8rp+w= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.13.4/go.mod h1:/9yo8Scnf6R0KufxJIHfQD+GAbT9cyINxaTPMDgl2Wk= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.13.4 h1:dU9oPMbAr/wYMNdzhu0pxIhAJOn1Btj1T3ZSyY6RvY0= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.13.4/go.mod h1:ud/Xr5TWUopcaGHdkh9RN8lhnCAFa95X16Rb5mrkE18= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.13.4 h1:ZuYc5Ql/GSyAEMgpKkbQiHOtIHkEpYujITW1wIVFgLE= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.13.4/go.mod h1:YSntkplFoUM1mepnPeJFsoblqD0Wdi+Avg1/d1upgZQ= +github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.13.4 h1:t/Zh8ztLDBOMRMiuVNFthWMMG5F4POgc5M6+Y3DTX9g= +github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.13.4/go.mod h1:JfdBBDreQfbIN5FYrAtZV3VmQMXnf9o4tMbaMxWqe40= github.com/DataDog/sketches-go v1.4.4 h1:dF52vzXRFSPOj2IjXSWLvXq3jubL4CI69kwYjJ1w5Z8= github.com/DataDog/sketches-go v1.4.4/go.mod h1:XR0ns2RtEEF09mDKXiKZiQg+nfZStrq1ZuL1eezeZe0= github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= @@ -111,8 +111,8 @@ github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8V github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/aws/aws-sdk-go v1.50.17 h1:KsbzUKDgGNlkDHGvoQDhiJ63a9jtZd+O+/s3pTOr/ns= -github.com/aws/aws-sdk-go v1.50.17/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.50.27 h1:96ifhrSuja+AzdP3W/T2337igqVQ2FcSIJYkk+0rCeA= +github.com/aws/aws-sdk-go v1.50.27/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= 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/bmatcuk/doublestar/v4 v4.6.1 h1:FH9SifrbvJhnlQpztAx++wlkk70QBf0iBWDwNy7PA4I= @@ -326,8 +326,8 @@ github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd/go.mod h1:M5qHK+eWf github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 h1:Wqo399gCIufwto+VfwCSvsnfGpF/w5E9CNxSwbpD6No= github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0/go.mod h1:qmOFXW2epJhM0qSnUUYpldc7gVz2KMQwJ/QYCDIa7XU= -github.com/haimrubinstein/go-syslog/v3 v3.0.0 h1:wuTrxJE60wx2pfwdERdbLNlcXEk3hk1MPagAaD2fq2g= -github.com/haimrubinstein/go-syslog/v3 v3.0.0/go.mod h1:/IKKpe5PS9pB5vJY1APQQM0ZPBrm95HWE1SQwsXWmVI= +github.com/haimrubinstein/go-syslog/v3 v3.0.3 h1:6vHBlaBT7QYW3Lg3SRH6ktd4RXDtysxtJ2sbbmnR984= +github.com/haimrubinstein/go-syslog/v3 v3.0.3/go.mod h1:eoxN4jiSgfvW5ZozHBsvBMVVOa8kUBnCghxP5PRL2Hs= github.com/hashicorp/consul/api v1.27.0 h1:gmJ6DPKQog1426xsdmgk5iqDyoRiNc+ipBdJOqKQFjc= github.com/hashicorp/consul/api v1.27.0/go.mod h1:JkekNRSou9lANFdt+4IKx3Za7XY0JzzpQjEb4Ivo1c8= github.com/hashicorp/cronexpr v1.1.2 h1:wG/ZYIKT+RT3QkOdgYc+xsKWVRgnxJ1OJtjjy84fJ9A= @@ -708,8 +708,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= diff --git a/exporter/datadogexporter/integrationtest/integration_test.go b/exporter/datadogexporter/integrationtest/integration_test.go index 94e3a47648c5..45e87a66cea1 100644 --- a/exporter/datadogexporter/integrationtest/integration_test.go +++ b/exporter/datadogexporter/integrationtest/integration_test.go @@ -24,7 +24,6 @@ import ( "go.opentelemetry.io/collector/connector" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/debugexporter" - "go.opentelemetry.io/collector/featuregate" "go.opentelemetry.io/collector/otelcol" "go.opentelemetry.io/collector/otelcol/otelcoltest" "go.opentelemetry.io/collector/processor" @@ -42,102 +41,72 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/connector/datadogconnector" "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/datadogexporter" "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/datadogexporter/internal/testutil" - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/datadog" "github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor" ) func TestIntegration(t *testing.T) { - tests := []struct { - name string - featureGateEnabled bool - }{ - { - name: "with feature gate enabled", - featureGateEnabled: true, - }, - { - name: "with feature gate disabled", - featureGateEnabled: false, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - // 1. Set up mock Datadog server - // See also https://github.com/DataDog/datadog-agent/blob/49c16e0d4deab396626238fa1d572b684475a53f/cmd/trace-agent/test/backend.go - apmstatsRec := &testutil.HTTPRequestRecorderWithChan{Pattern: testutil.APMStatsEndpoint, ReqChan: make(chan []byte)} - tracesRec := &testutil.HTTPRequestRecorderWithChan{Pattern: testutil.TraceEndpoint, ReqChan: make(chan []byte)} - server := testutil.DatadogServerMock(apmstatsRec.HandlerFunc, tracesRec.HandlerFunc) - defer server.Close() + // 1. Set up mock Datadog server + // See also https://github.com/DataDog/datadog-agent/blob/49c16e0d4deab396626238fa1d572b684475a53f/cmd/trace-agent/test/backend.go + apmstatsRec := &testutil.HTTPRequestRecorderWithChan{Pattern: testutil.APMStatsEndpoint, ReqChan: make(chan []byte)} + tracesRec := &testutil.HTTPRequestRecorderWithChan{Pattern: testutil.TraceEndpoint, ReqChan: make(chan []byte)} + server := testutil.DatadogServerMock(apmstatsRec.HandlerFunc, tracesRec.HandlerFunc) + defer server.Close() - // 2. Start in-process collector - factories := getIntegrationTestComponents(t) - app, confFilePath := getIntegrationTestCollector(t, server.URL, factories) - if tt.featureGateEnabled { - err := featuregate.GlobalRegistry().Set(datadog.ConnectorPerformanceFeatureGate.ID(), true) - assert.NoError(t, err) - defer func() { - _ = featuregate.GlobalRegistry().Set(datadog.ConnectorPerformanceFeatureGate.ID(), false) - }() - } - go func() { - assert.NoError(t, app.Run(context.Background())) - }() - defer app.Shutdown() - defer os.Remove(confFilePath) - waitForReadiness(app) + // 2. Start in-process collector + factories := getIntegrationTestComponents(t) + app, confFilePath := getIntegrationTestCollector(t, server.URL, factories) + go func() { + assert.NoError(t, app.Run(context.Background())) + }() + defer app.Shutdown() + defer os.Remove(confFilePath) + waitForReadiness(app) - // 3. Generate and send traces - sendTraces(t) + // 3. Generate and send traces + sendTraces(t) - // 4. Validate traces and APM stats from the mock server - var spans []*pb.Span - var stats []*pb.ClientGroupedStats + // 4. Validate traces and APM stats from the mock server + var spans []*pb.Span + var stats []*pb.ClientGroupedStats - // 5 sampled spans + APM stats on 10 spans are sent to datadog exporter - for len(spans) < 5 || len(stats) < 10 { - select { - case tracesBytes := <-tracesRec.ReqChan: - gz := getGzipReader(t, tracesBytes) - slurp, err := io.ReadAll(gz) - require.NoError(t, err) - var traces pb.AgentPayload - require.NoError(t, proto.Unmarshal(slurp, &traces)) - for _, tps := range traces.TracerPayloads { - for _, chunks := range tps.Chunks { - spans = append(spans, chunks.Spans...) - for _, span := range chunks.Spans { - assert.Equal(t, "true", span.Meta["_dd.stats_computed"]) - } - } - } + // 5 sampled spans + APM stats on 10 spans are sent to datadog exporter + for len(spans) < 5 || len(stats) < 10 { + select { + case tracesBytes := <-tracesRec.ReqChan: + gz := getGzipReader(t, tracesBytes) + slurp, err := io.ReadAll(gz) + require.NoError(t, err) + var traces pb.AgentPayload + require.NoError(t, proto.Unmarshal(slurp, &traces)) + for _, tps := range traces.TracerPayloads { + for _, chunks := range tps.Chunks { + spans = append(spans, chunks.Spans...) + } + } - case apmstatsBytes := <-apmstatsRec.ReqChan: - gz := getGzipReader(t, apmstatsBytes) - var spl pb.StatsPayload - require.NoError(t, msgp.Decode(gz, &spl)) - for _, csps := range spl.Stats { - for _, csbs := range csps.Stats { - stats = append(stats, csbs.Stats...) - for _, stat := range csbs.Stats { - assert.True(t, strings.HasPrefix(stat.Resource, "TestSpan")) - assert.Equal(t, uint64(1), stat.Hits) - assert.Equal(t, uint64(1), stat.TopLevelHits) - if tt.featureGateEnabled { - // Peer tags aggregation is supported only when the feature gate is enabled (it's enabled by default) - assert.Equal(t, "client", stat.SpanKind) - assert.Equal(t, []string{"extra_peer_tag:tag_val", "peer.service:svc"}, stat.PeerTags) - } - } - } + case apmstatsBytes := <-apmstatsRec.ReqChan: + gz := getGzipReader(t, apmstatsBytes) + var spl pb.StatsPayload + require.NoError(t, msgp.Decode(gz, &spl)) + for _, csps := range spl.Stats { + assert.Equal(t, "datadogexporter-otelcol-tests", spl.AgentVersion) + for _, csbs := range csps.Stats { + stats = append(stats, csbs.Stats...) + for _, stat := range csbs.Stats { + assert.True(t, strings.HasPrefix(stat.Resource, "TestSpan")) + assert.Equal(t, uint64(1), stat.Hits) + assert.Equal(t, uint64(1), stat.TopLevelHits) + assert.Equal(t, "client", stat.SpanKind) + assert.Equal(t, []string{"extra_peer_tag:tag_val", "peer.service:svc"}, stat.PeerTags) } } } - - // Verify we don't receive more than the expected numbers - assert.Len(t, spans, 5) - assert.Len(t, stats, 10) - }) + } } + + // Verify we don't receive more than the expected numbers + assert.Len(t, spans, 5) + assert.Len(t, stats, 10) } func getIntegrationTestComponents(t *testing.T) otelcol.Factories { diff --git a/exporter/datadogexporter/metrics_exporter.go b/exporter/datadogexporter/metrics_exporter.go index 9835d52e1997..332bffd9ed14 100644 --- a/exporter/datadogexporter/metrics_exporter.go +++ b/exporter/datadogexporter/metrics_exporter.go @@ -31,7 +31,6 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/datadogexporter/internal/metrics" "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/datadogexporter/internal/metrics/sketches" "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/datadogexporter/internal/scrub" - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/datadog" ) type metricsExporter struct { @@ -86,9 +85,7 @@ func translatorFromConfig(set component.TelemetrySettings, cfg *Config, attrsTra options = append(options, otlpmetrics.WithInitialCumulMonoValueMode( otlpmetrics.InitialCumulMonoValueMode(cfg.Metrics.SumConfig.InitialCumulativeMonotonicMode))) - if datadog.ConnectorPerformanceFeatureGate.IsEnabled() { - options = append(options, otlpmetrics.WithStatsOut(statsOut)) - } + options = append(options, otlpmetrics.WithStatsOut(statsOut)) return otlpmetrics.NewTranslator(set, attrsTranslator, options...) } diff --git a/exporter/datadogexporter/traces_exporter.go b/exporter/datadogexporter/traces_exporter.go index 6f59c66a454e..d64af8958b67 100644 --- a/exporter/datadogexporter/traces_exporter.go +++ b/exporter/datadogexporter/traces_exporter.go @@ -15,7 +15,9 @@ import ( tracelog "github.com/DataDog/datadog-agent/pkg/trace/log" "github.com/DataDog/datadog-agent/pkg/trace/telemetry" "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" + "github.com/DataDog/datadog-go/v5/statsd" "github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata" + "github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes" "github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes/source" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/exporter" @@ -181,15 +183,15 @@ func (exp *traceExporter) exportUsageMetrics(ctx context.Context, hosts map[stri } } -func newTraceAgent(ctx context.Context, params exporter.CreateSettings, cfg *Config, sourceProvider source.Provider) (*agent.Agent, error) { - acfg, err := newTraceAgentConfig(ctx, params, cfg, sourceProvider) +func newTraceAgent(ctx context.Context, params exporter.CreateSettings, cfg *Config, sourceProvider source.Provider, metricsClient statsd.ClientInterface, attrsTranslator *attributes.Translator) (*agent.Agent, error) { + acfg, err := newTraceAgentConfig(ctx, params, cfg, sourceProvider, attrsTranslator) if err != nil { return nil, err } - return agent.NewAgent(ctx, acfg, telemetry.NewNoopCollector()), nil + return agent.NewAgent(ctx, acfg, telemetry.NewNoopCollector(), metricsClient), nil } -func newTraceAgentConfig(ctx context.Context, params exporter.CreateSettings, cfg *Config, sourceProvider source.Provider) (*traceconfig.AgentConfig, error) { +func newTraceAgentConfig(ctx context.Context, params exporter.CreateSettings, cfg *Config, sourceProvider source.Provider, attrsTranslator *attributes.Translator) (*traceconfig.AgentConfig, error) { acfg := traceconfig.New() src, err := sourceProvider.Source(ctx) if err != nil { @@ -198,6 +200,7 @@ func newTraceAgentConfig(ctx context.Context, params exporter.CreateSettings, cf if src.Kind == source.HostnameKind { acfg.Hostname = src.Identifier } + acfg.OTLPReceiver.AttributesTranslator = attrsTranslator acfg.OTLPReceiver.SpanNameRemappings = cfg.Traces.SpanNameRemappings acfg.OTLPReceiver.SpanNameAsResourceName = cfg.Traces.SpanNameAsResourceName acfg.Endpoints[0].APIKey = string(cfg.API.Key) diff --git a/exporter/datasetexporter/generated_component_test.go b/exporter/datasetexporter/generated_component_test.go index d5e269fea684..e80c4b9f3f51 100644 --- a/exporter/datasetexporter/generated_component_test.go +++ b/exporter/datasetexporter/generated_component_test.go @@ -5,27 +5,19 @@ package datasetexporter import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -63,44 +55,40 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) + } +} - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - err = c.Start(context.Background(), host) - require.NoError(t, err) - require.NotPanics(t, func() { - switch e := c.(type) { - case exporter.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) - if !e.Capabilities().MutatesData { - logs.MarkReadOnly() - } - err = e.ConsumeLogs(context.Background(), logs) - case exporter.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() - if !e.Capabilities().MutatesData { - metrics.MarkReadOnly() - } - err = e.ConsumeMetrics(context.Background(), metrics) - case exporter.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() - if !e.Capabilities().MutatesData { - traces.MarkReadOnly() - } - err = e.ConsumeTraces(context.Background(), traces) - } - }) +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} - require.NoError(t, err) +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} - err = c.Shutdown(context.Background()) - require.NoError(t, err) - }) - } +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces } diff --git a/exporter/datasetexporter/go.mod b/exporter/datasetexporter/go.mod index 0e5a9357ace4..a370fee225f9 100644 --- a/exporter/datasetexporter/go.mod +++ b/exporter/datasetexporter/go.mod @@ -12,7 +12,7 @@ require ( go.opentelemetry.io/collector/confmap v0.95.0 go.opentelemetry.io/collector/exporter v0.95.0 go.opentelemetry.io/collector/pdata v1.2.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) diff --git a/exporter/datasetexporter/go.sum b/exporter/datasetexporter/go.sum index 2a04564c9b55..728711927c0f 100644 --- a/exporter/datasetexporter/go.sum +++ b/exporter/datasetexporter/go.sum @@ -110,8 +110,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/exporter/datasetexporter/metadata.yaml b/exporter/datasetexporter/metadata.yaml index fcccb0b99902..0ef95c31fac8 100644 --- a/exporter/datasetexporter/metadata.yaml +++ b/exporter/datasetexporter/metadata.yaml @@ -8,6 +8,7 @@ status: codeowners: active: [atoulme, martin-majlis-s1, zdaratom-s1, tomaz-s1] +# TODO: Update the exporter to pass the tests tests: config: dataset_url: https://app.scalyr.com diff --git a/exporter/dynatraceexporter/generated_component_test.go b/exporter/dynatraceexporter/generated_component_test.go index 08ed45e16a38..b31a9a2ae4d9 100644 --- a/exporter/dynatraceexporter/generated_component_test.go +++ b/exporter/dynatraceexporter/generated_component_test.go @@ -5,27 +5,20 @@ package dynatraceexporter import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -56,9 +49,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -67,19 +58,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case exporter.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case exporter.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case exporter.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -92,3 +83,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/exporter/dynatraceexporter/go.mod b/exporter/dynatraceexporter/go.mod index 3253ec4a0469..db873283241a 100644 --- a/exporter/dynatraceexporter/go.mod +++ b/exporter/dynatraceexporter/go.mod @@ -6,7 +6,6 @@ go 1.21 require ( github.com/dynatrace-oss/dynatrace-metric-utils-go v0.5.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.95.0 - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.95.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.95.0 @@ -21,7 +20,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/exporter/dynatraceexporter/go.sum b/exporter/dynatraceexporter/go.sum index 13318ff3f435..de8d5ffa7c05 100644 --- a/exporter/dynatraceexporter/go.sum +++ b/exporter/dynatraceexporter/go.sum @@ -134,8 +134,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/exporter/dynatraceexporter/metadata.yaml b/exporter/dynatraceexporter/metadata.yaml index fb8810840fff..a648860a74ea 100644 --- a/exporter/dynatraceexporter/metadata.yaml +++ b/exporter/dynatraceexporter/metadata.yaml @@ -9,5 +9,4 @@ status: active: [dyladan, arminru, evan-bradley] tests: - config: expect_consumer_error: true diff --git a/exporter/elasticsearchexporter/generated_component_test.go b/exporter/elasticsearchexporter/generated_component_test.go index ecd2594bfa0e..8f123f42726f 100644 --- a/exporter/elasticsearchexporter/generated_component_test.go +++ b/exporter/elasticsearchexporter/generated_component_test.go @@ -5,27 +5,20 @@ package elasticsearchexporter import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -63,9 +56,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -74,19 +65,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case exporter.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case exporter.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case exporter.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -101,3 +92,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/exporter/elasticsearchexporter/go.mod b/exporter/elasticsearchexporter/go.mod index a20775bb13cb..0dd2a8a890fb 100644 --- a/exporter/elasticsearchexporter/go.mod +++ b/exporter/elasticsearchexporter/go.mod @@ -20,7 +20,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/exporter/elasticsearchexporter/go.sum b/exporter/elasticsearchexporter/go.sum index a621d508887a..cf8993661596 100644 --- a/exporter/elasticsearchexporter/go.sum +++ b/exporter/elasticsearchexporter/go.sum @@ -121,8 +121,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/exporter/f5cloudexporter/Makefile b/exporter/f5cloudexporter/Makefile deleted file mode 100644 index ded7a36092dc..000000000000 --- a/exporter/f5cloudexporter/Makefile +++ /dev/null @@ -1 +0,0 @@ -include ../../Makefile.Common diff --git a/exporter/f5cloudexporter/README.md b/exporter/f5cloudexporter/README.md deleted file mode 100644 index 893ca3b7e25b..000000000000 --- a/exporter/f5cloudexporter/README.md +++ /dev/null @@ -1,52 +0,0 @@ -# F5 Cloud Exporter - - -| Status | | -| ------------- |-----------| -| Stability | [deprecated]: traces, metrics, logs | -| Distributions | [contrib], [observiq] | -| Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Aexporter%2Ff5cloud%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Aexporter%2Ff5cloud) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Aexporter%2Ff5cloud%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Aexporter%2Ff5cloud) | -| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | | -| Emeritus | [@gramidt](https://www.github.com/gramidt) | - -[deprecated]: https://github.com/open-telemetry/opentelemetry-collector#deprecated -[contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib -[observiq]: https://github.com/observIQ/observiq-otel-collector - - -Exports data via HTTP to F5 Cloud. - -## Getting Started - -The following settings are required: - -- `endpoint` (no default): The URL to send data to. See your F5 Cloud account for details. -- `source` (no default): A unique identifier that is used to distinguish where this data is coming from (e.g. dev_cluster). This is in - addition to the pipeline attributes and resources. -- `f5cloud_auth.credential_file` (no default): Path to the credential file used to authenticate this client. See your F5 - Cloud account for details. - -The following settings can be optionally configured: - -- `f5cloud_auth.audience` (no default): Identifies the recipient that the authentication JWT is intended for. See your F5 Cloud - account for details. - -- `timeout` (default = 30s): HTTP request time limit. For details see https://golang.org/pkg/net/http/#Client -- `read_buffer_size` (default = 0): ReadBufferSize for HTTP client. -- `write_buffer_size` (default = 512 * 1024): WriteBufferSize for HTTP client. - -Example: - -```yaml -f5cloud: - endpoint: https:// - source: prod - f5cloud_auth: - credential_file: "/etc/creds/key.json" -``` - -The full list of settings exposed for this exporter are documented [here](./config.go) with detailed sample -configurations [here](./testdata/config.yaml). - -This exporter also offers proxy support as documented -[here](https://github.com/open-telemetry/opentelemetry-collector/tree/main/exporter#proxy-support). diff --git a/exporter/f5cloudexporter/auth.go b/exporter/f5cloudexporter/auth.go deleted file mode 100644 index de59939a31ad..000000000000 --- a/exporter/f5cloudexporter/auth.go +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package f5cloudexporter // import "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/f5cloudexporter" - -import ( - "fmt" - "net/http" - - "golang.org/x/oauth2" -) - -const ( - sourceHeader = "X-F5-Source" -) - -type f5CloudAuthRoundTripper struct { - transport http.RoundTripper - tokenSource oauth2.TokenSource - source string -} - -func (rt *f5CloudAuthRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { - // Clone request to ensure thread safety - req2 := req.Clone(req.Context()) - - // Add authorization header - tkn, err := rt.tokenSource.Token() - if err != nil { - return nil, err - } - tkn.SetAuthHeader(req2) - - // Add F5 specific headers - req2.Header.Add(sourceHeader, rt.source) - - resp, err := rt.transport.RoundTrip(req2) - if err != nil { - return nil, err - } - - return resp, nil -} - -func newF5CloudAuthRoundTripper(ts oauth2.TokenSource, source string, next http.RoundTripper) (http.RoundTripper, error) { - if ts == nil { - return nil, fmt.Errorf("no TokenSource exists") - } - - if len(source) == 0 { - return nil, fmt.Errorf("no source provided") - } - - rt := f5CloudAuthRoundTripper{ - transport: next, - tokenSource: ts, - source: source, - } - - return &rt, nil -} diff --git a/exporter/f5cloudexporter/auth_test.go b/exporter/f5cloudexporter/auth_test.go deleted file mode 100644 index 44daca066c01..000000000000 --- a/exporter/f5cloudexporter/auth_test.go +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package f5cloudexporter - -import ( - "fmt" - "net/http" - "net/http/httptest" - "strings" - "testing" - "time" - - "github.com/stretchr/testify/assert" - "golang.org/x/oauth2" -) - -type ErrorRoundTripper struct{} - -func (ert *ErrorRoundTripper) RoundTrip(_ *http.Request) (*http.Response, error) { - return nil, fmt.Errorf("error") -} - -func TestF5CloudAuthRoundTripper_RoundTrip(t *testing.T) { - validTokenSource := createMockTokenSource() - source := "tests" - - defaultRoundTripper := (http.RoundTripper)(http.DefaultTransport.(*http.Transport).Clone()) - errorRoundTripper := &ErrorRoundTripper{} - - tests := []struct { - name string - rt http.RoundTripper - token oauth2.TokenSource - shouldError bool - }{ - { - name: "Test valid token source", - rt: defaultRoundTripper, - token: validTokenSource, - shouldError: false, - }, - { - name: "Test invalid token source", - rt: defaultRoundTripper, - token: &InvalidTokenSource{}, - shouldError: true, - }, - { - name: "Test error in next round tripper", - rt: errorRoundTripper, - token: validTokenSource, - shouldError: true, - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - assert.Equal(t, "Bearer test_access_token", r.Header.Get("Authorization")) - assert.Equal(t, "tests", r.Header.Get(sourceHeader)) - })) - defer server.Close() - rt, err := newF5CloudAuthRoundTripper(tt.token, source, tt.rt) - assert.NoError(t, err) - req, err := http.NewRequest("POST", server.URL, strings.NewReader("")) - assert.NoError(t, err) - res, err := rt.RoundTrip(req) - if tt.shouldError { - assert.Nil(t, res) - assert.Error(t, err) - return - } - assert.NoError(t, err) - assert.Equal(t, res.StatusCode, 200) - }) - } -} - -func TestCreateF5CloudAuthRoundTripperWithToken(t *testing.T) { - defaultRoundTripper := (http.RoundTripper)(http.DefaultTransport.(*http.Transport).Clone()) - - token := createMockTokenSource() - source := "test" - - tests := []struct { - name string - token oauth2.TokenSource - source string - rt http.RoundTripper - shouldError bool - }{ - { - name: "success_case", - token: token, - source: source, - rt: defaultRoundTripper, - shouldError: false, - }, - { - name: "no_token_provided_error", - token: nil, - source: source, - rt: defaultRoundTripper, - shouldError: true, - }, - { - name: "no_source_provided_error", - token: token, - source: "", - rt: defaultRoundTripper, - shouldError: true, - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - _, err := newF5CloudAuthRoundTripper(tt.token, tt.source, tt.rt) - if tt.shouldError { - assert.Error(t, err) - return - } - assert.NoError(t, err) - }) - } -} - -func createMockTokenSource() oauth2.TokenSource { - tkn := &oauth2.Token{ - AccessToken: "test_access_token", - TokenType: "", - RefreshToken: "", - Expiry: time.Time{}, - } - - return oauth2.StaticTokenSource(tkn) -} - -type InvalidTokenSource struct{} - -func (ts *InvalidTokenSource) Token() (*oauth2.Token, error) { - return nil, fmt.Errorf("bad TokenSource for testing") -} diff --git a/exporter/f5cloudexporter/config.go b/exporter/f5cloudexporter/config.go deleted file mode 100644 index a8147587a17e..000000000000 --- a/exporter/f5cloudexporter/config.go +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package f5cloudexporter // import "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/f5cloudexporter" - -import ( - "fmt" - "net/url" - "os" - - otlphttp "go.opentelemetry.io/collector/exporter/otlphttpexporter" -) - -// Config defines configuration for F5 Cloud exporter. -type Config struct { - // Config represents the OTLP HTTP Exporter configuration. - otlphttp.Config `mapstructure:",squash"` - - // Source represents a unique identifier that is used to distinguish where this data is coming from. - Source string `mapstructure:"source"` - - // AuthConfig represents the F5 Cloud authentication configuration options. - AuthConfig AuthConfig `mapstructure:"f5cloud_auth"` -} - -func (c *Config) sanitize() error { - if len(c.Endpoint) == 0 { - return fmt.Errorf("missing required \"endpoint\" setting") - } - - endpointURL, err := url.Parse(c.Endpoint) - if err != nil { - return err - } - - if len(c.Source) == 0 { - return fmt.Errorf("missing required \"source\" setting") - } - - if len(c.AuthConfig.CredentialFile) == 0 { - return fmt.Errorf("missing required \"f5cloud_auth.credential_file\" setting") - } - - if _, err := os.Stat(c.AuthConfig.CredentialFile); os.IsNotExist(err) { - return fmt.Errorf("the provided \"f5cloud_auth.credential_file\" does not exist") - } - - if len(c.AuthConfig.Audience) == 0 { - c.AuthConfig.Audience = fmt.Sprintf("%s://%s", endpointURL.Scheme, endpointURL.Hostname()) - } - - return nil -} - -// AuthConfig defines F5 Cloud authentication configurations for F5CloudAuthRoundTripper -type AuthConfig struct { - // CredentialFile is the F5 Cloud credentials for your designated account. - CredentialFile string `mapstructure:"credential_file"` - - // Audience is the F5 Cloud audience for your designated account. - Audience string `mapstructure:"audience"` -} diff --git a/exporter/f5cloudexporter/config_test.go b/exporter/f5cloudexporter/config_test.go deleted file mode 100644 index 0e82a41ae75f..000000000000 --- a/exporter/f5cloudexporter/config_test.go +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package f5cloudexporter - -import ( - "path/filepath" - "testing" - "time" - - "github.com/cenkalti/backoff/v4" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/config/confighttp" - "go.opentelemetry.io/collector/config/configopaque" - "go.opentelemetry.io/collector/config/configretry" - "go.opentelemetry.io/collector/confmap/confmaptest" - "go.opentelemetry.io/collector/exporter/exporterhelper" - otlphttp "go.opentelemetry.io/collector/exporter/otlphttpexporter" - - "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/f5cloudexporter/internal/metadata" -) - -func TestLoadConfig(t *testing.T) { - cm, err := confmaptest.LoadConf(filepath.Join("testdata", "config.yaml")) - require.NoError(t, err) - factory := NewFactory() - cfg := factory.CreateDefaultConfig() - - sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "allsettings").String()) - require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) - - actualCfg := cfg.(*Config) - otlphttpCfg := otlphttp.NewFactory().CreateDefaultConfig().(*otlphttp.Config) - otlphttpCfg.RetryConfig = configretry.BackOffConfig{ - Enabled: true, - InitialInterval: 10 * time.Second, - MaxInterval: 1 * time.Minute, - MaxElapsedTime: 10 * time.Minute, - RandomizationFactor: backoff.DefaultRandomizationFactor, - Multiplier: backoff.DefaultMultiplier, - } - otlphttpCfg.QueueConfig = exporterhelper.QueueSettings{ - Enabled: true, - NumConsumers: 2, - QueueSize: 10, - } - otlphttpCfg.ClientConfig = confighttp.ClientConfig{ - Endpoint: "https://f5cloud", - ReadBufferSize: 123, - WriteBufferSize: 345, - Timeout: time.Second * 10, - Headers: map[string]configopaque.String{ - "User-Agent": "opentelemetry-collector-contrib {{version}}", - }, - Compression: "gzip", - } - expectedCfg := &Config{ - Config: *otlphttpCfg, - Source: "dev", - AuthConfig: AuthConfig{ - CredentialFile: "/etc/creds/key.json", - Audience: "exampleaudience", - }, - } - // testing function equality is not supported in Go hence these will be ignored for this test - expectedCfg.ClientConfig.CustomRoundTripper = nil - actualCfg.ClientConfig.CustomRoundTripper = nil - assert.Equal(t, expectedCfg, actualCfg) -} - -func TestConfig_sanitize(t *testing.T) { - const validEndpoint = "https://validendpoint.local" - const validSource = "tests" - - type fields struct { - Endpoint string - Source string - CredentialFile string - Audience string - } - tests := []struct { - name string - fields fields - errorMessage string - shouldError bool - }{ - { - name: "Test missing endpoint", - fields: fields{ - Endpoint: "", - }, - errorMessage: "missing required \"endpoint\" setting", - shouldError: true, - }, - { - name: "Test invalid endpoint", - fields: fields{ - Endpoint: "this://is:an:invalid:endpoint.com", - }, - errorMessage: "", - shouldError: true, - }, - { - name: "Test credential file not provided", - fields: fields{ - Endpoint: validEndpoint, - Source: validSource, - CredentialFile: "", - }, - errorMessage: "missing required \"f5cloud_auth.credential_file\" setting", - shouldError: true, - }, - { - name: "Test non-existent credential file", - fields: fields{ - Endpoint: validEndpoint, - Source: validSource, - CredentialFile: "non-existent cred file", - }, - errorMessage: "the provided \"f5cloud_auth.credential_file\" does not exist", - shouldError: true, - }, - { - name: "Test missing source", - fields: fields{ - Endpoint: validEndpoint, - Source: "", - }, - errorMessage: "missing required \"source\" setting", - shouldError: true, - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - factory := NewFactory() - cfg := factory.CreateDefaultConfig().(*Config) - cfg.Endpoint = tt.fields.Endpoint - cfg.Source = tt.fields.Source - cfg.AuthConfig = AuthConfig{ - CredentialFile: tt.fields.CredentialFile, - Audience: tt.fields.Audience, - } - - err := cfg.sanitize() - if (err != nil) != tt.shouldError { - t.Errorf("sanitize() error = %v, shouldError %v", err, tt.shouldError) - return - } - - if tt.shouldError { - assert.Error(t, err) - if len(tt.errorMessage) != 0 { - assert.Equal(t, tt.errorMessage, err.Error()) - } - } - }) - } - - t.Run("Test audience is set from endpoint when not provided", func(t *testing.T) { - factory := NewFactory() - cfg := factory.CreateDefaultConfig().(*Config) - cfg.Endpoint = validEndpoint - cfg.Source = validSource - cfg.AuthConfig = AuthConfig{ - CredentialFile: "testdata/empty_credential_file.json", - Audience: "", - } - - err := cfg.sanitize() - assert.NoError(t, err) - assert.Equal(t, validEndpoint, cfg.AuthConfig.Audience) - }) - - t.Run("Test audience is not set from endpoint when provided", func(t *testing.T) { - factory := NewFactory() - cfg := factory.CreateDefaultConfig().(*Config) - cfg.Endpoint = validEndpoint - cfg.Source = validSource - cfg.AuthConfig = AuthConfig{ - CredentialFile: "testdata/empty_credential_file.json", - Audience: "tests", - } - - err := cfg.sanitize() - assert.NoError(t, err) - assert.Equal(t, "tests", cfg.AuthConfig.Audience) - }) -} diff --git a/exporter/f5cloudexporter/doc.go b/exporter/f5cloudexporter/doc.go deleted file mode 100644 index 2006b5a40f06..000000000000 --- a/exporter/f5cloudexporter/doc.go +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -//go:generate mdatagen metadata.yaml - -// Deprecated: [v0.95.0] This package is deprecated and will be removed in a future release. -// Package f5cloudexporter implements an OpenTelemetry Collector exporter that sends trace, metric, and log data to F5 Cloud. -package f5cloudexporter // import "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/f5cloudexporter" diff --git a/exporter/f5cloudexporter/factory.go b/exporter/f5cloudexporter/factory.go deleted file mode 100644 index 25eac8407722..000000000000 --- a/exporter/f5cloudexporter/factory.go +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package f5cloudexporter // import "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/f5cloudexporter" - -import ( - "context" - "net/http" - "strings" - - "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/config/configopaque" - "go.opentelemetry.io/collector/exporter" - otlphttp "go.opentelemetry.io/collector/exporter/otlphttpexporter" - "golang.org/x/oauth2" - "google.golang.org/api/idtoken" - - "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/f5cloudexporter/internal/metadata" -) - -type TokenSourceGetter func(config *Config) (oauth2.TokenSource, error) - -type f5cloudFactory struct { - exporter.Factory - getTokenSource TokenSourceGetter -} - -// NewFactory returns a factory of the F5 Cloud exporter that can be registered to the Collector. -func NewFactory() exporter.Factory { - return newFactoryWithTokenSourceGetter(getTokenSourceFromConfig) -} - -func newFactoryWithTokenSourceGetter(tsg TokenSourceGetter) exporter.Factory { - return &f5cloudFactory{Factory: otlphttp.NewFactory(), getTokenSource: tsg} -} - -func (f *f5cloudFactory) Type() component.Type { - return metadata.Type -} - -func (f *f5cloudFactory) CreateMetricsExporter( - ctx context.Context, - params exporter.CreateSettings, - config component.Config) (exporter.Metrics, error) { - - cfg := config.(*Config) - - if err := cfg.sanitize(); err != nil { - return nil, err - } - - fillUserAgent(cfg, params.BuildInfo.Version) - - return f.Factory.CreateMetricsExporter(ctx, params, &cfg.Config) -} - -func (f *f5cloudFactory) CreateTracesExporter( - ctx context.Context, - params exporter.CreateSettings, - config component.Config) (exporter.Traces, error) { - - cfg := config.(*Config) - - if err := cfg.sanitize(); err != nil { - return nil, err - } - - fillUserAgent(cfg, params.BuildInfo.Version) - - return f.Factory.CreateTracesExporter(ctx, params, &cfg.Config) -} - -func (f *f5cloudFactory) CreateLogsExporter( - ctx context.Context, - params exporter.CreateSettings, - config component.Config) (exporter.Logs, error) { - - cfg := config.(*Config) - - if err := cfg.sanitize(); err != nil { - return nil, err - } - - fillUserAgent(cfg, params.BuildInfo.Version) - - return f.Factory.CreateLogsExporter(ctx, params, &cfg.Config) -} - -func (f *f5cloudFactory) CreateDefaultConfig() component.Config { - cfg := &Config{ - Config: *f.Factory.CreateDefaultConfig().(*otlphttp.Config), - AuthConfig: AuthConfig{ - CredentialFile: "", - Audience: "", - }, - } - - cfg.Headers["User-Agent"] = "opentelemetry-collector-contrib {{version}}" - - cfg.ClientConfig.CustomRoundTripper = func(next http.RoundTripper) (http.RoundTripper, error) { - ts, err := f.getTokenSource(cfg) - if err != nil { - return nil, err - } - - return newF5CloudAuthRoundTripper(ts, cfg.Source, next) - } - - return cfg -} - -// getTokenSourceFromConfig gets a TokenSource based on the configuration. -func getTokenSourceFromConfig(config *Config) (oauth2.TokenSource, error) { - ts, err := idtoken.NewTokenSource(context.Background(), config.AuthConfig.Audience, idtoken.WithCredentialsFile(config.AuthConfig.CredentialFile)) - if err != nil { - return nil, err - } - - return ts, nil -} - -func fillUserAgent(cfg *Config, version string) { - cfg.Headers["User-Agent"] = configopaque.String(strings.ReplaceAll(string(cfg.Headers["User-Agent"]), "{{version}}", version)) -} diff --git a/exporter/f5cloudexporter/factory_test.go b/exporter/f5cloudexporter/factory_test.go deleted file mode 100644 index 859313bc1186..000000000000 --- a/exporter/f5cloudexporter/factory_test.go +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package f5cloudexporter - -import ( - "context" - "testing" - "time" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - "go.opentelemetry.io/collector/config/configopaque" - "go.opentelemetry.io/collector/exporter/exportertest" - "golang.org/x/oauth2" - - "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/f5cloudexporter/internal/metadata" - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/common/testutil" -) - -func TestFactory_TestType(t *testing.T) { - f := NewFactory() - assert.Equal(t, f.Type(), metadata.Type) -} - -func TestFactory_CreateDefaultConfig(t *testing.T) { - factory := NewFactory() - cfg := factory.CreateDefaultConfig() - assert.NotNil(t, cfg, "failed to create default config") - assert.NoError(t, componenttest.CheckConfigStruct(cfg)) - ocfg, ok := factory.CreateDefaultConfig().(*Config) - assert.True(t, ok) - assert.Equal(t, ocfg.ClientConfig.Endpoint, "") - assert.Equal(t, ocfg.ClientConfig.Timeout, 30*time.Second, "default timeout is 30 seconds") - assert.Equal(t, ocfg.RetryConfig.Enabled, true, "default retry is enabled") - assert.Equal(t, ocfg.RetryConfig.MaxElapsedTime, 300*time.Second, "default retry MaxElapsedTime") - assert.Equal(t, ocfg.RetryConfig.InitialInterval, 5*time.Second, "default retry InitialInterval") - assert.Equal(t, ocfg.RetryConfig.MaxInterval, 30*time.Second, "default retry MaxInterval") - assert.Equal(t, ocfg.RetryConfig.Enabled, true, "default sending queue is enabled") -} - -func TestFactory_CreateMetricsExporter(t *testing.T) { - factory := newFactoryWithTokenSourceGetter(mockTokenSourceGetter) - cfg := factory.CreateDefaultConfig().(*Config) - cfg.ClientConfig.Endpoint = "https://" + testutil.GetAvailableLocalAddress(t) - cfg.Source = "tests" - cfg.AuthConfig = AuthConfig{ - CredentialFile: "testdata/empty_credential_file.json", - Audience: "tests", - } - - creationParams := exportertest.NewNopCreateSettings() - creationParams.BuildInfo = component.BuildInfo{ - Version: "0.0.0", - } - oexp, err := factory.CreateMetricsExporter(context.Background(), creationParams, cfg) - require.NoError(t, err) - require.NotNil(t, oexp) - - require.Equal(t, configopaque.String("opentelemetry-collector-contrib 0.0.0"), cfg.Headers["User-Agent"]) -} - -func TestFactory_CreateMetricsExporterInvalidConfig(t *testing.T) { - factory := newFactoryWithTokenSourceGetter(mockTokenSourceGetter) - cfg := factory.CreateDefaultConfig().(*Config) - - creationParams := exportertest.NewNopCreateSettings() - oexp, err := factory.CreateMetricsExporter(context.Background(), creationParams, cfg) - require.Error(t, err) - require.Nil(t, oexp) -} - -func TestFactory_CreateTracesExporter(t *testing.T) { - factory := newFactoryWithTokenSourceGetter(mockTokenSourceGetter) - cfg := factory.CreateDefaultConfig().(*Config) - cfg.ClientConfig.Endpoint = "https://" + testutil.GetAvailableLocalAddress(t) - cfg.Source = "tests" - cfg.AuthConfig = AuthConfig{ - CredentialFile: "testdata/empty_credential_file.json", - Audience: "tests", - } - - creationParams := exportertest.NewNopCreateSettings() - creationParams.BuildInfo = component.BuildInfo{ - Version: "0.0.0", - } - oexp, err := factory.CreateTracesExporter(context.Background(), creationParams, cfg) - require.NoError(t, err) - require.NotNil(t, oexp) - - require.Equal(t, configopaque.String("opentelemetry-collector-contrib 0.0.0"), cfg.Headers["User-Agent"]) -} - -func Test_Factory_CreateTracesExporterInvalidConfig(t *testing.T) { - factory := newFactoryWithTokenSourceGetter(mockTokenSourceGetter) - cfg := factory.CreateDefaultConfig().(*Config) - - creationParams := exportertest.NewNopCreateSettings() - oexp, err := factory.CreateTracesExporter(context.Background(), creationParams, cfg) - require.Error(t, err) - require.Nil(t, oexp) -} - -func TestFactory_CreateLogsExporter(t *testing.T) { - factory := newFactoryWithTokenSourceGetter(mockTokenSourceGetter) - cfg := factory.CreateDefaultConfig().(*Config) - cfg.ClientConfig.Endpoint = "https://" + testutil.GetAvailableLocalAddress(t) - cfg.Source = "tests" - cfg.AuthConfig = AuthConfig{ - CredentialFile: "testdata/empty_credential_file.json", - Audience: "tests", - } - - creationParams := exportertest.NewNopCreateSettings() - creationParams.BuildInfo = component.BuildInfo{ - Version: "0.0.0", - } - oexp, err := factory.CreateLogsExporter(context.Background(), creationParams, cfg) - require.NoError(t, err) - require.NotNil(t, oexp) - - require.Equal(t, configopaque.String("opentelemetry-collector-contrib 0.0.0"), cfg.Headers["User-Agent"]) -} - -func TestFactory_CreateLogsExporterInvalidConfig(t *testing.T) { - factory := newFactoryWithTokenSourceGetter(mockTokenSourceGetter) - cfg := factory.CreateDefaultConfig().(*Config) - - creationParams := exportertest.NewNopCreateSettings() - oexp, err := factory.CreateLogsExporter(context.Background(), creationParams, cfg) - require.Error(t, err) - require.Nil(t, oexp) -} - -func TestFactory_getTokenSourceFromConfig(t *testing.T) { - factory := newFactoryWithTokenSourceGetter(mockTokenSourceGetter) - cfg := factory.CreateDefaultConfig().(*Config) - cfg.ClientConfig.Endpoint = "https://" + testutil.GetAvailableLocalAddress(t) - cfg.Source = "tests" - cfg.AuthConfig = AuthConfig{ - CredentialFile: "testdata/empty_credential_file.json", - Audience: "tests", - } - - ts, err := getTokenSourceFromConfig(cfg) - assert.Error(t, err) - assert.Nil(t, ts) -} - -func mockTokenSourceGetter(_ *Config) (oauth2.TokenSource, error) { - tkn := &oauth2.Token{ - AccessToken: "", - TokenType: "", - RefreshToken: "", - Expiry: time.Time{}, - } - - return oauth2.StaticTokenSource(tkn), nil -} diff --git a/exporter/f5cloudexporter/go.mod b/exporter/f5cloudexporter/go.mod deleted file mode 100644 index b9f3c21713ce..000000000000 --- a/exporter/f5cloudexporter/go.mod +++ /dev/null @@ -1,95 +0,0 @@ -// Deprecated: [v0.95.0] This package is deprecated and will be removed in a future release. -module github.com/open-telemetry/opentelemetry-collector-contrib/exporter/f5cloudexporter - -go 1.21 - -require ( - github.com/cenkalti/backoff/v4 v4.2.1 - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.95.0 - github.com/stretchr/testify v1.8.4 - go.opentelemetry.io/collector/component v0.95.0 - go.opentelemetry.io/collector/config/confighttp v0.95.0 - go.opentelemetry.io/collector/config/configopaque v1.2.0 - go.opentelemetry.io/collector/config/configretry v0.95.0 - go.opentelemetry.io/collector/confmap v0.95.0 - go.opentelemetry.io/collector/exporter v0.95.0 - go.opentelemetry.io/collector/exporter/otlphttpexporter v0.95.0 - go.opentelemetry.io/otel/metric v1.23.1 - go.opentelemetry.io/otel/trace v1.23.1 - go.uber.org/goleak v1.3.0 - golang.org/x/oauth2 v0.17.0 - google.golang.org/api v0.165.0 -) - -require ( - cloud.google.com/go/compute v1.23.3 // indirect - cloud.google.com/go/compute/metadata v0.2.4-0.20230617002413-005d2dfb6b68 // indirect - github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect - github.com/go-logr/logr v1.4.1 // indirect - github.com/go-logr/stdr v1.2.2 // indirect - github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect - github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/golang/protobuf v1.5.3 // indirect - github.com/golang/snappy v0.0.4 // indirect - github.com/google/s2a-go v0.1.7 // indirect - github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect - github.com/hashicorp/go-version v1.6.0 // indirect - github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.17.6 // 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.0 // indirect - github.com/mitchellh/copystructure v1.2.0 // indirect - github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect - github.com/mitchellh/reflectwalk v1.0.2 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.18.0 // indirect - github.com/prometheus/client_model v0.5.0 // indirect - github.com/prometheus/common v0.46.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect - github.com/rs/cors v1.10.1 // indirect - go.opencensus.io v0.24.0 // indirect - go.opentelemetry.io/collector v0.95.0 // indirect - go.opentelemetry.io/collector/config/configauth v0.95.0 // indirect - go.opentelemetry.io/collector/config/configcompression v0.95.0 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.95.0 // indirect - go.opentelemetry.io/collector/config/configtls v0.95.0 // indirect - go.opentelemetry.io/collector/config/internal v0.95.0 // indirect - go.opentelemetry.io/collector/consumer v0.95.0 // indirect - go.opentelemetry.io/collector/extension v0.95.0 // indirect - go.opentelemetry.io/collector/extension/auth v0.95.0 // indirect - go.opentelemetry.io/collector/featuregate v1.2.0 // indirect - go.opentelemetry.io/collector/pdata v1.2.0 // indirect - go.opentelemetry.io/collector/receiver v0.95.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 // indirect - go.opentelemetry.io/otel v1.23.1 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.45.2 // indirect - go.opentelemetry.io/otel/sdk v1.23.1 // indirect - go.opentelemetry.io/otel/sdk/metric v1.23.1 // indirect - go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.26.0 // indirect - golang.org/x/crypto v0.19.0 // indirect - golang.org/x/net v0.21.0 // indirect - golang.org/x/sys v0.17.0 // indirect - golang.org/x/text v0.14.0 // indirect - google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240205150955-31a09d347014 // indirect - google.golang.org/grpc v1.61.0 // indirect - google.golang.org/protobuf v1.32.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect -) - -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => ../../internal/common - -retract ( - v0.76.2 - v0.76.1 - v0.65.0 -) diff --git a/exporter/f5cloudexporter/go.sum b/exporter/f5cloudexporter/go.sum deleted file mode 100644 index 647e34ff5ed2..000000000000 --- a/exporter/f5cloudexporter/go.sum +++ /dev/null @@ -1,318 +0,0 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go/compute v1.23.3 h1:6sVlXXBmbd7jNX0Ipq0trII3e4n1/MsADLK6a+aiVlk= -cloud.google.com/go/compute v1.23.3/go.mod h1:VCgBUoMnIVIR0CscqQiPJLAG25E3ZRZMzcFZeQ+h8CI= -cloud.google.com/go/compute/metadata v0.2.4-0.20230617002413-005d2dfb6b68 h1:aRVqY1p2IJaBGStWMsQMpkAa83cPkCDLl80eOj0Rbz4= -cloud.google.com/go/compute/metadata v0.2.4-0.20230617002413-005d2dfb6b68/go.mod h1:1a3eRNYX12fs5UABBIXS8HXVvQbX9hRB/RkEBPORpe8= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= -github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -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.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= -github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= -github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= -github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= -github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c= -github.com/go-viper/mapstructure/v2 v2.0.0-alpha.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/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -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.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -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.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5/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/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= -github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -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.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs= -github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= -github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56etFpas= -github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 h1:Wqo399gCIufwto+VfwCSvsnfGpF/w5E9CNxSwbpD6No= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0/go.mod h1:qmOFXW2epJhM0qSnUUYpldc7gVz2KMQwJ/QYCDIa7XU= -github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= -github.com/hashicorp/go-version v1.6.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= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.6 h1:60eq2E/jlfwQXtvZEeBUYADs+BwKBWURIY+Gj2eRGjI= -github.com/klauspost/compress v1.17.6/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= -github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= -github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= -github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= -github.com/knadh/koanf/providers/confmap v0.1.0/go.mod h1:2uLhxQzJnyHKfxG927awZC7+fyHFdQkd697K4MdLnIU= -github.com/knadh/koanf/v2 v2.1.0 h1:eh4QmHHBuU8BybfIJ8mB8K8gsGCD/AUQTdwGq/GzId8= -github.com/knadh/koanf/v2 v2.1.0/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es= -github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= -github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= -github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= -github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c h1:cqn374mizHuIWj+OSJCajGr/phAmuMug9qIX3l9CflE= -github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= -github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= -github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= -github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= -github.com/prometheus/common v0.46.0 h1:doXzt5ybi1HBKpsZOL0sSkaNHJJqkyfEWZGGqqScV0Y= -github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1BTn+g2pa/hQ= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= -github.com/rs/cors v1.10.1 h1:L0uuZVXIKlI1SShY2nhFfo44TYvDPQ1w4oFkUJNfhyo= -github.com/rs/cors v1.10.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= -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= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= -go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/collector v0.95.0 h1:DFW0BkF2sOocpA3NUPrbMeuPSN3PWxFBrLqs/Cxn3vo= -go.opentelemetry.io/collector v0.95.0/go.mod h1:Lc+VkOkSBppKqR/cAevS5oPrbtUO3JUbYzo91niRkG0= -go.opentelemetry.io/collector/component v0.95.0 h1:68tI7KVy1bfpaR83+LxUvjd9/hjDh78utklGl2t6eVM= -go.opentelemetry.io/collector/component v0.95.0/go.mod h1:SMt7r9zm0OOEKJF/ZUy8agD92OAXq2Xhq1FaTcfIWHw= -go.opentelemetry.io/collector/config/configauth v0.95.0 h1:peGXB3ctZW/B8PomTL7CoIpTy94V5TR3JX6fD8kakmU= -go.opentelemetry.io/collector/config/configauth v0.95.0/go.mod h1:80lAG02Mucz0JYdG+k0NIul/BQF5bUpeRGEndgg07lg= -go.opentelemetry.io/collector/config/configcompression v0.95.0 h1:G1ljjbXmh37JaePSM+2r0bRNlEoCg4l1M1UuhGgnXx0= -go.opentelemetry.io/collector/config/configcompression v0.95.0/go.mod h1:owL6s04LI1fPrNZvXiRm6o4B0jaxb3z/oFEcgrakFK4= -go.opentelemetry.io/collector/config/confighttp v0.95.0 h1:x/f3CQhQzei2WPoGkSa9x1D1qXfMkbfnhKoQL7VjGvw= -go.opentelemetry.io/collector/config/confighttp v0.95.0/go.mod h1:77imNR16GOaIEoomda3ysRTyaVzH4cQi27FtDknJrqw= -go.opentelemetry.io/collector/config/configopaque v1.2.0 h1:ncnAuq4px3yREsirivGUbwr36xXEKa3K6JTOBNGlbtc= -go.opentelemetry.io/collector/config/configopaque v1.2.0/go.mod h1:6BAnSe6wok2Sg3tiNuapBbLnrduyMwzsBzbfgUSbDnI= -go.opentelemetry.io/collector/config/configretry v0.95.0 h1:YBLly9WRjLCnB91feTshPNCj3z91Yf+akLWRNiUNxps= -go.opentelemetry.io/collector/config/configretry v0.95.0/go.mod h1:Nq7hp4nk+zeH0LYYsx348NHl02O89FnV45hcCCmqdtg= -go.opentelemetry.io/collector/config/configtelemetry v0.95.0 h1:HabJZqbOAbNQ52L3v6usXoGXg1UKA1Ofs4Ytp5sGXEo= -go.opentelemetry.io/collector/config/configtelemetry v0.95.0/go.mod h1:tl8sI2RE3LSgJ0HjpadYpIwsKzw/CRA0nZUXLzMAZS0= -go.opentelemetry.io/collector/config/configtls v0.95.0 h1:LB6B5vCXwZV77jWPNhdvsgkyY8CFv8gdsRjfQS2Rioc= -go.opentelemetry.io/collector/config/configtls v0.95.0/go.mod h1:661iHIlhQTKIuUUEkQmuoyek1oq46XlsKjLu3JIzJrE= -go.opentelemetry.io/collector/config/internal v0.95.0 h1:jSifydX2KscDhVuTxGFdYtgWu+7AVKr9/7OCvBmS46Q= -go.opentelemetry.io/collector/config/internal v0.95.0/go.mod h1:KR0lphyXBwuB1DImzQDRVONoRTbwsGnH9degSG5018M= -go.opentelemetry.io/collector/confmap v0.95.0 h1:0oZwSUaeKTDCP7eewFpQSD+9SxXspiaJWjZDQYGGars= -go.opentelemetry.io/collector/confmap v0.95.0/go.mod h1:L3djzwpt+jL06wxnHAuy1jPUFcM+MdKGQAsz3B1d6pk= -go.opentelemetry.io/collector/consumer v0.95.0 h1:M/N5RDx8/6Hz5L1qWUXdtirtdoV8BEjIxCSdt6cCx+I= -go.opentelemetry.io/collector/consumer v0.95.0/go.mod h1:tM5aOolWS1zAByMbne2xVOkmVvZrF3VEKY6TkxhmkOs= -go.opentelemetry.io/collector/exporter v0.95.0 h1:orUpjMVsD2IYRzrofE0tBhEBGHjr7W4wfltERxnWhP4= -go.opentelemetry.io/collector/exporter v0.95.0/go.mod h1:5wyZskvf4T1Zmm414a7JM1xw8EPhrFZeCe5kCff6VRg= -go.opentelemetry.io/collector/exporter/otlphttpexporter v0.95.0 h1:qYwzbWoO0+lo8ZCvlJnejTLaidnPmfNB4JbIzQ5isHY= -go.opentelemetry.io/collector/exporter/otlphttpexporter v0.95.0/go.mod h1:GuZWJMiyHXmLQTKMdniu4uNScrAuUSkp2RSW7+zDjpY= -go.opentelemetry.io/collector/extension v0.95.0 h1:amE7zV/lfJRdCmZ4cqWmvBzZB5aQmIFIQqIuXmhaCjI= -go.opentelemetry.io/collector/extension v0.95.0/go.mod h1:IDt4B5GJxh/uJ/mUWxYZ+eHrJ49k4B8s8gJhuI0TRVI= -go.opentelemetry.io/collector/extension/auth v0.95.0 h1:Qu2/I6YXW1yhh+M5PZ6b5izPdzrh+bl8X7ewEeJQWGU= -go.opentelemetry.io/collector/extension/auth v0.95.0/go.mod h1:FSODnSbmqfRT9dQdJgogby7j4bcV8TmrhddTvcAjcjU= -go.opentelemetry.io/collector/featuregate v1.2.0 h1:nF8OGq5PsSNSLeuNwTWlOqThxbLW6v6DOCvSqQMc108= -go.opentelemetry.io/collector/featuregate v1.2.0/go.mod h1:mm8+xyQfgDmqhyegZRNIQmoKsNnDTwWKFLsdMoXAb7A= -go.opentelemetry.io/collector/pdata v1.2.0 h1:N6VdyEFYJyoHIKqHd0F372eNVD5b+AbH0ZQf7Z2jJ9I= -go.opentelemetry.io/collector/pdata v1.2.0/go.mod h1:mKXb6527Syb8PT4P9CZOJNbkuHOHjjGTZNNwSKESJhc= -go.opentelemetry.io/collector/receiver v0.95.0 h1:9gA8/ceXiYiPheGQUt+EmCEKTjkGpUdPkiG7iey3Md0= -go.opentelemetry.io/collector/receiver v0.95.0/go.mod h1:kQrMBxcrgZfmtvjVQa6jStYG7c2L1c8UiHe/JNb7M+E= -go.opentelemetry.io/contrib/config v0.3.0 h1:nJxYSB7/8fckSya4EAFyFGxIytMvNlQInXSmhz/OKKg= -go.opentelemetry.io/contrib/config v0.3.0/go.mod h1:tQW0mY8be9/LGikwZNYno97PleUhF/lMal9xJ1TC2vo= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0 h1:UNQQKPfTDe1J81ViolILjTKPr9WetKW6uei2hFgJmFs= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0/go.mod h1:r9vWsPS/3AQItv3OSlEJ/E4mbrhUbbw18meOjArPtKQ= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 h1:sv9kVfal0MK0wBMCOGr+HeJm9v803BkJxGrk2au7j08= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0/go.mod h1:SK2UL73Zy1quvRPonmOmRDiWk1KBV3LyIeeIxcEApWw= -go.opentelemetry.io/otel v1.23.1 h1:Za4UzOqJYS+MUczKI320AtqZHZb7EqxO00jAHE0jmQY= -go.opentelemetry.io/otel v1.23.1/go.mod h1:Td0134eafDLcTS4y+zQ26GE8u3dEuRBiBCTUIRHaikA= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.23.0 h1:D/cXD+03/UOphyyT87NX6h+DlU+BnplN6/P6KJwsgGc= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.23.0/go.mod h1:L669qRGbPBwLcftXLFnTVFO6ES/GyMAvITLdvRjEAIM= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.23.0 h1:VZrBiTXzP3FErizsdF1JQj0qf0yA8Ktt6LAcjUhZqbc= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.23.0/go.mod h1:xkkwo777b9MEfsyD1yUZa4g+7MCqqWAP3r2tTSZePRc= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.23.0 h1:cZXHUQvCx7YMdjGu0AlmoArUz7NZ7K6WWsT4cjSkzc0= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.23.0/go.mod h1:OHlshrAeSV9uiVQs1n+c0FVCyo8L0NrYzVf5GuLllRo= -go.opentelemetry.io/otel/exporters/prometheus v0.45.2 h1:pe2Jqk1K18As0RCw7J08QhgXNqr+6npx0a5W4IgAFA8= -go.opentelemetry.io/otel/exporters/prometheus v0.45.2/go.mod h1:B38pscHKI6bhFS44FDw0eFU3iqG3ASNIvY+fZgR5sAc= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.23.0 h1:f4N/tfYchDXfM78Ng5KKO7OjrShVzww1g4oYxZ7tyMA= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.23.0/go.mod h1:v1gipIZLj3qtxR1L1F7jF/WaPFA5ptuHk52+eq9SSRg= -go.opentelemetry.io/otel/metric v1.23.1 h1:PQJmqJ9u2QaJLBOELl1cxIdPcpbwzbkjfEyelTl2rlo= -go.opentelemetry.io/otel/metric v1.23.1/go.mod h1:mpG2QPlAfnK8yNhNJAxDZruU9Y1/HubbC+KyH8FaCWI= -go.opentelemetry.io/otel/sdk v1.23.1 h1:O7JmZw0h76if63LQdsBMKQDWNb5oEcOThG9IrxscV+E= -go.opentelemetry.io/otel/sdk v1.23.1/go.mod h1:LzdEVR5am1uKOOwfBWFef2DCi1nu3SA8XQxx2IerWFk= -go.opentelemetry.io/otel/sdk/metric v1.23.1 h1:T9/8WsYg+ZqIpMWwdISVVrlGb/N0Jr1OHjR/alpKwzg= -go.opentelemetry.io/otel/sdk/metric v1.23.1/go.mod h1:8WX6WnNtHCgUruJ4TJ+UssQjMtpxkpX0zveQC8JG/E0= -go.opentelemetry.io/otel/trace v1.23.1 h1:4LrmmEd8AU2rFvU1zegmvqW7+kWarxtNOPyeL6HmYY8= -go.opentelemetry.io/otel/trace v1.23.1/go.mod h1:4IpnpJFwr1mo/6HL8XIPJaE9y0+u1KcVmuW7dwFSVrI= -go.opentelemetry.io/proto/otlp v1.1.0 h1:2Di21piLrCqJ3U3eXGCTPHE9R8Nh+0uglSnOyxikMeI= -go.opentelemetry.io/proto/otlp v1.1.0/go.mod h1:GpBHCBWiqvVLDqmHZsoMM3C5ySeKTC7ej/RNTae6MdY= -go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= -go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= -go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= -go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= -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.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= -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/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= -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.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.17.0 h1:6m3ZPmLEFdVxKKWnKq4VqZ60gutO35zm+zrAHVmHyDQ= -golang.org/x/oauth2 v0.17.0/go.mod h1:OzPDGQiuQMguemayvdylqddI7qcD9lnSDb+1FiwQ5HA= -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/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -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-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-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -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.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.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/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= -golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= -golang.org/x/time v0.5.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-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.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -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= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.165.0 h1:zd5d4JIIIaYYsfVy1HzoXYZ9rWCSBxxAglbczzo7Bgc= -google.golang.org/api v0.165.0/go.mod h1:2OatzO7ZDQsoS7IFf3rvsE17/TldiU3F/zxFHeqUB5o= -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.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= -google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= -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-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20240125205218-1f4bbc51befe h1:USL2DhxfgRchafRvt/wYyyQNzwgL7ZiURcozOE/Pkvo= -google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917 h1:rcS6EyEaoCO52hQDupoSfrxI3R6C2Tq741is7X8OvnM= -google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917/go.mod h1:CmlNWB9lSezaYELKS5Ym1r44VrrbPUa7JTvw+6MbpJ0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240205150955-31a09d347014 h1:FSL3lRCkhaPFxqi0s9o+V4UI2WTzAVOvkgbd4kVV4Wg= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240205150955-31a09d347014/go.mod h1:SaPjaZGWb0lPqs6Ittu0spdfrOArqji4ZdeP5IC/9N4= -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.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0= -google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= -google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.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/exporter/f5cloudexporter/internal/metadata/generated_status.go b/exporter/f5cloudexporter/internal/metadata/generated_status.go deleted file mode 100644 index e86dd6f8a3b0..000000000000 --- a/exporter/f5cloudexporter/internal/metadata/generated_status.go +++ /dev/null @@ -1,27 +0,0 @@ -// Code generated by mdatagen. DO NOT EDIT. - -package metadata - -import ( - "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/otel/metric" - "go.opentelemetry.io/otel/trace" -) - -var ( - Type = component.MustNewType("f5cloud") -) - -const ( - TracesStability = component.StabilityLevelDeprecated - MetricsStability = component.StabilityLevelDeprecated - LogsStability = component.StabilityLevelDeprecated -) - -func Meter(settings component.TelemetrySettings) metric.Meter { - return settings.MeterProvider.Meter("otelcol/f5cloud") -} - -func Tracer(settings component.TelemetrySettings) trace.Tracer { - return settings.TracerProvider.Tracer("otelcol/f5cloud") -} diff --git a/exporter/f5cloudexporter/metadata.yaml b/exporter/f5cloudexporter/metadata.yaml deleted file mode 100644 index 1906d9ff9b99..000000000000 --- a/exporter/f5cloudexporter/metadata.yaml +++ /dev/null @@ -1,10 +0,0 @@ -type: f5cloud - -status: - class: exporter - stability: - deprecated: [traces, metrics, logs] - distributions: [contrib, observiq] - codeowners: - active: [] - emeritus: [gramidt] diff --git a/exporter/f5cloudexporter/testdata/config.yaml b/exporter/f5cloudexporter/testdata/config.yaml deleted file mode 100644 index c89dbf147b7b..000000000000 --- a/exporter/f5cloudexporter/testdata/config.yaml +++ /dev/null @@ -1,23 +0,0 @@ -f5cloud: - endpoint: "https://f5cloud" - source: "dev" - f5cloud_auth: - credential_file: "/etc/creds/key.json" -f5cloud/allsettings: - endpoint: "https://f5cloud" - source: "dev" - f5cloud_auth: - credential_file: "/etc/creds/key.json" - audience: "exampleaudience" - timeout: 10s - read_buffer_size: 123 - write_buffer_size: 345 - sending_queue: - enabled: true - num_consumers: 2 - queue_size: 10 - retry_on_failure: - enabled: true - initial_interval: 10s - max_interval: 60s - max_elapsed_time: 10m diff --git a/exporter/f5cloudexporter/testdata/empty_credential_file.json b/exporter/f5cloudexporter/testdata/empty_credential_file.json deleted file mode 100644 index 9e26dfeeb6e6..000000000000 --- a/exporter/f5cloudexporter/testdata/empty_credential_file.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/exporter/fileexporter/error_component.go b/exporter/fileexporter/error_component.go deleted file mode 100644 index 16d4675f6ed5..000000000000 --- a/exporter/fileexporter/error_component.go +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package fileexporter // import "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter" - -import ( - "context" - - "go.opentelemetry.io/collector/component" -) - -// errorComponent is used to return error from a factory method. SharedComponent does -// not handle errors, so wrapping the error into a component is necessary. -type errorComponent struct { - err error -} - -// Start will return the cached error. -func (e *errorComponent) Start(context.Context, component.Host) error { - return e.err -} - -// Shutdown will return the cached error. -func (e *errorComponent) Shutdown(context.Context) error { - return e.err -} diff --git a/exporter/fileexporter/factory.go b/exporter/fileexporter/factory.go index 5f2f29e29ab6..b75a0c0eb528 100644 --- a/exporter/fileexporter/factory.go +++ b/exporter/fileexporter/factory.go @@ -63,10 +63,7 @@ func createTracesExporter( set exporter.CreateSettings, cfg component.Config, ) (exporter.Traces, error) { - fe, err := getOrCreateFileExporter(cfg) - if err != nil { - return nil, err - } + fe := getOrCreateFileExporter(cfg) return exporterhelper.NewTracesExporter( ctx, set, @@ -83,10 +80,7 @@ func createMetricsExporter( set exporter.CreateSettings, cfg component.Config, ) (exporter.Metrics, error) { - fe, err := getOrCreateFileExporter(cfg) - if err != nil { - return nil, err - } + fe := getOrCreateFileExporter(cfg) return exporterhelper.NewMetricsExporter( ctx, set, @@ -103,10 +97,7 @@ func createLogsExporter( set exporter.CreateSettings, cfg component.Config, ) (exporter.Logs, error) { - fe, err := getOrCreateFileExporter(cfg) - if err != nil { - return nil, err - } + fe := getOrCreateFileExporter(cfg) return exporterhelper.NewLogsExporter( ctx, set, @@ -122,45 +113,20 @@ func createLogsExporter( // or returns the already cached one. Caching is required because the factory is asked trace and // metric receivers separately when it gets CreateTracesReceiver() and CreateMetricsReceiver() // but they must not create separate objects, they must use one Exporter object per configuration. -func getOrCreateFileExporter(cfg component.Config) (FileExporter, error) { +func getOrCreateFileExporter(cfg component.Config) FileExporter { conf := cfg.(*Config) fe := exporters.GetOrAdd(cfg, func() component.Component { - e, err := newFileExporter(conf) - if err != nil { - return &errorComponent{err: err} - } - - return e + return newFileExporter(conf) }) - component := fe.Unwrap() - if errComponent, ok := component.(*errorComponent); ok { - return nil, errComponent.err - } - - return component.(FileExporter), nil + c := fe.Unwrap() + return c.(FileExporter) } -func newFileExporter(conf *Config) (FileExporter, error) { - marshaller := &marshaller{ - formatType: conf.FormatType, - tracesMarshaler: tracesMarshalers[conf.FormatType], - metricsMarshaler: metricsMarshalers[conf.FormatType], - logsMarshaler: logsMarshalers[conf.FormatType], - compression: conf.Compression, - compressor: buildCompressor(conf.Compression), - } - export := buildExportFunc(conf) - - writer, err := newFileWriter(conf.Path, conf.Rotation, conf.FlushInterval, export) - if err != nil { - return nil, err - } - +func newFileExporter(conf *Config) FileExporter { return &fileExporter{ - marshaller: marshaller, - writer: writer, - }, nil + conf: conf, + } } func newFileWriter(path string, rotation *Rotation, flushInterval time.Duration, export exportFunc) (*fileWriter, error) { diff --git a/exporter/fileexporter/factory_test.go b/exporter/fileexporter/factory_test.go index 9d155e653d34..1f8a99c79163 100644 --- a/exporter/fileexporter/factory_test.go +++ b/exporter/fileexporter/factory_test.go @@ -26,10 +26,12 @@ func TestCreateMetricsExporterError(t *testing.T) { cfg := &Config{ FormatType: formatTypeJSON, } - _, err := createMetricsExporter( + e, err := createMetricsExporter( context.Background(), exportertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + err = e.Start(context.Background(), componenttest.NewNopHost()) assert.Error(t, err) } @@ -65,10 +67,12 @@ func TestCreateTracesExporterError(t *testing.T) { cfg := &Config{ FormatType: formatTypeJSON, } - _, err := createTracesExporter( + e, err := createTracesExporter( context.Background(), exportertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + err = e.Start(context.Background(), componenttest.NewNopHost()) assert.Error(t, err) } @@ -90,10 +94,12 @@ func TestCreateLogsExporterError(t *testing.T) { cfg := &Config{ FormatType: formatTypeJSON, } - _, err := createLogsExporter( + e, err := createLogsExporter( context.Background(), exportertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + err = e.Start(context.Background(), componenttest.NewNopHost()) assert.Error(t, err) } diff --git a/exporter/fileexporter/file_exporter.go b/exporter/fileexporter/file_exporter.go index c610c9fa6445..18cf7aa58637 100644 --- a/exporter/fileexporter/file_exporter.go +++ b/exporter/fileexporter/file_exporter.go @@ -14,6 +14,7 @@ import ( // fileExporter is the implementation of file exporter that writes telemetry data to a file type fileExporter struct { + conf *Config marshaller *marshaller writer *fileWriter } @@ -43,12 +44,33 @@ func (e *fileExporter) consumeLogs(_ context.Context, ld plog.Logs) error { } // Start starts the flush timer if set. -func (e *fileExporter) Start(ctx context.Context, _ component.Host) error { - return e.writer.start(ctx) +func (e *fileExporter) Start(_ context.Context, _ component.Host) error { + e.marshaller = &marshaller{ + formatType: e.conf.FormatType, + tracesMarshaler: tracesMarshalers[e.conf.FormatType], + metricsMarshaler: metricsMarshalers[e.conf.FormatType], + logsMarshaler: logsMarshalers[e.conf.FormatType], + compression: e.conf.Compression, + compressor: buildCompressor(e.conf.Compression), + } + export := buildExportFunc(e.conf) + + var err error + e.writer, err = newFileWriter(e.conf.Path, e.conf.Rotation, e.conf.FlushInterval, export) + if err != nil { + return err + } + e.writer.start() + return nil } // Shutdown stops the exporter and is invoked during shutdown. // It stops the flush ticker if set. func (e *fileExporter) Shutdown(context.Context) error { - return e.writer.shutdown() + if e.writer == nil { + return nil + } + w := e.writer + e.writer = nil + return w.shutdown() } diff --git a/exporter/fileexporter/file_exporter_test.go b/exporter/fileexporter/file_exporter_test.go index 7b1747df7a0b..5cff81001f62 100644 --- a/exporter/fileexporter/file_exporter_test.go +++ b/exporter/fileexporter/file_exporter_test.go @@ -126,8 +126,7 @@ func TestFileTracesExporter(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { conf := tt.args.conf - feI, err := newFileExporter(conf) - assert.NoError(t, err) + feI := newFileExporter(conf) require.IsType(t, &fileExporter{}, feI) fe := feI.(*fileExporter) @@ -135,7 +134,9 @@ func TestFileTracesExporter(t *testing.T) { assert.NoError(t, fe.Start(context.Background(), componenttest.NewNopHost())) assert.NoError(t, fe.consumeTraces(context.Background(), td)) assert.NoError(t, fe.consumeTraces(context.Background(), td)) - assert.NoError(t, fe.Shutdown(context.Background())) + defer func() { + assert.NoError(t, fe.Shutdown(context.Background())) + }() fi, err := os.Open(fe.writer.path) assert.NoError(t, err) @@ -256,16 +257,8 @@ func TestFileMetricsExporter(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { conf := tt.args.conf - writer, err := buildFileWriter(conf) - assert.NoError(t, err) fe := &fileExporter{ - marshaller: &marshaller{ - formatType: conf.FormatType, - metricsMarshaler: metricsMarshalers[conf.FormatType], - compression: conf.Compression, - compressor: buildCompressor(conf.Compression), - }, - writer: writer, + conf: conf, } require.NotNil(t, fe) @@ -273,7 +266,9 @@ func TestFileMetricsExporter(t *testing.T) { assert.NoError(t, fe.Start(context.Background(), componenttest.NewNopHost())) assert.NoError(t, fe.consumeMetrics(context.Background(), md)) assert.NoError(t, fe.consumeMetrics(context.Background(), md)) - assert.NoError(t, fe.Shutdown(context.Background())) + defer func() { + assert.NoError(t, fe.Shutdown(context.Background())) + }() fi, err := os.Open(fe.writer.path) assert.NoError(t, err) @@ -396,16 +391,8 @@ func TestFileLogsExporter(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { conf := tt.args.conf - writer, err := buildFileWriter(conf) - assert.NoError(t, err) fe := &fileExporter{ - marshaller: &marshaller{ - formatType: conf.FormatType, - logsMarshaler: logsMarshalers[conf.FormatType], - compression: conf.Compression, - compressor: buildCompressor(conf.Compression), - }, - writer: writer, + conf: conf, } require.NotNil(t, fe) @@ -413,7 +400,9 @@ func TestFileLogsExporter(t *testing.T) { assert.NoError(t, fe.Start(context.Background(), componenttest.NewNopHost())) assert.NoError(t, fe.consumeLogs(context.Background(), ld)) assert.NoError(t, fe.consumeLogs(context.Background(), ld)) - assert.NoError(t, fe.Shutdown(context.Background())) + defer func() { + assert.NoError(t, fe.Shutdown(context.Background())) + }() fi, err := os.Open(fe.writer.path) assert.NoError(t, err) @@ -631,11 +620,6 @@ func safeFileExporterWrite(e *fileExporter, d []byte) (int, error) { return e.writer.file.Write(d) } -func buildFileWriter(conf *Config) (*fileWriter, error) { - export := buildExportFunc(conf) - return newFileWriter(conf.Path, conf.Rotation, conf.FlushInterval, export) -} - func TestFlushing(t *testing.T) { cfg := &Config{ Path: tempFileName(t), @@ -648,16 +632,28 @@ func TestFlushing(t *testing.T) { // Wrap the buffer with the buffered writer closer that implements flush() method. bwc := newBufferedWriteCloser(buf) // Create a file exporter with flushing enabled. - feI, err := newFileExporter(cfg) - assert.NoError(t, err) + feI := newFileExporter(cfg) assert.IsType(t, &fileExporter{}, feI) fe := feI.(*fileExporter) - fe.writer.file.Close() - fe.writer.file = bwc // Start the flusher. ctx := context.Background() - assert.NoError(t, fe.Start(ctx, nil)) + fe.marshaller = &marshaller{ + formatType: fe.conf.FormatType, + tracesMarshaler: tracesMarshalers[fe.conf.FormatType], + metricsMarshaler: metricsMarshalers[fe.conf.FormatType], + logsMarshaler: logsMarshalers[fe.conf.FormatType], + compression: fe.conf.Compression, + compressor: buildCompressor(fe.conf.Compression), + } + export := buildExportFunc(fe.conf) + var err error + fe.writer, err = newFileWriter(fe.conf.Path, fe.conf.Rotation, fe.conf.FlushInterval, export) + assert.NoError(t, err) + err = fe.writer.file.Close() + assert.NoError(t, err) + fe.writer.file = bwc + fe.writer.start() // Write 10 bytes. b := []byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10} diff --git a/exporter/fileexporter/file_writer.go b/exporter/fileexporter/file_writer.go index 46dde6d82ed6..fc4c34e25425 100644 --- a/exporter/fileexporter/file_writer.go +++ b/exporter/fileexporter/file_writer.go @@ -4,7 +4,6 @@ package fileexporter // import "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter" import ( - "context" "encoding/binary" "io" "sync" @@ -78,6 +77,8 @@ func (w *fileWriter) startFlusher() { ff.flush() w.mutex.Unlock() case <-w.stopTicker: + w.flushTicker.Stop() + w.flushTicker = nil return } } @@ -85,23 +86,22 @@ func (w *fileWriter) startFlusher() { } // Start starts the flush timer if set. -func (w *fileWriter) start(context.Context) error { +func (w *fileWriter) start() { if w.flushInterval > 0 { w.startFlusher() } - return nil } // Shutdown stops the exporter and is invoked during shutdown. // It stops the flush ticker if set. func (w *fileWriter) shutdown() error { - w.mutex.Lock() - defer w.mutex.Unlock() + // Stop the flush ticker. if w.flushTicker != nil { - w.flushTicker.Stop() // Stop the go routine. + w.mutex.Lock() close(w.stopTicker) + w.mutex.Unlock() } return w.file.Close() } diff --git a/exporter/fileexporter/generated_component_test.go b/exporter/fileexporter/generated_component_test.go new file mode 100644 index 000000000000..01de9d0396be --- /dev/null +++ b/exporter/fileexporter/generated_component_test.go @@ -0,0 +1,134 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package fileexporter + +import ( + "context" + "testing" + "time" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/exporter" + "go.opentelemetry.io/collector/exporter/exportertest" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" +) + +func TestComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "logs", + createFn: func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateLogsExporter(ctx, set, cfg) + }, + }, + + { + name: "metrics", + createFn: func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateMetricsExporter(ctx, set, cfg) + }, + }, + + { + name: "traces", + createFn: func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateTracesExporter(ctx, set, cfg) + }, + }, + } + + cm, err := confmaptest.LoadConf("metadata.yaml") + require.NoError(t, err) + cfg := factory.CreateDefaultConfig() + sub, err := cm.Sub("tests::config") + require.NoError(t, err) + require.NoError(t, component.UnmarshalConfig(sub, cfg)) + + for _, test := range tests { + t.Run(test.name+"-shutdown", func(t *testing.T) { + c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + t.Run(test.name+"-lifecycle", func(t *testing.T) { + c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := componenttest.NewNopHost() + err = c.Start(context.Background(), host) + require.NoError(t, err) + require.NotPanics(t, func() { + switch e := c.(type) { + case exporter.Logs: + logs := generateLifecycleTestLogs() + if !e.Capabilities().MutatesData { + logs.MarkReadOnly() + } + err = e.ConsumeLogs(context.Background(), logs) + case exporter.Metrics: + metrics := generateLifecycleTestMetrics() + if !e.Capabilities().MutatesData { + metrics.MarkReadOnly() + } + err = e.ConsumeMetrics(context.Background(), metrics) + case exporter.Traces: + traces := generateLifecycleTestTraces() + if !e.Capabilities().MutatesData { + traces.MarkReadOnly() + } + err = e.ConsumeTraces(context.Background(), traces) + } + }) + + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + } +} + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/exporter/fileexporter/go.mod b/exporter/fileexporter/go.mod index b2391d0928cb..64b26ead0db1 100644 --- a/exporter/fileexporter/go.mod +++ b/exporter/fileexporter/go.mod @@ -3,7 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileex go 1.21 require ( - github.com/klauspost/compress v1.17.6 + github.com/klauspost/compress v1.17.7 github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.95.0 github.com/stretchr/testify v1.8.4 @@ -52,7 +52,7 @@ require ( go.opentelemetry.io/otel/sdk v1.23.1 // indirect go.opentelemetry.io/otel/sdk/metric v1.23.1 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.26.0 // indirect + go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.20.0 // indirect golang.org/x/sys v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/exporter/fileexporter/go.sum b/exporter/fileexporter/go.sum index 81309656368c..f451c81af15d 100644 --- a/exporter/fileexporter/go.sum +++ b/exporter/fileexporter/go.sum @@ -27,8 +27,8 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.6 h1:60eq2E/jlfwQXtvZEeBUYADs+BwKBWURIY+Gj2eRGjI= -github.com/klauspost/compress v1.17.6/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLAKQQg= +github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= @@ -104,8 +104,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/exporter/fileexporter/metadata.yaml b/exporter/fileexporter/metadata.yaml index 7610d9a67c61..a200e3c3eebf 100644 --- a/exporter/fileexporter/metadata.yaml +++ b/exporter/fileexporter/metadata.yaml @@ -7,3 +7,8 @@ status: distributions: [core, contrib, observiq, splunk, sumo, aws] codeowners: active: [atingchen] + +tests: + config: + path: testdata/log.json + expect_consumer_error: true \ No newline at end of file diff --git a/exporter/fileexporter/testdata/.gitignore b/exporter/fileexporter/testdata/.gitignore new file mode 100644 index 000000000000..71aba6f8f5a7 --- /dev/null +++ b/exporter/fileexporter/testdata/.gitignore @@ -0,0 +1,2 @@ +# File generated by lifecycle tests +log.json \ No newline at end of file diff --git a/exporter/googlecloudexporter/README.md b/exporter/googlecloudexporter/README.md index b70f2152da0a..3eddd2f9dc28 100644 --- a/exporter/googlecloudexporter/README.md +++ b/exporter/googlecloudexporter/README.md @@ -238,7 +238,7 @@ will or will not proxy traffic as defined by these environment variables. ### Monitored Resources For metrics and logs, this exporter maps the OpenTelemetry Resource to a Google -Cloud [Logging\(https://cloud.google.com/logging/docs/api/v2/resource-list) or +Cloud [Logging](https://cloud.google.com/logging/docs/api/v2/resource-list) or [Monitoring](https://cloud.google.com/monitoring/api/resources) Monitored Resource. The complete mapping logic can be found [here](https://github.com/GoogleCloudPlatform/opentelemetry-operations-go/blob/main/internal/resourcemapping/resourcemapping.go). diff --git a/exporter/googlecloudexporter/metadata.yaml b/exporter/googlecloudexporter/metadata.yaml index 5b551dc0f188..a96a028478c4 100644 --- a/exporter/googlecloudexporter/metadata.yaml +++ b/exporter/googlecloudexporter/metadata.yaml @@ -7,3 +7,8 @@ status: distributions: [contrib, observiq] codeowners: active: [aabmass, dashpole, jsuereth, punya, damemi, psx95] + +# TODO: Update the exporter to pass the tests +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/exporter/googlecloudpubsubexporter/generated_component_test.go b/exporter/googlecloudpubsubexporter/generated_component_test.go new file mode 100644 index 000000000000..bbe9f0c7a3be --- /dev/null +++ b/exporter/googlecloudpubsubexporter/generated_component_test.go @@ -0,0 +1,101 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package googlecloudpubsubexporter + +import ( + "context" + "testing" + "time" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/exporter" + "go.opentelemetry.io/collector/exporter/exportertest" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" +) + +func TestComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "logs", + createFn: func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateLogsExporter(ctx, set, cfg) + }, + }, + + { + name: "metrics", + createFn: func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateMetricsExporter(ctx, set, cfg) + }, + }, + + { + name: "traces", + createFn: func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateTracesExporter(ctx, set, cfg) + }, + }, + } + + cm, err := confmaptest.LoadConf("metadata.yaml") + require.NoError(t, err) + cfg := factory.CreateDefaultConfig() + sub, err := cm.Sub("tests::config") + require.NoError(t, err) + require.NoError(t, component.UnmarshalConfig(sub, cfg)) + + for _, test := range tests { + t.Run(test.name+"-shutdown", func(t *testing.T) { + c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + } +} + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/exporter/googlecloudpubsubexporter/go.mod b/exporter/googlecloudpubsubexporter/go.mod index 9fdb5722e4ec..f3125fdc757d 100644 --- a/exporter/googlecloudpubsubexporter/go.mod +++ b/exporter/googlecloudpubsubexporter/go.mod @@ -14,7 +14,7 @@ require ( go.opentelemetry.io/collector/pdata v1.2.0 go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 google.golang.org/api v0.165.0 google.golang.org/grpc v1.61.0 ) diff --git a/exporter/googlecloudpubsubexporter/go.sum b/exporter/googlecloudpubsubexporter/go.sum index cc5b2d317a8a..55c9a0de65df 100644 --- a/exporter/googlecloudpubsubexporter/go.sum +++ b/exporter/googlecloudpubsubexporter/go.sum @@ -172,8 +172,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/exporter/googlecloudpubsubexporter/metadata.yaml b/exporter/googlecloudpubsubexporter/metadata.yaml index f38f9ae8a2ad..cafd83185532 100644 --- a/exporter/googlecloudpubsubexporter/metadata.yaml +++ b/exporter/googlecloudpubsubexporter/metadata.yaml @@ -7,3 +7,7 @@ status: distributions: [contrib, observiq] codeowners: active: [alexvanboxel] + +# TODO: Update the exporter to pass the tests +tests: + skip_lifecycle: true diff --git a/exporter/googlemanagedprometheusexporter/metadata.yaml b/exporter/googlemanagedprometheusexporter/metadata.yaml index 6b3d0c326f7e..c5123fed2726 100644 --- a/exporter/googlemanagedprometheusexporter/metadata.yaml +++ b/exporter/googlemanagedprometheusexporter/metadata.yaml @@ -7,3 +7,8 @@ status: distributions: [contrib, observiq] codeowners: active: [aabmass, dashpole, jsuereth, punya, damemi, psx95] + +# TODO: Update the exporter to pass the tests +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/exporter/honeycombmarkerexporter/generated_component_test.go b/exporter/honeycombmarkerexporter/generated_component_test.go index 381375b5bedc..f1d77f7a1ee8 100644 --- a/exporter/honeycombmarkerexporter/generated_component_test.go +++ b/exporter/honeycombmarkerexporter/generated_component_test.go @@ -5,27 +5,20 @@ package honeycombmarkerexporter import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -56,9 +49,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -67,19 +58,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case exporter.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case exporter.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case exporter.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -92,3 +83,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/exporter/honeycombmarkerexporter/go.mod b/exporter/honeycombmarkerexporter/go.mod index ba6290ee581d..b912d953c112 100644 --- a/exporter/honeycombmarkerexporter/go.mod +++ b/exporter/honeycombmarkerexporter/go.mod @@ -3,7 +3,6 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/exporter/honeyc go 1.21 require ( - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.95.0 github.com/stretchr/testify v1.8.4 @@ -17,7 +16,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( @@ -49,6 +48,7 @@ require ( github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.95.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_golang v1.18.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect diff --git a/exporter/honeycombmarkerexporter/go.sum b/exporter/honeycombmarkerexporter/go.sum index a7d425b1483f..586f02e6b4ed 100644 --- a/exporter/honeycombmarkerexporter/go.sum +++ b/exporter/honeycombmarkerexporter/go.sum @@ -148,8 +148,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/exporter/honeycombmarkerexporter/metadata.yaml b/exporter/honeycombmarkerexporter/metadata.yaml index 950deb987572..956f924f3e5b 100644 --- a/exporter/honeycombmarkerexporter/metadata.yaml +++ b/exporter/honeycombmarkerexporter/metadata.yaml @@ -9,5 +9,4 @@ status: active: [TylerHelmuth, fchikwekwe] tests: - config: expect_consumer_error: true \ No newline at end of file diff --git a/exporter/influxdbexporter/generated_component_test.go b/exporter/influxdbexporter/generated_component_test.go index a5036c37bb61..68d79ff2a0d4 100644 --- a/exporter/influxdbexporter/generated_component_test.go +++ b/exporter/influxdbexporter/generated_component_test.go @@ -5,27 +5,20 @@ package influxdbexporter import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -70,9 +63,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -81,19 +72,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case exporter.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case exporter.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case exporter.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -106,3 +97,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/exporter/influxdbexporter/go.mod b/exporter/influxdbexporter/go.mod index e4fb30b2b9c6..c32f8d1a4c38 100644 --- a/exporter/influxdbexporter/go.mod +++ b/exporter/influxdbexporter/go.mod @@ -7,7 +7,6 @@ require ( github.com/influxdata/influxdb-observability/common v0.5.8 github.com/influxdata/influxdb-observability/otel2influx v0.5.8 github.com/influxdata/line-protocol/v2 v2.2.1 - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.95.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.95.0 go.opentelemetry.io/collector/config/confighttp v0.95.0 @@ -16,10 +15,11 @@ require ( go.opentelemetry.io/collector/confmap v0.95.0 go.opentelemetry.io/collector/consumer v0.95.0 go.opentelemetry.io/collector/exporter v0.95.0 + go.opentelemetry.io/collector/pdata v1.2.0 go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc ) @@ -62,7 +62,6 @@ require ( go.opentelemetry.io/collector/extension v0.95.0 // indirect go.opentelemetry.io/collector/extension/auth v0.95.0 // indirect go.opentelemetry.io/collector/featuregate v1.2.0 // indirect - go.opentelemetry.io/collector/pdata v1.2.0 // indirect go.opentelemetry.io/collector/receiver v0.95.0 // indirect go.opentelemetry.io/collector/semconv v0.95.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 // indirect @@ -85,11 +84,3 @@ retract ( v0.76.1 v0.65.0 ) - -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal => ../../internal/coreinternal - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil => ../../pkg/pdatautil - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden diff --git a/exporter/influxdbexporter/go.sum b/exporter/influxdbexporter/go.sum index c6d59f9963f1..ab944089083b 100644 --- a/exporter/influxdbexporter/go.sum +++ b/exporter/influxdbexporter/go.sum @@ -160,8 +160,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/exporter/influxdbexporter/metadata.yaml b/exporter/influxdbexporter/metadata.yaml index c8d1a1cae3f3..14176efcf877 100644 --- a/exporter/influxdbexporter/metadata.yaml +++ b/exporter/influxdbexporter/metadata.yaml @@ -9,5 +9,4 @@ status: active: [jacobmarble] tests: - config: expect_consumer_error: true \ No newline at end of file diff --git a/exporter/instanaexporter/generated_component_test.go b/exporter/instanaexporter/generated_component_test.go index 6e39520796e1..bbb5b6fab6c3 100644 --- a/exporter/instanaexporter/generated_component_test.go +++ b/exporter/instanaexporter/generated_component_test.go @@ -5,27 +5,20 @@ package instanaexporter import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -56,9 +49,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -67,19 +58,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case exporter.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case exporter.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case exporter.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -92,3 +83,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/exporter/instanaexporter/go.mod b/exporter/instanaexporter/go.mod index 7db38532fe18..9e13a0fa8020 100644 --- a/exporter/instanaexporter/go.mod +++ b/exporter/instanaexporter/go.mod @@ -18,7 +18,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/exporter/instanaexporter/go.sum b/exporter/instanaexporter/go.sum index 89124de8e5ba..7c5a725a2c5f 100644 --- a/exporter/instanaexporter/go.sum +++ b/exporter/instanaexporter/go.sum @@ -134,8 +134,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/exporter/instanaexporter/metadata.yaml b/exporter/instanaexporter/metadata.yaml index aca77294d82a..c057cac93ff8 100644 --- a/exporter/instanaexporter/metadata.yaml +++ b/exporter/instanaexporter/metadata.yaml @@ -9,5 +9,4 @@ status: active: [jpkrohling, hickeyma] tests: - config: expect_consumer_error: true \ No newline at end of file diff --git a/exporter/kafkaexporter/factory_test.go b/exporter/kafkaexporter/factory_test.go index 42692c5ab6d0..7f83a4c33857 100644 --- a/exporter/kafkaexporter/factory_test.go +++ b/exporter/kafkaexporter/factory_test.go @@ -131,6 +131,7 @@ func TestCreateMetricExporter(t *testing.T) { } assert.NoError(t, err, "Must not error") assert.NotNil(t, exporter, "Must return valid exporter when no error is returned") + assert.NoError(t, exporter.Shutdown(context.Background())) }) } } @@ -205,6 +206,7 @@ func TestCreateLogExporter(t *testing.T) { } assert.NoError(t, err, "Must not error") assert.NotNil(t, exporter, "Must return valid exporter when no error is returned") + assert.NoError(t, exporter.Shutdown(context.Background())) }) } } @@ -279,6 +281,7 @@ func TestCreateTraceExporter(t *testing.T) { } assert.NoError(t, err, "Must not error") assert.NotNil(t, exporter, "Must return valid exporter when no error is returned") + assert.NoError(t, exporter.Shutdown(context.Background())) }) } } diff --git a/exporter/kafkaexporter/go.mod b/exporter/kafkaexporter/go.mod index 48e2c3cadf85..75fb38f3e80a 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.21 require ( - github.com/IBM/sarama v1.42.2 + github.com/IBM/sarama v1.43.0 github.com/cenkalti/backoff/v4 v4.2.1 github.com/gogo/protobuf v1.3.2 github.com/jaegertracing/jaeger v1.54.0 @@ -24,17 +24,18 @@ require ( go.opentelemetry.io/collector/semconv v0.95.0 go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 + go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( github.com/apache/thrift v0.19.0 // indirect - github.com/aws/aws-sdk-go v1.50.17 // indirect + github.com/aws/aws-sdk-go v1.50.27 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/eapache/go-resiliency v1.5.0 // indirect + github.com/eapache/go-resiliency v1.6.0 // indirect github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 // indirect github.com/eapache/queue v1.1.0 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect @@ -53,7 +54,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.4 // indirect + github.com/klauspost/compress v1.17.7 // 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.0 // indirect diff --git a/exporter/kafkaexporter/go.sum b/exporter/kafkaexporter/go.sum index 299dfc2f3c2c..aaa5c051e2e5 100644 --- a/exporter/kafkaexporter/go.sum +++ b/exporter/kafkaexporter/go.sum @@ -1,9 +1,9 @@ -github.com/IBM/sarama v1.42.2 h1:VoY4hVIZ+WQJ8G9KNY/SQlWguBQXQ9uvFPOnrcu8hEw= -github.com/IBM/sarama v1.42.2/go.mod h1:FLPGUGwYqEs62hq2bVG6Io2+5n+pS6s/WOXVKWSLFtE= +github.com/IBM/sarama v1.43.0 h1:YFFDn8mMI2QL0wOrG0J2sFoVIAFl7hS9JQi2YZsXtJc= +github.com/IBM/sarama v1.43.0/go.mod h1:zlE6HEbC/SMQ9mhEYaF7nNLYOUyrs0obySKCckWP9BM= github.com/apache/thrift v0.19.0 h1:sOqkWPzMj7w6XaYbJQG7m4sGqVolaW/0D28Ln7yPzMk= github.com/apache/thrift v0.19.0/go.mod h1:SUALL216IiaOw2Oy+5Vs9lboJ/t9g40C+G07Dc0QC1I= -github.com/aws/aws-sdk-go v1.50.17 h1:KsbzUKDgGNlkDHGvoQDhiJ63a9jtZd+O+/s3pTOr/ns= -github.com/aws/aws-sdk-go v1.50.17/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.50.27 h1:96ifhrSuja+AzdP3W/T2337igqVQ2FcSIJYkk+0rCeA= +github.com/aws/aws-sdk-go v1.50.27/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= @@ -14,8 +14,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/eapache/go-resiliency v1.5.0 h1:dRsaR00whmQD+SgVKlq/vCRFNgtEb5yppyeVos3Yce0= -github.com/eapache/go-resiliency v1.5.0/go.mod h1:5yPzW0MIvSe0JDsv0v+DvcjEv2FyD6iZYSs1ZI+iQho= +github.com/eapache/go-resiliency v1.6.0 h1:CqGDTLtpwuWKn6Nj3uNUdflaq+/kIPsg0gfNzHton30= +github.com/eapache/go-resiliency v1.6.0/go.mod h1:5yPzW0MIvSe0JDsv0v+DvcjEv2FyD6iZYSs1ZI+iQho= github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 h1:Oy0F4ALJ04o5Qqpdz8XLIpNA3WM/iSIXqxtqo7UGVws= github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3/go.mod h1:YvSRo5mw33fLEx1+DlK6L2VV43tJt5Eyel9n9XBcR+0= github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc= @@ -74,8 +74,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.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= -github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLAKQQg= +github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= @@ -177,8 +177,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/exporter/kafkaexporter/metadata.yaml b/exporter/kafkaexporter/metadata.yaml index 349b91659be1..f6215e889405 100644 --- a/exporter/kafkaexporter/metadata.yaml +++ b/exporter/kafkaexporter/metadata.yaml @@ -7,3 +7,8 @@ status: distributions: [core, contrib, observiq, splunk, sumo, aws] codeowners: active: [pavolloffay, MovieStoreGuy] + +# TODO: Update the exporter to pass the tests +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/extension/httpforwarder/package_test.go b/exporter/kafkaexporter/package_test.go similarity index 89% rename from extension/httpforwarder/package_test.go rename to exporter/kafkaexporter/package_test.go index 2013e405422b..c43d258301ad 100644 --- a/extension/httpforwarder/package_test.go +++ b/exporter/kafkaexporter/package_test.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package httpforwarder +package kafkaexporter import ( "testing" diff --git a/exporter/kineticaexporter/generated_component_test.go b/exporter/kineticaexporter/generated_component_test.go index db225e8076af..b2ce8ed923d7 100644 --- a/exporter/kineticaexporter/generated_component_test.go +++ b/exporter/kineticaexporter/generated_component_test.go @@ -5,27 +5,19 @@ package kineticaexporter import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -70,44 +62,40 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) + } +} - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - err = c.Start(context.Background(), host) - require.NoError(t, err) - require.NotPanics(t, func() { - switch e := c.(type) { - case exporter.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) - if !e.Capabilities().MutatesData { - logs.MarkReadOnly() - } - err = e.ConsumeLogs(context.Background(), logs) - case exporter.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() - if !e.Capabilities().MutatesData { - metrics.MarkReadOnly() - } - err = e.ConsumeMetrics(context.Background(), metrics) - case exporter.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() - if !e.Capabilities().MutatesData { - traces.MarkReadOnly() - } - err = e.ConsumeTraces(context.Background(), traces) - } - }) +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} - require.NoError(t, err) +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} - err = c.Shutdown(context.Background()) - require.NoError(t, err) - }) - } +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces } diff --git a/exporter/kineticaexporter/go.mod b/exporter/kineticaexporter/go.mod index 412882209220..7fe0fd5942b4 100644 --- a/exporter/kineticaexporter/go.mod +++ b/exporter/kineticaexporter/go.mod @@ -16,13 +16,11 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect ) -require github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.95.0 - require ( github.com/bahlo/generic-list-go v0.2.0 // indirect github.com/beorn7/perks v1.0.1 // indirect @@ -80,11 +78,3 @@ retract ( v0.76.1 v0.65.0 ) - -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal => ../../internal/coreinternal - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil => ../../pkg/pdatautil - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden diff --git a/exporter/kineticaexporter/go.sum b/exporter/kineticaexporter/go.sum index 6819dd0d996d..323c2326866a 100644 --- a/exporter/kineticaexporter/go.sum +++ b/exporter/kineticaexporter/go.sum @@ -132,8 +132,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/exporter/kineticaexporter/metadata.yaml b/exporter/kineticaexporter/metadata.yaml index 7c07aa7625b5..23fe9da02f1d 100644 --- a/exporter/kineticaexporter/metadata.yaml +++ b/exporter/kineticaexporter/metadata.yaml @@ -8,6 +8,7 @@ status: codeowners: active: [am-kinetica, TylerHelmuth] + +# TODO: Update the exporter to pass the tests tests: - config: skip_lifecycle: true \ No newline at end of file diff --git a/exporter/loadbalancingexporter/README.md b/exporter/loadbalancingexporter/README.md index 8630669ed55d..0afc8f51048d 100644 --- a/exporter/loadbalancingexporter/README.md +++ b/exporter/loadbalancingexporter/README.md @@ -3,14 +3,14 @@ | Status | | | ------------- |-----------| -| Stability | [beta]: traces, logs | -| | [development]: metrics | +| Stability | [development]: metrics | +| | [beta]: traces, logs | | Distributions | [contrib], [aws], [grafana], [observiq], [splunk], [sumo] | | Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Aexporter%2Floadbalancing%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Aexporter%2Floadbalancing) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Aexporter%2Floadbalancing%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Aexporter%2Floadbalancing) | | [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@jpkrohling](https://www.github.com/jpkrohling) | -[beta]: https://github.com/open-telemetry/opentelemetry-collector#beta [development]: https://github.com/open-telemetry/opentelemetry-collector#development +[beta]: https://github.com/open-telemetry/opentelemetry-collector#beta [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib [aws]: https://github.com/aws-observability/aws-otel-collector [grafana]: https://github.com/grafana/agent @@ -47,7 +47,7 @@ Around R/N of the "routes" will be rerouted differently, where: This should be stable enough for most cases, and the larger the number of backends, the less disruption it should cause. Still, if routing stability is important for your use case and your list of backends are constantly changing, consider using the `groupbytrace` processor. This way, traces are dispatched atomically to this exporter, and the same decision about the backend is made for the trace as a whole. -This also supports service name based exporting for traces. If you have two or more collectors that collect traces and then use spanmetrics processor to generate metrics and push to prometheus, there is a high chance of facing label collisions on prometheus if the routing is based on `traceID` because every collector sees the `service+operation` label. With service name based routing, each collector can only see one service name and can push metrics without any label collisions. +This also supports service name based exporting for traces. If you have two or more collectors that collect traces and then use spanmetrics connector to generate metrics and push to prometheus, there is a high chance of facing label collisions on prometheus if the routing is based on `traceID` because every collector sees the `service+operation` label. With service name based routing, each collector can only see one service name and can push metrics without any label collisions. ## Resilience and scaling considerations The `loadbalancingexporter` will, irrespective of the chosen resolver (`static`, `dns`, `k8s`), create one exporter per endpoint. The exporter conforms to its published configuration regarding sending queue and retry mechanisms. Importantly, the `loadbalancingexporter` will not attempt to re-route data to a healthy endpoint on delivery failure, and data loss is therefore possible if the exporter's target remains unavailable once redelivery is exhausted. Due consideration needs to be given to the exporter queue and retry configuration when running in a highly elastic environment. diff --git a/exporter/loadbalancingexporter/factory.go b/exporter/loadbalancingexporter/factory.go index 331ae9a98517..f748ff162c6f 100644 --- a/exporter/loadbalancingexporter/factory.go +++ b/exporter/loadbalancingexporter/factory.go @@ -32,7 +32,7 @@ func NewFactory() exporter.Factory { func createDefaultConfig() component.Config { otlpFactory := otlpexporter.NewFactory() otlpDefaultCfg := otlpFactory.CreateDefaultConfig().(*otlpexporter.Config) - otlpDefaultCfg.Endpoint = "placeholder" + otlpDefaultCfg.Endpoint = "placeholder:4317" return &Config{ Protocol: Protocol{ diff --git a/exporter/loadbalancingexporter/generated_component_test.go b/exporter/loadbalancingexporter/generated_component_test.go index e99a1fec7f4d..89d139bd0614 100644 --- a/exporter/loadbalancingexporter/generated_component_test.go +++ b/exporter/loadbalancingexporter/generated_component_test.go @@ -5,27 +5,20 @@ package loadbalancingexporter import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -70,9 +63,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -81,19 +72,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case exporter.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case exporter.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case exporter.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -106,3 +97,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/exporter/loadbalancingexporter/go.mod b/exporter/loadbalancingexporter/go.mod index cfdf4d5397f4..d80e76ed8a8a 100644 --- a/exporter/loadbalancingexporter/go.mod +++ b/exporter/loadbalancingexporter/go.mod @@ -3,7 +3,6 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/exporter/loadba go 1.21 require ( - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchpersignal v0.95.0 github.com/stretchr/testify v1.8.4 go.opencensus.io v0.24.0 @@ -18,7 +17,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 k8s.io/api v0.29.2 k8s.io/apimachinery v0.29.2 k8s.io/client-go v0.29.2 @@ -123,6 +122,7 @@ require ( go.opentelemetry.io/otel/sdk v1.23.1 // indirect go.opentelemetry.io/otel/sdk/metric v1.23.1 // indirect go.opentelemetry.io/proto/otlp v1.1.0 // indirect + golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 // indirect golang.org/x/net v0.20.0 // indirect golang.org/x/oauth2 v0.16.0 // indirect golang.org/x/sys v0.17.0 // indirect @@ -155,11 +155,3 @@ retract ( // ambiguous import: found package cloud.google.com/go/compute/metadata in multiple modules replace cloud.google.com/go v0.65.0 => cloud.google.com/go v0.110.10 - -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal => ../../internal/coreinternal - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil => ../../pkg/pdatautil - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden diff --git a/exporter/loadbalancingexporter/go.sum b/exporter/loadbalancingexporter/go.sum index 5b95fec3c05e..341dcff29b62 100644 --- a/exporter/loadbalancingexporter/go.sum +++ b/exporter/loadbalancingexporter/go.sum @@ -304,8 +304,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/exporter/loadbalancingexporter/internal/metadata/generated_status.go b/exporter/loadbalancingexporter/internal/metadata/generated_status.go index cb1a1a701098..111de6b0d320 100644 --- a/exporter/loadbalancingexporter/internal/metadata/generated_status.go +++ b/exporter/loadbalancingexporter/internal/metadata/generated_status.go @@ -13,9 +13,9 @@ var ( ) const ( + MetricsStability = component.StabilityLevelDevelopment TracesStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta - MetricsStability = component.StabilityLevelDevelopment ) func Meter(settings component.TelemetrySettings) metric.Meter { diff --git a/exporter/loadbalancingexporter/testdata/test-build-exporter-config.yaml b/exporter/loadbalancingexporter/testdata/test-build-exporter-config.yaml index b7e1b4475437..bce0c82f379b 100644 --- a/exporter/loadbalancingexporter/testdata/test-build-exporter-config.yaml +++ b/exporter/loadbalancingexporter/testdata/test-build-exporter-config.yaml @@ -7,7 +7,7 @@ exporters: loadbalancing: protocol: otlp: - endpoint: should-be-replaced + endpoint: should-be-replaced:4317 resolver: static: diff --git a/exporter/logicmonitorexporter/generated_component_test.go b/exporter/logicmonitorexporter/generated_component_test.go index 00c045f96213..e1a8f14804c2 100644 --- a/exporter/logicmonitorexporter/generated_component_test.go +++ b/exporter/logicmonitorexporter/generated_component_test.go @@ -5,27 +5,20 @@ package logicmonitorexporter import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -63,9 +56,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -74,19 +65,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case exporter.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case exporter.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case exporter.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -99,3 +90,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/exporter/logicmonitorexporter/go.mod b/exporter/logicmonitorexporter/go.mod index 0ce073edc320..6f52847306cb 100644 --- a/exporter/logicmonitorexporter/go.mod +++ b/exporter/logicmonitorexporter/go.mod @@ -18,7 +18,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/exporter/logicmonitorexporter/go.sum b/exporter/logicmonitorexporter/go.sum index 84359e6f0745..c41245b3bf6f 100644 --- a/exporter/logicmonitorexporter/go.sum +++ b/exporter/logicmonitorexporter/go.sum @@ -136,8 +136,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/exporter/logzioexporter/generated_component_test.go b/exporter/logzioexporter/generated_component_test.go index dc8b7e033279..2e975d99def4 100644 --- a/exporter/logzioexporter/generated_component_test.go +++ b/exporter/logzioexporter/generated_component_test.go @@ -5,27 +5,20 @@ package logzioexporter import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -63,9 +56,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -74,19 +65,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case exporter.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case exporter.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case exporter.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -99,3 +90,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/exporter/logzioexporter/go.mod b/exporter/logzioexporter/go.mod index 5926d27a4445..297f01870f7a 100644 --- a/exporter/logzioexporter/go.mod +++ b/exporter/logzioexporter/go.mod @@ -20,7 +20,8 @@ require ( go.opentelemetry.io/collector/semconv v0.95.0 go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 - go.uber.org/zap v1.26.0 + go.uber.org/goleak v1.3.0 + go.uber.org/zap v1.27.0 google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1 google.golang.org/protobuf v1.32.0 ) diff --git a/exporter/logzioexporter/go.sum b/exporter/logzioexporter/go.sum index f557f6756f2c..3135adf26f90 100644 --- a/exporter/logzioexporter/go.sum +++ b/exporter/logzioexporter/go.sum @@ -155,8 +155,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/exporter/logzioexporter/jsonlog_test.go b/exporter/logzioexporter/jsonlog_test.go index 435c6159acec..6d75ceecc148 100644 --- a/exporter/logzioexporter/jsonlog_test.go +++ b/exporter/logzioexporter/jsonlog_test.go @@ -81,6 +81,7 @@ func TestSetTimeStamp(t *testing.T) { recordedRequests, _ = io.ReadAll(req.Body) rw.WriteHeader(http.StatusOK) })) + defer func() { server.Close() }() ld := generateLogsOneEmptyTimestamp() cfg := &Config{ Region: "us", diff --git a/exporter/logzioexporter/package_test.go b/exporter/logzioexporter/package_test.go new file mode 100644 index 000000000000..475e5299340f --- /dev/null +++ b/exporter/logzioexporter/package_test.go @@ -0,0 +1,14 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package logzioexporter + +import ( + "testing" + + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} diff --git a/exporter/lokiexporter/generated_component_test.go b/exporter/lokiexporter/generated_component_test.go index 777710966172..2b3aa25c5205 100644 --- a/exporter/lokiexporter/generated_component_test.go +++ b/exporter/lokiexporter/generated_component_test.go @@ -5,27 +5,20 @@ package lokiexporter import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -56,9 +49,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -67,19 +58,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case exporter.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case exporter.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case exporter.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -92,3 +83,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/exporter/lokiexporter/go.mod b/exporter/lokiexporter/go.mod index ddfa1d91c232..444c70be9e7e 100644 --- a/exporter/lokiexporter/go.mod +++ b/exporter/lokiexporter/go.mod @@ -7,7 +7,6 @@ require ( github.com/gogo/protobuf v1.3.2 github.com/golang/snappy v0.0.4 github.com/grafana/loki/pkg/push v0.0.0-20231127162423-bd505f8e2d37 - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/loki v0.95.0 github.com/prometheus/common v0.46.0 github.com/stretchr/testify v1.8.4 @@ -25,7 +24,7 @@ require ( go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( @@ -53,6 +52,7 @@ require ( github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.95.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.95.0 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect diff --git a/exporter/lokiexporter/go.sum b/exporter/lokiexporter/go.sum index f788593c1d09..8da9206c1db1 100644 --- a/exporter/lokiexporter/go.sum +++ b/exporter/lokiexporter/go.sum @@ -182,8 +182,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/exporter/lokiexporter/metadata.yaml b/exporter/lokiexporter/metadata.yaml index 28573ef226a2..c2485b102572 100644 --- a/exporter/lokiexporter/metadata.yaml +++ b/exporter/lokiexporter/metadata.yaml @@ -11,5 +11,4 @@ status: active: [gramidt, gouthamve, jpkrohling, mar4uk] tests: - config: expect_consumer_error: true \ No newline at end of file diff --git a/exporter/mezmoexporter/exporter.go b/exporter/mezmoexporter/exporter.go index 4c10b8c9ce72..b262889005eb 100644 --- a/exporter/mezmoexporter/exporter.go +++ b/exporter/mezmoexporter/exporter.go @@ -64,7 +64,12 @@ func (m *mezmoExporter) start(_ context.Context, host component.Host) (err error } func (m *mezmoExporter) stop(context.Context) (err error) { + if m.client == nil { + return nil + } m.wg.Wait() + m.client.CloseIdleConnections() + m.client = nil return nil } diff --git a/exporter/mezmoexporter/generated_component_test.go b/exporter/mezmoexporter/generated_component_test.go new file mode 100644 index 000000000000..b075ef51e2da --- /dev/null +++ b/exporter/mezmoexporter/generated_component_test.go @@ -0,0 +1,120 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package mezmoexporter + +import ( + "context" + "testing" + "time" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/exporter" + "go.opentelemetry.io/collector/exporter/exportertest" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" +) + +func TestComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "logs", + createFn: func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateLogsExporter(ctx, set, cfg) + }, + }, + } + + cm, err := confmaptest.LoadConf("metadata.yaml") + require.NoError(t, err) + cfg := factory.CreateDefaultConfig() + sub, err := cm.Sub("tests::config") + require.NoError(t, err) + require.NoError(t, component.UnmarshalConfig(sub, cfg)) + + for _, test := range tests { + t.Run(test.name+"-shutdown", func(t *testing.T) { + c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + t.Run(test.name+"-lifecycle", func(t *testing.T) { + c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := componenttest.NewNopHost() + err = c.Start(context.Background(), host) + require.NoError(t, err) + require.NotPanics(t, func() { + switch e := c.(type) { + case exporter.Logs: + logs := generateLifecycleTestLogs() + if !e.Capabilities().MutatesData { + logs.MarkReadOnly() + } + err = e.ConsumeLogs(context.Background(), logs) + case exporter.Metrics: + metrics := generateLifecycleTestMetrics() + if !e.Capabilities().MutatesData { + metrics.MarkReadOnly() + } + err = e.ConsumeMetrics(context.Background(), metrics) + case exporter.Traces: + traces := generateLifecycleTestTraces() + if !e.Capabilities().MutatesData { + traces.MarkReadOnly() + } + err = e.ConsumeTraces(context.Background(), traces) + } + }) + + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + } +} + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/exporter/mezmoexporter/go.mod b/exporter/mezmoexporter/go.mod index e9fb0ea67a17..789a944894af 100644 --- a/exporter/mezmoexporter/go.mod +++ b/exporter/mezmoexporter/go.mod @@ -16,7 +16,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/exporter/mezmoexporter/go.sum b/exporter/mezmoexporter/go.sum index 89124de8e5ba..7c5a725a2c5f 100644 --- a/exporter/mezmoexporter/go.sum +++ b/exporter/mezmoexporter/go.sum @@ -134,8 +134,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/exporter/mezmoexporter/metadata.yaml b/exporter/mezmoexporter/metadata.yaml index 5255f57e8e53..281b1cbf1636 100644 --- a/exporter/mezmoexporter/metadata.yaml +++ b/exporter/mezmoexporter/metadata.yaml @@ -7,3 +7,8 @@ status: distributions: [contrib] codeowners: active: [dashpole, billmeyer, gjanco] + +tests: + config: + disable_keep_alives: true + expect_consumer_error: true \ No newline at end of file diff --git a/exporter/opencensusexporter/generated_component_test.go b/exporter/opencensusexporter/generated_component_test.go index cd30b4f5876f..c9356009d0f1 100644 --- a/exporter/opencensusexporter/generated_component_test.go +++ b/exporter/opencensusexporter/generated_component_test.go @@ -5,27 +5,20 @@ package opencensusexporter import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -63,9 +56,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -74,19 +65,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case exporter.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case exporter.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case exporter.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -99,3 +90,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/exporter/opencensusexporter/go.mod b/exporter/opencensusexporter/go.mod index 8f7aad892f3d..e97cd7e8999f 100644 --- a/exporter/opencensusexporter/go.mod +++ b/exporter/opencensusexporter/go.mod @@ -77,7 +77,7 @@ require ( go.opentelemetry.io/otel/sdk v1.23.1 // indirect go.opentelemetry.io/otel/sdk/metric v1.23.1 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.26.0 // indirect + go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.20.0 // indirect golang.org/x/sys v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/exporter/opencensusexporter/go.sum b/exporter/opencensusexporter/go.sum index d7bdd280e14d..ebdfa27f1636 100644 --- a/exporter/opencensusexporter/go.sum +++ b/exporter/opencensusexporter/go.sum @@ -189,8 +189,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/exporter/opensearchexporter/README.md b/exporter/opensearchexporter/README.md index f7aa3cc67ec1..47c7bd705f87 100644 --- a/exporter/opensearchexporter/README.md +++ b/exporter/opensearchexporter/README.md @@ -3,14 +3,14 @@ | Status | | | ------------- |-----------| -| Stability | [alpha]: traces | -| | [development]: logs | +| Stability | [development]: logs | +| | [alpha]: traces | | Distributions | [contrib] | | Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Aexporter%2Fopensearch%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Aexporter%2Fopensearch) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Aexporter%2Fopensearch%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Aexporter%2Fopensearch) | | [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@Aneurysm9](https://www.github.com/Aneurysm9), [@MitchellGale](https://www.github.com/MitchellGale), [@MaxKsyunz](https://www.github.com/MaxKsyunz), [@YANG-DB](https://www.github.com/YANG-DB) | -[alpha]: https://github.com/open-telemetry/opentelemetry-collector#alpha [development]: https://github.com/open-telemetry/opentelemetry-collector#development +[alpha]: https://github.com/open-telemetry/opentelemetry-collector#alpha [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib diff --git a/exporter/opensearchexporter/generated_component_test.go b/exporter/opensearchexporter/generated_component_test.go index 872678389a65..e40a2952d28b 100644 --- a/exporter/opensearchexporter/generated_component_test.go +++ b/exporter/opensearchexporter/generated_component_test.go @@ -5,27 +5,20 @@ package opensearchexporter import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -63,9 +56,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -74,19 +65,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case exporter.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case exporter.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case exporter.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -99,3 +90,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/exporter/opensearchexporter/go.mod b/exporter/opensearchexporter/go.mod index b296ba552622..750addc91121 100644 --- a/exporter/opensearchexporter/go.mod +++ b/exporter/opensearchexporter/go.mod @@ -3,7 +3,6 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/exporter/opense go 1.21 require ( - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.95.0 github.com/opensearch-project/opensearch-go/v2 v2.3.0 github.com/stretchr/testify v1.8.4 @@ -17,7 +16,7 @@ require ( go.opentelemetry.io/collector/exporter v0.95.0 go.opentelemetry.io/collector/pdata v1.2.0 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( @@ -84,7 +83,3 @@ require ( replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil => ../../pkg/pdatautil replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden - -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal => ../../internal/coreinternal - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest diff --git a/exporter/opensearchexporter/go.sum b/exporter/opensearchexporter/go.sum index 2efdcaa512cc..a37c02ef0221 100644 --- a/exporter/opensearchexporter/go.sum +++ b/exporter/opensearchexporter/go.sum @@ -160,8 +160,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/exporter/opensearchexporter/internal/metadata/generated_status.go b/exporter/opensearchexporter/internal/metadata/generated_status.go index 7f93ca86db40..94060398ab71 100644 --- a/exporter/opensearchexporter/internal/metadata/generated_status.go +++ b/exporter/opensearchexporter/internal/metadata/generated_status.go @@ -13,8 +13,8 @@ var ( ) const ( - TracesStability = component.StabilityLevelAlpha LogsStability = component.StabilityLevelDevelopment + TracesStability = component.StabilityLevelAlpha ) func Meter(settings component.TelemetrySettings) metric.Meter { diff --git a/exporter/otelarrowexporter/metadata.yaml b/exporter/otelarrowexporter/metadata.yaml index be5725f9ad4b..0f3c7c23e26e 100644 --- a/exporter/otelarrowexporter/metadata.yaml +++ b/exporter/otelarrowexporter/metadata.yaml @@ -7,3 +7,8 @@ status: distributions: [] codeowners: active: [jmacd, moh-osman3] + +# TODO: Update the exporter to pass the tests +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/exporter/prometheusexporter/generated_component_test.go b/exporter/prometheusexporter/generated_component_test.go new file mode 100644 index 000000000000..9fdc955b8305 --- /dev/null +++ b/exporter/prometheusexporter/generated_component_test.go @@ -0,0 +1,122 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package prometheusexporter + +import ( + "context" + "testing" + "time" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/exporter" + "go.opentelemetry.io/collector/exporter/exportertest" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" +) + +func TestComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "metrics", + createFn: func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateMetricsExporter(ctx, set, cfg) + }, + }, + } + + cm, err := confmaptest.LoadConf("metadata.yaml") + require.NoError(t, err) + cfg := factory.CreateDefaultConfig() + sub, err := cm.Sub("tests::config") + require.NoError(t, err) + require.NoError(t, component.UnmarshalConfig(sub, cfg)) + + for _, test := range tests { + t.Run(test.name+"-shutdown", func(t *testing.T) { + c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + t.Run(test.name+"-lifecycle", func(t *testing.T) { + c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := componenttest.NewNopHost() + err = c.Start(context.Background(), host) + require.NoError(t, err) + require.NotPanics(t, func() { + switch e := c.(type) { + case exporter.Logs: + logs := generateLifecycleTestLogs() + if !e.Capabilities().MutatesData { + logs.MarkReadOnly() + } + err = e.ConsumeLogs(context.Background(), logs) + case exporter.Metrics: + metrics := generateLifecycleTestMetrics() + if !e.Capabilities().MutatesData { + metrics.MarkReadOnly() + } + err = e.ConsumeMetrics(context.Background(), metrics) + case exporter.Traces: + traces := generateLifecycleTestTraces() + if !e.Capabilities().MutatesData { + traces.MarkReadOnly() + } + err = e.ConsumeTraces(context.Background(), traces) + } + }) + + require.NoError(t, err) + + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + } +} + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/exporter/prometheusexporter/go.mod b/exporter/prometheusexporter/go.mod index 86000ea3bf35..404945ab684d 100644 --- a/exporter/prometheusexporter/go.mod +++ b/exporter/prometheusexporter/go.mod @@ -7,9 +7,9 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.95.0 - github.com/prometheus/client_golang v1.18.0 + github.com/prometheus/client_golang v1.19.0 github.com/prometheus/client_model v0.5.0 - github.com/prometheus/common v0.46.0 + github.com/prometheus/common v0.48.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.95.0 go.opentelemetry.io/collector/config/confighttp v0.95.0 @@ -22,7 +22,7 @@ require ( go.opentelemetry.io/collector/semconv v0.95.0 go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 gopkg.in/yaml.v2 v2.4.0 ) diff --git a/exporter/prometheusexporter/go.sum b/exporter/prometheusexporter/go.sum index 1e22ba3d58c8..e8f0ff5106e2 100644 --- a/exporter/prometheusexporter/go.sum +++ b/exporter/prometheusexporter/go.sum @@ -466,8 +466,8 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= -github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= +github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= +github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -479,8 +479,8 @@ github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8b github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.29.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.46.0 h1:doXzt5ybi1HBKpsZOL0sSkaNHJJqkyfEWZGGqqScV0Y= -github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1BTn+g2pa/hQ= +github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE= +github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= github.com/prometheus/common/sigv4 v0.1.0 h1:qoVebwtwwEhS85Czm2dSROY5fTo2PAPEVdDeppTwGX4= github.com/prometheus/common/sigv4 v0.1.0/go.mod h1:2Jkxxk9yYvCkE5G1sQT7GuEXm57JrvHu9k5YwTjsNtI= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= @@ -663,8 +663,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= diff --git a/exporter/prometheusexporter/metadata.yaml b/exporter/prometheusexporter/metadata.yaml index aad0b7cdebbf..376aa62b11bf 100644 --- a/exporter/prometheusexporter/metadata.yaml +++ b/exporter/prometheusexporter/metadata.yaml @@ -15,3 +15,7 @@ status: - liatrio codeowners: active: [Aneurysm9] + +tests: + config: + endpoint: "127.0.0.1:1234" diff --git a/exporter/prometheusremotewriteexporter/factory_test.go b/exporter/prometheusremotewriteexporter/factory_test.go index 1559b37bd19a..ea3be196bac5 100644 --- a/exporter/prometheusremotewriteexporter/factory_test.go +++ b/exporter/prometheusremotewriteexporter/factory_test.go @@ -86,6 +86,7 @@ func Test_createMetricsExporter(t *testing.T) { return } assert.NoError(t, err) + assert.NoError(t, exp.Shutdown(context.Background())) }) } } diff --git a/exporter/prometheusremotewriteexporter/generated_component_test.go b/exporter/prometheusremotewriteexporter/generated_component_test.go index 6e6ecfaf7b31..feee79c38994 100644 --- a/exporter/prometheusremotewriteexporter/generated_component_test.go +++ b/exporter/prometheusremotewriteexporter/generated_component_test.go @@ -5,27 +5,20 @@ package prometheusremotewriteexporter import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -56,9 +49,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -67,19 +58,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case exporter.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case exporter.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case exporter.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -92,3 +83,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/exporter/prometheusremotewriteexporter/go.mod b/exporter/prometheusremotewriteexporter/go.mod index 77fb53963280..5f1d5323080c 100644 --- a/exporter/prometheusremotewriteexporter/go.mod +++ b/exporter/prometheusremotewriteexporter/go.mod @@ -25,8 +25,9 @@ require ( go.opentelemetry.io/collector/pdata v1.2.0 go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 + go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/exporter/prometheusremotewriteexporter/go.sum b/exporter/prometheusremotewriteexporter/go.sum index 4881d88c92f4..dc48e3601a31 100644 --- a/exporter/prometheusremotewriteexporter/go.sum +++ b/exporter/prometheusremotewriteexporter/go.sum @@ -148,8 +148,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/exporter/prometheusremotewriteexporter/metadata.yaml b/exporter/prometheusremotewriteexporter/metadata.yaml index d30ec5eb99dc..cdd124b22b9c 100644 --- a/exporter/prometheusremotewriteexporter/metadata.yaml +++ b/exporter/prometheusremotewriteexporter/metadata.yaml @@ -9,5 +9,4 @@ status: active: [Aneurysm9, rapphil] tests: - config: expect_consumer_error: true \ No newline at end of file diff --git a/exporter/prometheusremotewriteexporter/package_test.go b/exporter/prometheusremotewriteexporter/package_test.go new file mode 100644 index 000000000000..b12f843d1f2e --- /dev/null +++ b/exporter/prometheusremotewriteexporter/package_test.go @@ -0,0 +1,17 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package prometheusremotewriteexporter + +import ( + "testing" + + "go.uber.org/goleak" +) + +// The IgnoreTopFunction call prevents catching the leak generated by opencensus +// defaultWorker.Start which at this time is part of the package's init call. +// See https://github.com/census-instrumentation/opencensus-go/issues/1191 for more information. +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} diff --git a/exporter/pulsarexporter/generated_component_test.go b/exporter/pulsarexporter/generated_component_test.go index 875b93412b18..4979e6a6d81b 100644 --- a/exporter/pulsarexporter/generated_component_test.go +++ b/exporter/pulsarexporter/generated_component_test.go @@ -5,27 +5,19 @@ package pulsarexporter import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -70,44 +62,40 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) + } +} - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - err = c.Start(context.Background(), host) - require.NoError(t, err) - require.NotPanics(t, func() { - switch e := c.(type) { - case exporter.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) - if !e.Capabilities().MutatesData { - logs.MarkReadOnly() - } - err = e.ConsumeLogs(context.Background(), logs) - case exporter.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() - if !e.Capabilities().MutatesData { - metrics.MarkReadOnly() - } - err = e.ConsumeMetrics(context.Background(), metrics) - case exporter.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() - if !e.Capabilities().MutatesData { - traces.MarkReadOnly() - } - err = e.ConsumeTraces(context.Background(), traces) - } - }) +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} - require.NoError(t, err) +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} - err = c.Shutdown(context.Background()) - require.NoError(t, err) - }) - } +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces } diff --git a/exporter/pulsarexporter/go.mod b/exporter/pulsarexporter/go.mod index 9fdf6b336f90..b4b7fa466bae 100644 --- a/exporter/pulsarexporter/go.mod +++ b/exporter/pulsarexporter/go.mod @@ -21,7 +21,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/exporter/pulsarexporter/go.sum b/exporter/pulsarexporter/go.sum index 543b906a50f5..351da387d1e5 100644 --- a/exporter/pulsarexporter/go.sum +++ b/exporter/pulsarexporter/go.sum @@ -467,8 +467,8 @@ go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9i 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.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= diff --git a/exporter/pulsarexporter/metadata.yaml b/exporter/pulsarexporter/metadata.yaml index ce2d5868b7cb..bf156dfd0ed2 100644 --- a/exporter/pulsarexporter/metadata.yaml +++ b/exporter/pulsarexporter/metadata.yaml @@ -8,6 +8,6 @@ status: codeowners: active: [dmitryax, dao-jun] +# Update the exporter to pass the tests tests: - config: skip_lifecycle: true \ No newline at end of file diff --git a/exporter/sapmexporter/generated_component_test.go b/exporter/sapmexporter/generated_component_test.go index 45c1bc886ed4..8007975490d4 100644 --- a/exporter/sapmexporter/generated_component_test.go +++ b/exporter/sapmexporter/generated_component_test.go @@ -5,27 +5,20 @@ package sapmexporter import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -56,9 +49,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -67,19 +58,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case exporter.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case exporter.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case exporter.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -92,3 +83,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/exporter/sapmexporter/go.mod b/exporter/sapmexporter/go.mod index 4c86b5af18fa..7b343e5a61eb 100644 --- a/exporter/sapmexporter/go.mod +++ b/exporter/sapmexporter/go.mod @@ -5,8 +5,7 @@ go 1.21 require ( github.com/cenkalti/backoff/v4 v4.2.1 github.com/jaegertracing/jaeger v1.54.0 - github.com/klauspost/compress v1.17.6 - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.95.0 + github.com/klauspost/compress v1.17.7 github.com/open-telemetry/opentelemetry-collector-contrib/internal/splunk v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchperresourceattr v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.95.0 @@ -22,7 +21,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( @@ -45,6 +44,7 @@ require ( github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.95.0 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.18.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect diff --git a/exporter/sapmexporter/go.sum b/exporter/sapmexporter/go.sum index 9d6b85cde874..0944f73da531 100644 --- a/exporter/sapmexporter/go.sum +++ b/exporter/sapmexporter/go.sum @@ -64,8 +64,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.6 h1:60eq2E/jlfwQXtvZEeBUYADs+BwKBWURIY+Gj2eRGjI= -github.com/klauspost/compress v1.17.6/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLAKQQg= +github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= @@ -158,8 +158,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/exporter/sapmexporter/metadata.yaml b/exporter/sapmexporter/metadata.yaml index ef71db8313d1..08393e6cb403 100644 --- a/exporter/sapmexporter/metadata.yaml +++ b/exporter/sapmexporter/metadata.yaml @@ -10,5 +10,4 @@ status: tests: - config: expect_consumer_error: true \ No newline at end of file diff --git a/exporter/sentryexporter/generated_component_test.go b/exporter/sentryexporter/generated_component_test.go index ad0130d06052..28e5fe7698ab 100644 --- a/exporter/sentryexporter/generated_component_test.go +++ b/exporter/sentryexporter/generated_component_test.go @@ -5,27 +5,20 @@ package sentryexporter import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -56,9 +49,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -67,19 +58,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case exporter.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case exporter.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case exporter.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -92,3 +83,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/exporter/sentryexporter/go.mod b/exporter/sentryexporter/go.mod index 5f0e2ead11ab..974debc8a316 100644 --- a/exporter/sentryexporter/go.mod +++ b/exporter/sentryexporter/go.mod @@ -52,7 +52,7 @@ require ( go.opentelemetry.io/otel/sdk v1.23.1 // indirect go.opentelemetry.io/otel/sdk/metric v1.23.1 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.26.0 // indirect + go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.20.0 // indirect golang.org/x/sys v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/exporter/sentryexporter/go.sum b/exporter/sentryexporter/go.sum index 4c4c18ddbfef..bd857f9d4e32 100644 --- a/exporter/sentryexporter/go.sum +++ b/exporter/sentryexporter/go.sum @@ -112,8 +112,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/exporter/sentryexporter/metadata.yaml b/exporter/sentryexporter/metadata.yaml index ea049b5c20f0..c9cfb5d63e59 100644 --- a/exporter/sentryexporter/metadata.yaml +++ b/exporter/sentryexporter/metadata.yaml @@ -10,5 +10,4 @@ status: tests: - config: expect_consumer_error: true \ No newline at end of file diff --git a/exporter/signalfxexporter/generated_component_test.go b/exporter/signalfxexporter/generated_component_test.go index d9bea9b45c54..189d9cc9d455 100644 --- a/exporter/signalfxexporter/generated_component_test.go +++ b/exporter/signalfxexporter/generated_component_test.go @@ -5,27 +5,20 @@ package signalfxexporter import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -70,9 +63,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -81,19 +72,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case exporter.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case exporter.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case exporter.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -106,3 +97,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/exporter/signalfxexporter/go.mod b/exporter/signalfxexporter/go.mod index 59f925e4f8fb..fe3040ca16b3 100644 --- a/exporter/signalfxexporter/go.mod +++ b/exporter/signalfxexporter/go.mod @@ -12,6 +12,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchperresourceattr v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/experimentalmetricmetadata v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.95.0 + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/signalfx v0.95.0 github.com/shirou/gopsutil/v3 v3.24.1 github.com/signalfx/com_signalfx_metrics_protobuf v0.0.3 @@ -30,7 +31,7 @@ require ( go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 golang.org/x/sys v0.17.0 gopkg.in/yaml.v3 v3.0.1 ) diff --git a/exporter/signalfxexporter/go.sum b/exporter/signalfxexporter/go.sum index a69d89381c3e..38014b211764 100644 --- a/exporter/signalfxexporter/go.sum +++ b/exporter/signalfxexporter/go.sum @@ -172,8 +172,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/exporter/signalfxexporter/internal/apm/correlations/client.go b/exporter/signalfxexporter/internal/apm/correlations/client.go index 427c0abb685f..ba86baf9a6c2 100644 --- a/exporter/signalfxexporter/internal/apm/correlations/client.go +++ b/exporter/signalfxexporter/internal/apm/correlations/client.go @@ -44,6 +44,7 @@ type CorrelationClient interface { Delete(*Correlation, SuccessfulDeleteCB) Get(dimName string, dimValue string, cb SuccessfulGetCB) Start() + Shutdown() } type request struct { @@ -387,3 +388,9 @@ func (cc *Client) Start() { go cc.processChan() go cc.processRetryChan() } + +// Shutdown the client. This will block until the context's cancel +// function is complete. +func (cc *Client) Shutdown() { + cc.wg.Wait() +} diff --git a/exporter/signalfxexporter/internal/apm/correlations/client_test.go b/exporter/signalfxexporter/internal/apm/correlations/client_test.go index 48cb24b996de..87ff12866cb6 100644 --- a/exporter/signalfxexporter/internal/apm/correlations/client_test.go +++ b/exporter/signalfxexporter/internal/apm/correlations/client_test.go @@ -124,7 +124,7 @@ func makeHandler(t *testing.T, corCh chan<- *request, forcedRespCode *atomic.Val }) } -func setup(t *testing.T) (CorrelationClient, chan *request, *atomic.Value, *atomic.Value, context.CancelFunc) { +func setup(t *testing.T) (CorrelationClient, *httptest.Server, chan *request, *atomic.Value, *atomic.Value, context.CancelFunc, context.Context) { serverCh := make(chan *request, 100) var forcedRespCode atomic.Value @@ -132,10 +132,6 @@ func setup(t *testing.T) (CorrelationClient, chan *request, *atomic.Value, *atom server := httptest.NewServer(makeHandler(t, serverCh, &forcedRespCode, &forcedRespPayload)) ctx, cancel := context.WithCancel(context.Background()) - go func() { - <-ctx.Done() - server.Close() - }() serverURL, err := url.Parse(server.URL) if err != nil { @@ -176,13 +172,20 @@ func setup(t *testing.T) (CorrelationClient, chan *request, *atomic.Value, *atom } client.Start() - return client, serverCh, &forcedRespCode, &forcedRespPayload, cancel + return client, server, serverCh, &forcedRespCode, &forcedRespPayload, cancel, ctx +} + +func teardown(ctx context.Context, client CorrelationClient, server *httptest.Server, serverCh chan *request, cancel context.CancelFunc) { + close(serverCh) + cancel() + <-ctx.Done() + client.Shutdown() + server.Close() } func TestCorrelationClient(t *testing.T) { - client, serverCh, forcedRespCode, forcedRespPayload, cancel := setup(t) - defer close(serverCh) - defer cancel() + client, server, serverCh, forcedRespCode, forcedRespPayload, cancel, ctx := setup(t) + defer teardown(ctx, client, server, serverCh, cancel) for _, correlationType := range []Type{Service, Environment} { for _, op := range []string{http.MethodPut, http.MethodDelete} { @@ -242,7 +245,7 @@ func TestCorrelationClient(t *testing.T) { client.Correlate(testData, CorrelateCB(func(_ *Correlation, _ error) {})) // sending the testData twice tests deduplication, since the 500 status // will trigger retries, and the requests should be deduped and the - // TotalRertriedUpdates should still only be 5 + // TotalRetriedUpdates should still only be 5 client.Correlate(testData, CorrelateCB(func(_ *Correlation, _ error) {})) cors := waitForCors(serverCh, 1, 4) diff --git a/exporter/f5cloudexporter/package_test.go b/exporter/signalfxexporter/internal/apm/correlations/package_test.go similarity index 95% rename from exporter/f5cloudexporter/package_test.go rename to exporter/signalfxexporter/internal/apm/correlations/package_test.go index a5f988aac078..3aa20e78afd4 100644 --- a/exporter/f5cloudexporter/package_test.go +++ b/exporter/signalfxexporter/internal/apm/correlations/package_test.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package f5cloudexporter +package correlations import ( "testing" diff --git a/exporter/signalfxexporter/internal/apm/tracetracker/tracker_test.go b/exporter/signalfxexporter/internal/apm/tracetracker/tracker_test.go index 43c638ac0948..b7fb27695550 100644 --- a/exporter/signalfxexporter/internal/apm/tracetracker/tracker_test.go +++ b/exporter/signalfxexporter/internal/apm/tracetracker/tracker_test.go @@ -85,7 +85,8 @@ type correlationTestClient struct { correlateCounter int64 } -func (c *correlationTestClient) Start() { /*no-op*/ } +func (c *correlationTestClient) Start() { /*no-op*/ } +func (c *correlationTestClient) Shutdown() { /*no-op*/ } func (c *correlationTestClient) Get(_ string, dimValue string, cb correlations.SuccessfulGetCB) { atomic.AddInt64(&c.getCounter, 1) go func() { diff --git a/exporter/signalfxexporter/internal/correlation/correlation.go b/exporter/signalfxexporter/internal/correlation/correlation.go index ee00b0a470d0..281339e1df6c 100644 --- a/exporter/signalfxexporter/internal/correlation/correlation.go +++ b/exporter/signalfxexporter/internal/correlation/correlation.go @@ -137,6 +137,7 @@ func (cor *Tracker) Shutdown(_ context.Context) error { if cor != nil { if cor.correlation != nil { cor.correlation.cancel() + cor.correlation.CorrelationClient.Shutdown() } if cor.pTicker != nil { diff --git a/exporter/signalfxexporter/internal/correlation/correlation_test.go b/exporter/signalfxexporter/internal/correlation/correlation_test.go index d1e9db2f7c03..4c2b7db6c83a 100644 --- a/exporter/signalfxexporter/internal/correlation/correlation_test.go +++ b/exporter/signalfxexporter/internal/correlation/correlation_test.go @@ -86,6 +86,8 @@ func TestTrackerStart(t *testing.T) { } else { require.NoError(t, err) } + + assert.NoError(t, tracker.Shutdown(context.Background())) }) } } diff --git a/exporter/signalfxexporter/internal/correlation/package_test.go b/exporter/signalfxexporter/internal/correlation/package_test.go new file mode 100644 index 000000000000..0d55bd5d83fe --- /dev/null +++ b/exporter/signalfxexporter/internal/correlation/package_test.go @@ -0,0 +1,17 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package correlation + +import ( + "testing" + + "go.uber.org/goleak" +) + +// The IgnoreTopFunction call prevents catching the leak generated by opencensus +// defaultWorker.Start which at this time is part of the package's init call. +// See https://github.com/census-instrumentation/opencensus-go/issues/1191 for more information. +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m, goleak.IgnoreTopFunction("go.opencensus.io/stats/view.(*worker).start")) +} diff --git a/exporter/signalfxexporter/internal/utils/histogram_utils_test.go b/exporter/signalfxexporter/internal/utils/histogram_utils_test.go index e47a1f55b4d1..03d7f366a2c9 100644 --- a/exporter/signalfxexporter/internal/utils/histogram_utils_test.go +++ b/exporter/signalfxexporter/internal/utils/histogram_utils_test.go @@ -10,6 +10,8 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/pmetric" + + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest/pmetrictest" ) func initMetric(m pmetric.Metric, name string, ty pmetric.MetricType) { @@ -168,30 +170,30 @@ func TestHistogramsAreRetrieved(t *testing.T) { res.Attributes().PutStr("kr0", "vr0") rm.ScopeMetrics().AppendEmpty() ilm0 := rm.ScopeMetrics().At(0) - ilm0.SetSchemaUrl("Scope SchemaUrl") + ilm0.SetSchemaUrl("Scope SchemaUrl s0") ilm0.Scope().Attributes().PutStr("ks0", "vs0") - ilm0.Scope().SetName("Scope name") - ilm0.Scope().SetVersion("Scope version") + ilm0.Scope().SetName("Scope name s0") + ilm0.Scope().SetVersion("Scope version s0") ilm0.Metrics().EnsureCapacity(2) ilm0.Metrics().AppendEmpty() - buildHistogram(ilm0.Metrics().At(0), "histogram_1", ts, 1) + buildHistogram(ilm0.Metrics().At(0), "histogram_1_s0", ts, 1) ilm0.Metrics().AppendEmpty() - buildGauge(ilm0.Metrics().At(1), "gauge", ts, 2) + buildGauge(ilm0.Metrics().At(1), "gauge_s0", ts, 2) rm.ScopeMetrics().AppendEmpty() ilm1 := rm.ScopeMetrics().At(1) ilm1.Metrics().AppendEmpty() - buildSum(ilm1.Metrics().At(0), "gauge", ts, 2) + buildSum(ilm1.Metrics().At(0), "gauge_s1", ts, 2) rm.ScopeMetrics().AppendEmpty() ilm2 := rm.ScopeMetrics().At(2) - ilm2.SetSchemaUrl("Scope SchemaUrl") - ilm2.Scope().Attributes().PutStr("ks0", "vs0") + ilm2.SetSchemaUrl("Scope SchemaUrl s2") + ilm2.Scope().Attributes().PutStr("ks2", "vs2") ilm2.Metrics().EnsureCapacity(2) ilm2.Metrics().AppendEmpty() - buildHistogram(ilm2.Metrics().At(0), "histogram_1", ts, 1) + buildHistogram(ilm2.Metrics().At(0), "histogram_1_s2", ts, 1) ilm2.Metrics().AppendEmpty() - buildHistogram(ilm2.Metrics().At(1), "histogram_2", ts, 2) + buildHistogram(ilm2.Metrics().At(1), "histogram_2_s2", ts, 2) return out }, wantMetricCount: 3, @@ -202,71 +204,93 @@ func TestHistogramsAreRetrieved(t *testing.T) { res.Attributes().PutStr("kr0", "vr0") rm.ScopeMetrics().AppendEmpty() ilm0 := rm.ScopeMetrics().At(0) - ilm0.SetSchemaUrl("Scope SchemaUrl") + ilm0.SetSchemaUrl("Scope SchemaUrl s0") ilm0.Scope().Attributes().PutStr("ks0", "vs0") - ilm0.Scope().SetName("Scope name") - ilm0.Scope().SetVersion("Scope version") - buildHistogram(ilm0.Metrics().AppendEmpty(), "histogram_1", ts, 1) + ilm0.Scope().SetName("Scope name s0") + ilm0.Scope().SetVersion("Scope version s0") + buildHistogram(ilm0.Metrics().AppendEmpty(), "histogram_1_s0", ts, 1) rm.ScopeMetrics().AppendEmpty() ilm1 := rm.ScopeMetrics().At(1) - ilm1.SetSchemaUrl("Scope SchemaUrl") - ilm1.Scope().Attributes().PutStr("ks0", "vs0") + ilm1.SetSchemaUrl("Scope SchemaUrl s2") + ilm1.Scope().Attributes().PutStr("ks2", "vs2") ilm1.Metrics().EnsureCapacity(2) ilm1.Metrics().AppendEmpty() - buildHistogram(ilm1.Metrics().At(0), "histogram_1", ts, 1) + buildHistogram(ilm1.Metrics().At(0), "histogram_1_s2", ts, 1) ilm1.Metrics().AppendEmpty() - buildHistogram(ilm1.Metrics().At(1), "histogram_2", ts, 2) + buildHistogram(ilm1.Metrics().At(1), "histogram_2_s2", ts, 2) return out }}, { name: "mixed_type_multiple_resources", inMetricsFunc: func() pmetric.Metrics { out := pmetric.NewMetrics() - out.ResourceMetrics().EnsureCapacity(2) + out.ResourceMetrics().EnsureCapacity(3) out.ResourceMetrics().AppendEmpty() rm0 := out.ResourceMetrics().At(0) - rm0.SetSchemaUrl("Resource SchemaUrl") + rm0.SetSchemaUrl("Resource SchemaUrl r0") rm0.Resource().Attributes().PutStr("kr0", "vr0") rm0.ScopeMetrics().AppendEmpty() ilm0r0 := rm0.ScopeMetrics().At(0) - ilm0r0.SetSchemaUrl("Scope SchemaUrl") + ilm0r0.SetSchemaUrl("Scope SchemaUrl s0") ilm0r0.Scope().Attributes().PutStr("ks0", "vs0") ilm0r0.Metrics().EnsureCapacity(2) ilm0r0.Metrics().AppendEmpty() - buildHistogram(ilm0r0.Metrics().At(0), "histogram_1", ts, 1) + buildHistogram(ilm0r0.Metrics().At(0), "histogram_1_s0_r0", ts, 1) ilm0r0.Metrics().AppendEmpty() - buildGauge(ilm0r0.Metrics().At(1), "gauge", ts, 1) + buildGauge(ilm0r0.Metrics().At(1), "gauge_s0_r0", ts, 1) rm0.ScopeMetrics().AppendEmpty() ilm1r0 := rm0.ScopeMetrics().At(1) ilm1r0.Metrics().AppendEmpty() - buildGauge(ilm1r0.Metrics().At(0), "gauge", ts, 1) + buildGauge(ilm1r0.Metrics().At(0), "gauge_s1_r0", ts, 1) out.ResourceMetrics().AppendEmpty() rm1 := out.ResourceMetrics().At(1) rm1.Resource().Attributes().PutStr("kr1", "vr1") ilm0r1 := rm1.ScopeMetrics().AppendEmpty() - ilm0r1.SetSchemaUrl("Scope SchemaUrl") + ilm0r1.SetSchemaUrl("Scope SchemaUrl s0") ilm0r1.Scope().Attributes().PutStr("ks0", "vs0") ilm0r1.Metrics().AppendEmpty() - buildGauge(ilm0r1.Metrics().At(0), "gauge", ts, 1) + buildGauge(ilm0r1.Metrics().At(0), "gauge_s0_r1", ts, 1) + + out.ResourceMetrics().AppendEmpty() + rm2 := out.ResourceMetrics().At(2) + rm2.Resource().Attributes().PutStr("kr2", "vr2") + ilm0r2 := rm2.ScopeMetrics().AppendEmpty() + ilm0r2.SetSchemaUrl("Scope SchemaUrl s0") + ilm0r2.Scope().Attributes().PutStr("ks0", "vs0") + ilm0r2.Metrics().AppendEmpty() + ilm0r2.Metrics().EnsureCapacity(2) + buildGauge(ilm0r2.Metrics().At(0), "gauge_s0_r2", ts, 1) + ilm0r2.Metrics().AppendEmpty() + buildHistogram(ilm0r2.Metrics().At(1), "histogram_s0_r2", ts, 1) return out }, - wantMetricCount: 1, + wantMetricCount: 2, wantMetrics: func() pmetric.Metrics { out := pmetric.NewMetrics() out.ResourceMetrics().AppendEmpty() rm := out.ResourceMetrics().At(0) - rm.SetSchemaUrl("Resource SchemaUrl") + rm.SetSchemaUrl("Resource SchemaUrl r0") rm.Resource().Attributes().PutStr("kr0", "vr0") rm.ScopeMetrics().AppendEmpty() ilm0 := rm.ScopeMetrics().At(0) - ilm0.SetSchemaUrl("Scope SchemaUrl") + ilm0.SetSchemaUrl("Scope SchemaUrl s0") ilm0.Scope().Attributes().PutStr("ks0", "vs0") ilm0.Metrics().EnsureCapacity(1) ilm0.Metrics().AppendEmpty() - buildHistogram(ilm0.Metrics().At(0), "histogram_1", ts, 1) + buildHistogram(ilm0.Metrics().At(0), "histogram_1_s0_r0", ts, 1) + + out.ResourceMetrics().AppendEmpty() + rm1 := out.ResourceMetrics().At(1) + rm1.Resource().Attributes().PutStr("kr2", "vr2") + ilm0r1 := rm1.ScopeMetrics().AppendEmpty() + ilm0r1.SetSchemaUrl("Scope SchemaUrl s0") + ilm0r1.Scope().Attributes().PutStr("ks0", "vs0") + ilm0r1.Metrics().AppendEmpty() + buildHistogram(ilm0r1.Metrics().At(0), "histogram_s0_r2", ts, 1) + return out }}, { @@ -278,7 +302,6 @@ func TestHistogramsAreRetrieved(t *testing.T) { res.Attributes().PutStr("kr0", "vr0") res.Attributes().PutStr("com.splunk.signalfx.access_token", "abcd") ilms := rm.ScopeMetrics() - ilms.EnsureCapacity(3) ilm := ilms.AppendEmpty() buildHistogram(ilm.Metrics().AppendEmpty(), "histogram_1", ts, 1) return out @@ -290,7 +313,6 @@ func TestHistogramsAreRetrieved(t *testing.T) { res := rm.Resource() res.Attributes().PutStr("kr0", "vr0") ilms := rm.ScopeMetrics() - ilms.EnsureCapacity(3) ilm := ilms.AppendEmpty() buildHistogram(ilm.Metrics().AppendEmpty(), "histogram_1", ts, 1) return out @@ -302,9 +324,14 @@ func TestHistogramsAreRetrieved(t *testing.T) { t.Run(tt.name, func(t *testing.T) { md := tt.inMetricsFunc() gotMetrics, gotCount := GetHistograms(md) - assert.Equal(t, tt.wantMetricCount, gotCount) - assert.Equal(t, tt.wantMetrics(), gotMetrics) + if tt.wantMetricCount == 0 { + assert.Equal(t, tt.wantMetrics(), gotMetrics) + } else { + err := pmetrictest.CompareMetrics(tt.wantMetrics(), gotMetrics, + pmetrictest.IgnoreResourceMetricsOrder(), pmetrictest.IgnoreScopeMetricsOrder()) + assert.NoError(t, err) + } }) } } diff --git a/exporter/skywalkingexporter/generated_component_test.go b/exporter/skywalkingexporter/generated_component_test.go index 9fa2c39c6375..1827d9cf9e4f 100644 --- a/exporter/skywalkingexporter/generated_component_test.go +++ b/exporter/skywalkingexporter/generated_component_test.go @@ -5,27 +5,19 @@ package skywalkingexporter import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -63,44 +55,40 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) + } +} - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - err = c.Start(context.Background(), host) - require.NoError(t, err) - require.NotPanics(t, func() { - switch e := c.(type) { - case exporter.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) - if !e.Capabilities().MutatesData { - logs.MarkReadOnly() - } - err = e.ConsumeLogs(context.Background(), logs) - case exporter.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() - if !e.Capabilities().MutatesData { - metrics.MarkReadOnly() - } - err = e.ConsumeMetrics(context.Background(), metrics) - case exporter.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() - if !e.Capabilities().MutatesData { - traces.MarkReadOnly() - } - err = e.ConsumeTraces(context.Background(), traces) - } - }) +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} - require.NoError(t, err) +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} - err = c.Shutdown(context.Background()) - require.NoError(t, err) - }) - } +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces } diff --git a/exporter/skywalkingexporter/go.mod b/exporter/skywalkingexporter/go.mod index 8065b59bc2dd..c2138226ebaf 100644 --- a/exporter/skywalkingexporter/go.mod +++ b/exporter/skywalkingexporter/go.mod @@ -68,7 +68,7 @@ require ( go.opentelemetry.io/otel/sdk v1.23.1 // indirect go.opentelemetry.io/otel/sdk/metric v1.23.1 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.26.0 // indirect + go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.20.0 // indirect golang.org/x/sys v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/exporter/skywalkingexporter/go.sum b/exporter/skywalkingexporter/go.sum index 9a279cf4e6d6..4d40a2e3ee1c 100644 --- a/exporter/skywalkingexporter/go.sum +++ b/exporter/skywalkingexporter/go.sum @@ -191,8 +191,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/exporter/skywalkingexporter/metadata.yaml b/exporter/skywalkingexporter/metadata.yaml index 8ee4d617a205..817d539be1d5 100644 --- a/exporter/skywalkingexporter/metadata.yaml +++ b/exporter/skywalkingexporter/metadata.yaml @@ -10,5 +10,4 @@ status: emeritus: [liqiangz] tests: - config: skip_lifecycle: true diff --git a/exporter/splunkhecexporter/generated_component_test.go b/exporter/splunkhecexporter/generated_component_test.go index b6431b687068..4f617c1b3d48 100644 --- a/exporter/splunkhecexporter/generated_component_test.go +++ b/exporter/splunkhecexporter/generated_component_test.go @@ -5,27 +5,20 @@ package splunkhecexporter import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -70,9 +63,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -81,19 +72,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case exporter.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case exporter.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case exporter.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -106,3 +97,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/exporter/splunkhecexporter/go.mod b/exporter/splunkhecexporter/go.mod index 5f6ffd889a2d..2a0a11c5b1cd 100644 --- a/exporter/splunkhecexporter/go.mod +++ b/exporter/splunkhecexporter/go.mod @@ -26,7 +26,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 gopkg.in/yaml.v3 v3.0.1 ) diff --git a/exporter/splunkhecexporter/go.sum b/exporter/splunkhecexporter/go.sum index 14e9a084e920..250f3be2bc78 100644 --- a/exporter/splunkhecexporter/go.sum +++ b/exporter/splunkhecexporter/go.sum @@ -243,8 +243,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/exporter/sumologicexporter/generated_component_test.go b/exporter/sumologicexporter/generated_component_test.go index fad215a00c06..9dc51201a441 100644 --- a/exporter/sumologicexporter/generated_component_test.go +++ b/exporter/sumologicexporter/generated_component_test.go @@ -5,27 +5,19 @@ package sumologicexporter import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -63,44 +55,40 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) + } +} - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - err = c.Start(context.Background(), host) - require.NoError(t, err) - require.NotPanics(t, func() { - switch e := c.(type) { - case exporter.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) - if !e.Capabilities().MutatesData { - logs.MarkReadOnly() - } - err = e.ConsumeLogs(context.Background(), logs) - case exporter.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() - if !e.Capabilities().MutatesData { - metrics.MarkReadOnly() - } - err = e.ConsumeMetrics(context.Background(), metrics) - case exporter.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() - if !e.Capabilities().MutatesData { - traces.MarkReadOnly() - } - err = e.ConsumeTraces(context.Background(), traces) - } - }) +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} - require.NoError(t, err) +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} - err = c.Shutdown(context.Background()) - require.NoError(t, err) - }) - } +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces } diff --git a/exporter/sumologicexporter/go.mod b/exporter/sumologicexporter/go.mod index 7ed26e11855a..bbb4ad03e074 100644 --- a/exporter/sumologicexporter/go.mod +++ b/exporter/sumologicexporter/go.mod @@ -3,7 +3,6 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/exporter/sumolo go 1.21 require ( - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.95.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.95.0 go.opentelemetry.io/collector/config/confighttp v0.95.0 @@ -63,7 +62,7 @@ require ( go.opentelemetry.io/otel/sdk v1.23.1 // indirect go.opentelemetry.io/otel/sdk/metric v1.23.1 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.26.0 // indirect + go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.21.0 // indirect golang.org/x/sys v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect @@ -78,11 +77,3 @@ retract ( v0.76.1 v0.65.0 ) - -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal => ../../internal/coreinternal - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil => ../../pkg/pdatautil - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden diff --git a/exporter/sumologicexporter/go.sum b/exporter/sumologicexporter/go.sum index c950731df136..e6a3348b888e 100644 --- a/exporter/sumologicexporter/go.sum +++ b/exporter/sumologicexporter/go.sum @@ -132,8 +132,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/exporter/sumologicexporter/metadata.yaml b/exporter/sumologicexporter/metadata.yaml index 13c2c248ac91..8675ce025cb0 100644 --- a/exporter/sumologicexporter/metadata.yaml +++ b/exporter/sumologicexporter/metadata.yaml @@ -8,6 +8,6 @@ status: codeowners: active: [sumo-drosiek] +# TODO: Update the exporter to pass the tests tests: - config: skip_lifecycle: true diff --git a/exporter/syslogexporter/README.md b/exporter/syslogexporter/README.md index a89c6e2b3cc3..08457ec06fe2 100644 --- a/exporter/syslogexporter/README.md +++ b/exporter/syslogexporter/README.md @@ -28,7 +28,7 @@ This means that syslog messages received via the Syslog receiver and exported vi - `rfc5424` - Expects the syslog messages to be rfc5424 compliant - `rfc3164` - Expects the syslog messages to be rfc3164 compliant - `enable_octet_counting` (default = `false`) - Whether or not to enable rfc6587 octet counting -- `tls` - configuration for TLS/mTLS +- `tls` - configuration for TLS/mTLS (applied only when `network` is set to `tcp`) - `insecure` (default = `false`) whether to enable client transport security, by default, TLS is enabled. - `cert_file` - Path to the TLS cert to use for TLS required connections. Should only be used if `insecure` is set to `false`. - `key_file` - Path to the TLS key to use for TLS required connections. Should only be used if `insecure` is set to `false`. diff --git a/exporter/syslogexporter/exporter.go b/exporter/syslogexporter/exporter.go index 3c69ced8210b..890b1071559e 100644 --- a/exporter/syslogexporter/exporter.go +++ b/exporter/syslogexporter/exporter.go @@ -25,17 +25,21 @@ type syslogexporter struct { } func initExporter(cfg *Config, createSettings exporter.CreateSettings) (*syslogexporter, error) { - tlsConfig, err := cfg.TLSSetting.LoadTLSConfig() - if err != nil { - return nil, err - } - cfg.Network = strings.ToLower(cfg.Network) + var loadedTLSConfig *tls.Config + if cfg.Network == "tcp" { + var err error + loadedTLSConfig, err = cfg.TLSSetting.LoadTLSConfig() + if err != nil { + return nil, err + } + } + s := &syslogexporter{ config: cfg, logger: createSettings.Logger, - tlsConfig: tlsConfig, + tlsConfig: loadedTLSConfig, formatter: createFormatter(cfg.Protocol, cfg.EnableOctetCounting), } diff --git a/exporter/syslogexporter/exporter_test.go b/exporter/syslogexporter/exporter_test.go index 58cdb03a61aa..58a025701b3a 100644 --- a/exporter/syslogexporter/exporter_test.go +++ b/exporter/syslogexporter/exporter_test.go @@ -5,6 +5,7 @@ package syslogexporter import ( "context" + "crypto/tls" "errors" "io" "net" @@ -15,6 +16,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/config/configtls" "go.opentelemetry.io/collector/consumer/consumererror" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/pdata/pcommon" @@ -183,3 +185,55 @@ func TestSyslogExportFail(t *testing.T) { assert.ErrorContains(t, consumerErr, "dial tcp 127.0.0.1:112: connect") assert.Equal(t, droppedLog, originalForm) } + +func TestTLSConfig(t *testing.T) { + + tests := []struct { + name string + network string + tlsSettings configtls.TLSClientSetting + tlsConfig *tls.Config + }{ + {name: "TCP with TLS configuration", + network: "tcp", + tlsSettings: configtls.TLSClientSetting{}, + tlsConfig: &tls.Config{}, + }, + {name: "TCP insecure", + network: "tcp", + tlsSettings: configtls.TLSClientSetting{Insecure: true}, + tlsConfig: nil, + }, + {name: "UDP with TLS configuration", + network: "udp", + tlsSettings: configtls.TLSClientSetting{}, + tlsConfig: nil, + }, + {name: "UDP insecure", + network: "udp", + tlsSettings: configtls.TLSClientSetting{Insecure: true}, + tlsConfig: nil, + }, + } + + for _, testInstance := range tests { + t.Run(testInstance.name, func(t *testing.T) { + + exporter, err := initExporter( + &Config{Endpoint: "test.com", + Network: testInstance.network, + Port: 514, + Protocol: "rfc5424", + TLSSetting: testInstance.tlsSettings}, + createExporterCreateSettings()) + + assert.NoError(t, err) + if testInstance.tlsConfig != nil { + assert.NotNil(t, exporter.tlsConfig) + } else { + assert.Nil(t, exporter.tlsConfig) + } + + }) + } +} diff --git a/exporter/syslogexporter/generated_component_test.go b/exporter/syslogexporter/generated_component_test.go index 6628d4fb8309..4acdd30f1a29 100644 --- a/exporter/syslogexporter/generated_component_test.go +++ b/exporter/syslogexporter/generated_component_test.go @@ -5,27 +5,19 @@ package syslogexporter import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -56,44 +48,40 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) + } +} - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - err = c.Start(context.Background(), host) - require.NoError(t, err) - require.NotPanics(t, func() { - switch e := c.(type) { - case exporter.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) - if !e.Capabilities().MutatesData { - logs.MarkReadOnly() - } - err = e.ConsumeLogs(context.Background(), logs) - case exporter.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() - if !e.Capabilities().MutatesData { - metrics.MarkReadOnly() - } - err = e.ConsumeMetrics(context.Background(), metrics) - case exporter.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() - if !e.Capabilities().MutatesData { - traces.MarkReadOnly() - } - err = e.ConsumeTraces(context.Background(), traces) - } - }) +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} - require.NoError(t, err) +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} - err = c.Shutdown(context.Background()) - require.NoError(t, err) - }) - } +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces } diff --git a/exporter/syslogexporter/go.mod b/exporter/syslogexporter/go.mod index caf71ceb4f74..520e2669977d 100644 --- a/exporter/syslogexporter/go.mod +++ b/exporter/syslogexporter/go.mod @@ -3,7 +3,6 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/exporter/syslog go 1.21 require ( - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.95.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.95.0 go.opentelemetry.io/collector/config/configretry v0.95.0 @@ -11,7 +10,7 @@ require ( go.opentelemetry.io/collector/exporter v0.95.0 go.opentelemetry.io/collector/pdata v1.2.0 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( @@ -64,11 +63,3 @@ require ( google.golang.org/protobuf v1.32.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) - -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal => ../../internal/coreinternal - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil => ../../pkg/pdatautil - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden diff --git a/exporter/syslogexporter/go.sum b/exporter/syslogexporter/go.sum index fac4db05cd55..8e0c14699ae0 100644 --- a/exporter/syslogexporter/go.sum +++ b/exporter/syslogexporter/go.sum @@ -108,8 +108,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/exporter/syslogexporter/metadata.yaml b/exporter/syslogexporter/metadata.yaml index 4566dbad9278..f0c4679af848 100644 --- a/exporter/syslogexporter/metadata.yaml +++ b/exporter/syslogexporter/metadata.yaml @@ -8,6 +8,6 @@ status: codeowners: active: [kkujawa-sumo, rnishtala-sumo, astencel-sumo] +# TODO: Update the exporter to pass the tests tests: - config: skip_lifecycle: true diff --git a/exporter/syslogexporter/sender.go b/exporter/syslogexporter/sender.go index cd3d5d700963..cd70b2ed8163 100644 --- a/exporter/syslogexporter/sender.go +++ b/exporter/syslogexporter/sender.go @@ -78,8 +78,8 @@ func (s *sender) dial() error { s.conn = nil } var err error - if s.tlsConfig != nil { - s.conn, err = tls.Dial("tcp", s.addr, s.tlsConfig) + if s.tlsConfig != nil && s.network == "tcp" { + s.conn, err = tls.Dial(s.network, s.addr, s.tlsConfig) } else { s.conn, err = net.Dial(s.network, s.addr) } diff --git a/exporter/tencentcloudlogserviceexporter/generated_component_test.go b/exporter/tencentcloudlogserviceexporter/generated_component_test.go index f295e29ddeaa..d8ca76aee854 100644 --- a/exporter/tencentcloudlogserviceexporter/generated_component_test.go +++ b/exporter/tencentcloudlogserviceexporter/generated_component_test.go @@ -5,27 +5,19 @@ package tencentcloudlogserviceexporter import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -56,44 +48,40 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) + } +} - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - err = c.Start(context.Background(), host) - require.NoError(t, err) - require.NotPanics(t, func() { - switch e := c.(type) { - case exporter.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) - if !e.Capabilities().MutatesData { - logs.MarkReadOnly() - } - err = e.ConsumeLogs(context.Background(), logs) - case exporter.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() - if !e.Capabilities().MutatesData { - metrics.MarkReadOnly() - } - err = e.ConsumeMetrics(context.Background(), metrics) - case exporter.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() - if !e.Capabilities().MutatesData { - traces.MarkReadOnly() - } - err = e.ConsumeTraces(context.Background(), traces) - } - }) +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} - require.NoError(t, err) +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} - err = c.Shutdown(context.Background()) - require.NoError(t, err) - }) - } +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces } diff --git a/exporter/tencentcloudlogserviceexporter/go.mod b/exporter/tencentcloudlogserviceexporter/go.mod index 8e220192a204..78739134adbe 100644 --- a/exporter/tencentcloudlogserviceexporter/go.mod +++ b/exporter/tencentcloudlogserviceexporter/go.mod @@ -15,7 +15,7 @@ require ( go.opentelemetry.io/collector/semconv v0.95.0 go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 google.golang.org/protobuf v1.32.0 ) diff --git a/exporter/tencentcloudlogserviceexporter/go.sum b/exporter/tencentcloudlogserviceexporter/go.sum index e364a739a08d..4916da4ff896 100644 --- a/exporter/tencentcloudlogserviceexporter/go.sum +++ b/exporter/tencentcloudlogserviceexporter/go.sum @@ -119,8 +119,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/exporter/tencentcloudlogserviceexporter/metadata.yaml b/exporter/tencentcloudlogserviceexporter/metadata.yaml index 59b84df9c5f5..3d2f9bd64893 100644 --- a/exporter/tencentcloudlogserviceexporter/metadata.yaml +++ b/exporter/tencentcloudlogserviceexporter/metadata.yaml @@ -8,6 +8,6 @@ status: codeowners: active: [wgliang, yiyang5055] +# TODO: Update the exporter to pass the tests tests: - config: skip_lifecycle: true diff --git a/exporter/zipkinexporter/generated_component_test.go b/exporter/zipkinexporter/generated_component_test.go index 6ea0689f46e0..c223b5d0bc5c 100644 --- a/exporter/zipkinexporter/generated_component_test.go +++ b/exporter/zipkinexporter/generated_component_test.go @@ -5,27 +5,20 @@ package zipkinexporter import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -56,9 +49,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -67,19 +58,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case exporter.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case exporter.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case exporter.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -94,3 +85,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/exporter/zipkinexporter/go.mod b/exporter/zipkinexporter/go.mod index 712ba8720e29..1690f5bcd38c 100644 --- a/exporter/zipkinexporter/go.mod +++ b/exporter/zipkinexporter/go.mod @@ -5,7 +5,6 @@ go 1.21 require ( github.com/cenkalti/backoff/v4 v4.2.1 github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.95.0 - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver v0.95.0 github.com/openzipkin/zipkin-go v0.4.2 @@ -49,6 +48,7 @@ require ( github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.95.0 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.18.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect @@ -71,7 +71,7 @@ require ( go.opentelemetry.io/otel/sdk v1.23.1 // indirect go.opentelemetry.io/otel/sdk/metric v1.23.1 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.26.0 // indirect + go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.21.0 // indirect golang.org/x/sys v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/exporter/zipkinexporter/go.sum b/exporter/zipkinexporter/go.sum index 5363647d80d2..0bff44589ed5 100644 --- a/exporter/zipkinexporter/go.sum +++ b/exporter/zipkinexporter/go.sum @@ -142,8 +142,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/exporter/zipkinexporter/metadata.yaml b/exporter/zipkinexporter/metadata.yaml index e61ffff77ef5..6890a6ff9095 100644 --- a/exporter/zipkinexporter/metadata.yaml +++ b/exporter/zipkinexporter/metadata.yaml @@ -7,6 +7,3 @@ status: distributions: [core, contrib, observiq, liatrio] codeowners: active: [MovieStoreGuy, astencel-sumo, crobert-1] - -tests: - config: diff --git a/extension/ackextension/metadata.yaml b/extension/ackextension/metadata.yaml index c562fc292749..b9212a9c8fda 100644 --- a/extension/ackextension/metadata.yaml +++ b/extension/ackextension/metadata.yaml @@ -9,4 +9,5 @@ status: active: [zpzhuSplunk, splunkericl] tests: - config: \ No newline at end of file + skip_lifecycle: true + skip_shutdown: true diff --git a/extension/asapauthextension/metadata.yaml b/extension/asapauthextension/metadata.yaml index e513253ee2af..f8e943196f43 100644 --- a/extension/asapauthextension/metadata.yaml +++ b/extension/asapauthextension/metadata.yaml @@ -7,3 +7,8 @@ status: distributions: [contrib, sumo] codeowners: active: [jamesmoessis, MovieStoreGuy] + +# TODO: Update the extension to make the tests pass +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/extension/awsproxy/go.mod b/extension/awsproxy/go.mod index 4718a2505f2b..973556958ade 100644 --- a/extension/awsproxy/go.mod +++ b/extension/awsproxy/go.mod @@ -13,11 +13,11 @@ require ( go.opentelemetry.io/collector/extension v0.95.0 go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( - github.com/aws/aws-sdk-go v1.50.17 // indirect + github.com/aws/aws-sdk-go v1.50.27 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect diff --git a/extension/awsproxy/go.sum b/extension/awsproxy/go.sum index 158ab616f6f7..7db554b5fc1a 100644 --- a/extension/awsproxy/go.sum +++ b/extension/awsproxy/go.sum @@ -1,5 +1,5 @@ -github.com/aws/aws-sdk-go v1.50.17 h1:KsbzUKDgGNlkDHGvoQDhiJ63a9jtZd+O+/s3pTOr/ns= -github.com/aws/aws-sdk-go v1.50.17/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.50.27 h1:96ifhrSuja+AzdP3W/T2337igqVQ2FcSIJYkk+0rCeA= +github.com/aws/aws-sdk-go v1.50.27/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= @@ -99,8 +99,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/extension/awsproxy/metadata.yaml b/extension/awsproxy/metadata.yaml index a2987a86d0fa..2d717611011f 100644 --- a/extension/awsproxy/metadata.yaml +++ b/extension/awsproxy/metadata.yaml @@ -7,3 +7,8 @@ status: distributions: [contrib, aws, sumo] codeowners: active: [Aneurysm9, mxiamxia] + +# TODO: Update the extension to make the tests pass +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/extension/basicauthextension/generated_component_test.go b/extension/basicauthextension/generated_component_test.go index 71bba3ef3c95..c507fb7186ee 100644 --- a/extension/basicauthextension/generated_component_test.go +++ b/extension/basicauthextension/generated_component_test.go @@ -9,20 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/extension/extensiontest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/extension/extensiontest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -32,16 +22,13 @@ func TestComponentLifecycle(t *testing.T) { sub, err := cm.Sub("tests::config") require.NoError(t, err) require.NoError(t, component.UnmarshalConfig(sub, cfg)) - t.Run("shutdown", func(t *testing.T) { e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) err = e.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run("lifecycle", func(t *testing.T) { - firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost())) diff --git a/extension/bearertokenauthextension/generated_component_test.go b/extension/bearertokenauthextension/generated_component_test.go index 52427770d16e..e4c98d4bbfa0 100644 --- a/extension/bearertokenauthextension/generated_component_test.go +++ b/extension/bearertokenauthextension/generated_component_test.go @@ -9,20 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/extension/extensiontest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/extension/extensiontest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -32,16 +22,13 @@ func TestComponentLifecycle(t *testing.T) { sub, err := cm.Sub("tests::config") require.NoError(t, err) require.NoError(t, component.UnmarshalConfig(sub, cfg)) - t.Run("shutdown", func(t *testing.T) { e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) err = e.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run("lifecycle", func(t *testing.T) { - firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost())) diff --git a/extension/bearertokenauthextension/go.mod b/extension/bearertokenauthextension/go.mod index 07301353eac1..01825ca776ca 100644 --- a/extension/bearertokenauthextension/go.mod +++ b/extension/bearertokenauthextension/go.mod @@ -13,7 +13,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 google.golang.org/grpc v1.61.0 ) diff --git a/extension/bearertokenauthextension/go.sum b/extension/bearertokenauthextension/go.sum index bef1be170f19..6800601c2cf3 100644 --- a/extension/bearertokenauthextension/go.sum +++ b/extension/bearertokenauthextension/go.sum @@ -85,8 +85,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/extension/encoding/jaegerencodingextension/generated_component_test.go b/extension/encoding/jaegerencodingextension/generated_component_test.go index 8af788f66478..25002d065f4f 100644 --- a/extension/encoding/jaegerencodingextension/generated_component_test.go +++ b/extension/encoding/jaegerencodingextension/generated_component_test.go @@ -9,20 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/extension/extensiontest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/extension/extensiontest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -32,16 +22,13 @@ func TestComponentLifecycle(t *testing.T) { sub, err := cm.Sub("tests::config") require.NoError(t, err) require.NoError(t, component.UnmarshalConfig(sub, cfg)) - t.Run("shutdown", func(t *testing.T) { e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) err = e.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run("lifecycle", func(t *testing.T) { - firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost())) diff --git a/extension/encoding/jaegerencodingextension/go.mod b/extension/encoding/jaegerencodingextension/go.mod index caad23e9df39..2c3e128b822e 100644 --- a/extension/encoding/jaegerencodingextension/go.mod +++ b/extension/encoding/jaegerencodingextension/go.mod @@ -48,7 +48,7 @@ require ( go.opentelemetry.io/otel/sdk v1.23.1 // indirect go.opentelemetry.io/otel/sdk/metric v1.23.1 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.26.0 // indirect + go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.20.0 // indirect golang.org/x/sys v0.16.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/extension/encoding/jaegerencodingextension/go.sum b/extension/encoding/jaegerencodingextension/go.sum index 867adff89d77..35478a63682e 100644 --- a/extension/encoding/jaegerencodingextension/go.sum +++ b/extension/encoding/jaegerencodingextension/go.sum @@ -98,8 +98,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/extension/encoding/jsonlogencodingextension/generated_component_test.go b/extension/encoding/jsonlogencodingextension/generated_component_test.go index c1100f4d8f6e..06031169f8a6 100644 --- a/extension/encoding/jsonlogencodingextension/generated_component_test.go +++ b/extension/encoding/jsonlogencodingextension/generated_component_test.go @@ -9,20 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/extension/extensiontest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/extension/extensiontest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -32,16 +22,13 @@ func TestComponentLifecycle(t *testing.T) { sub, err := cm.Sub("tests::config") require.NoError(t, err) require.NoError(t, component.UnmarshalConfig(sub, cfg)) - t.Run("shutdown", func(t *testing.T) { e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) err = e.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run("lifecycle", func(t *testing.T) { - firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost())) diff --git a/extension/encoding/otlpencodingextension/generated_component_test.go b/extension/encoding/otlpencodingextension/generated_component_test.go index 5b1ee24dda1e..0d8dcf68c223 100644 --- a/extension/encoding/otlpencodingextension/generated_component_test.go +++ b/extension/encoding/otlpencodingextension/generated_component_test.go @@ -9,20 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/extension/extensiontest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/extension/extensiontest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -32,16 +22,13 @@ func TestComponentLifecycle(t *testing.T) { sub, err := cm.Sub("tests::config") require.NoError(t, err) require.NoError(t, component.UnmarshalConfig(sub, cfg)) - t.Run("shutdown", func(t *testing.T) { e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) err = e.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run("lifecycle", func(t *testing.T) { - firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost())) diff --git a/extension/encoding/textencodingextension/generated_component_test.go b/extension/encoding/textencodingextension/generated_component_test.go index eaed84dbaaf0..24c3489a465f 100644 --- a/extension/encoding/textencodingextension/generated_component_test.go +++ b/extension/encoding/textencodingextension/generated_component_test.go @@ -9,20 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/extension/extensiontest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/extension/extensiontest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -32,16 +22,13 @@ func TestComponentLifecycle(t *testing.T) { sub, err := cm.Sub("tests::config") require.NoError(t, err) require.NoError(t, component.UnmarshalConfig(sub, cfg)) - t.Run("shutdown", func(t *testing.T) { e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) err = e.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run("lifecycle", func(t *testing.T) { - firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost())) diff --git a/extension/encoding/textencodingextension/go.mod b/extension/encoding/textencodingextension/go.mod index aac16b29fd16..948195a9154d 100644 --- a/extension/encoding/textencodingextension/go.mod +++ b/extension/encoding/textencodingextension/go.mod @@ -44,7 +44,7 @@ require ( go.opentelemetry.io/otel/sdk v1.23.1 // indirect go.opentelemetry.io/otel/sdk/metric v1.23.1 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.26.0 // indirect + go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.20.0 // indirect golang.org/x/sys v0.16.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/extension/encoding/textencodingextension/go.sum b/extension/encoding/textencodingextension/go.sum index 82454474b9ab..14d2332dcc52 100644 --- a/extension/encoding/textencodingextension/go.sum +++ b/extension/encoding/textencodingextension/go.sum @@ -92,8 +92,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/extension/encoding/zipkinencodingextension/generated_component_test.go b/extension/encoding/zipkinencodingextension/generated_component_test.go index 43fe6de97d7b..88fba0d4d201 100644 --- a/extension/encoding/zipkinencodingextension/generated_component_test.go +++ b/extension/encoding/zipkinencodingextension/generated_component_test.go @@ -9,20 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/extension/extensiontest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/extension/extensiontest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -32,16 +22,13 @@ func TestComponentLifecycle(t *testing.T) { sub, err := cm.Sub("tests::config") require.NoError(t, err) require.NoError(t, component.UnmarshalConfig(sub, cfg)) - t.Run("shutdown", func(t *testing.T) { e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) err = e.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run("lifecycle", func(t *testing.T) { - firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost())) diff --git a/extension/encoding/zipkinencodingextension/go.mod b/extension/encoding/zipkinencodingextension/go.mod index 5388783b8af9..e76fce5ed72c 100644 --- a/extension/encoding/zipkinencodingextension/go.mod +++ b/extension/encoding/zipkinencodingextension/go.mod @@ -49,7 +49,7 @@ require ( go.opentelemetry.io/otel/sdk v1.23.1 // indirect go.opentelemetry.io/otel/sdk/metric v1.23.1 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.26.0 // indirect + go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.20.0 // indirect golang.org/x/sys v0.16.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/extension/encoding/zipkinencodingextension/go.sum b/extension/encoding/zipkinencodingextension/go.sum index 09cc6ebb52fc..0f5bfc2fbbf6 100644 --- a/extension/encoding/zipkinencodingextension/go.sum +++ b/extension/encoding/zipkinencodingextension/go.sum @@ -100,8 +100,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/extension/headerssetterextension/generated_component_test.go b/extension/headerssetterextension/generated_component_test.go index d281962d7459..6bfc0c1c3413 100644 --- a/extension/headerssetterextension/generated_component_test.go +++ b/extension/headerssetterextension/generated_component_test.go @@ -9,20 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/extension/extensiontest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/extension/extensiontest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -32,16 +22,13 @@ func TestComponentLifecycle(t *testing.T) { sub, err := cm.Sub("tests::config") require.NoError(t, err) require.NoError(t, component.UnmarshalConfig(sub, cfg)) - t.Run("shutdown", func(t *testing.T) { e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) err = e.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run("lifecycle", func(t *testing.T) { - firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost())) diff --git a/extension/headerssetterextension/go.mod b/extension/headerssetterextension/go.mod index 899a1bbfaee3..6cdd62144f19 100644 --- a/extension/headerssetterextension/go.mod +++ b/extension/headerssetterextension/go.mod @@ -12,7 +12,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 google.golang.org/grpc v1.61.0 ) diff --git a/extension/headerssetterextension/go.sum b/extension/headerssetterextension/go.sum index 94ced76691f7..6860bede1293 100644 --- a/extension/headerssetterextension/go.sum +++ b/extension/headerssetterextension/go.sum @@ -91,8 +91,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/extension/healthcheckextension/generated_component_test.go b/extension/healthcheckextension/generated_component_test.go index 4951e85212e1..977fe6e5a838 100644 --- a/extension/healthcheckextension/generated_component_test.go +++ b/extension/healthcheckextension/generated_component_test.go @@ -9,20 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/extension/extensiontest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/extension/extensiontest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -32,16 +22,13 @@ func TestComponentLifecycle(t *testing.T) { sub, err := cm.Sub("tests::config") require.NoError(t, err) require.NoError(t, component.UnmarshalConfig(sub, cfg)) - t.Run("shutdown", func(t *testing.T) { e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) err = e.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run("lifecycle", func(t *testing.T) { - firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost())) diff --git a/extension/healthcheckextension/go.mod b/extension/healthcheckextension/go.mod index 31d9e9f3d010..345c6c960858 100644 --- a/extension/healthcheckextension/go.mod +++ b/extension/healthcheckextension/go.mod @@ -14,7 +14,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/extension/healthcheckextension/go.sum b/extension/healthcheckextension/go.sum index 3884bcc27eec..876e0444873b 100644 --- a/extension/healthcheckextension/go.sum +++ b/extension/healthcheckextension/go.sum @@ -161,8 +161,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/extension/httpforwarder/Makefile b/extension/httpforwarder/Makefile deleted file mode 100644 index c1496226e590..000000000000 --- a/extension/httpforwarder/Makefile +++ /dev/null @@ -1 +0,0 @@ -include ../../Makefile.Common \ No newline at end of file diff --git a/extension/httpforwarder/README.md b/extension/httpforwarder/README.md deleted file mode 100644 index fa96b07790d1..000000000000 --- a/extension/httpforwarder/README.md +++ /dev/null @@ -1,51 +0,0 @@ -# HTTP Forwarder Extension - -**This extension is deprecated. Please use [httpforwarderextension](../httpforwarderextension) instead.** - - -| Status | | -| ------------- |-----------| -| Stability | [deprecated] | -| Distributions | [contrib], [splunk], [sumo] | -| Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Aextension%2Fhttpforwarder%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Aextension%2Fhttpforwarder) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Aextension%2Fhttpforwarder%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Aextension%2Fhttpforwarder) | -| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@atoulme](https://www.github.com/atoulme), [@rmfitzpatrick](https://www.github.com/rmfitzpatrick) | - -[deprecated]: https://github.com/open-telemetry/opentelemetry-collector#deprecated -[contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib -[splunk]: https://github.com/signalfx/splunk-otel-collector -[sumo]: https://github.com/SumoLogic/sumologic-otel-collector - - -This extension accepts HTTP requests, optionally adds headers to them and forwards them. -The RequestURIs of the original requests are preserved by the extension. - -## Configuration - -The following settings are required: - -- `egress`: HTTP config settings to use for forwarding requests. - - `endpoint` (no default): The target to which requests should be forwarded to. - -The following settings can be optionally configured: - -- `ingress`: HTTP config settings for HTTP server listening to requests. - - `endpoint` (default = `0.0.0.0:6060`): The host to which requests should be forwarded to. -- `egress`: HTTP config settings to use for forwarding requests. - - `headers` (default = `nil`): Additional headers to be added to all requests passing through the extension. - - `timeout` (default = `10s`): How long to wait for each request to complete. - -### Example - -```yaml - http_forwarder: - ingress: - endpoint: localhost:7070 - egress: - endpoint: http://target/ - headers: - otel_http_forwarder: dev - timeout: 5s -``` - -The full list of settings exposed for this exporter are documented [here](config.go) -with detailed sample configurations [here](testdata/config.yaml). diff --git a/extension/httpforwarder/config.go b/extension/httpforwarder/config.go deleted file mode 100644 index d4e3fc80805c..000000000000 --- a/extension/httpforwarder/config.go +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package httpforwarder // import "github.com/open-telemetry/opentelemetry-collector-contrib/extension/httpforwarder" - -import ( - "go.opentelemetry.io/collector/config/confighttp" -) - -// Config defines configuration for http forwarder extension. -type Config struct { - - // Ingress holds config settings for HTTP server listening for requests. - Ingress confighttp.ServerConfig `mapstructure:"ingress"` - - // Egress holds config settings to use for forwarded requests. - Egress confighttp.ClientConfig `mapstructure:"egress"` -} diff --git a/extension/httpforwarder/config_test.go b/extension/httpforwarder/config_test.go deleted file mode 100644 index 27fb2c560464..000000000000 --- a/extension/httpforwarder/config_test.go +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package httpforwarder - -import ( - "path/filepath" - "testing" - "time" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/config/confighttp" - "go.opentelemetry.io/collector/config/configopaque" - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/extension/httpforwarder/internal/metadata" -) - -func TestLoadConfig(t *testing.T) { - t.Parallel() - maxIdleConns := 42 - idleConnTimeout := 80 * time.Second - - tests := []struct { - id component.ID - expected component.Config - }{ - { - id: component.NewID(metadata.Type), - expected: NewFactory().CreateDefaultConfig(), - }, - { - id: component.NewIDWithName(metadata.Type, "1"), - expected: &Config{ - Ingress: confighttp.ServerConfig{ - Endpoint: "http://localhost:7070", - }, - Egress: confighttp.ClientConfig{ - Endpoint: "http://target/", - Headers: map[string]configopaque.String{ - "otel_http_forwarder": "dev", - }, - MaxIdleConns: &maxIdleConns, - IdleConnTimeout: &idleConnTimeout, - Timeout: 5 * time.Second, - }, - }, - }, - } - for _, tt := range tests { - t.Run(tt.id.String(), func(t *testing.T) { - cm, err := confmaptest.LoadConf(filepath.Join("testdata", "config.yaml")) - require.NoError(t, err) - factory := NewFactory() - cfg := factory.CreateDefaultConfig() - sub, err := cm.Sub(tt.id.String()) - require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) - assert.NoError(t, component.ValidateConfig(cfg)) - assert.Equal(t, tt.expected, cfg) - }) - } -} diff --git a/extension/httpforwarder/doc.go b/extension/httpforwarder/doc.go deleted file mode 100644 index 8eb8a22efc4e..000000000000 --- a/extension/httpforwarder/doc.go +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -//go:generate mdatagen metadata.yaml - -// Package httpforwarder accepts HTTP requests, optionally adds headers to them and forwards them. -// Deprecated: use httpforwarderextension instead -package httpforwarder // import "github.com/open-telemetry/opentelemetry-collector-contrib/extension/httpforwarder" diff --git a/extension/httpforwarder/extension.go b/extension/httpforwarder/extension.go deleted file mode 100644 index d8d3ce08decf..000000000000 --- a/extension/httpforwarder/extension.go +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package httpforwarder // import "github.com/open-telemetry/opentelemetry-collector-contrib/extension/httpforwarder" - -import ( - "context" - "errors" - "fmt" - "io" - "net/http" - "net/url" - - "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/extension" - "go.uber.org/zap" -) - -type httpForwarder struct { - forwardTo *url.URL - httpClient *http.Client - server *http.Server - settings component.TelemetrySettings - config *Config -} - -var _ extension.Extension = (*httpForwarder)(nil) - -func (h *httpForwarder) Start(_ context.Context, host component.Host) error { - listener, err := h.config.Ingress.ToListener() - if err != nil { - return fmt.Errorf("failed to bind to address %s: %w", h.config.Ingress.Endpoint, err) - } - - httpClient, err := h.config.Egress.ToClient(host, h.settings) - if err != nil { - return fmt.Errorf("failed to create HTTP Client: %w", err) - } - h.httpClient = httpClient - - handler := http.NewServeMux() - handler.HandleFunc("/", h.forwardRequest) - - h.server, err = h.config.Ingress.ToServer(host, h.settings, handler) - if err != nil { - return fmt.Errorf("failed to create HTTP Client: %w", err) - } - - go func() { - if errHTTP := h.server.Serve(listener); !errors.Is(errHTTP, http.ErrServerClosed) && errHTTP != nil { - h.settings.ReportStatus(component.NewFatalErrorEvent(errHTTP)) - } - }() - - return nil -} - -func (h *httpForwarder) Shutdown(_ context.Context) error { - if h.server == nil { - return nil - } - return h.server.Close() -} - -func (h *httpForwarder) forwardRequest(writer http.ResponseWriter, request *http.Request) { - forwarderRequest := request.Clone(request.Context()) - forwarderRequest.URL.Host = h.forwardTo.Host - forwarderRequest.URL.Scheme = h.forwardTo.Scheme - forwarderRequest.Host = h.forwardTo.Host - // Clear RequestURI to avoid getting "http: Request.RequestURI can't be set in client requests" error. - forwarderRequest.RequestURI = "" - - // Add additional headers. - for k, v := range h.config.Egress.Headers { - forwarderRequest.Header.Add(k, string(v)) - } - - // Add "Via" header for tracking purposes on both the outgoing requests and responses. - // See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Via. - addViaHeader(forwarderRequest.Header, request.Proto, request.Host) - - response, err := h.httpClient.Do(forwarderRequest) - if err != nil { - http.Error(writer, err.Error(), http.StatusBadGateway) - } - - if response == nil { - return - } - defer response.Body.Close() - - // Copy over response from the final destination. - for k := range response.Header { - writer.Header().Set(k, response.Header.Get(k)) - } - addViaHeader(writer.Header(), response.Proto, request.Host) - - writer.WriteHeader(response.StatusCode) - written, err := io.Copy(writer, response.Body) - if err != nil { - h.settings.Logger.Warn("Error writing HTTP response message", zap.Error(err)) - } - - if response.ContentLength != written { - h.settings.Logger.Warn("Response from target not fully copied, body might be corrupted") - } -} - -func addViaHeader(header http.Header, protocol string, host string) { - header.Add("Via", fmt.Sprintf("%s %s", protocol, host)) -} - -func newHTTPForwarder(config *Config, settings component.TelemetrySettings) (extension.Extension, error) { - if config.Egress.Endpoint == "" { - return nil, errors.New("'egress.endpoint' config option cannot be empty") - } - - var url, err = url.Parse(config.Egress.Endpoint) - if err != nil { - return nil, fmt.Errorf("enter a valid URL for 'egress.endpoint': %w", err) - } - - h := &httpForwarder{ - config: config, - forwardTo: url, - settings: settings, - } - - return h, nil -} diff --git a/extension/httpforwarder/extension_test.go b/extension/httpforwarder/extension_test.go deleted file mode 100644 index 44854174cc7a..000000000000 --- a/extension/httpforwarder/extension_test.go +++ /dev/null @@ -1,272 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package httpforwarder - -import ( - "context" - "fmt" - "io" - "net/http" - "net/http/httptest" - "net/url" - "strings" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "go.opentelemetry.io/collector/component/componenttest" - "go.opentelemetry.io/collector/config/confighttp" - "go.opentelemetry.io/collector/config/configopaque" - "go.opentelemetry.io/collector/config/configtls" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/common/testutil" -) - -type clientRequestArgs struct { - method string - url string - headers map[string]string - body string -} - -func TestExtension(t *testing.T) { - listenAt := testutil.GetAvailableLocalAddress(t) - tests := []struct { - name string - config *Config - expectedbackendStatusCode int - expectedBackendResponseBody []byte - expectedHeaders map[string]configopaque.String - httpErrorFromBackend bool - requestErrorAtForwarder bool - clientRequestArgs clientRequestArgs - startUpError bool - startUpErrorMessage string - }{ - { - name: "No additional headers", - config: &Config{ - Ingress: confighttp.ServerConfig{ - Endpoint: listenAt, - }, - }, - expectedbackendStatusCode: http.StatusAccepted, - expectedBackendResponseBody: []byte("hello world"), - expectedHeaders: map[string]configopaque.String{ - "header": "value", - }, - clientRequestArgs: clientRequestArgs{ - method: "GET", - url: fmt.Sprintf("http://%s/api/dosomething", listenAt), - headers: map[string]string{ - "client_header": "val1", - }, - body: "client_body", - }, - }, - { - name: "With additional headers", - config: &Config{ - Ingress: confighttp.ServerConfig{ - Endpoint: listenAt, - }, - Egress: confighttp.ClientConfig{ - Headers: map[string]configopaque.String{ - "key": "value", - }, - }, - }, - expectedbackendStatusCode: http.StatusAccepted, - expectedBackendResponseBody: []byte("hello world with additional headers"), - expectedHeaders: map[string]configopaque.String{ - "header": "value", - }, - clientRequestArgs: clientRequestArgs{ - method: "PUT", - url: fmt.Sprintf("http://%s/api/dosomething", listenAt), - }, - }, - { - name: "Error code from backend", - config: &Config{ - Ingress: confighttp.ServerConfig{ - Endpoint: listenAt, - }, - Egress: confighttp.ClientConfig{ - Headers: map[string]configopaque.String{ - "key": "value", - }, - }, - }, - expectedbackendStatusCode: http.StatusInternalServerError, - expectedBackendResponseBody: []byte("\n"), - httpErrorFromBackend: true, - clientRequestArgs: clientRequestArgs{ - method: "PATCH", - url: fmt.Sprintf("http://%s/api/dosomething", listenAt), - }, - }, - { - name: "Error making request at forwarder", - config: &Config{ - Ingress: confighttp.ServerConfig{ - Endpoint: listenAt, - }, - Egress: confighttp.ClientConfig{ - Headers: map[string]configopaque.String{ - "key": "value", - }, - }, - }, - expectedbackendStatusCode: http.StatusBadGateway, - expectedBackendResponseBody: []byte("\n"), - requestErrorAtForwarder: true, - clientRequestArgs: clientRequestArgs{ - method: "GET", - url: fmt.Sprintf("http://%s/api/dosomething", listenAt), - }, - }, - { - name: "Invalid config - HTTP Client creation fails", - config: &Config{ - Egress: confighttp.ClientConfig{ - Endpoint: "localhost:9090", - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ - CAFile: "/non/existent", - }, - }, - }, - }, - startUpError: true, - startUpErrorMessage: "failed to create HTTP Client: ", - }, - { - name: "Error on Startup", - config: &Config{ - Ingress: confighttp.ServerConfig{ - Endpoint: "invalid", // to mock error setting up listener. - }, - }, - startUpError: true, - }, - } - - for _, test := range tests { - t.Run(test.name, func(t *testing.T) { - backend := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - if test.httpErrorFromBackend { - http.Error(w, "", http.StatusInternalServerError) - return - } - - assert.Equal(t, getParsedURL(t, test.clientRequestArgs.url).RequestURI(), r.RequestURI) - assert.Equal(t, test.clientRequestArgs.method, r.Method) - assert.Equal(t, test.clientRequestArgs.body, string(readBody(r.Body))) - - // Assert headers originating from client. - for k, v := range test.clientRequestArgs.headers { - got := r.Header.Get(k) - assert.Equal(t, v, got) - } - - // Assert additional headers added by forwarder. - for k, v := range test.config.Egress.Headers { - got := r.Header.Get(k) - assert.Equal(t, string(v), got) - } - - // Assert Via header added by the forwarder on all requests. - assert.Equal(t, fmt.Sprintf("%s %s", r.Proto, listenAt), r.Header.Get("Via")) - - for k, v := range test.expectedHeaders { - w.Header().Set(k, string(v)) - } - w.WriteHeader(test.expectedbackendStatusCode) - _, err := w.Write(test.expectedBackendResponseBody) - assert.NoError(t, err) - })) - defer backend.Close() - - // Fill in final destination URL. - backendURL, _ := url.Parse(backend.URL) - test.config.Egress.Endpoint = backendURL.String() - - // Setup forwarder with wrong final address to mock failures. - if test.requestErrorAtForwarder { - test.config.Egress.Endpoint = "http://" + testutil.GetAvailableLocalAddress(t) - } - - hf, err := newHTTPForwarder(test.config, componenttest.NewNopTelemetrySettings()) - require.NoError(t, err) - - ctx := context.Background() - if test.startUpError { - err = hf.Start(ctx, componenttest.NewNopHost()) - if test.startUpErrorMessage != "" { - require.True(t, strings.Contains(err.Error(), test.startUpErrorMessage)) - } - require.Error(t, err) - - return - } - require.NoError(t, hf.Start(ctx, componenttest.NewNopHost())) - - // Mock a client trying to talk to backend using the forwarder. - httpClient := http.Client{} - - // Assert responses received by client. - response, err := httpClient.Do(httpRequest(t, test.clientRequestArgs)) - require.NoError(t, err) - require.NotNil(t, response) - defer response.Body.Close() - - assert.Equal(t, test.expectedbackendStatusCode, response.StatusCode) - if !test.requestErrorAtForwarder { - assert.Equal(t, string(test.expectedBackendResponseBody), string(readBody(response.Body))) - assert.Equal(t, fmt.Sprintf("%s %s", response.Proto, listenAt), response.Header.Get("Via")) - } - - for k := range response.Header { - got := response.Header.Get(k) - header := strings.ToLower(k) - if want, ok := test.expectedHeaders[header]; ok { - assert.Equal(t, want, configopaque.String(got)) - continue - } - - if k == "Content-Length" || k == "Content-Type" || k == "X-Content-Type-Options" || k == "Date" || k == "Via" { - // Content-Length, Content-Type, X-Content-Type-Options and Date are certain headers added by default. - // Assertion for Via is done above. - continue - } - t.Error("unexpected header found in response: ", k) - } - - require.NoError(t, hf.Shutdown(ctx)) - }) - } -} - -func httpRequest(t *testing.T, args clientRequestArgs) *http.Request { - r, err := http.NewRequest(args.method, args.url, io.NopCloser(strings.NewReader(args.body))) - require.NoError(t, err) - - for k, v := range args.headers { - r.Header.Set(k, v) - } - - return r -} - -func readBody(body io.ReadCloser) []byte { - out, _ := io.ReadAll(body) - return out -} - -func getParsedURL(t *testing.T, rawURL string) *url.URL { - var url, err = url.Parse(rawURL) - require.NoError(t, err) - return url -} diff --git a/extension/httpforwarder/factory.go b/extension/httpforwarder/factory.go deleted file mode 100644 index f8f28d79cc88..000000000000 --- a/extension/httpforwarder/factory.go +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package httpforwarder // import "github.com/open-telemetry/opentelemetry-collector-contrib/extension/httpforwarder" - -import ( - "context" - "time" - - "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/config/confighttp" - "go.opentelemetry.io/collector/extension" - - "github.com/open-telemetry/opentelemetry-collector-contrib/extension/httpforwarder/internal/metadata" -) - -const ( - // Default endpoints to bind to. - defaultEndpoint = ":6060" -) - -// NewFactory creates a factory for HostObserver extension. -func NewFactory() extension.Factory { - return extension.NewFactory( - metadata.Type, - createDefaultConfig, - createExtension, - metadata.ExtensionStability) -} - -func createDefaultConfig() component.Config { - httpClientSettings := confighttp.NewDefaultClientConfig() - httpClientSettings.Timeout = 10 * time.Second - return &Config{ - Ingress: confighttp.ServerConfig{ - Endpoint: defaultEndpoint, - }, - Egress: httpClientSettings, - } -} - -func createExtension( - _ context.Context, - params extension.CreateSettings, - cfg component.Config, -) (extension.Extension, error) { - return newHTTPForwarder(cfg.(*Config), params.TelemetrySettings) -} diff --git a/extension/httpforwarder/factory_test.go b/extension/httpforwarder/factory_test.go deleted file mode 100644 index e7c1571f944c..000000000000 --- a/extension/httpforwarder/factory_test.go +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package httpforwarder - -import ( - "context" - "strings" - "testing" - "time" - - "github.com/stretchr/testify/require" - "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - "go.opentelemetry.io/collector/config/confighttp" - "go.opentelemetry.io/collector/extension/extensiontest" -) - -func TestFactory(t *testing.T) { - f := NewFactory() - expectType := component.MustNewType("http_forwarder") - require.Equal(t, expectType, f.Type()) - - cfg := f.CreateDefaultConfig().(*Config) - require.Equal(t, ":6060", cfg.Ingress.Endpoint) - require.Equal(t, 10*time.Second, cfg.Egress.Timeout) - - tests := []struct { - name string - config *Config - wantErr bool - wantErrMessage string - }{ - { - name: "Default config", - config: cfg, - wantErr: true, - wantErrMessage: "'egress.endpoint' config option cannot be empty", - }, - { - name: "Invalid config", - config: &Config{Egress: confighttp.ClientConfig{Endpoint: "123.456.7.89:9090"}}, - wantErr: true, - wantErrMessage: "enter a valid URL for 'egress.endpoint': parse \"123.456.7.89:9090\": first path segment in URL cannot", - }, - { - name: "Valid config", - config: &Config{Egress: confighttp.ClientConfig{Endpoint: "localhost:9090"}}, - }, - } - for _, test := range tests { - t.Run(test.name, func(t *testing.T) { - e, err := f.CreateExtension( - context.Background(), - extensiontest.NewNopCreateSettings(), - test.config, - ) - if test.wantErr { - if test.wantErrMessage != "" { - require.True(t, strings.Contains(err.Error(), test.wantErrMessage)) - } - require.Error(t, err) - require.Nil(t, e) - } else { - require.NoError(t, err) - require.NotNil(t, e) - ctx := context.Background() - require.NoError(t, e.Start(ctx, componenttest.NewNopHost())) - require.NoError(t, e.Shutdown(ctx)) - } - }) - } -} diff --git a/extension/httpforwarder/go.mod b/extension/httpforwarder/go.mod deleted file mode 100644 index aa5156e2f071..000000000000 --- a/extension/httpforwarder/go.mod +++ /dev/null @@ -1,76 +0,0 @@ -// Deprecated: use httpforwarderextension instead -module github.com/open-telemetry/opentelemetry-collector-contrib/extension/httpforwarder - -go 1.21 - -require ( - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.95.0 - github.com/stretchr/testify v1.8.4 - go.opentelemetry.io/collector/component v0.95.0 - go.opentelemetry.io/collector/config/confighttp v0.95.0 - go.opentelemetry.io/collector/config/configopaque v1.2.0 - go.opentelemetry.io/collector/config/configtls v0.95.0 - go.opentelemetry.io/collector/confmap v0.95.0 - go.opentelemetry.io/collector/extension v0.95.0 - go.opentelemetry.io/otel/metric v1.23.1 - go.opentelemetry.io/otel/trace v1.23.1 - go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 -) - -require ( - github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect - github.com/go-logr/logr v1.4.1 // indirect - github.com/go-logr/stdr v1.2.2 // indirect - github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect - github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/protobuf v1.5.3 // indirect - github.com/golang/snappy v0.0.4 // indirect - github.com/hashicorp/go-version v1.6.0 // indirect - github.com/klauspost/compress v1.17.6 // 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.0 // indirect - github.com/mitchellh/copystructure v1.2.0 // indirect - github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect - github.com/mitchellh/reflectwalk v1.0.2 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.18.0 // indirect - github.com/prometheus/client_model v0.5.0 // indirect - github.com/prometheus/common v0.46.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect - github.com/rs/cors v1.10.1 // indirect - go.opentelemetry.io/collector v0.95.0 // indirect - go.opentelemetry.io/collector/config/configauth v0.95.0 // indirect - go.opentelemetry.io/collector/config/configcompression v0.95.0 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.95.0 // indirect - go.opentelemetry.io/collector/config/internal v0.95.0 // indirect - go.opentelemetry.io/collector/extension/auth v0.95.0 // indirect - go.opentelemetry.io/collector/featuregate v1.2.0 // indirect - go.opentelemetry.io/collector/pdata v1.2.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 // indirect - go.opentelemetry.io/otel v1.23.1 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.45.2 // indirect - go.opentelemetry.io/otel/sdk v1.23.1 // indirect - go.opentelemetry.io/otel/sdk/metric v1.23.1 // indirect - go.uber.org/multierr v1.11.0 // indirect - golang.org/x/net v0.21.0 // indirect - golang.org/x/sys v0.17.0 // indirect - golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917 // indirect - google.golang.org/grpc v1.61.0 // indirect - google.golang.org/protobuf v1.32.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect -) - -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => ../../internal/common - -retract ( - v0.76.2 - v0.76.1 - v0.65.0 -) diff --git a/extension/httpforwarder/go.sum b/extension/httpforwarder/go.sum deleted file mode 100644 index 458eaef5d617..000000000000 --- a/extension/httpforwarder/go.sum +++ /dev/null @@ -1,167 +0,0 @@ -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= -github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= -github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= -github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= -github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= -github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c= -github.com/go-viper/mapstructure/v2 v2.0.0-alpha.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/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -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.5.5/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/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= -github.com/hashicorp/go-version v1.6.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= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.6 h1:60eq2E/jlfwQXtvZEeBUYADs+BwKBWURIY+Gj2eRGjI= -github.com/klauspost/compress v1.17.6/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= -github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= -github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= -github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= -github.com/knadh/koanf/providers/confmap v0.1.0/go.mod h1:2uLhxQzJnyHKfxG927awZC7+fyHFdQkd697K4MdLnIU= -github.com/knadh/koanf/v2 v2.1.0 h1:eh4QmHHBuU8BybfIJ8mB8K8gsGCD/AUQTdwGq/GzId8= -github.com/knadh/koanf/v2 v2.1.0/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es= -github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= -github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= -github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= -github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c h1:cqn374mizHuIWj+OSJCajGr/phAmuMug9qIX3l9CflE= -github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= -github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= -github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= -github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= -github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= -github.com/prometheus/common v0.46.0 h1:doXzt5ybi1HBKpsZOL0sSkaNHJJqkyfEWZGGqqScV0Y= -github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1BTn+g2pa/hQ= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= -github.com/rs/cors v1.10.1 h1:L0uuZVXIKlI1SShY2nhFfo44TYvDPQ1w4oFkUJNfhyo= -github.com/rs/cors v1.10.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -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 v0.95.0 h1:DFW0BkF2sOocpA3NUPrbMeuPSN3PWxFBrLqs/Cxn3vo= -go.opentelemetry.io/collector v0.95.0/go.mod h1:Lc+VkOkSBppKqR/cAevS5oPrbtUO3JUbYzo91niRkG0= -go.opentelemetry.io/collector/component v0.95.0 h1:68tI7KVy1bfpaR83+LxUvjd9/hjDh78utklGl2t6eVM= -go.opentelemetry.io/collector/component v0.95.0/go.mod h1:SMt7r9zm0OOEKJF/ZUy8agD92OAXq2Xhq1FaTcfIWHw= -go.opentelemetry.io/collector/config/configauth v0.95.0 h1:peGXB3ctZW/B8PomTL7CoIpTy94V5TR3JX6fD8kakmU= -go.opentelemetry.io/collector/config/configauth v0.95.0/go.mod h1:80lAG02Mucz0JYdG+k0NIul/BQF5bUpeRGEndgg07lg= -go.opentelemetry.io/collector/config/configcompression v0.95.0 h1:G1ljjbXmh37JaePSM+2r0bRNlEoCg4l1M1UuhGgnXx0= -go.opentelemetry.io/collector/config/configcompression v0.95.0/go.mod h1:owL6s04LI1fPrNZvXiRm6o4B0jaxb3z/oFEcgrakFK4= -go.opentelemetry.io/collector/config/confighttp v0.95.0 h1:x/f3CQhQzei2WPoGkSa9x1D1qXfMkbfnhKoQL7VjGvw= -go.opentelemetry.io/collector/config/confighttp v0.95.0/go.mod h1:77imNR16GOaIEoomda3ysRTyaVzH4cQi27FtDknJrqw= -go.opentelemetry.io/collector/config/configopaque v1.2.0 h1:ncnAuq4px3yREsirivGUbwr36xXEKa3K6JTOBNGlbtc= -go.opentelemetry.io/collector/config/configopaque v1.2.0/go.mod h1:6BAnSe6wok2Sg3tiNuapBbLnrduyMwzsBzbfgUSbDnI= -go.opentelemetry.io/collector/config/configtelemetry v0.95.0 h1:HabJZqbOAbNQ52L3v6usXoGXg1UKA1Ofs4Ytp5sGXEo= -go.opentelemetry.io/collector/config/configtelemetry v0.95.0/go.mod h1:tl8sI2RE3LSgJ0HjpadYpIwsKzw/CRA0nZUXLzMAZS0= -go.opentelemetry.io/collector/config/configtls v0.95.0 h1:LB6B5vCXwZV77jWPNhdvsgkyY8CFv8gdsRjfQS2Rioc= -go.opentelemetry.io/collector/config/configtls v0.95.0/go.mod h1:661iHIlhQTKIuUUEkQmuoyek1oq46XlsKjLu3JIzJrE= -go.opentelemetry.io/collector/config/internal v0.95.0 h1:jSifydX2KscDhVuTxGFdYtgWu+7AVKr9/7OCvBmS46Q= -go.opentelemetry.io/collector/config/internal v0.95.0/go.mod h1:KR0lphyXBwuB1DImzQDRVONoRTbwsGnH9degSG5018M= -go.opentelemetry.io/collector/confmap v0.95.0 h1:0oZwSUaeKTDCP7eewFpQSD+9SxXspiaJWjZDQYGGars= -go.opentelemetry.io/collector/confmap v0.95.0/go.mod h1:L3djzwpt+jL06wxnHAuy1jPUFcM+MdKGQAsz3B1d6pk= -go.opentelemetry.io/collector/consumer v0.95.0 h1:M/N5RDx8/6Hz5L1qWUXdtirtdoV8BEjIxCSdt6cCx+I= -go.opentelemetry.io/collector/consumer v0.95.0/go.mod h1:tM5aOolWS1zAByMbne2xVOkmVvZrF3VEKY6TkxhmkOs= -go.opentelemetry.io/collector/extension v0.95.0 h1:amE7zV/lfJRdCmZ4cqWmvBzZB5aQmIFIQqIuXmhaCjI= -go.opentelemetry.io/collector/extension v0.95.0/go.mod h1:IDt4B5GJxh/uJ/mUWxYZ+eHrJ49k4B8s8gJhuI0TRVI= -go.opentelemetry.io/collector/extension/auth v0.95.0 h1:Qu2/I6YXW1yhh+M5PZ6b5izPdzrh+bl8X7ewEeJQWGU= -go.opentelemetry.io/collector/extension/auth v0.95.0/go.mod h1:FSODnSbmqfRT9dQdJgogby7j4bcV8TmrhddTvcAjcjU= -go.opentelemetry.io/collector/featuregate v1.2.0 h1:nF8OGq5PsSNSLeuNwTWlOqThxbLW6v6DOCvSqQMc108= -go.opentelemetry.io/collector/featuregate v1.2.0/go.mod h1:mm8+xyQfgDmqhyegZRNIQmoKsNnDTwWKFLsdMoXAb7A= -go.opentelemetry.io/collector/pdata v1.2.0 h1:N6VdyEFYJyoHIKqHd0F372eNVD5b+AbH0ZQf7Z2jJ9I= -go.opentelemetry.io/collector/pdata v1.2.0/go.mod h1:mKXb6527Syb8PT4P9CZOJNbkuHOHjjGTZNNwSKESJhc= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 h1:sv9kVfal0MK0wBMCOGr+HeJm9v803BkJxGrk2au7j08= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0/go.mod h1:SK2UL73Zy1quvRPonmOmRDiWk1KBV3LyIeeIxcEApWw= -go.opentelemetry.io/otel v1.23.1 h1:Za4UzOqJYS+MUczKI320AtqZHZb7EqxO00jAHE0jmQY= -go.opentelemetry.io/otel v1.23.1/go.mod h1:Td0134eafDLcTS4y+zQ26GE8u3dEuRBiBCTUIRHaikA= -go.opentelemetry.io/otel/exporters/prometheus v0.45.2 h1:pe2Jqk1K18As0RCw7J08QhgXNqr+6npx0a5W4IgAFA8= -go.opentelemetry.io/otel/exporters/prometheus v0.45.2/go.mod h1:B38pscHKI6bhFS44FDw0eFU3iqG3ASNIvY+fZgR5sAc= -go.opentelemetry.io/otel/metric v1.23.1 h1:PQJmqJ9u2QaJLBOELl1cxIdPcpbwzbkjfEyelTl2rlo= -go.opentelemetry.io/otel/metric v1.23.1/go.mod h1:mpG2QPlAfnK8yNhNJAxDZruU9Y1/HubbC+KyH8FaCWI= -go.opentelemetry.io/otel/sdk v1.23.1 h1:O7JmZw0h76if63LQdsBMKQDWNb5oEcOThG9IrxscV+E= -go.opentelemetry.io/otel/sdk v1.23.1/go.mod h1:LzdEVR5am1uKOOwfBWFef2DCi1nu3SA8XQxx2IerWFk= -go.opentelemetry.io/otel/sdk/metric v1.23.1 h1:T9/8WsYg+ZqIpMWwdISVVrlGb/N0Jr1OHjR/alpKwzg= -go.opentelemetry.io/otel/sdk/metric v1.23.1/go.mod h1:8WX6WnNtHCgUruJ4TJ+UssQjMtpxkpX0zveQC8JG/E0= -go.opentelemetry.io/otel/trace v1.23.1 h1:4LrmmEd8AU2rFvU1zegmvqW7+kWarxtNOPyeL6HmYY8= -go.opentelemetry.io/otel/trace v1.23.1/go.mod h1:4IpnpJFwr1mo/6HL8XIPJaE9y0+u1KcVmuW7dwFSVrI= -go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= -go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= -go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= -go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= -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/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.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= -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.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.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.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -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= -golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -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= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917 h1:6G8oQ016D88m1xAKljMlBOOGWDZkes4kMhgGFlf8WcQ= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917/go.mod h1:xtjpI3tXFPP051KaWnhvxkiubL/6dJ18vLVf7q2pTOU= -google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0= -google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= -google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/extension/httpforwarder/internal/metadata/generated_status.go b/extension/httpforwarder/internal/metadata/generated_status.go deleted file mode 100644 index 1b40a9c32981..000000000000 --- a/extension/httpforwarder/internal/metadata/generated_status.go +++ /dev/null @@ -1,25 +0,0 @@ -// Code generated by mdatagen. DO NOT EDIT. - -package metadata - -import ( - "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/otel/metric" - "go.opentelemetry.io/otel/trace" -) - -var ( - Type = component.MustNewType("http_forwarder") -) - -const ( - ExtensionStability = component.StabilityLevelDeprecated -) - -func Meter(settings component.TelemetrySettings) metric.Meter { - return settings.MeterProvider.Meter("otelcol") -} - -func Tracer(settings component.TelemetrySettings) trace.Tracer { - return settings.TracerProvider.Tracer("otelcol") -} diff --git a/extension/httpforwarder/metadata.yaml b/extension/httpforwarder/metadata.yaml deleted file mode 100644 index 8c8a5712b920..000000000000 --- a/extension/httpforwarder/metadata.yaml +++ /dev/null @@ -1,9 +0,0 @@ -type: http_forwarder - -status: - class: extension - stability: - deprecated: [extension] - distributions: [contrib, splunk, sumo] - codeowners: - active: [atoulme, rmfitzpatrick] diff --git a/extension/httpforwarder/testdata/config.yaml b/extension/httpforwarder/testdata/config.yaml deleted file mode 100644 index 2d6e17e95d9a..000000000000 --- a/extension/httpforwarder/testdata/config.yaml +++ /dev/null @@ -1,11 +0,0 @@ -http_forwarder: -http_forwarder/1: - ingress: - endpoint: http://localhost:7070 - egress: - endpoint: http://target/ - headers: - otel_http_forwarder: dev - idle_conn_timeout: 80s - max_idle_conns: 42 - timeout: 5s diff --git a/extension/httpforwarderextension/go.mod b/extension/httpforwarderextension/go.mod index 34f9b6a5f5c6..99395047dffe 100644 --- a/extension/httpforwarderextension/go.mod +++ b/extension/httpforwarderextension/go.mod @@ -14,7 +14,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/extension/httpforwarderextension/go.sum b/extension/httpforwarderextension/go.sum index 458eaef5d617..6d85703d934d 100644 --- a/extension/httpforwarderextension/go.sum +++ b/extension/httpforwarderextension/go.sum @@ -119,8 +119,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/extension/httpforwarderextension/metadata.yaml b/extension/httpforwarderextension/metadata.yaml index d41a2ea7e4d9..ed07ffb3aa8d 100644 --- a/extension/httpforwarderextension/metadata.yaml +++ b/extension/httpforwarderextension/metadata.yaml @@ -7,3 +7,8 @@ status: distributions: [] codeowners: active: [atoulme, rmfitzpatrick] + +# TODO: Update the extension to make the tests pass +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/extension/jaegerremotesampling/generated_component_test.go b/extension/jaegerremotesampling/generated_component_test.go new file mode 100644 index 000000000000..33dedb1680c5 --- /dev/null +++ b/extension/jaegerremotesampling/generated_component_test.go @@ -0,0 +1,30 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package jaegerremotesampling + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/extension/extensiontest" +) + +func TestComponentLifecycle(t *testing.T) { + factory := NewFactory() + + cm, err := confmaptest.LoadConf("metadata.yaml") + require.NoError(t, err) + cfg := factory.CreateDefaultConfig() + sub, err := cm.Sub("tests::config") + require.NoError(t, err) + require.NoError(t, component.UnmarshalConfig(sub, cfg)) + t.Run("shutdown", func(t *testing.T) { + e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + err = e.Shutdown(context.Background()) + require.NoError(t, err) + }) +} diff --git a/extension/jaegerremotesampling/go.mod b/extension/jaegerremotesampling/go.mod index 221ee22e177d..24ce459b623e 100644 --- a/extension/jaegerremotesampling/go.mod +++ b/extension/jaegerremotesampling/go.mod @@ -20,7 +20,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 google.golang.org/grpc v1.61.0 ) diff --git a/extension/jaegerremotesampling/go.sum b/extension/jaegerremotesampling/go.sum index 5d0da19a1092..aaa192280ab8 100644 --- a/extension/jaegerremotesampling/go.sum +++ b/extension/jaegerremotesampling/go.sum @@ -184,8 +184,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/extension/jaegerremotesampling/metadata.yaml b/extension/jaegerremotesampling/metadata.yaml index 46b400bd352d..ea0e7ef23537 100644 --- a/extension/jaegerremotesampling/metadata.yaml +++ b/extension/jaegerremotesampling/metadata.yaml @@ -11,3 +11,7 @@ status: - sumo codeowners: active: [yurishkuro, frzifus] + +# TODO: Update the extension to make the tests pass +tests: + skip_lifecycle: true diff --git a/extension/oauth2clientauthextension/generated_component_test.go b/extension/oauth2clientauthextension/generated_component_test.go index 8fd8ee7da9fa..b3941a495e84 100644 --- a/extension/oauth2clientauthextension/generated_component_test.go +++ b/extension/oauth2clientauthextension/generated_component_test.go @@ -9,20 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/extension/extensiontest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/extension/extensiontest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -32,16 +22,13 @@ func TestComponentLifecycle(t *testing.T) { sub, err := cm.Sub("tests::config") require.NoError(t, err) require.NoError(t, component.UnmarshalConfig(sub, cfg)) - t.Run("shutdown", func(t *testing.T) { e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) err = e.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run("lifecycle", func(t *testing.T) { - firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost())) diff --git a/extension/oauth2clientauthextension/go.mod b/extension/oauth2clientauthextension/go.mod index cc2a1ced988a..da561c3ead05 100644 --- a/extension/oauth2clientauthextension/go.mod +++ b/extension/oauth2clientauthextension/go.mod @@ -15,7 +15,7 @@ require ( go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 golang.org/x/oauth2 v0.17.0 google.golang.org/grpc v1.61.0 ) diff --git a/extension/oauth2clientauthextension/go.sum b/extension/oauth2clientauthextension/go.sum index 2e1456ba30cf..8069033ce565 100644 --- a/extension/oauth2clientauthextension/go.sum +++ b/extension/oauth2clientauthextension/go.sum @@ -125,8 +125,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/extension/observer/dockerobserver/generated_component_test.go b/extension/observer/dockerobserver/generated_component_test.go new file mode 100644 index 000000000000..11f7c8cc06a7 --- /dev/null +++ b/extension/observer/dockerobserver/generated_component_test.go @@ -0,0 +1,42 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package dockerobserver + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/extension/extensiontest" +) + +func TestComponentLifecycle(t *testing.T) { + factory := NewFactory() + + cm, err := confmaptest.LoadConf("metadata.yaml") + require.NoError(t, err) + cfg := factory.CreateDefaultConfig() + sub, err := cm.Sub("tests::config") + require.NoError(t, err) + require.NoError(t, component.UnmarshalConfig(sub, cfg)) + t.Run("shutdown", func(t *testing.T) { + e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + err = e.Shutdown(context.Background()) + require.NoError(t, err) + }) + t.Run("lifecycle", func(t *testing.T) { + firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost())) + require.NoError(t, firstExt.Shutdown(context.Background())) + + secondExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + require.NoError(t, secondExt.Start(context.Background(), componenttest.NewNopHost())) + require.NoError(t, secondExt.Shutdown(context.Background())) + }) +} diff --git a/extension/observer/dockerobserver/go.mod b/extension/observer/dockerobserver/go.mod index 31bcc525d2b9..7d48dd0b83d9 100644 --- a/extension/observer/dockerobserver/go.mod +++ b/extension/observer/dockerobserver/go.mod @@ -15,7 +15,7 @@ require ( go.opentelemetry.io/collector/extension v0.95.0 go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/extension/observer/dockerobserver/go.sum b/extension/observer/dockerobserver/go.sum index 5af8db67d121..f6ad9e55d08d 100644 --- a/extension/observer/dockerobserver/go.sum +++ b/extension/observer/dockerobserver/go.sum @@ -163,8 +163,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/extension/observer/ecsobserver/extension_test.go b/extension/observer/ecsobserver/extension_test.go index 61cf6e170d20..cbf02b8d5215 100644 --- a/extension/observer/ecsobserver/extension_test.go +++ b/extension/observer/ecsobserver/extension_test.go @@ -6,7 +6,6 @@ package ecsobserver import ( "context" "runtime" - "sync" "testing" "time" @@ -20,49 +19,6 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecsobserver/internal/ecsmock" ) -// inspectErrorHost implements component.Host. -// btw: I only find assertNoErrorHost in other components, seems there is no exported util struct. -type inspectErrorHost struct { - component.Host - - // Why we need a mutex here? Our extension only has one go routine so it seems - // we don't need to protect the error as our extension is the only component for this 'host'. - // But without the lock the test actually fails on race detector. - // There is no actual concurrency in our test, when we read the error in test assertion, - // we know the extension has already stopped because we provided invalided config and waited long enough. - // However, (I assume) from race detector's perspective, race between a stopped goroutine and a running one - // is same as two running goroutines. A goroutine's stop condition is uncertain at runtime, and the data - // access order may varies, goroutine A can stop before B in first run and reverse in next run. - // As long as there is some read/write of one memory area without protection from multiple go routines, - // it means the code can have data race, but it does not mean this race always happen. - // In our case, the race never happens because we hard coded the sleep time of two go routines. - // - // btw: assertNoErrorHost does not have mutex because it never saves the error. Its ReportFatalError - // just call assertion and forget about nil error. For unexpected error it call helpers to fail the test - // and those helper func all have mutex. https://golang.org/src/testing/testing.go - mu sync.Mutex - err error -} - -func newInspectErrorHost() component.Host { - return &inspectErrorHost{ - Host: componenttest.NewNopHost(), - } -} - -func (h *inspectErrorHost) ReportFatalError(err error) { - h.mu.Lock() - h.err = err - h.mu.Unlock() -} - -func (h *inspectErrorHost) getError() error { - h.mu.Lock() - cp := h.err - h.mu.Unlock() - return cp -} - // Simply start and stop, the actual test logic is in sd_test.go until we implement the ListWatcher interface. // In that case sd itself does not use timer and relies on caller to trigger List. func TestExtensionStartStop(t *testing.T) { @@ -71,7 +27,6 @@ func TestExtensionStartStop(t *testing.T) { "https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/4042") } refreshInterval := 100 * time.Millisecond - waitDuration := 2 * refreshInterval createTestExt := func(c *ecsmock.Cluster, output string) extension.Extension { f := newTestTaskFetcher(t, c) @@ -79,7 +34,11 @@ func TestExtensionStartStop(t *testing.T) { sdCfg := cfg.(*Config) sdCfg.RefreshInterval = refreshInterval sdCfg.ResultFile = output - ext, err := createExtensionWithFetcher(extensiontest.NewNopCreateSettings(), sdCfg, f) + cs := extensiontest.NewNopCreateSettings() + cs.ReportStatus = func(event *component.StatusEvent) { + require.NoError(t, event.Err()) + } + ext, err := createExtensionWithFetcher(cs, sdCfg, f) require.NoError(t, err) return ext } @@ -88,10 +47,7 @@ func TestExtensionStartStop(t *testing.T) { c := ecsmock.NewCluster() ext := createTestExt(c, "testdata/ut_ext_noop.actual.yaml") require.IsType(t, &ecsObserver{}, ext) - host := newInspectErrorHost() - require.NoError(t, ext.Start(context.TODO(), host)) - time.Sleep(waitDuration) - require.NoError(t, host.(*inspectErrorHost).getError()) + require.NoError(t, ext.Start(context.TODO(), componenttest.NewNopHost())) require.NoError(t, ext.Shutdown(context.TODO())) }) diff --git a/extension/observer/ecsobserver/go.mod b/extension/observer/ecsobserver/go.mod index 675ea82adea6..72c7d6f76ce2 100644 --- a/extension/observer/ecsobserver/go.mod +++ b/extension/observer/ecsobserver/go.mod @@ -3,7 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/extension/obser go 1.21 require ( - github.com/aws/aws-sdk-go v1.50.17 + github.com/aws/aws-sdk-go v1.50.27 github.com/hashicorp/golang-lru v1.0.2 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.95.0 @@ -13,7 +13,7 @@ require ( go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 gopkg.in/yaml.v2 v2.4.0 ) diff --git a/extension/observer/ecsobserver/go.sum b/extension/observer/ecsobserver/go.sum index 0c93a1435f7d..8975b510e798 100644 --- a/extension/observer/ecsobserver/go.sum +++ b/extension/observer/ecsobserver/go.sum @@ -1,5 +1,5 @@ -github.com/aws/aws-sdk-go v1.50.17 h1:KsbzUKDgGNlkDHGvoQDhiJ63a9jtZd+O+/s3pTOr/ns= -github.com/aws/aws-sdk-go v1.50.17/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.50.27 h1:96ifhrSuja+AzdP3W/T2337igqVQ2FcSIJYkk+0rCeA= +github.com/aws/aws-sdk-go v1.50.27/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= @@ -89,8 +89,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/extension/observer/ecsobserver/metadata.yaml b/extension/observer/ecsobserver/metadata.yaml index 9f1e59fb8419..9787f88c0d9c 100644 --- a/extension/observer/ecsobserver/metadata.yaml +++ b/extension/observer/ecsobserver/metadata.yaml @@ -7,3 +7,8 @@ status: distributions: [contrib, aws, splunk, sumo] codeowners: active: [dmitryax, rmfitzpatrick] + +# TODO: Update the extension to make the tests pass +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/extension/observer/ecstaskobserver/go.mod b/extension/observer/ecstaskobserver/go.mod index 504ce1e3ddf0..e88338cf703f 100644 --- a/extension/observer/ecstaskobserver/go.mod +++ b/extension/observer/ecstaskobserver/go.mod @@ -14,7 +14,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/extension/observer/ecstaskobserver/go.sum b/extension/observer/ecstaskobserver/go.sum index c92b383bc9f7..adc359029ddd 100644 --- a/extension/observer/ecstaskobserver/go.sum +++ b/extension/observer/ecstaskobserver/go.sum @@ -121,8 +121,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/extension/observer/ecstaskobserver/metadata.yaml b/extension/observer/ecstaskobserver/metadata.yaml index 21882823f67f..64df54ada926 100644 --- a/extension/observer/ecstaskobserver/metadata.yaml +++ b/extension/observer/ecstaskobserver/metadata.yaml @@ -7,3 +7,8 @@ status: distributions: [contrib, splunk, sumo] codeowners: active: [rmfitzpatrick] + +# TODO: Update the extension to make the tests pass +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/extension/observer/go.mod b/extension/observer/go.mod index e62b622b83d5..25a7c75200e2 100644 --- a/extension/observer/go.mod +++ b/extension/observer/go.mod @@ -5,7 +5,7 @@ go 1.21 require ( github.com/stretchr/testify v1.8.4 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/extension/observer/go.sum b/extension/observer/go.sum index 298fcd528a2c..fa3d4c5b6e48 100644 --- a/extension/observer/go.sum +++ b/extension/observer/go.sum @@ -19,8 +19,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= +go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/extension/observer/hostobserver/generated_component_test.go b/extension/observer/hostobserver/generated_component_test.go new file mode 100644 index 000000000000..fc8046c1668d --- /dev/null +++ b/extension/observer/hostobserver/generated_component_test.go @@ -0,0 +1,42 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package hostobserver + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/extension/extensiontest" +) + +func TestComponentLifecycle(t *testing.T) { + factory := NewFactory() + + cm, err := confmaptest.LoadConf("metadata.yaml") + require.NoError(t, err) + cfg := factory.CreateDefaultConfig() + sub, err := cm.Sub("tests::config") + require.NoError(t, err) + require.NoError(t, component.UnmarshalConfig(sub, cfg)) + t.Run("shutdown", func(t *testing.T) { + e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + err = e.Shutdown(context.Background()) + require.NoError(t, err) + }) + t.Run("lifecycle", func(t *testing.T) { + firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost())) + require.NoError(t, firstExt.Shutdown(context.Background())) + + secondExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + require.NoError(t, secondExt.Start(context.Background(), componenttest.NewNopHost())) + require.NoError(t, secondExt.Shutdown(context.Background())) + }) +} diff --git a/extension/observer/hostobserver/go.mod b/extension/observer/hostobserver/go.mod index 4ee4c9c8a389..53e4b0d02a6e 100644 --- a/extension/observer/hostobserver/go.mod +++ b/extension/observer/hostobserver/go.mod @@ -12,7 +12,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/extension/observer/hostobserver/go.sum b/extension/observer/hostobserver/go.sum index c1155701ab1e..41868ad28b59 100644 --- a/extension/observer/hostobserver/go.sum +++ b/extension/observer/hostobserver/go.sum @@ -106,8 +106,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/extension/observer/k8sobserver/go.mod b/extension/observer/k8sobserver/go.mod index 835392a5a4b7..1a7a0be1761e 100644 --- a/extension/observer/k8sobserver/go.mod +++ b/extension/observer/k8sobserver/go.mod @@ -11,7 +11,7 @@ require ( go.opentelemetry.io/collector/extension v0.95.0 go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 k8s.io/api v0.29.2 k8s.io/apimachinery v0.29.2 k8s.io/client-go v0.29.2 diff --git a/extension/observer/k8sobserver/go.sum b/extension/observer/k8sobserver/go.sum index 10e59bd12c27..9466bab0eb1b 100644 --- a/extension/observer/k8sobserver/go.sum +++ b/extension/observer/k8sobserver/go.sum @@ -291,8 +291,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= diff --git a/extension/observer/k8sobserver/metadata.yaml b/extension/observer/k8sobserver/metadata.yaml index db0065725397..2d51dae899f9 100644 --- a/extension/observer/k8sobserver/metadata.yaml +++ b/extension/observer/k8sobserver/metadata.yaml @@ -7,3 +7,8 @@ status: distributions: [contrib, splunk, sumo] codeowners: active: [rmfitzpatrick, dmitryax] + +# TODO: Update the extension to make the tests pass +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/extension/oidcauthextension/generated_component_test.go b/extension/oidcauthextension/generated_component_test.go index e50d5c4ff441..9ea4072ff751 100644 --- a/extension/oidcauthextension/generated_component_test.go +++ b/extension/oidcauthextension/generated_component_test.go @@ -8,21 +8,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/extension/extensiontest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/extension/extensiontest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -32,27 +21,10 @@ func TestComponentLifecycle(t *testing.T) { sub, err := cm.Sub("tests::config") require.NoError(t, err) require.NoError(t, component.UnmarshalConfig(sub, cfg)) - t.Run("shutdown", func(t *testing.T) { e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) err = e.Shutdown(context.Background()) require.NoError(t, err) }) - - t.Run("lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost())) - require.NoError(t, firstExt.Shutdown(context.Background())) - - secondExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - require.NoError(t, secondExt.Start(context.Background(), componenttest.NewNopHost())) - require.NoError(t, secondExt.Shutdown(context.Background())) - }) } diff --git a/extension/oidcauthextension/go.mod b/extension/oidcauthextension/go.mod index 90bc4bf67742..477b049e98b9 100644 --- a/extension/oidcauthextension/go.mod +++ b/extension/oidcauthextension/go.mod @@ -12,7 +12,7 @@ require ( go.opentelemetry.io/collector/extension/auth v0.95.0 go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/extension/oidcauthextension/go.sum b/extension/oidcauthextension/go.sum index e65d7da8f2d8..23262340fb01 100644 --- a/extension/oidcauthextension/go.sum +++ b/extension/oidcauthextension/go.sum @@ -100,8 +100,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/extension/opampextension/config.go b/extension/opampextension/config.go index 825c52a9ab1b..0ed2bb11e4a1 100644 --- a/extension/opampextension/config.go +++ b/extension/opampextension/config.go @@ -5,11 +5,14 @@ package opampextension // import "github.com/open-telemetry/opentelemetry-collec import ( "errors" + "net/url" "github.com/oklog/ulid/v2" + "github.com/open-telemetry/opamp-go/client" "github.com/open-telemetry/opamp-go/protobufs" "go.opentelemetry.io/collector/config/configopaque" "go.opentelemetry.io/collector/config/configtls" + "go.uber.org/zap" ) // Config contains the configuration for the opamp extension. Trying to mirror @@ -41,22 +44,82 @@ func (caps Capabilities) toAgentCapabilities() protobufs.AgentCapabilities { return agentCapabilities } +type commonFields struct { + Endpoint string `mapstructure:"endpoint"` + TLSSetting configtls.TLSClientSetting `mapstructure:"tls,omitempty"` + Headers map[string]configopaque.String `mapstructure:"headers,omitempty"` +} + // OpAMPServer contains the OpAMP transport configuration. type OpAMPServer struct { - WS *OpAMPWebsocket `mapstructure:"ws"` + WS *commonFields `mapstructure:"ws,omitempty"` + HTTP *commonFields `mapstructure:"http,omitempty"` } -// OpAMPWebsocket contains the OpAMP websocket transport configuration. -type OpAMPWebsocket struct { - Endpoint string `mapstructure:"endpoint"` - TLSSetting configtls.TLSClientSetting `mapstructure:"tls,omitempty"` - Headers map[string]configopaque.String `mapstructure:"headers,omitempty"` +func (c *commonFields) Scheme() string { + uri, err := url.ParseRequestURI(c.Endpoint) + if err != nil { + return "" + } + return uri.Scheme +} + +func (c *commonFields) Validate() error { + if c.Endpoint == "" { + return errors.New("opamp server endpoint must be provided") + } + return nil +} + +func (s OpAMPServer) GetClient(logger *zap.Logger) client.OpAMPClient { + if s.WS != nil { + return client.NewWebSocket(newLoggerFromZap(logger.With(zap.String("client", "ws")))) + } + return client.NewHTTP(newLoggerFromZap(logger.With(zap.String("client", "http")))) +} + +func (s OpAMPServer) GetHeaders() map[string]configopaque.String { + if s.WS != nil { + return s.WS.Headers + } else if s.HTTP != nil { + return s.HTTP.Headers + } + return map[string]configopaque.String{} +} + +func (s OpAMPServer) GetTLSSetting() configtls.TLSClientSetting { + if s.WS != nil { + return s.WS.TLSSetting + } else if s.HTTP != nil { + return s.HTTP.TLSSetting + } + return configtls.TLSClientSetting{} +} + +func (s OpAMPServer) GetEndpoint() string { + if s.WS != nil { + return s.WS.Endpoint + } else if s.HTTP != nil { + return s.HTTP.Endpoint + } + return "" } // Validate checks if the extension configuration is valid func (cfg *Config) Validate() error { - if cfg.Server.WS.Endpoint == "" { - return errors.New("opamp server websocket endpoint must be provided") + switch { + case cfg.Server.WS == nil && cfg.Server.HTTP == nil: + return errors.New("opamp server must have at least ws or http set") + case cfg.Server.WS != nil && cfg.Server.HTTP != nil: + return errors.New("opamp server must have only ws or http set") + case cfg.Server.WS != nil: + if err := cfg.Server.WS.Validate(); err != nil { + return err + } + case cfg.Server.HTTP != nil: + if err := cfg.Server.HTTP.Validate(); err != nil { + return err + } } if cfg.InstanceUID != "" { diff --git a/extension/opampextension/config_test.go b/extension/opampextension/config_test.go index 184c97b387d1..364f1236f1e5 100644 --- a/extension/opampextension/config_test.go +++ b/extension/opampextension/config_test.go @@ -10,6 +10,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/config/configopaque" + "go.opentelemetry.io/collector/config/configtls" "go.opentelemetry.io/collector/confmap" "go.opentelemetry.io/collector/confmap/confmaptest" ) @@ -30,7 +32,7 @@ func TestUnmarshalConfig(t *testing.T) { assert.Equal(t, &Config{ Server: &OpAMPServer{ - WS: &OpAMPWebsocket{ + WS: &commonFields{ Endpoint: "wss://127.0.0.1:4320/v1/opamp", }, }, @@ -41,20 +43,218 @@ func TestUnmarshalConfig(t *testing.T) { }, cfg) } -func TestConfigValidate(t *testing.T) { - cfg := &Config{ - Server: &OpAMPServer{ - WS: &OpAMPWebsocket{}, +func TestUnmarshalHttpConfig(t *testing.T) { + cm, err := confmaptest.LoadConf(filepath.Join("testdata", "config_http.yaml")) + require.NoError(t, err) + factory := NewFactory() + cfg := factory.CreateDefaultConfig() + assert.NoError(t, component.UnmarshalConfig(cm, cfg)) + assert.Equal(t, + &Config{ + Server: &OpAMPServer{ + HTTP: &commonFields{ + Endpoint: "https://127.0.0.1:4320/v1/opamp", + }, + }, + InstanceUID: "01BX5ZZKBKACTAV9WEVGEMMVRZ", + Capabilities: Capabilities{ + ReportsEffectiveConfig: true, + }, + }, cfg) +} + +func TestConfig_Getters(t *testing.T) { + type fields struct { + Server *OpAMPServer + } + type expected struct { + headers assert.ValueAssertionFunc + tls assert.ValueAssertionFunc + endpoint assert.ValueAssertionFunc + } + tests := []struct { + name string + fields fields + expected expected + }{ + { + name: "nothing set", + fields: fields{ + Server: &OpAMPServer{}, + }, + expected: expected{ + headers: assert.Empty, + tls: assert.Empty, + endpoint: assert.Empty, + }, + }, + { + name: "WS valid endpoint, headers, tls", + fields: fields{ + Server: &OpAMPServer{ + WS: &commonFields{ + Endpoint: "wss://127.0.0.1:4320/v1/opamp", + Headers: map[string]configopaque.String{ + "test": configopaque.String("test"), + }, + TLSSetting: configtls.TLSClientSetting{ + Insecure: true, + }, + }, + }, + }, + expected: expected{ + headers: assert.NotEmpty, + tls: assert.NotEmpty, + endpoint: assert.NotEmpty, + }, }, + { + name: "HTTP valid endpoint and valid instance id", + fields: fields{ + Server: &OpAMPServer{ + HTTP: &commonFields{ + Endpoint: "https://127.0.0.1:4320/v1/opamp", + Headers: map[string]configopaque.String{ + "test": configopaque.String("test"), + }, + TLSSetting: configtls.TLSClientSetting{ + Insecure: true, + }, + }, + }, + }, + expected: expected{ + headers: assert.NotEmpty, + tls: assert.NotEmpty, + endpoint: assert.NotEmpty, + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + tt.expected.headers(t, tt.fields.Server.GetHeaders()) + tt.expected.tls(t, tt.fields.Server.GetTLSSetting()) + tt.expected.endpoint(t, tt.fields.Server.GetEndpoint()) + }) + } +} + +func TestConfig_Validate(t *testing.T) { + type fields struct { + Server *OpAMPServer + InstanceUID string + Capabilities Capabilities + } + tests := []struct { + name string + fields fields + wantErr assert.ErrorAssertionFunc + }{ + { + name: "WS must have endpoint", + fields: fields{ + Server: &OpAMPServer{ + WS: &commonFields{}, + }, + }, + wantErr: func(t assert.TestingT, err error, _ ...any) bool { + return assert.Equal(t, "opamp server endpoint must be provided", err.Error()) + }, + }, + { + name: "WS valid endpoint and invalid instance id", + fields: fields{ + Server: &OpAMPServer{ + WS: &commonFields{ + Endpoint: "wss://127.0.0.1:4320/v1/opamp", + }, + }, + InstanceUID: "01BX5ZZKBKACTAV9WEVGEMMVRZFAIL", + }, + wantErr: func(t assert.TestingT, err error, _ ...any) bool { + return assert.Equal(t, "opamp instance_uid is invalid", err.Error()) + }, + }, + { + name: "WS valid endpoint and valid instance id", + fields: fields{ + Server: &OpAMPServer{ + WS: &commonFields{ + Endpoint: "wss://127.0.0.1:4320/v1/opamp", + }, + }, + InstanceUID: "01BX5ZZKBKACTAV9WEVGEMMVRZ", + }, + wantErr: assert.NoError, + }, + { + name: "HTTP must have endpoint", + fields: fields{ + Server: &OpAMPServer{ + HTTP: &commonFields{}, + }, + }, + wantErr: func(t assert.TestingT, err error, _ ...any) bool { + return assert.Equal(t, "opamp server endpoint must be provided", err.Error()) + }, + }, + { + name: "HTTP valid endpoint and invalid instance id", + fields: fields{ + Server: &OpAMPServer{ + HTTP: &commonFields{ + Endpoint: "https://127.0.0.1:4320/v1/opamp", + }, + }, + InstanceUID: "01BX5ZZKBKACTAV9WEVGEMMVRZFAIL", + }, + wantErr: func(t assert.TestingT, err error, _ ...any) bool { + return assert.Equal(t, "opamp instance_uid is invalid", err.Error()) + }, + }, + { + name: "HTTP valid endpoint and valid instance id", + fields: fields{ + Server: &OpAMPServer{ + HTTP: &commonFields{ + Endpoint: "https://127.0.0.1:4320/v1/opamp", + }, + }, + InstanceUID: "01BX5ZZKBKACTAV9WEVGEMMVRZ", + }, + wantErr: assert.NoError, + }, + { + name: "neither config set", + fields: fields{ + Server: &OpAMPServer{}, + }, + wantErr: func(t assert.TestingT, err error, _ ...any) bool { + return assert.Equal(t, "opamp server must have at least ws or http set", err.Error()) + }, + }, + { + name: "both config set", + fields: fields{ + Server: &OpAMPServer{ + WS: &commonFields{}, + HTTP: &commonFields{}, + }, + }, + wantErr: func(t assert.TestingT, err error, _ ...any) bool { + return assert.Equal(t, "opamp server must have only ws or http set", err.Error()) + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + cfg := &Config{ + Server: tt.fields.Server, + InstanceUID: tt.fields.InstanceUID, + Capabilities: tt.fields.Capabilities, + } + tt.wantErr(t, cfg.Validate()) + }) } - err := cfg.Validate() - assert.Equal(t, "opamp server websocket endpoint must be provided", err.Error()) - cfg.Server.WS.Endpoint = "wss://127.0.0.1:4320/v1/opamp" - assert.NoError(t, cfg.Validate()) - cfg.InstanceUID = "01BX5ZZKBKACTAV9WEVGEMMVRZFAIL" - err = cfg.Validate() - require.Error(t, err) - assert.Equal(t, "opamp instance_uid is invalid", err.Error()) - cfg.InstanceUID = "01BX5ZZKBKACTAV9WEVGEMMVRZ" - require.NoError(t, cfg.Validate()) } diff --git a/extension/opampextension/factory.go b/extension/opampextension/factory.go index 91c39e9a011b..0974399752c4 100644 --- a/extension/opampextension/factory.go +++ b/extension/opampextension/factory.go @@ -23,9 +23,7 @@ func NewFactory() extension.Factory { func createDefaultConfig() component.Config { return &Config{ - Server: &OpAMPServer{ - WS: &OpAMPWebsocket{}, - }, + Server: &OpAMPServer{}, Capabilities: Capabilities{ ReportsEffectiveConfig: true, }, diff --git a/extension/opampextension/generated_component_test.go b/extension/opampextension/generated_component_test.go index 7eb07a75d308..9f981c640967 100644 --- a/extension/opampextension/generated_component_test.go +++ b/extension/opampextension/generated_component_test.go @@ -9,20 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/extension/extensiontest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/extension/extensiontest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -32,16 +22,13 @@ func TestComponentLifecycle(t *testing.T) { sub, err := cm.Sub("tests::config") require.NoError(t, err) require.NoError(t, component.UnmarshalConfig(sub, cfg)) - t.Run("shutdown", func(t *testing.T) { e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) err = e.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run("lifecycle", func(t *testing.T) { - firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost())) diff --git a/extension/opampextension/go.mod b/extension/opampextension/go.mod index 987cde88ba76..f0533d2ce00d 100644 --- a/extension/opampextension/go.mod +++ b/extension/opampextension/go.mod @@ -16,7 +16,8 @@ require ( go.opentelemetry.io/collector/semconv v0.95.0 go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 - go.uber.org/zap v1.26.0 + go.uber.org/goleak v1.3.0 + go.uber.org/zap v1.27.0 gopkg.in/yaml.v3 v3.0.1 ) diff --git a/extension/opampextension/go.sum b/extension/opampextension/go.sum index 44c92a184815..65940492405d 100644 --- a/extension/opampextension/go.sum +++ b/extension/opampextension/go.sum @@ -98,8 +98,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/extension/opampextension/opamp_agent.go b/extension/opampextension/opamp_agent.go index 9b4d666ab67c..99156d790d05 100644 --- a/extension/opampextension/opamp_agent.go +++ b/extension/opampextension/opamp_agent.go @@ -8,6 +8,7 @@ import ( "net/http" "os" "runtime" + "strings" "sync" "github.com/google/uuid" @@ -43,15 +44,12 @@ type opampAgent struct { } func (o *opampAgent) Start(_ context.Context, _ component.Host) error { - // TODO: Add OpAMP HTTP transport support. - o.opampClient = client.NewWebSocket(newLoggerFromZap(o.logger)) - header := http.Header{} - for k, v := range o.cfg.Server.WS.Headers { + for k, v := range o.cfg.Server.GetHeaders() { header.Set(k, string(v)) } - tls, err := o.cfg.Server.WS.TLSSetting.LoadTLSConfig() + tls, err := o.cfg.Server.GetTLSSetting().LoadTLSConfig() if err != nil { return err } @@ -59,7 +57,7 @@ func (o *opampAgent) Start(_ context.Context, _ component.Host) error { settings := types.StartSettings{ Header: header, TLSConfig: tls, - OpAMPServerURL: o.cfg.Server.WS.Endpoint, + OpAMPServerURL: o.cfg.Server.GetEndpoint(), InstanceUid: o.instanceID.String(), Callbacks: types.CallbacksStruct{ OnConnectFunc: func(_ context.Context) { @@ -104,7 +102,13 @@ func (o *opampAgent) Shutdown(ctx context.Context) error { return nil } o.logger.Debug("Stopping OpAMP client...") - return o.opampClient.Stop(ctx) + err := o.opampClient.Stop(ctx) + // Opamp-go considers this an error, but the collector does not. + // https://github.com/open-telemetry/opamp-go/issues/255 + if err != nil && strings.EqualFold(err.Error(), "cannot stop because not started") { + return nil + } + return err } func (o *opampAgent) NotifyConfig(ctx context.Context, conf *confmap.Conf) error { @@ -148,11 +152,11 @@ func newOpampAgent(cfg *Config, logger *zap.Logger, build component.BuildInfo, r } else { sid, ok := res.Attributes().Get(semconv.AttributeServiceInstanceID) if ok { - uuid, err := uuid.Parse(sid.AsString()) + parsedUUID, err := uuid.Parse(sid.AsString()) if err != nil { return nil, err } - uid = ulid.ULID(uuid) + uid = ulid.ULID(parsedUUID) } } @@ -163,6 +167,7 @@ func newOpampAgent(cfg *Config, logger *zap.Logger, build component.BuildInfo, r agentVersion: agentVersion, instanceID: uid, capabilities: cfg.Capabilities, + opampClient: cfg.Server.GetClient(logger), } return agent, nil diff --git a/extension/opampextension/opamp_agent_test.go b/extension/opampextension/opamp_agent_test.go index 5332d7769f80..bc6c26735ac0 100644 --- a/extension/opampextension/opamp_agent_test.go +++ b/extension/opampextension/opamp_agent_test.go @@ -113,4 +113,5 @@ func TestStart(t *testing.T) { assert.NoError(t, err) assert.NoError(t, o.Start(context.TODO(), componenttest.NewNopHost())) + assert.NoError(t, o.Shutdown(context.TODO())) } diff --git a/extension/opampextension/package_test.go b/extension/opampextension/package_test.go new file mode 100644 index 000000000000..c15f00e62f80 --- /dev/null +++ b/extension/opampextension/package_test.go @@ -0,0 +1,14 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package opampextension + +import ( + "testing" + + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} diff --git a/extension/opampextension/testdata/config_http.yaml b/extension/opampextension/testdata/config_http.yaml new file mode 100644 index 000000000000..c97da589a392 --- /dev/null +++ b/extension/opampextension/testdata/config_http.yaml @@ -0,0 +1,4 @@ +server: + http: + endpoint: https://127.0.0.1:4320/v1/opamp +instance_uid: 01BX5ZZKBKACTAV9WEVGEMMVRZ diff --git a/extension/pprofextension/generated_component_test.go b/extension/pprofextension/generated_component_test.go index 54588e5009e7..60fd77ba6b37 100644 --- a/extension/pprofextension/generated_component_test.go +++ b/extension/pprofextension/generated_component_test.go @@ -9,20 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/extension/extensiontest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/extension/extensiontest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -32,16 +22,13 @@ func TestComponentLifecycle(t *testing.T) { sub, err := cm.Sub("tests::config") require.NoError(t, err) require.NoError(t, component.UnmarshalConfig(sub, cfg)) - t.Run("shutdown", func(t *testing.T) { e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) err = e.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run("lifecycle", func(t *testing.T) { - firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost())) diff --git a/extension/pprofextension/go.mod b/extension/pprofextension/go.mod index 0f58ffb70488..f768dd389f64 100644 --- a/extension/pprofextension/go.mod +++ b/extension/pprofextension/go.mod @@ -12,7 +12,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/extension/pprofextension/go.sum b/extension/pprofextension/go.sum index 2bacdb093e09..ef5262fec8a3 100644 --- a/extension/pprofextension/go.sum +++ b/extension/pprofextension/go.sum @@ -85,8 +85,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/extension/remotetapextension/generated_component_test.go b/extension/remotetapextension/generated_component_test.go index 6a517643f2b5..2252f12ca8d4 100644 --- a/extension/remotetapextension/generated_component_test.go +++ b/extension/remotetapextension/generated_component_test.go @@ -9,20 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/extension/extensiontest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/extension/extensiontest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -32,16 +22,13 @@ func TestComponentLifecycle(t *testing.T) { sub, err := cm.Sub("tests::config") require.NoError(t, err) require.NoError(t, component.UnmarshalConfig(sub, cfg)) - t.Run("shutdown", func(t *testing.T) { e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) err = e.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run("lifecycle", func(t *testing.T) { - firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost())) diff --git a/extension/sigv4authextension/generated_component_test.go b/extension/sigv4authextension/generated_component_test.go index 2f15b785ffdf..d21f1d87dcc7 100644 --- a/extension/sigv4authextension/generated_component_test.go +++ b/extension/sigv4authextension/generated_component_test.go @@ -9,20 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/extension/extensiontest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/extension/extensiontest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -32,16 +22,13 @@ func TestComponentLifecycle(t *testing.T) { sub, err := cm.Sub("tests::config") require.NoError(t, err) require.NoError(t, component.UnmarshalConfig(sub, cfg)) - t.Run("shutdown", func(t *testing.T) { e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) err = e.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run("lifecycle", func(t *testing.T) { - firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost())) diff --git a/extension/sigv4authextension/go.mod b/extension/sigv4authextension/go.mod index c9ab79834c16..c9e2a26e46c5 100644 --- a/extension/sigv4authextension/go.mod +++ b/extension/sigv4authextension/go.mod @@ -3,10 +3,10 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/extension/sigv4 go 1.21 require ( - github.com/aws/aws-sdk-go-v2 v1.25.0 - github.com/aws/aws-sdk-go-v2/config v1.27.0 - github.com/aws/aws-sdk-go-v2/credentials v1.17.0 - github.com/aws/aws-sdk-go-v2/service/sts v1.27.0 + github.com/aws/aws-sdk-go-v2 v1.25.2 + github.com/aws/aws-sdk-go-v2/config v1.27.4 + github.com/aws/aws-sdk-go-v2/credentials v1.17.4 + github.com/aws/aws-sdk-go-v2/service/sts v1.28.1 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.95.0 go.opentelemetry.io/collector/confmap v0.95.0 @@ -14,20 +14,20 @@ require ( go.opentelemetry.io/collector/extension/auth v0.95.0 go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 google.golang.org/grpc v1.61.0 ) require ( - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.0 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.0 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.0 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.2 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.2 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.2 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.0 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.0 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.19.0 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.22.0 // indirect - github.com/aws/smithy-go v1.20.0 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.1 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.2 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.20.1 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.1 // indirect + github.com/aws/smithy-go v1.20.1 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect diff --git a/extension/sigv4authextension/go.sum b/extension/sigv4authextension/go.sum index 649fec22d694..f99439f56df8 100644 --- a/extension/sigv4authextension/go.sum +++ b/extension/sigv4authextension/go.sum @@ -1,29 +1,29 @@ -github.com/aws/aws-sdk-go-v2 v1.25.0 h1:sv7+1JVJxOu/dD/sz/csHX7jFqmP001TIY7aytBWDSQ= -github.com/aws/aws-sdk-go-v2 v1.25.0/go.mod h1:G104G1Aho5WqF+SR3mDIobTABQzpYV0WxMsKxlMggOA= -github.com/aws/aws-sdk-go-v2/config v1.27.0 h1:J5sdGCAHuWKIXLeXiqr8II/adSvetkx0qdZwdbXXpb0= -github.com/aws/aws-sdk-go-v2/config v1.27.0/go.mod h1:cfh8v69nuSUohNFMbIISP2fhmblGmYEOKs5V53HiHnk= -github.com/aws/aws-sdk-go-v2/credentials v1.17.0 h1:lMW2x6sKBsiAJrpi1doOXqWFyEPoE886DTb1X0wb7So= -github.com/aws/aws-sdk-go-v2/credentials v1.17.0/go.mod h1:uT41FIH8cCIxOdUYIL0PYyHlL1NoneDuDSCwg5VE/5o= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.0 h1:xWCwjjvVz2ojYTP4kBKUuUh9ZrXfcAXpflhOUUeXg1k= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.0/go.mod h1:j3fACuqXg4oMTQOR2yY7m0NmJY0yBK4L4sLsRXq1Ins= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.0 h1:NPs/EqVO+ajwOoq56EfcGKa3L3ruWuazkIw1BqxwOPw= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.0/go.mod h1:D+duLy2ylgatV+yTlQ8JTuLfDD0BnFvnQRc+o6tbZ4M= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.0 h1:ks7KGMVUMoDzcxNWUlEdI+/lokMFD136EL6DWmUOV80= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.0/go.mod h1:hL6BWM/d/qz113fVitZjbXR0E+RCTU1+x+1Idyn5NgE= +github.com/aws/aws-sdk-go-v2 v1.25.2 h1:/uiG1avJRgLGiQM9X3qJM8+Qa6KRGK5rRPuXE0HUM+w= +github.com/aws/aws-sdk-go-v2 v1.25.2/go.mod h1:Evoc5AsmtveRt1komDwIsjHFyrP5tDuF1D1U+6z6pNo= +github.com/aws/aws-sdk-go-v2/config v1.27.4 h1:AhfWb5ZwimdsYTgP7Od8E9L1u4sKmDW2ZVeLcf2O42M= +github.com/aws/aws-sdk-go-v2/config v1.27.4/go.mod h1:zq2FFXK3A416kiukwpsd+rD4ny6JC7QSkp4QdN1Mp2g= +github.com/aws/aws-sdk-go-v2/credentials v1.17.4 h1:h5Vztbd8qLppiPwX+y0Q6WiwMZgpd9keKe2EAENgAuI= +github.com/aws/aws-sdk-go-v2/credentials v1.17.4/go.mod h1:+30tpwrkOgvkJL1rUZuRLoxcJwtI/OkeBLYnHxJtVe0= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.2 h1:AK0J8iYBFeUk2Ax7O8YpLtFsfhdOByh2QIkHmigpRYk= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.2/go.mod h1:iRlGzMix0SExQEviAyptRWRGdYNo3+ufW/lCzvKVTUc= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.2 h1:bNo4LagzUKbjdxE0tIcR9pMzLR2U/Tgie1Hq1HQ3iH8= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.2/go.mod h1:wRQv0nN6v9wDXuWThpovGQjqF1HFdcgWjporw14lS8k= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.2 h1:EtOU5jsPdIQNP+6Q2C5e3d65NKT1PeCiQk+9OdzO12Q= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.2/go.mod h1:tyF5sKccmDz0Bv4NrstEr+/9YkSPJHrcO7UsUKf7pWM= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 h1:hT8rVHwugYE2lEfdFE0QWVo81lF7jMrYJVDWI+f+VxU= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0/go.mod h1:8tu/lYfQfFe6IGnaOdrpVgEL2IrrDOf6/m9RQum4NkY= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.0 h1:a33HuFlO0KsveiP90IUJh8Xr/cx9US2PqkSroaLc+o8= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.0/go.mod h1:SxIkWpByiGbhbHYTo9CMTUnx2G4p4ZQMrDPcRRy//1c= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.0 h1:SHN/umDLTmFTmYfI+gkanz6da3vK8Kvj/5wkqnTHbuA= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.0/go.mod h1:l8gPU5RYGOFHJqWEpPMoRTP0VoaWQSkJdKo+hwWnnDA= -github.com/aws/aws-sdk-go-v2/service/sso v1.19.0 h1:u6OkVDxtBPnxPkZ9/63ynEe+8kHbtS5IfaC4PzVxzWM= -github.com/aws/aws-sdk-go-v2/service/sso v1.19.0/go.mod h1:YqbU3RS/pkDVu+v+Nwxvn0i1WB0HkNWEePWbmODEbbs= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.22.0 h1:6DL0qu5+315wbsAEEmzK+P9leRwNbkp+lGjPC+CEvb8= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.22.0/go.mod h1:olUAyg+FaoFaL/zFaeQQONjOZ9HXoxgvI/c7mQTYz7M= -github.com/aws/aws-sdk-go-v2/service/sts v1.27.0 h1:cjTRjh700H36MQ8M0LnDn33W3JmwC77mdxIIyPWCdpM= -github.com/aws/aws-sdk-go-v2/service/sts v1.27.0/go.mod h1:nXfOBMWPokIbOY+Gi7a1psWMSvskUCemZzI+SMB7Akc= -github.com/aws/smithy-go v1.20.0 h1:6+kZsCXZwKxZS9RfISnPc4EXlHoyAkm2hPuM8X2BrrQ= -github.com/aws/smithy-go v1.20.0/go.mod h1:uo5RKksAl4PzhqaAbjd4rLgFoq5koTsQKYuGe7dklGc= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.1 h1:EyBZibRTVAs6ECHZOw5/wlylS9OcTzwyjeQMudmREjE= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.1/go.mod h1:JKpmtYhhPs7D97NL/ltqz7yCkERFW5dOlHyVl66ZYF8= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.2 h1:5ffmXjPtwRExp1zc7gENLgCPyHFbhEPwVTkTiH9niSk= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.2/go.mod h1:Ru7vg1iQ7cR4i7SZ/JTLYN9kaXtbL69UdgG0OQWQxW0= +github.com/aws/aws-sdk-go-v2/service/sso v1.20.1 h1:utEGkfdQ4L6YW/ietH7111ZYglLJvS+sLriHJ1NBJEQ= +github.com/aws/aws-sdk-go-v2/service/sso v1.20.1/go.mod h1:RsYqzYr2F2oPDdpy+PdhephuZxTfjHQe7SOBcZGoAU8= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.1 h1:9/GylMS45hGGFCcMrUZDVayQE1jYSIN6da9jo7RAYIw= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.1/go.mod h1:YjAPFn4kGFqKC54VsHs5fn5B6d+PCY2tziEa3U/GB5Y= +github.com/aws/aws-sdk-go-v2/service/sts v1.28.1 h1:3I2cBEYgKhrWlwyZgfpSO2BpaMY1LHPqXYk/QGlu2ew= +github.com/aws/aws-sdk-go-v2/service/sts v1.28.1/go.mod h1:uQ7YYKZt3adCRrdCBREm1CD3efFLOUNH77MrUCvx5oA= +github.com/aws/smithy-go v1.20.1 h1:4SZlSlMr36UEqC7XOyRVb27XMeZubNcBNN+9IgEPIQw= +github.com/aws/smithy-go v1.20.1/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= @@ -107,8 +107,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/extension/solarwindsapmsettingsextension/generated_component_test.go b/extension/solarwindsapmsettingsextension/generated_component_test.go new file mode 100644 index 000000000000..afbaecbe570d --- /dev/null +++ b/extension/solarwindsapmsettingsextension/generated_component_test.go @@ -0,0 +1,42 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package solarwindsapmsettingsextension + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/extension/extensiontest" +) + +func TestComponentLifecycle(t *testing.T) { + factory := NewFactory() + + cm, err := confmaptest.LoadConf("metadata.yaml") + require.NoError(t, err) + cfg := factory.CreateDefaultConfig() + sub, err := cm.Sub("tests::config") + require.NoError(t, err) + require.NoError(t, component.UnmarshalConfig(sub, cfg)) + t.Run("shutdown", func(t *testing.T) { + e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + err = e.Shutdown(context.Background()) + require.NoError(t, err) + }) + t.Run("lifecycle", func(t *testing.T) { + firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost())) + require.NoError(t, firstExt.Shutdown(context.Background())) + + secondExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + require.NoError(t, secondExt.Start(context.Background(), componenttest.NewNopHost())) + require.NoError(t, secondExt.Shutdown(context.Background())) + }) +} diff --git a/extension/solarwindsapmsettingsextension/go.mod b/extension/solarwindsapmsettingsextension/go.mod index 0f4802b197c8..a98e16fab4ba 100644 --- a/extension/solarwindsapmsettingsextension/go.mod +++ b/extension/solarwindsapmsettingsextension/go.mod @@ -5,10 +5,11 @@ go 1.21 require ( github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.95.0 + go.opentelemetry.io/collector/confmap v0.95.0 go.opentelemetry.io/collector/extension v0.95.0 go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( @@ -32,7 +33,6 @@ require ( github.com/prometheus/common v0.46.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.95.0 // indirect - go.opentelemetry.io/collector/confmap v0.95.0 // indirect go.opentelemetry.io/collector/pdata v1.2.0 // indirect go.opentelemetry.io/otel v1.23.1 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.45.2 // indirect diff --git a/extension/solarwindsapmsettingsextension/go.sum b/extension/solarwindsapmsettingsextension/go.sum index 7bed9bf94ee1..734e656eb2b9 100644 --- a/extension/solarwindsapmsettingsextension/go.sum +++ b/extension/solarwindsapmsettingsextension/go.sum @@ -79,8 +79,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/extension/storage/dbstorage/generated_component_test.go b/extension/storage/dbstorage/generated_component_test.go new file mode 100644 index 000000000000..65e7b5632143 --- /dev/null +++ b/extension/storage/dbstorage/generated_component_test.go @@ -0,0 +1,30 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package dbstorage + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/extension/extensiontest" +) + +func TestComponentLifecycle(t *testing.T) { + factory := NewFactory() + + cm, err := confmaptest.LoadConf("metadata.yaml") + require.NoError(t, err) + cfg := factory.CreateDefaultConfig() + sub, err := cm.Sub("tests::config") + require.NoError(t, err) + require.NoError(t, component.UnmarshalConfig(sub, cfg)) + t.Run("shutdown", func(t *testing.T) { + e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + err = e.Shutdown(context.Background()) + require.NoError(t, err) + }) +} diff --git a/extension/storage/dbstorage/go.mod b/extension/storage/dbstorage/go.mod index f45a282a6cc6..9427457893e6 100644 --- a/extension/storage/dbstorage/go.mod +++ b/extension/storage/dbstorage/go.mod @@ -2,18 +2,17 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/extension/stora go 1.21 -toolchain go1.21.6 - require ( github.com/jackc/pgx/v4 v4.18.1 github.com/mattn/go-sqlite3 v1.14.22 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.95.0 + go.opentelemetry.io/collector/confmap v0.95.0 go.opentelemetry.io/collector/extension v0.95.0 go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( @@ -45,7 +44,6 @@ require ( github.com/prometheus/common v0.46.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.95.0 // indirect - go.opentelemetry.io/collector/confmap v0.95.0 // indirect go.opentelemetry.io/collector/pdata v1.2.0 // indirect go.opentelemetry.io/otel v1.23.1 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.45.2 // indirect diff --git a/extension/storage/dbstorage/go.sum b/extension/storage/dbstorage/go.sum index d83290bd8698..dee57d4e8bef 100644 --- a/extension/storage/dbstorage/go.sum +++ b/extension/storage/dbstorage/go.sum @@ -199,8 +199,8 @@ go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9E go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= diff --git a/extension/storage/dbstorage/metadata.yaml b/extension/storage/dbstorage/metadata.yaml index 3142ebba4c29..7f714b17c6eb 100644 --- a/extension/storage/dbstorage/metadata.yaml +++ b/extension/storage/dbstorage/metadata.yaml @@ -7,3 +7,7 @@ status: distributions: [contrib, sumo] codeowners: active: [dmitryax, atoulme] + +# TODO: Update the extension to make the tests pass +tests: + skip_lifecycle: true diff --git a/extension/storage/filestorage/generated_component_test.go b/extension/storage/filestorage/generated_component_test.go new file mode 100644 index 000000000000..de532e008c6b --- /dev/null +++ b/extension/storage/filestorage/generated_component_test.go @@ -0,0 +1,42 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package filestorage + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/extension/extensiontest" +) + +func TestComponentLifecycle(t *testing.T) { + factory := NewFactory() + + cm, err := confmaptest.LoadConf("metadata.yaml") + require.NoError(t, err) + cfg := factory.CreateDefaultConfig() + sub, err := cm.Sub("tests::config") + require.NoError(t, err) + require.NoError(t, component.UnmarshalConfig(sub, cfg)) + t.Run("shutdown", func(t *testing.T) { + e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + err = e.Shutdown(context.Background()) + require.NoError(t, err) + }) + t.Run("lifecycle", func(t *testing.T) { + firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost())) + require.NoError(t, firstExt.Shutdown(context.Background())) + + secondExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + require.NoError(t, secondExt.Start(context.Background(), componenttest.NewNopHost())) + require.NoError(t, secondExt.Shutdown(context.Background())) + }) +} diff --git a/extension/storage/filestorage/go.mod b/extension/storage/filestorage/go.mod index 72782561595a..74ba96f3c8eb 100644 --- a/extension/storage/filestorage/go.mod +++ b/extension/storage/filestorage/go.mod @@ -2,11 +2,9 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/extension/stora go 1.21 -toolchain go1.21.6 - require ( github.com/stretchr/testify v1.8.4 - go.etcd.io/bbolt v1.3.8 + go.etcd.io/bbolt v1.3.9 go.opentelemetry.io/collector/component v0.95.0 go.opentelemetry.io/collector/confmap v0.95.0 go.opentelemetry.io/collector/extension v0.95.0 @@ -14,7 +12,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect diff --git a/extension/storage/filestorage/go.sum b/extension/storage/filestorage/go.sum index b75fdfbabfb8..2c8a52cbc094 100644 --- a/extension/storage/filestorage/go.sum +++ b/extension/storage/filestorage/go.sum @@ -55,8 +55,8 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.etcd.io/bbolt v1.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA= -go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= +go.etcd.io/bbolt v1.3.9 h1:8x7aARPEXiXbHmtUwAIv7eV2fQFHrLLavdiJ3uzJXoI= +go.etcd.io/bbolt v1.3.9/go.mod h1:zaO32+Ti0PK1ivdPtgMESzuzL2VPoIG1PCQNvOdo/dE= go.opentelemetry.io/collector/component v0.95.0 h1:68tI7KVy1bfpaR83+LxUvjd9/hjDh78utklGl2t6eVM= go.opentelemetry.io/collector/component v0.95.0/go.mod h1:SMt7r9zm0OOEKJF/ZUy8agD92OAXq2Xhq1FaTcfIWHw= go.opentelemetry.io/collector/config/configtelemetry v0.95.0 h1:HabJZqbOAbNQ52L3v6usXoGXg1UKA1Ofs4Ytp5sGXEo= @@ -85,8 +85,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= @@ -101,6 +101,8 @@ golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= 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/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= +golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= diff --git a/extension/sumologicextension/README.md b/extension/sumologicextension/README.md index a930b227280b..225437747609 100644 --- a/extension/sumologicextension/README.md +++ b/extension/sumologicextension/README.md @@ -76,6 +76,7 @@ and can be used as an authenticator for the - `initial_interval` - initial interval of backoff (default: `500ms`) - `max_interval` - maximum interval of backoff (default: `1m`) - `max_elapsed_time` - time after which registration fails definitely (default: `15m`) + - `sticky_session_enabled` - enable sticky session support (default: `false`) [credentials_help]: https://help.sumologic.com/docs/manage/security/installation-tokens [fields_help]: https://help.sumologic.com/docs/manage/fields diff --git a/extension/sumologicextension/api/error.go b/extension/sumologicextension/api/error.go new file mode 100644 index 000000000000..ae420b6a485c --- /dev/null +++ b/extension/sumologicextension/api/error.go @@ -0,0 +1,14 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package api // import "github.com/open-telemetry/opentelemetry-collector-contrib/extension/sumologicextension/api" + +type ErrorResponsePayload struct { + ID string `json:"id"` + Errors []Error `json:"errors"` +} + +type Error struct { + Code string `json:"code"` + Message string `json:"message"` +} diff --git a/extension/sumologicextension/api/metadata.go b/extension/sumologicextension/api/metadata.go new file mode 100644 index 000000000000..87a16596c439 --- /dev/null +++ b/extension/sumologicextension/api/metadata.go @@ -0,0 +1,26 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package api // import "github.com/open-telemetry/opentelemetry-collector-contrib/extension/sumologicextension/api" + +type OpenMetadataHostDetails struct { + Name string `json:"name"` + OsName string `json:"osName"` + OsVersion string `json:"osVersion"` + Environment string `json:"environment"` +} + +type OpenMetadataCollectorDetails struct { + RunningVersion string `json:"runningVersion"` +} + +type OpenMetadataNetworkDetails struct { + HostIPAddress string `json:"hostIpAddress"` +} + +type OpenMetadataRequestPayload struct { + HostDetails OpenMetadataHostDetails `json:"hostDetails"` + CollectorDetails OpenMetadataCollectorDetails `json:"collectorDetails"` + NetworkDetails OpenMetadataNetworkDetails `json:"networkDetails"` + TagDetails map[string]any `json:"tagDetails"` +} diff --git a/extension/sumologicextension/api/register.go b/extension/sumologicextension/api/register.go new file mode 100644 index 000000000000..005df63520d7 --- /dev/null +++ b/extension/sumologicextension/api/register.go @@ -0,0 +1,22 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package api // import "github.com/open-telemetry/opentelemetry-collector-contrib/extension/sumologicextension/api" + +type OpenRegisterRequestPayload struct { + CollectorName string `json:"collectorName"` + Ephemeral bool `json:"ephemeral,omitempty"` + Description string `json:"description,omitempty"` + Hostname string `json:"hostname,omitempty"` + Category string `json:"category,omitempty"` + TimeZone string `json:"timeZone,omitempty"` + Clobber bool `json:"clobber,omitempty"` + Fields map[string]any `json:"fields,omitempty"` +} + +type OpenRegisterResponsePayload struct { + CollectorCredentialID string `json:"collectorCredentialID"` + CollectorCredentialKey string `json:"collectorCredentialKey"` + CollectorID string `json:"collectorId"` + CollectorName string `json:"collectorName"` +} diff --git a/extension/sumologicextension/config.go b/extension/sumologicextension/config.go index 5960302859f9..e1b231e2b971 100644 --- a/extension/sumologicextension/config.go +++ b/extension/sumologicextension/config.go @@ -80,6 +80,10 @@ type Config struct { // Exponential algorithm is being used. // Please see following link for details: https://github.com/cenkalti/backoff BackOff backOffConfig `mapstructure:"backoff"` + + // StickySessionEnabled defines if sticky session support is enable. + // By default this is false. + StickySessionEnabled bool `mapstructure:"sticky_session_enabled"` } type accessCredentials struct { diff --git a/extension/sumologicextension/credentials/credentialsstore_localfs.go b/extension/sumologicextension/credentials/credentialsstore_localfs.go new file mode 100644 index 000000000000..4d6283681582 --- /dev/null +++ b/extension/sumologicextension/credentials/credentialsstore_localfs.go @@ -0,0 +1,257 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package credentials // import "github.com/open-telemetry/opentelemetry-collector-contrib/extension/sumologicextension/credentials" + +import ( + "encoding/json" + "fmt" + "io" + "os" + "path" + + "go.uber.org/zap" +) + +const ( + DefaultCollectorDataDirectory = ".sumologic-otel-collector/" +) + +func GetDefaultCollectorCredentialsDirectory() (string, error) { + home, err := os.UserHomeDir() + if err != nil { + return "", err + } + + return path.Join(home, DefaultCollectorDataDirectory), nil +} + +// LocalFsStore implements Store interface and can be used to store and retrieve +// collector credentials from local file system. +// +// Files are stored locally in collectorCredentialsDirectory. +type LocalFsStore struct { + collectorCredentialsDirectory string + logger *zap.Logger +} + +type LocalFsStoreOpt func(*LocalFsStore) + +func WithLogger(l *zap.Logger) LocalFsStoreOpt { + return func(s *LocalFsStore) { + s.logger = l + } +} + +func WithCredentialsDirectory(dir string) LocalFsStoreOpt { + return func(s *LocalFsStore) { + s.collectorCredentialsDirectory = dir + } +} + +func NewLocalFsStore(opts ...LocalFsStoreOpt) (Store, error) { + defaultDir, err := GetDefaultCollectorCredentialsDirectory() + if err != nil { + return nil, err + } + + logger, err := zap.NewDevelopment() + if err != nil { + return nil, err + } + + store := LocalFsStore{ + collectorCredentialsDirectory: defaultDir, + logger: logger, + } + for _, opt := range opts { + opt(&store) + } + + return store, err +} + +// Check checks if collector credentials can be found under a name being a hash +// of provided key inside collectorCredentialsDirectory. +func (cr LocalFsStore) Check(key string) bool { + f := func(_ Hasher, key string) bool { + filenameHash, err := HashKeyToFilename(key) + if err != nil { + return false + } + path := path.Join(cr.collectorCredentialsDirectory, filenameHash) + if _, err := os.Stat(path); err != nil { + return false + } + return true + } + + return f(_getHasher(), key) +} + +// Get retrieves collector credentials stored in local file system and then +// decrypts it using a hash of provided key. +func (cr LocalFsStore) Get(key string) (CollectorCredentials, error) { + f := func(_ Hasher, key string) (CollectorCredentials, error) { + filenameHash, err := HashKeyToFilename(key) + if err != nil { + return CollectorCredentials{}, err + } + + path := path.Join(cr.collectorCredentialsDirectory, filenameHash) + creds, err := os.Open(path) + if err != nil { + return CollectorCredentials{}, err + } + defer creds.Close() + + encryptedCreds, err := io.ReadAll(creds) + if err != nil { + return CollectorCredentials{}, err + } + + encKey, err := HashKeyToEncryptionKey(key) + if err != nil { + return CollectorCredentials{}, err + } + + collectorCreds, err := decrypt(encryptedCreds, encKey) + if err != nil { + return CollectorCredentials{}, err + } + + var credentialsInfo CollectorCredentials + if err = json.Unmarshal(collectorCreds, &credentialsInfo); err != nil { + return CollectorCredentials{}, err + } + + cr.logger.Info("Collector registration credentials retrieved from local fs", + zap.String("path", path), + ) + + return credentialsInfo, nil + } + + creds, err := f(_getHasher(), key) + + if err != nil { + return CollectorCredentials{}, err + } + + return creds, nil +} + +// Store stores collector credentials in a file in directory as specified +// in CollectorCredentialsDirectory. +// The credentials are encrypted using the provided key. +func (cr LocalFsStore) Store(key string, creds CollectorCredentials) error { + if err := ensureDir(cr.collectorCredentialsDirectory); err != nil { + return err + } + + f := func(_ Hasher, key string, creds CollectorCredentials) error { + filenameHash, err := HashKeyToFilename(key) + if err != nil { + return err + } + path := path.Join(cr.collectorCredentialsDirectory, filenameHash) + collectorCreds, err := json.Marshal(creds) + if err != nil { + return fmt.Errorf("failed marshaling collector credentials: %w", err) + } + + encKey, err := HashKeyToEncryptionKey(key) + if err != nil { + return err + } + + encryptedCreds, err := encrypt(collectorCreds, encKey) + if err != nil { + return err + } + + if err = os.WriteFile(path, encryptedCreds, 0600); err != nil { + return fmt.Errorf("failed to save credentials file '%s': %w", + path, err, + ) + } + + cr.logger.Info("Collector registration credentials stored locally", + zap.String("path", path), + ) + + return nil + } + + err := f(_getHasher(), key, creds) + if err != nil { + return err + } + + return nil +} + +func (cr LocalFsStore) Delete(key string) error { + f := func(hasher Hasher, key string) error { + filenameHash, err := HashKeyToFilenameWith(hasher, key) + if err != nil { + return err + } + + path := path.Join(cr.collectorCredentialsDirectory, filenameHash) + + if _, err := os.Stat(path); err != nil { + return nil + } + if err := os.Remove(path); err != nil { + return fmt.Errorf("failed to remove credentials file '%s': %w", + path, err, + ) + } + + cr.logger.Debug("Collector registration credentials removed", + zap.String("path", path), + ) + + return nil + } + + err := f(_getHasher(), key) + if err != nil { + return err + } + + return nil +} + +// Validate checks if the store is operating correctly +// This mostly means file permissions and the like +func (cr LocalFsStore) Validate() error { + if err := ensureDir(cr.collectorCredentialsDirectory); err != nil { + return err + } + + return nil +} + +// ensureDir checks if the specified directory exists and has the right permissions +// if it doesn't then it tries to create it. +func ensureDir(path string) error { + fi, err := os.Stat(path) + if err != nil { + if err := os.Mkdir(path, 0700); err != nil { + return err + } + return nil + } + + // If the directory doesn't have the execution bit then + // set it so that we can 'exec' into it. + if fi.Mode().Perm() != 0700 { + if err := os.Chmod(path, 0700); err != nil { + return err + } + } + + return nil +} diff --git a/extension/sumologicextension/credentials/credentialsstore_localfs_test.go b/extension/sumologicextension/credentials/credentialsstore_localfs_test.go new file mode 100644 index 000000000000..e98721710928 --- /dev/null +++ b/extension/sumologicextension/credentials/credentialsstore_localfs_test.go @@ -0,0 +1,87 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package credentials + +import ( + "io/fs" + "os" + "path/filepath" + "runtime" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "go.uber.org/zap" + + "github.com/open-telemetry/opentelemetry-collector-contrib/extension/sumologicextension/api" +) + +func TestCredentialsStoreLocalFs(t *testing.T) { + dir, err := os.MkdirTemp("", "otelcol-sumo-credentials-store-local-fs-test-*") + require.NoError(t, err) + t.Cleanup(func() { + os.RemoveAll(dir) + }) + + const key = "my_storage_key" + + creds := CollectorCredentials{ + CollectorName: "name", + Credentials: api.OpenRegisterResponsePayload{ + CollectorCredentialID: "credentialId", + CollectorCredentialKey: "credentialKey", + CollectorID: "id", + }, + } + + sut := LocalFsStore{ + collectorCredentialsDirectory: dir, + logger: zap.NewNop(), + } + + require.NoError(t, sut.Store(key, creds)) + + require.True(t, sut.Check(key)) + + actual, err := sut.Get(key) + require.NoError(t, err) + assert.Equal(t, creds, actual) + + require.NoError(t, sut.Delete(key)) + // Make sure the file got deleted and there is nothing in the credentials store dir. + var fileCounter int + require.NoError(t, + filepath.WalkDir(dir, + func(path string, d fs.DirEntry, err error) error { + if d.IsDir() { + return nil + } + fileCounter++ + return nil + }, + ), + ) + require.EqualValues(t, fileCounter, 0) +} + +func TestCredentialsStoreValidate(t *testing.T) { + var expectedFileMode fs.FileMode + dir := filepath.Join(t.TempDir(), "store") + if runtime.GOOS == "windows" { // on Windows, we get 0777 for writable directories + expectedFileMode = fs.FileMode(0777) + } else { + expectedFileMode = fs.FileMode(0700) + } + err := os.Mkdir(dir, 0400) + require.NoError(t, err) + + store, err := NewLocalFsStore(WithCredentialsDirectory(dir), WithLogger(zap.NewNop())) + require.NoError(t, err) + err = store.Validate() + require.NoError(t, err) + + stat, err := os.Stat(dir) + require.NoError(t, err) + require.Equal(t, expectedFileMode.Perm(), stat.Mode().Perm()) +} diff --git a/extension/sumologicextension/credentials/encrypt.go b/extension/sumologicextension/credentials/encrypt.go new file mode 100644 index 000000000000..986e1aa8a094 --- /dev/null +++ b/extension/sumologicextension/credentials/encrypt.go @@ -0,0 +1,124 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package credentials // import "github.com/open-telemetry/opentelemetry-collector-contrib/extension/sumologicextension/credentials" + +import ( + "crypto/aes" + "crypto/cipher" + "crypto/rand" + "crypto/sha256" + "encoding/hex" + "fmt" + "io" +) + +func _getHasher() Hasher { + return sha256.New() +} + +const ( + filenamePrefix = "filename" + encryptionKeyPrefix = "encryption" +) + +type Hasher interface { + Write(p []byte) (n int, err error) + Sum(b []byte) []byte +} + +func hashWith(hasher Hasher, key []byte) (string, error) { + if _, err := hasher.Write(key); err != nil { + return "", err + } + return hex.EncodeToString(hasher.Sum(nil)), nil +} + +// HashKeyToFilename creates a filename using the default hasher and provided key +// as input. It returns this filename and an error. +func HashKeyToFilename(key string) (string, error) { + return HashKeyToFilenameWith(_getHasher(), key) +} + +// HashKeyToFilenameWith creates a filename using the provided key as input and +// using the provided hasher. +func HashKeyToFilenameWith(hasher Hasher, key string) (string, error) { + return hashWith(hasher, []byte(filenamePrefix+key)) +} + +// HashKeyToEncryptionKey creates an encryption key using a default hasher. +// It returns the created key and an error. +func HashKeyToEncryptionKey(key string) ([]byte, error) { + return HashKeyToEncryptionKeyWith(_getHasher(), key) +} + +// HashKeyToEncryptionKeyWith creates a 32 bytes long key from the provided +// key using the provided hasher. +func HashKeyToEncryptionKeyWith(hasher Hasher, key string) ([]byte, error) { + h, err := hashWith(hasher, []byte(encryptionKeyPrefix+key)) + if err != nil { + return nil, err + } + b := []byte(h) + return b[:32], nil +} + +// encrypt encrypts provided byte slice with AES using the encryption key. +func encrypt(data []byte, encryptionKey []byte) ([]byte, error) { + f := func(_ Hasher, data []byte, encryptionKey []byte) ([]byte, error) { + block, err := aes.NewCipher(encryptionKey) + if err != nil { + return nil, err + } + gcm, err := cipher.NewGCM(block) + if err != nil { + return nil, err + } + nonce := make([]byte, gcm.NonceSize()) + if _, err = io.ReadFull(rand.Reader, nonce); err != nil { + return nil, err + } + ciphertext := gcm.Seal(nonce, nonce, data, nil) + return ciphertext, nil + } + + ret, err := f(_getHasher(), data, encryptionKey) + + if err != nil { + return ret, err + } + + return ret, nil +} + +// decrypt decrypts provided byte slice with AES using the encryptionKey. +func decrypt(data []byte, encryptionKey []byte) ([]byte, error) { + f := func(_ Hasher, data []byte, encryptionKey []byte) ([]byte, error) { + block, err := aes.NewCipher(encryptionKey) + if err != nil { + return nil, fmt.Errorf("unable tocreate new aes cipher: %w", err) + } + gcm, err := cipher.NewGCM(block) + if err != nil { + return nil, fmt.Errorf("unable to create new cipher gcm: %w", err) + } + nonceSize := gcm.NonceSize() + if nonceSize > len(data) { + return nil, fmt.Errorf("unable to decrypt credentials") + } + nonce, ciphertext := data[:nonceSize], data[nonceSize:] + plaintext, err := gcm.Open(nil, nonce, ciphertext, nil) + if err != nil { + return nil, fmt.Errorf("unable to decrypt: %w", err) + } + return plaintext, nil + } + + ret, err := f(_getHasher(), data, encryptionKey) + + if err != nil { + return ret, err + } + + return ret, nil +} diff --git a/extension/sumologicextension/credentials/store.go b/extension/sumologicextension/credentials/store.go new file mode 100644 index 000000000000..738cd9a9bb7e --- /dev/null +++ b/extension/sumologicextension/credentials/store.go @@ -0,0 +1,43 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package credentials // import "github.com/open-telemetry/opentelemetry-collector-contrib/extension/sumologicextension/credentials" + +import ( + "github.com/open-telemetry/opentelemetry-collector-contrib/extension/sumologicextension/api" +) + +// CollectorCredentials are used for storing the credentials received during +// collector registration. +type CollectorCredentials struct { + // CollectorName indicates what name was set in the configuration when + // registration has been made. + CollectorName string `json:"collectorName"` + Credentials api.OpenRegisterResponsePayload `json:"collectorCredentials"` + // APIBaseURL saves the destination API base URL which was used for registration. + // This is used for instance when the API redirects the collector to a different + // deployment due to the fact that the installation token being used for registration + // belongs to a different deployment. + // In order to make collector registration work, we save the destination + // API base URL so that when the collector starts up again it can use this + // API base URL for communication with the backend. + APIBaseURL string `json:"apiBaseUrl"` +} + +// Store is an interface to get collector authentication data +type Store interface { + // Check checks if collector credentials exist under the specified key. + Check(key string) bool + + // Get returns the collector credentials stored under a specified key. + Get(key string) (CollectorCredentials, error) + + // Store stores the provided collector credentials stored under a specified key. + Store(key string, creds CollectorCredentials) error + + // Delete deletes collector credentials stored under the specified key. + Delete(key string) error + + // Validate checks if the store is operating correctly + Validate() error +} diff --git a/extension/sumologicextension/extension.go b/extension/sumologicextension/extension.go index b3774da85d2d..a8947f7ec9e0 100644 --- a/extension/sumologicextension/extension.go +++ b/extension/sumologicextension/extension.go @@ -4,30 +4,1047 @@ package sumologicextension // import "github.com/open-telemetry/opentelemetry-collector-contrib/extension/sumologicextension" import ( + "bytes" "context" + "encoding/base64" + "encoding/json" + "errors" + "fmt" + "io" + "net" + "net/http" + "net/url" + "os" + "strings" + "sync" "time" + "github.com/Showmax/go-fqdn" + "github.com/cenkalti/backoff/v4" + ps "github.com/mitchellh/go-ps" + "github.com/shirou/gopsutil/v3/host" "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/config/confighttp" + "go.opentelemetry.io/collector/extension/auth" + "go.opentelemetry.io/collector/featuregate" "go.uber.org/zap" + grpccredentials "google.golang.org/grpc/credentials" + + "github.com/open-telemetry/opentelemetry-collector-contrib/extension/sumologicextension/api" + "github.com/open-telemetry/opentelemetry-collector-contrib/extension/sumologicextension/credentials" ) type SumologicExtension struct { + collectorName string + buildVersion string + + // The lock around baseURL is needed because sumologicexporter is using + // it as base URL for API requests and this access has to be coordinated. + baseURLLock sync.RWMutex + baseURL string + + credsNotifyLock sync.Mutex + credsNotifyUpdate chan struct{} + + host component.Host + conf *Config + origLogger *zap.Logger + logger *zap.Logger + credentialsStore credentials.Store + hashKey string + httpClient *http.Client + registrationInfo api.OpenRegisterResponsePayload + updateMetadata bool + + stickySessionCookieLock sync.RWMutex + stickySessionCookie string + + closeChan chan struct{} + closeOnce sync.Once + backOff *backoff.ExponentialBackOff + id component.ID } -const DefaultHeartbeatInterval = 15 * time.Second +const ( + heartbeatURL = "/api/v1/collector/heartbeat" + metadataURL = "/api/v1/otCollectors/metadata" + registerURL = "/api/v1/collector/register" + + collectorIDField = "collector_id" + collectorNameField = "collector_name" + collectorCredentialIDField = "collector_credential_id" + + stickySessionKey = "AWSALB" +) + +const ( + updateCollectorMetadataID = "extension.sumologic.updateCollectorMetadata" + updateCollectorMetadataStage = featuregate.StageAlpha + + DefaultHeartbeatInterval = 15 * time.Second +) + +var updateCollectorMetadataFeatureGate *featuregate.Gate func init() { + updateCollectorMetadataFeatureGate = featuregate.GlobalRegistry().MustRegister( + updateCollectorMetadataID, + updateCollectorMetadataStage, + featuregate.WithRegisterDescription("When enabled, the collector will update its Sumo Logic metadata on startup."), + featuregate.WithRegisterReferenceURL("https://github.com/SumoLogic/sumologic-otel-collector/pull/858"), + ) } -func newSumologicExtension(_ *Config, _ *zap.Logger, _ component.ID, _ string) (*SumologicExtension, error) { - return &SumologicExtension{}, nil +var errGRPCNotSupported = fmt.Errorf("gRPC is not supported by sumologicextension") + +// SumologicExtension implements ClientAuthenticator +var _ auth.Client = (*SumologicExtension)(nil) + +func newSumologicExtension(conf *Config, logger *zap.Logger, id component.ID, buildVersion string) (*SumologicExtension, error) { + if conf.Credentials.InstallationToken == "" { + return nil, errors.New("access credentials not provided: need installation_token") + } + + hostname, err := getHostname(logger) + if err != nil { + return nil, err + } + + credentialsStore, err := credentials.NewLocalFsStore( + credentials.WithCredentialsDirectory(conf.CollectorCredentialsDirectory), + credentials.WithLogger(logger), + ) + if err != nil { + return nil, fmt.Errorf("failed to initialize credentials store: %w", err) + } + + var ( + collectorName string + hashKey = createHashKey(conf) + ) + if conf.CollectorName == "" { + // If collector name is not set by the user, check if the collector was restarted + // and that we can reuse collector name save in credentials store. + if creds, err := credentialsStore.Get(hashKey); err != nil { + // If credentials file is not stored on filesystem generate collector name + collectorName = hostname + } else { + collectorName = creds.CollectorName + } + } else { + collectorName = conf.CollectorName + } + + if conf.HeartBeatInterval <= 0 { + conf.HeartBeatInterval = DefaultHeartbeatInterval + } + + // Prepare ExponentialBackoff + backOff := backoff.NewExponentialBackOff() + backOff.InitialInterval = conf.BackOff.InitialInterval + backOff.MaxElapsedTime = conf.BackOff.MaxElapsedTime + backOff.MaxInterval = conf.BackOff.MaxInterval + + return &SumologicExtension{ + collectorName: collectorName, + buildVersion: buildVersion, + baseURL: strings.TrimSuffix(conf.APIBaseURL, "/"), + credsNotifyUpdate: make(chan struct{}), + conf: conf, + origLogger: logger, + logger: logger, + hashKey: hashKey, + credentialsStore: credentialsStore, + updateMetadata: updateCollectorMetadataFeatureGate.IsEnabled(), + closeChan: make(chan struct{}), + backOff: backOff, + id: id, + }, nil +} + +func createHashKey(conf *Config) string { + return fmt.Sprintf("%s%s%s", + conf.CollectorName, + conf.Credentials.InstallationToken, + strings.TrimSuffix(conf.APIBaseURL, "/"), + ) } -func (se *SumologicExtension) Start(_ context.Context, _ component.Host) error { +func (se *SumologicExtension) Start(ctx context.Context, host component.Host) error { + var err error + se.host = host + + // if force registration is not enabled, verify that the store is correctly configured + if !se.conf.ForceRegistration { + err = se.credentialsStore.Validate() + if err != nil { + return err + } + } + + colCreds, err := se.getCredentials(ctx) + if err != nil { + return err + } + + if err = se.injectCredentials(colCreds); err != nil { + return err + } + + // Add logger fields based on actual collector name and ID. + se.logger = se.origLogger.With( + zap.String(collectorNameField, colCreds.Credentials.CollectorName), + zap.String(collectorIDField, colCreds.Credentials.CollectorID), + ) + + if se.updateMetadata { + err = se.updateMetadataWithBackoff(ctx) + if err != nil { + return err + } + } + + go se.heartbeatLoop() + return nil } // Shutdown is invoked during service shutdown. -func (se *SumologicExtension) Shutdown(_ context.Context) error { +func (se *SumologicExtension) Shutdown(ctx context.Context) error { + se.closeOnce.Do(func() { close(se.closeChan) }) + select { + case <-ctx.Done(): + return ctx.Err() + default: + return nil + } +} + +func (se *SumologicExtension) validateCredentials( + ctx context.Context, + colCreds credentials.CollectorCredentials, +) error { + se.logger.Info("Validating collector credentials...", + zap.String(collectorCredentialIDField, colCreds.Credentials.CollectorCredentialID), + zap.String(collectorIDField, colCreds.Credentials.CollectorID), + ) + + if err := se.injectCredentials(colCreds); err != nil { + return err + } + + se.backOff.Reset() + var err error + + for { + err = se.sendHeartbeatWithHTTPClient(ctx, se.httpClient) + + if errors.Is(err, errUnauthorizedHeartbeat) || err == nil { + return err + } + + nbo := se.backOff.NextBackOff() + var backOffErr *backoff.PermanentError + // Return error if backoff reaches the limit or uncoverable error is spotted + if ok := errors.As(err, &backOffErr); nbo == se.backOff.Stop || ok { + return err + } + + se.logger.Info(fmt.Sprintf("Retrying credentials validation due to error %s", err)) + + t := time.NewTimer(nbo) + defer t.Stop() + + select { + case <-t.C: + case <-ctx.Done(): + return fmt.Errorf("credential validation cancelled: %w", ctx.Err()) + } + } +} + +// injectCredentials injects the collector credentials: +// - into registration info that's stored in the extension and can be used by roundTripper +// - into http client and its transport so that each request is using collector +// credentials as authentication keys +func (se *SumologicExtension) injectCredentials(colCreds credentials.CollectorCredentials) error { + se.credsNotifyLock.Lock() + defer se.credsNotifyLock.Unlock() + + // Set the registration info so that it can be used in RoundTripper. + se.registrationInfo = colCreds.Credentials + + httpClient, err := se.getHTTPClient(se.conf.ClientConfig, colCreds.Credentials) + if err != nil { + return err + } + + se.httpClient = httpClient + + // Let components know that the credentials may have changed. + close(se.credsNotifyUpdate) + se.credsNotifyUpdate = make(chan struct{}) + return nil } + +func (se *SumologicExtension) getHTTPClient( + httpClientSettings confighttp.ClientConfig, + _ api.OpenRegisterResponsePayload, +) (*http.Client, error) { + httpClient, err := httpClientSettings.ToClient( + se.host, + component.TelemetrySettings{}, + ) + if err != nil { + return nil, fmt.Errorf("couldn't create HTTP client: %w", err) + } + + // Set the transport so that all requests from httpClient will contain + // the collector credentials. + httpClient.Transport, err = se.RoundTripper(httpClient.Transport) + if err != nil { + return nil, fmt.Errorf("couldn't create HTTP client transport: %w", err) + } + + return httpClient, nil +} + +// getCredentials retrieves the credentials for the collector. +// It does so by checking the local credentials store and by validating those credentials. +// In case they are invalid or are not available through local credentials store +// then it tries to register the collector using the provided access keys. +func (se *SumologicExtension) getCredentials(ctx context.Context) (credentials.CollectorCredentials, error) { + var ( + colCreds credentials.CollectorCredentials + err error + ) + + if !se.conf.ForceRegistration { + colCreds, err = se.getLocalCredentials(ctx) + if err == nil { + errV := se.validateCredentials(ctx, colCreds) + + if errV == nil { + se.logger.Info("Found stored credentials, skipping registration", + zap.String(collectorNameField, colCreds.Credentials.CollectorName), + ) + return colCreds, nil + } + + // We are unable to confirm if credentials are valid or not as we do not have (clear) response from the API + if !errors.Is(errV, errUnauthorizedHeartbeat) { + return credentials.CollectorCredentials{}, errV + } + + // Credentials might have ended up being invalid or the collector + // might have been removed in Sumo. + // Fall back to removing the credentials and recreating them by registering + // the collector. + if err = se.credentialsStore.Delete(se.hashKey); err != nil { + se.logger.Error( + "Unable to delete old collector credentials", zap.Error(err), + ) + } + + se.logger.Info("Locally stored credentials invalid. Trying to re-register...", + zap.String(collectorNameField, colCreds.Credentials.CollectorName), + zap.String(collectorIDField, colCreds.Credentials.CollectorID), + zap.Error(errV), + ) + } else { + se.logger.Info("Locally stored credentials not found, registering the collector") + } + } + + colCreds, err = se.getCredentialsByRegistering(ctx) + if err != nil { + return credentials.CollectorCredentials{}, err + } + + return colCreds, nil +} + +// getCredentialsByRegistering registers the collector and returns the credentials +// obtained from the API. +func (se *SumologicExtension) getCredentialsByRegistering(ctx context.Context) (credentials.CollectorCredentials, error) { + colCreds, err := se.registerCollectorWithBackoff(ctx, se.collectorName) + if err != nil { + return credentials.CollectorCredentials{}, err + } + if err := se.credentialsStore.Store(se.hashKey, colCreds); err != nil { + se.logger.Error( + "Unable to store collector credentials, they will be used now but won't be re-used on next run", + zap.Error(err), + ) + } + + se.collectorName = colCreds.CollectorName + + return colCreds, nil +} + +// getLocalCredentials returns the credentials retrieved from local credentials +// storage in case they are available there. +func (se *SumologicExtension) getLocalCredentials(_ context.Context) (credentials.CollectorCredentials, error) { + colCreds, err := se.credentialsStore.Get(se.hashKey) + if err != nil { + return credentials.CollectorCredentials{}, + fmt.Errorf("problem finding local collector credentials (hash key: %s): %w", + se.hashKey, err, + ) + } + + se.collectorName = colCreds.CollectorName + if colCreds.APIBaseURL != "" { + se.SetBaseURL(colCreds.APIBaseURL) + } + + return colCreds, nil +} + +// registerCollector registers the collector using registration API and returns +// the obtained collector credentials. +func (se *SumologicExtension) registerCollector(ctx context.Context, collectorName string) (credentials.CollectorCredentials, error) { + u, err := url.Parse(se.BaseURL()) + if err != nil { + return credentials.CollectorCredentials{}, err + } + u.Path = registerURL + + hostname, err := getHostname(se.logger) + if err != nil { + return credentials.CollectorCredentials{}, fmt.Errorf("cannot get hostname: %w", err) + } + + var buff bytes.Buffer + if err = json.NewEncoder(&buff).Encode(api.OpenRegisterRequestPayload{ + CollectorName: collectorName, + Description: se.conf.CollectorDescription, + Category: se.conf.CollectorCategory, + Fields: se.conf.CollectorFields, + Hostname: hostname, + Ephemeral: se.conf.Ephemeral, + Clobber: se.conf.Clobber, + TimeZone: se.conf.TimeZone, + }); err != nil { + return credentials.CollectorCredentials{}, err + } + + req, err := http.NewRequestWithContext(ctx, http.MethodPost, u.String(), &buff) + if err != nil { + return credentials.CollectorCredentials{}, err + } + + addClientCredentials(req, + se.conf.Credentials, + ) + addJSONHeaders(req) + + se.logger.Info("Calling register API", zap.String("URL", u.String())) + + client := *http.DefaultClient + client.CheckRedirect = func(req *http.Request, via []*http.Request) error { + return http.ErrUseLastResponse + } + res, err := client.Do(req) + if err != nil { + se.logger.Warn("Collector registration HTTP request failed", zap.Error(err)) + return credentials.CollectorCredentials{}, fmt.Errorf("failed to register the collector: %w", err) + } + + defer res.Body.Close() + + if res.StatusCode < 200 || res.StatusCode >= 400 { + return se.handleRegistrationError(res) + } else if res.StatusCode == 301 { + // Use the URL from Location header for subsequent requests. + u := strings.TrimSuffix(res.Header.Get("Location"), "/") + se.SetBaseURL(u) + se.logger.Info("Redirected to a different deployment", + zap.String("url", u), + ) + return se.registerCollector(ctx, collectorName) + } + + var resp api.OpenRegisterResponsePayload + if err := json.NewDecoder(res.Body).Decode(&resp); err != nil { + return credentials.CollectorCredentials{}, err + } + + if collectorName != resp.CollectorName { + se.logger.Warn("Collector name already in use, registered modified name", zap.String("registered_name", resp.CollectorName)) + } + + return credentials.CollectorCredentials{ + CollectorName: collectorName, + Credentials: resp, + APIBaseURL: se.BaseURL(), + }, nil +} + +// handleRegistrationError handles the collector registration errors and returns +// appropriate error for backoff handling and logging purposes. +func (se *SumologicExtension) handleRegistrationError(res *http.Response) (credentials.CollectorCredentials, error) { + var errResponse api.ErrorResponsePayload + if err := json.NewDecoder(res.Body).Decode(&errResponse); err != nil { + var buff bytes.Buffer + if _, errCopy := io.Copy(&buff, res.Body); errCopy != nil { + return credentials.CollectorCredentials{}, fmt.Errorf( + "failed to read the collector registration response body, status code: %d, err: %w", + res.StatusCode, errCopy, + ) + } + return credentials.CollectorCredentials{}, fmt.Errorf( + "failed to decode collector registration response body: %s, status code: %d, err: %w", + buff.String(), res.StatusCode, err, + ) + } + + se.logger.Warn("Collector registration failed", + zap.Int("status_code", res.StatusCode), + zap.String("error_id", errResponse.ID), + zap.Any("errors", errResponse.Errors), + ) + + // Return unrecoverable error for 4xx status codes except 429 + if res.StatusCode >= 400 && res.StatusCode < 500 && res.StatusCode != 429 { + return credentials.CollectorCredentials{}, backoff.Permanent(fmt.Errorf( + "failed to register the collector, got HTTP status code: %d", + res.StatusCode, + )) + } + + return credentials.CollectorCredentials{}, fmt.Errorf( + "failed to register the collector, got HTTP status code: %d", res.StatusCode, + ) +} + +// callRegisterWithBackoff calls registration using exponential backoff algorithm +// this loosely base on backoff.Retry function +func (se *SumologicExtension) registerCollectorWithBackoff(ctx context.Context, collectorName string) (credentials.CollectorCredentials, error) { + se.backOff.Reset() + for { + creds, err := se.registerCollector(ctx, collectorName) + if err == nil { + se.logger = se.origLogger.With( + zap.String(collectorNameField, creds.Credentials.CollectorName), + zap.String(collectorIDField, creds.Credentials.CollectorID), + ) + se.logger.Info("Collector registration finished successfully") + + return creds, nil + } + + nbo := se.backOff.NextBackOff() + var backOffErr *backoff.PermanentError + // Return error if backoff reaches the limit or uncoverable error is spotted + if ok := errors.As(err, &backOffErr); nbo == se.backOff.Stop || ok { + return credentials.CollectorCredentials{}, fmt.Errorf("collector registration failed: %w", err) + } + + t := time.NewTimer(nbo) + defer t.Stop() + + select { + case <-t.C: + case <-ctx.Done(): + return credentials.CollectorCredentials{}, fmt.Errorf("collector registration cancelled: %w", ctx.Err()) + } + } +} + +func (se *SumologicExtension) heartbeatLoop() { + if se.registrationInfo.CollectorCredentialID == "" || se.registrationInfo.CollectorCredentialKey == "" { + se.logger.Error("Collector not registered, cannot send heartbeat") + return + } + + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + go func() { + // When the close channel is closed ... + <-se.closeChan + // ... cancel the ongoing heartbeat request. + cancel() + }() + + se.logger.Info("Heartbeat loop initialized. Starting to send hearbeat requests") + timer := time.NewTimer(se.conf.HeartBeatInterval) + for { + select { + case <-se.closeChan: + se.logger.Info("Heartbeat sender turned off") + return + + default: + err := se.sendHeartbeatWithHTTPClient(ctx, se.httpClient) + + if err != nil { + if errors.Is(err, errUnauthorizedHeartbeat) { + se.logger.Warn("Heartbeat request unauthorized, re-registering the collector") + var colCreds credentials.CollectorCredentials + colCreds, err = se.getCredentialsByRegistering(ctx) + if err != nil { + se.logger.Error("Heartbeat error, cannot register the collector", zap.Error(err)) + continue + } + + // Inject newly received credentials into extension's configuration. + if err = se.injectCredentials(colCreds); err != nil { + se.logger.Error("Heartbeat error, cannot inject new collector credentials", zap.Error(err)) + continue + } + + // Overwrite old logger fields with new collector name and ID. + se.logger = se.origLogger.With( + zap.String(collectorNameField, colCreds.Credentials.CollectorName), + zap.String(collectorIDField, colCreds.Credentials.CollectorID), + ) + + } else { + se.logger.Error("Heartbeat error", zap.Error(err)) + } + } else { + se.logger.Debug("Heartbeat sent") + } + + select { + case <-timer.C: + timer.Stop() + timer.Reset(se.conf.HeartBeatInterval) + case <-se.closeChan: + } + + } + } +} + +var errUnauthorizedHeartbeat = errors.New("heartbeat unauthorized") +var errUnauthorizedMetadata = errors.New("metadata update unauthorized") + +type ErrorAPI struct { + status int + body string +} + +func (e ErrorAPI) Error() string { + return fmt.Sprintf("API error (status code: %d): %s", e.status, e.body) +} + +func (se *SumologicExtension) sendHeartbeatWithHTTPClient(ctx context.Context, httpClient *http.Client) error { + u, err := url.Parse(se.BaseURL() + heartbeatURL) + if err != nil { + return fmt.Errorf("unable to parse heartbeat URL %w", err) + } + req, err := http.NewRequestWithContext(ctx, http.MethodPost, u.String(), nil) + if err != nil { + return fmt.Errorf("unable to create HTTP request %w", err) + } + + addJSONHeaders(req) + res, err := httpClient.Do(req) + if err != nil { + return fmt.Errorf("unable to send HTTP request: %w", err) + } + defer res.Body.Close() + + switch res.StatusCode { + default: + var buff bytes.Buffer + + if _, err := io.Copy(&buff, res.Body); err != nil { + return fmt.Errorf( + "failed to copy collector heartbeat response body, status code: %d, err: %w", + res.StatusCode, err, + ) + } + + return fmt.Errorf("collector heartbeat request failed: %w", + ErrorAPI{ + status: res.StatusCode, + body: buff.String(), + }, + ) + + case http.StatusUnauthorized: + return errUnauthorizedHeartbeat + + case http.StatusNoContent: + } + + return nil +} + +func baseURL() (string, error) { + // This doesn't connect, we just need the connection object. + c, err := net.Dial("udp", "255.255.255.255:53") + if err != nil { + return "", err + } + + defer c.Close() + a := c.LocalAddr().(*net.UDPAddr) + h, _, err := net.SplitHostPort(a.String()) + if err != nil { + return "", err + } + + return h, nil +} + +var sumoAppProcesses = map[string]string{ + "apache": "apache", + "apache2": "apache", + "httpd": "apache", + "docker": "docker", + "elasticsearch": "elasticsearch", + "mysql-server": "mysql", + "mysqld": "mysql", + "nginx": "nginx", + "postgresql": "postgres", + "postgresql-9.5": "postgres", + "rabbitmq-server": "rabbitmq", + "redis": "redis", + "tomcat": "tomcat", + "kafka-server-start.sh": "kafka", // Need to test this, most common shell wrapper. +} + +func filteredProcessList() ([]string, error) { + var pl []string + + p, err := ps.Processes() + if err != nil { + return pl, err + } + + for _, v := range p { + e := strings.ToLower(v.Executable()) + if a, i := sumoAppProcesses[e]; i { + pl = append(pl, a) + } + } + + return pl, nil +} + +func discoverTags() (map[string]any, error) { + t := map[string]any{ + "sumo.disco.enabled": "true", + } + + pl, err := filteredProcessList() + if err != nil { + return t, err + } + + for _, v := range pl { + t["sumo.disco."+v] = 1 // Sumo does not allow empty tag values, let's set it to anything. + } + + return t, nil +} + +func (se *SumologicExtension) updateMetadataWithHTTPClient(ctx context.Context, httpClient *http.Client) error { + u, err := url.Parse(se.BaseURL() + metadataURL) + if err != nil { + return fmt.Errorf("unable to parse metadata URL %w", err) + } + + info, err := host.Info() + if err != nil { + return err + } + + hostname, err := getHostname(se.logger) + if err != nil { + return err + } + + ip, err := baseURL() + if err != nil { + return err + } + + td := map[string]any{} + + if se.conf.DiscoverCollectorTags { + td, err = discoverTags() + if err != nil { + return err + } + } + + for k, v := range se.conf.CollectorFields { + td[k] = v + } + + var buff bytes.Buffer + if err = json.NewEncoder(&buff).Encode(api.OpenMetadataRequestPayload{ + HostDetails: api.OpenMetadataHostDetails{ + Name: hostname, + OsName: info.OS, + OsVersion: info.PlatformVersion, + Environment: se.conf.CollectorEnvironment, + }, + CollectorDetails: api.OpenMetadataCollectorDetails{ + RunningVersion: se.buildVersion, + }, + NetworkDetails: api.OpenMetadataNetworkDetails{ + HostIPAddress: ip, + }, + TagDetails: td, + }); err != nil { + return err + } + + req, err := http.NewRequestWithContext(ctx, http.MethodPost, u.String(), &buff) + if err != nil { + return fmt.Errorf("unable to create HTTP request %w", err) + } + + addJSONHeaders(req) + + se.logger.Info("Updating collector metadata", + zap.String("URL", u.String()), + zap.String("body", buff.String())) + + res, err := httpClient.Do(req) + if err != nil { + return fmt.Errorf("unable to send HTTP request: %w", err) + } + defer res.Body.Close() + + switch res.StatusCode { + default: + var buff bytes.Buffer + if _, err := io.Copy(&buff, res.Body); err != nil { + return fmt.Errorf( + "failed to copy collector metadata response body, status code: %d, err: %w", + res.StatusCode, err, + ) + } + + se.logger.Warn("Metadata API error response", + zap.Int("status", res.StatusCode), + zap.String("body", buff.String())) + + return fmt.Errorf("collector metadata request failed: %w", + ErrorAPI{ + status: res.StatusCode, + body: buff.String(), + }, + ) + + case http.StatusUnauthorized: + return errUnauthorizedMetadata + case http.StatusNoContent: + case http.StatusOK: + } + + return nil +} + +func (se *SumologicExtension) updateMetadataWithBackoff(ctx context.Context) error { + se.backOff.Reset() + for { + err := se.updateMetadataWithHTTPClient(ctx, se.httpClient) + if err == nil { + return nil + } + + se.logger.Warn(fmt.Sprintf("collector metadata update failed: %s", err)) + + nbo := se.backOff.NextBackOff() + var backOffErr *backoff.PermanentError + // Return error if backoff reaches the limit or uncoverable error is spotted + if ok := errors.As(err, &backOffErr); nbo == se.backOff.Stop || ok { + return fmt.Errorf("collector metadata update failed: %w", err) + } + + t := time.NewTimer(nbo) + defer t.Stop() + + select { + case <-t.C: + case <-ctx.Done(): + return fmt.Errorf("collector metadata update cancelled: %w", ctx.Err()) + } + } +} + +func (se *SumologicExtension) ComponentID() component.ID { + return se.id +} + +func (se *SumologicExtension) CollectorID() string { + return se.registrationInfo.CollectorID +} + +func (se *SumologicExtension) BaseURL() string { + se.baseURLLock.RLock() + defer se.baseURLLock.RUnlock() + return se.baseURL +} + +func (se *SumologicExtension) SetBaseURL(baseURL string) { + se.baseURLLock.Lock() + se.baseURL = baseURL + se.baseURLLock.Unlock() +} + +func (se *SumologicExtension) StickySessionCookie() string { + se.stickySessionCookieLock.RLock() + defer se.stickySessionCookieLock.RUnlock() + return se.stickySessionCookie +} + +func (se *SumologicExtension) SetStickySessionCookie(stickySessionCookie string) { + se.stickySessionCookieLock.Lock() + se.stickySessionCookie = stickySessionCookie + se.stickySessionCookieLock.Unlock() +} + +// WatchCredentialKey watches for credential key updates. It makes use of a +// channel close (done by injectCredentials) and string comparison with a +// known/previous credential key (old). This function allows components to be +// proactive when dealing with changes to authentication. +func (se *SumologicExtension) WatchCredentialKey(ctx context.Context, old string) string { + se.credsNotifyLock.Lock() + v, ch := se.registrationInfo.CollectorCredentialKey, se.credsNotifyUpdate + se.credsNotifyLock.Unlock() + + for v == old { + select { + case <-ctx.Done(): + return v + case <-ch: + se.credsNotifyLock.Lock() + v, ch = se.registrationInfo.CollectorCredentialKey, se.credsNotifyUpdate + se.credsNotifyLock.Unlock() + } + } + + return v +} + +// CreateCredentialsHeader produces an HTTP header containing authentication +// credentials. This function is for components that do not make use of the +// RoundTripper or have an HTTP request to build upon. +func (se *SumologicExtension) CreateCredentialsHeader() (http.Header, error) { + id, key := se.registrationInfo.CollectorCredentialID, se.registrationInfo.CollectorCredentialKey + + if id == "" || key == "" { + return nil, errors.New("collector credentials are not set") + } + + token := base64.StdEncoding.EncodeToString( + []byte(id + ":" + key), + ) + + header := http.Header{} + header.Set("Authorization", "Basic "+token) + + return header, nil +} + +// Implement [1] in order for this extension to be used as custom exporter +// authenticator. +// +// [1]: https://github.com/open-telemetry/opentelemetry-collector/blob/2e84285efc665798d76773b9901727e8836e9d8f/config/configauth/clientauth.go#L34-L39 +func (se *SumologicExtension) RoundTripper(base http.RoundTripper) (http.RoundTripper, error) { + return roundTripper{ + collectorCredentialID: se.registrationInfo.CollectorCredentialID, + collectorCredentialKey: se.registrationInfo.CollectorCredentialKey, + addStickySessionCookie: se.addStickySessionCookie, + updateStickySessionCookie: se.updateStickySessionCookie, + base: base, + }, nil +} + +func (se *SumologicExtension) PerRPCCredentials() (grpccredentials.PerRPCCredentials, error) { + return nil, errGRPCNotSupported +} + +func (se *SumologicExtension) addStickySessionCookie(req *http.Request) { + if !se.conf.StickySessionEnabled { + return + } + currectCookieValue := se.StickySessionCookie() + if currectCookieValue != "" { + cookie := &http.Cookie{ + Name: stickySessionKey, + Value: currectCookieValue, + } + req.AddCookie(cookie) + } +} + +func (se *SumologicExtension) updateStickySessionCookie(resp *http.Response) { + cookies := resp.Cookies() + if se.conf.StickySessionEnabled && len(cookies) > 0 { + for _, cookie := range cookies { + if cookie.Name == stickySessionKey { + if cookie.Value != se.StickySessionCookie() { + se.SetStickySessionCookie(cookie.Value) + } + return + } + } + } +} + +type roundTripper struct { + collectorCredentialID string + collectorCredentialKey string + addStickySessionCookie func(*http.Request) + updateStickySessionCookie func(*http.Response) + base http.RoundTripper +} + +func (rt roundTripper) RoundTrip(req *http.Request) (*http.Response, error) { + addCollectorCredentials(req, rt.collectorCredentialID, rt.collectorCredentialKey) + rt.addStickySessionCookie(req) + resp, err := rt.base.RoundTrip(req) + if err != nil { + return nil, err + } + rt.updateStickySessionCookie(resp) + return resp, err +} + +func addCollectorCredentials(req *http.Request, collectorCredentialID string, collectorCredentialKey string) { + token := base64.StdEncoding.EncodeToString( + []byte(collectorCredentialID + ":" + collectorCredentialKey), + ) + + // Delete the existing Authorization header so prevent sending both the old one + // and the new one. + req.Header.Del("Authorization") + req.Header.Add("Authorization", "Basic "+token) +} + +func addClientCredentials(req *http.Request, credentials accessCredentials) { + var authHeaderValue string + if credentials.InstallationToken != "" { + authHeaderValue = fmt.Sprintf("Bearer %s", string(credentials.InstallationToken)) + } + + req.Header.Del("Authorization") + req.Header.Add("Authorization", authHeaderValue) +} + +// TODO(ck): hostname allows the darwin tests to bypass fqdn. +var hostname = fqdn.FqdnHostname + +// getHostname returns the host name consistently with the resource detection processor's defaults +// TODO: try to dynamically extract this from the resource processor in the pipeline +func getHostname(logger *zap.Logger) (string, error) { + fqdnHostname, err := hostname() + if err == nil { + return fqdnHostname, nil + } + logger.Debug("failed to get fqdn", zap.Error(err)) + + return os.Hostname() +} diff --git a/extension/sumologicextension/extension_darwin_test.go b/extension/sumologicextension/extension_darwin_test.go new file mode 100644 index 000000000000..d779824199d1 --- /dev/null +++ b/extension/sumologicextension/extension_darwin_test.go @@ -0,0 +1,13 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package sumologicextension // import "github.com/open-telemetry/opentelemetry-collector-contrib/extension/sumologicextension" + +import "os" + +func init() { + // fqdn seems to hang running in github actions on darwin amd64. This + // bypasses it. + // https://github.com/SumoLogic/sumologic-otel-collector/issues/1295 + hostname = os.Hostname +} diff --git a/extension/sumologicextension/extension_test.go b/extension/sumologicextension/extension_test.go new file mode 100644 index 000000000000..96fa759198d4 --- /dev/null +++ b/extension/sumologicextension/extension_test.go @@ -0,0 +1,1573 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package sumologicextension // import "github.com/open-telemetry/opentelemetry-collector-contrib/extension/sumologicextension" + +import ( + "context" + "crypto/sha256" + "encoding/base64" + "encoding/json" + "net/http" + "net/http/httptest" + "os" + "path" + "sync/atomic" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/featuregate" + "go.uber.org/zap" + + "github.com/open-telemetry/opentelemetry-collector-contrib/extension/sumologicextension/api" + "github.com/open-telemetry/opentelemetry-collector-contrib/extension/sumologicextension/credentials" +) + +func TestMain(m *testing.M) { + // Enable the feature gates before all tests to avoid flaky tests. + err := featuregate.GlobalRegistry().Set(updateCollectorMetadataID, true) + + if err != nil { + panic("unable to set feature gates") + } + + code := m.Run() + os.Exit(code) +} + +func TestBasicExtensionConstruction(t *testing.T) { + t.Parallel() + + testcases := []struct { + Name string + Config *Config + WantErr bool + }{ + { + Name: "no_collector_name_causes_error", + Config: createDefaultConfig().(*Config), + WantErr: true, + }, + { + Name: "no_credentials_causes_error", + Config: func() *Config { + cfg := createDefaultConfig().(*Config) + cfg.CollectorName = "collector_name" + return cfg + }(), + WantErr: true, + }, + { + Name: "basic", + Config: func() *Config { + cfg := createDefaultConfig().(*Config) + cfg.CollectorName = "collector_name" + cfg.Credentials.InstallationToken = "install_token_123456" + return cfg + }(), + }, + } + + for _, tc := range testcases { + t.Run(tc.Name, func(t *testing.T) { + se, err := newSumologicExtension(tc.Config, zap.NewNop(), component.NewID("sumologic"), "1.0.0") + if tc.WantErr { + assert.Error(t, err) + } else { + assert.NoError(t, err) + assert.NotNil(t, se) + } + }) + } +} + +func TestBasicStart(t *testing.T) { + t.Parallel() + + srv := httptest.NewServer(func() http.HandlerFunc { + var reqCount int32 + + return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + // TODO Add payload verification - verify if collectorName is set properly + reqNum := atomic.AddInt32(&reqCount, 1) + + switch reqNum { + + // register + case 1: + require.Equal(t, registerURL, req.URL.Path) + _, err := w.Write([]byte(`{ + "collectorCredentialID": "collectorId", + "collectorCredentialKey": "collectorKey", + "collectorId": "id" + }`)) + if err != nil { + w.WriteHeader(http.StatusInternalServerError) + } + + // metadata + case 2: + assert.Equal(t, metadataURL, req.URL.Path) + w.WriteHeader(200) + + // heartbeat + case 3: + assert.Equal(t, heartbeatURL, req.URL.Path) + w.WriteHeader(204) + + // should not produce any more requests + default: + w.WriteHeader(http.StatusInternalServerError) + } + }) + }()) + t.Cleanup(func() { srv.Close() }) + + dir, err := os.MkdirTemp("", "otelcol-sumo-store-credentials-test-*") + require.NoError(t, err) + t.Cleanup(func() { os.RemoveAll(dir) }) + + cfg := createDefaultConfig().(*Config) + cfg.CollectorName = "collector_name" + cfg.APIBaseURL = srv.URL + cfg.Credentials.InstallationToken = "dummy_install_token" + cfg.CollectorCredentialsDirectory = dir + + se, err := newSumologicExtension(cfg, zap.NewNop(), component.NewID("sumologic"), "1.0.0") + require.NoError(t, err) + require.NoError(t, se.Start(context.Background(), componenttest.NewNopHost())) + assert.NotEmpty(t, se.registrationInfo.CollectorCredentialID) + assert.NotEmpty(t, se.registrationInfo.CollectorCredentialKey) + assert.NotEmpty(t, se.registrationInfo.CollectorID) + require.NoError(t, se.Shutdown(context.Background())) +} + +func TestStoreCredentials(t *testing.T) { + t.Parallel() + + getServer := func() *httptest.Server { + var reqCount int32 + + return httptest.NewServer(http.HandlerFunc( + func(w http.ResponseWriter, req *http.Request) { + // TODO Add payload verification - verify if collectorName is set properly + reqNum := atomic.AddInt32(&reqCount, 1) + + switch reqNum { + + // register + case 1: + require.Equal(t, registerURL, req.URL.Path) + _, err := w.Write([]byte(`{ + "collectorCredentialID": "collectorId", + "collectorCredentialKey": "collectorKey", + "collectorId": "id" + }`)) + if err != nil { + w.WriteHeader(http.StatusInternalServerError) + } + + // metadata + case 2: + assert.Equal(t, metadataURL, req.URL.Path) + w.WriteHeader(200) + + // heartbeat + case 3: + assert.Equal(t, heartbeatURL, req.URL.Path) + w.WriteHeader(204) + + // should not produce any more requests + default: + w.WriteHeader(http.StatusInternalServerError) + } + })) + } + + getConfig := func(url string) *Config { + cfg := createDefaultConfig().(*Config) + cfg.CollectorName = "collector_name" + cfg.APIBaseURL = url + cfg.Credentials.InstallationToken = "dummy_install_token" + return cfg + } + + logger, err := zap.NewDevelopment() + require.NoError(t, err) + + t.Run("dir does not exist", func(t *testing.T) { + dir, err := os.MkdirTemp("", "otelcol-sumo-store-credentials-test-*") + require.NoError(t, err) + t.Cleanup(func() { os.RemoveAll(dir) }) + + srv := getServer() + t.Cleanup(func() { srv.Close() }) + + cfg := getConfig(srv.URL) + cfg.CollectorCredentialsDirectory = dir + + // Ensure the directory doesn't exist before running the extension + require.NoError(t, os.RemoveAll(dir)) + + se, err := newSumologicExtension(cfg, logger, component.NewID("sumologic"), "1.0.0") + require.NoError(t, err) + key := createHashKey(cfg) + fileName, err := credentials.HashKeyToFilename(key) + require.NoError(t, err) + credsPath := path.Join(dir, fileName) + require.NoFileExists(t, credsPath) + require.NoError(t, se.Start(context.Background(), componenttest.NewNopHost())) + require.NoError(t, se.Shutdown(context.Background())) + require.FileExists(t, credsPath) + }) + + t.Run("dir exists before launch with 600 permissions", func(t *testing.T) { + dir, err := os.MkdirTemp("", "otelcol-sumo-store-credentials-test-*") + require.NoError(t, err) + t.Cleanup(func() { os.RemoveAll(dir) }) + + srv := getServer() + t.Cleanup(func() { srv.Close() }) + + cfg := getConfig(srv.URL) + cfg.CollectorCredentialsDirectory = dir + + // Ensure the directory has 600 permissions + require.NoError(t, os.Chmod(dir, 0600)) + + se, err := newSumologicExtension(cfg, zap.NewNop(), component.NewID("sumologic"), "1.0.0") + require.NoError(t, err) + key := createHashKey(cfg) + fileName, err := credentials.HashKeyToFilename(key) + require.NoError(t, err) + credsPath := path.Join(dir, fileName) + require.NoFileExists(t, credsPath) + require.NoError(t, se.Start(context.Background(), componenttest.NewNopHost())) + require.NoError(t, se.Shutdown(context.Background())) + require.FileExists(t, credsPath) + }) + + t.Run("ensure dir gets created with 700 permissions", func(t *testing.T) { + dir, err := os.MkdirTemp("", "otelcol-sumo-store-credentials-test-*") + require.NoError(t, err) + t.Cleanup(func() { os.RemoveAll(dir) }) + + srv := getServer() + t.Cleanup(func() { srv.Close() }) + cfg := getConfig(srv.URL) + cfg.CollectorCredentialsDirectory = dir + + // Ensure the directory has 700 permissions + require.NoError(t, os.Chmod(dir, 0700)) + + se, err := newSumologicExtension(cfg, zap.NewNop(), component.NewID("sumologic"), "1.0.0") + require.NoError(t, err) + key := createHashKey(cfg) + fileName, err := credentials.HashKeyToFilename(key) + require.NoError(t, err) + credsPath := path.Join(dir, fileName) + require.NoFileExists(t, credsPath) + require.NoError(t, se.Start(context.Background(), componenttest.NewNopHost())) + require.NoError(t, se.Shutdown(context.Background())) + require.FileExists(t, credsPath) + }) + + t.Run("by default use sha256 for hashing", func(t *testing.T) { + dir, err := os.MkdirTemp("", "otelcol-sumo-store-credentials-test-*") + require.NoError(t, err) + t.Cleanup(func() { os.RemoveAll(dir) }) + + srv := getServer() + t.Cleanup(func() { srv.Close() }) + + cfg := getConfig(srv.URL) + cfg.CollectorCredentialsDirectory = dir + + se, err := newSumologicExtension(cfg, zap.NewNop(), component.NewID("sumologic"), "1.0.0") + require.NoError(t, err) + key := createHashKey(cfg) + fileName, err := credentials.HashKeyToFilename(key) + require.NoError(t, err) + fileNameSha256, err := credentials.HashKeyToFilenameWith(sha256.New(), key) + require.NoError(t, err) + require.Equal(t, fileName, fileNameSha256) + + credsPath := path.Join(dir, fileName) + require.NoFileExists(t, credsPath) + require.NoError(t, se.Start(context.Background(), componenttest.NewNopHost())) + require.NoError(t, se.Shutdown(context.Background())) + require.FileExists(t, credsPath) + }) +} + +func TestStoreCredentials_PreexistingCredentialsAreUsed(t *testing.T) { + t.Parallel() + + var reqCount int32 + getServer := func() *httptest.Server { + return httptest.NewServer(http.HandlerFunc( + func(w http.ResponseWriter, req *http.Request) { + reqNum := atomic.AddInt32(&reqCount, 1) + + switch reqNum { + // heartbeat + case 1: + require.Equal(t, heartbeatURL, req.URL.Path) + w.WriteHeader(204) + + // metadata + case 2: + require.Equal(t, metadataURL, req.URL.Path) + w.WriteHeader(200) + + // should not produce any more requests + default: + w.WriteHeader(http.StatusInternalServerError) + } + })) + } + + getConfig := func(url string) *Config { + cfg := createDefaultConfig().(*Config) + cfg.CollectorName = "collector_name" + cfg.APIBaseURL = url + cfg.Credentials.InstallationToken = "dummy_install_token" + return cfg + } + + logger, err := zap.NewDevelopment() + require.NoError(t, err) + + dir, err := os.MkdirTemp("", "otelcol-sumo-store-credentials-test-*") + require.NoError(t, err) + t.Cleanup(func() { os.RemoveAll(dir) }) + t.Logf("Using dir: %s", dir) + + store, err := credentials.NewLocalFsStore( + credentials.WithCredentialsDirectory(dir), + credentials.WithLogger(logger), + ) + require.NoError(t, err) + + srv := getServer() + t.Cleanup(func() { srv.Close() }) + + cfg := getConfig(srv.URL) + cfg.CollectorCredentialsDirectory = dir + + hashKey := createHashKey(cfg) + + require.NoError(t, + store.Store(hashKey, credentials.CollectorCredentials{ + CollectorName: "collector_name", + Credentials: api.OpenRegisterResponsePayload{ + CollectorCredentialID: "collectorId", + CollectorCredentialKey: "collectorKey", + CollectorID: "id", + }, + }), + ) + + se, err := newSumologicExtension(cfg, logger, component.NewID("sumologic"), "1.0.0") + require.NoError(t, err) + + fileName, err := credentials.HashKeyToFilename(hashKey) + require.NoError(t, err) + credsPath := path.Join(dir, fileName) + // Credentials file exists before starting the extension because we created + // it directly via store.Store() + require.FileExists(t, credsPath) + + require.NoError(t, se.Start(context.Background(), componenttest.NewNopHost())) + require.NoError(t, se.Shutdown(context.Background())) + require.FileExists(t, credsPath) + + require.EqualValues(t, atomic.LoadInt32(&reqCount), 2) +} + +func TestLocalFSCredentialsStore_WorkCorrectlyForMultipleExtensions(t *testing.T) { + t.Parallel() + + getServer := func() *httptest.Server { + var reqCount int32 + + return httptest.NewServer(http.HandlerFunc( + func(w http.ResponseWriter, req *http.Request) { + // TODO Add payload verification - verify if collectorName is set properly + reqNum := atomic.AddInt32(&reqCount, 1) + + switch reqNum { + + // register + case 1: + require.Equal(t, registerURL, req.URL.Path) + _, err := w.Write([]byte(`{ + "collectorCredentialID": "collectorId", + "collectorCredentialKey": "collectorKey", + "collectorId": "id" + }`)) + if err != nil { + w.WriteHeader(http.StatusInternalServerError) + } + + // metadata + case 2: + assert.Equal(t, metadataURL, req.URL.Path) + w.WriteHeader(200) + + // heartbeat + case 3: + assert.Equal(t, heartbeatURL, req.URL.Path) + w.WriteHeader(204) + + // should not produce any more requests + default: + w.WriteHeader(http.StatusInternalServerError) + } + })) + } + + getConfig := func(url string) *Config { + cfg := createDefaultConfig().(*Config) + cfg.CollectorName = "collector_name" + cfg.APIBaseURL = url + cfg.Credentials.InstallationToken = "dummy_install_token" + return cfg + } + + getDir := func(t *testing.T) string { + dir, err := os.MkdirTemp("", "otelcol-sumo-store-credentials-multiple-extensions-test-*") + require.NoError(t, err) + return dir + } + + dir1 := getDir(t) + t.Cleanup(func() { os.RemoveAll(dir1) }) + dir2 := getDir(t) + t.Cleanup(func() { os.RemoveAll(dir2) }) + + srv1 := getServer() + t.Cleanup(func() { srv1.Close() }) + srv2 := getServer() + t.Cleanup(func() { srv2.Close() }) + + cfg1 := getConfig(srv1.URL) + cfg1.CollectorCredentialsDirectory = dir1 + + cfg2 := getConfig(srv2.URL) + cfg2.CollectorCredentialsDirectory = dir2 + + logger1, err := zap.NewDevelopment(zap.Fields(zap.Int("#", 1))) + require.NoError(t, err) + + logger2, err := zap.NewDevelopment(zap.Fields(zap.Int("#", 2))) + require.NoError(t, err) + + se1, err := newSumologicExtension(cfg1, logger1, component.NewID("sumologic"), "1.0.0") + require.NoError(t, err) + t.Cleanup(func() { require.NoError(t, se1.Shutdown(context.Background())) }) + fileName1, err := credentials.HashKeyToFilename(createHashKey(cfg1)) + require.NoError(t, err) + credsPath1 := path.Join(dir1, fileName1) + require.NoFileExists(t, credsPath1) + require.NoError(t, se1.Start(context.Background(), componenttest.NewNopHost())) + require.FileExists(t, credsPath1) + + se2, err := newSumologicExtension(cfg2, logger2, component.NewID("sumologic"), "1.0.0") + require.NoError(t, err) + t.Cleanup(func() { require.NoError(t, se2.Shutdown(context.Background())) }) + fileName2, err := credentials.HashKeyToFilename(createHashKey(cfg2)) + require.NoError(t, err) + credsPath2 := path.Join(dir2, fileName2) + require.NoFileExists(t, credsPath2) + require.NoError(t, se2.Start(context.Background(), componenttest.NewNopHost())) + require.FileExists(t, credsPath2) + + require.NotEqual(t, credsPath1, credsPath2, + "credentials files should be different for configs with different apiBaseURLs", + ) +} + +func TestRegisterEmptyCollectorName(t *testing.T) { + t.Parallel() + + hostname, err := getHostname(zap.NewNop()) + require.NoError(t, err) + srv := httptest.NewServer(func() http.HandlerFunc { + var reqCount int32 + + return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + // TODO Add payload verification - verify if collectorName is set properly + reqNum := atomic.AddInt32(&reqCount, 1) + + switch reqNum { + + // register + case 1: + require.Equal(t, registerURL, req.URL.Path) + + authHeader := req.Header.Get("Authorization") + assert.Equal(t, "Bearer dummy_install_token", authHeader, + "collector didn't send correct Authorization header with registration request") + + _, err = w.Write([]byte(`{ + "collectorCredentialID": "aaaaaaaaaaaaaaaaaaaa", + "collectorCredentialKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "collectorId": "000000000FFFFFFF" + }`)) + if err != nil { + w.WriteHeader(http.StatusInternalServerError) + } + + // metadata + case 2: + assert.Equal(t, metadataURL, req.URL.Path) + w.WriteHeader(200) + + // heartbeat + case 3: + assert.Equal(t, heartbeatURL, req.URL.Path) + w.WriteHeader(204) + + // should not produce any more requests + default: + w.WriteHeader(http.StatusInternalServerError) + } + }) + }()) + + dir, err := os.MkdirTemp("", "otelcol-sumo-store-credentials-test-*") + t.Cleanup(func() { + srv.Close() + os.RemoveAll(dir) + }) + require.NoError(t, err) + + cfg := createDefaultConfig().(*Config) + cfg.CollectorName = "" + cfg.APIBaseURL = srv.URL + cfg.Credentials.InstallationToken = "dummy_install_token" + cfg.CollectorCredentialsDirectory = dir + + se, err := newSumologicExtension(cfg, zap.NewNop(), component.NewID("sumologic"), "1.0.0") + require.NoError(t, err) + require.NoError(t, se.Start(context.Background(), componenttest.NewNopHost())) + require.NoError(t, err) + require.Equal(t, hostname, se.collectorName) +} + +func TestRegisterEmptyCollectorNameForceRegistration(t *testing.T) { + t.Parallel() + + hostname, err := getHostname(zap.NewNop()) + require.NoError(t, err) + srv := httptest.NewServer(func() http.HandlerFunc { + var reqCount int32 + + return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + // TODO Add payload verification - verify if collectorName is set properly + reqNum := atomic.AddInt32(&reqCount, 1) + + switch reqNum { + + // register + case 1: + require.Equal(t, registerURL, req.URL.Path) + + authHeader := req.Header.Get("Authorization") + assert.Equal(t, "Bearer dummy_install_token", authHeader, + "collector didn't send correct Authorization header with registration request") + + _, err = w.Write([]byte(`{ + "collectorCredentialID": "aaaaaaaaaaaaaaaaaaaa", + "collectorCredentialKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "collectorId": "000000000FFFFFFF", + "collectorName": "hostname-test-123456123123" + }`)) + if err != nil { + w.WriteHeader(http.StatusInternalServerError) + } + + // metadata + case 2: + assert.Equal(t, metadataURL, req.URL.Path) + w.WriteHeader(200) + + // register again because force registration was set + case 3: + require.Equal(t, registerURL, req.URL.Path) + + authHeader := req.Header.Get("Authorization") + assert.Equal(t, "Bearer dummy_install_token", authHeader, + "collector didn't send correct Authorization header with registration request") + + _, err = w.Write([]byte(`{ + "collectorCredentialID": "aaaaaaaaaaaaaaaaaaaa", + "collectorCredentialKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "collectorId": "000000000FFFFFFF", + "collectorName": "hostname-test-123456123123" + }`)) + if err != nil { + w.WriteHeader(http.StatusInternalServerError) + } + + // metadata + case 4: + assert.Equal(t, metadataURL, req.URL.Path) + w.WriteHeader(200) + + // should not produce any more requests + default: + w.WriteHeader(http.StatusInternalServerError) + } + }) + }()) + + dir, err := os.MkdirTemp("", "otelcol-sumo-store-credentials-test-*") + t.Cleanup(func() { + srv.Close() + os.RemoveAll(dir) + }) + require.NoError(t, err) + + cfg := createDefaultConfig().(*Config) + cfg.CollectorName = "" + cfg.APIBaseURL = srv.URL + cfg.Credentials.InstallationToken = "dummy_install_token" + cfg.CollectorCredentialsDirectory = dir + cfg.ForceRegistration = true + + se, err := newSumologicExtension(cfg, zap.NewNop(), component.NewID("sumologic"), "1.0.0") + require.NoError(t, err) + require.NoError(t, se.Start(context.Background(), componenttest.NewNopHost())) + require.NoError(t, se.Shutdown(context.Background())) + assert.NotEmpty(t, se.collectorName) + assert.Equal(t, hostname, se.collectorName) + colCreds, err := se.credentialsStore.Get(se.hashKey) + require.NoError(t, err) + colName := colCreds.CollectorName + se, err = newSumologicExtension(cfg, zap.NewNop(), component.NewID("sumologic"), "1.0.0") + require.NoError(t, err) + require.NoError(t, se.Start(context.Background(), componenttest.NewNopHost())) + assert.Equal(t, se.collectorName, colName) +} + +func TestCollectorSendsBasicAuthHeadersOnRegistration(t *testing.T) { + t.Parallel() + + srv := httptest.NewServer(func() http.HandlerFunc { + var reqCount int32 + + return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + // TODO Add payload verification - verify if collectorName is set properly + reqNum := atomic.AddInt32(&reqCount, 1) + + switch reqNum { + + // register + case 1: + require.Equal(t, registerURL, req.URL.Path) + + authHeader := req.Header.Get("Authorization") + assert.Equal(t, "Bearer dummy_install_token", authHeader, + "collector didn't send correct Authorization header with registration request") + + _, err := w.Write([]byte(`{ + "collectorCredentialID": "aaaaaaaaaaaaaaaaaaaa", + "collectorCredentialKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "collectorId": "000000000FFFFFFF" + }`)) + if err != nil { + w.WriteHeader(http.StatusInternalServerError) + } + + // metadata + case 2: + assert.Equal(t, metadataURL, req.URL.Path) + w.WriteHeader(200) + + // heartbeat + case 3: + assert.Equal(t, heartbeatURL, req.URL.Path) + w.WriteHeader(204) + + // should not produce any more requests + default: + w.WriteHeader(http.StatusInternalServerError) + } + }) + }()) + + t.Cleanup(func() { srv.Close() }) + + dir, err := os.MkdirTemp("", "otelcol-sumo-store-credentials-test-*") + require.NoError(t, err) + t.Cleanup(func() { os.RemoveAll(dir) }) + + cfg := createDefaultConfig().(*Config) + cfg.CollectorName = "" + cfg.APIBaseURL = srv.URL + cfg.Credentials.InstallationToken = "dummy_install_token" + cfg.CollectorCredentialsDirectory = dir + + se, err := newSumologicExtension(cfg, zap.NewNop(), component.NewID("sumologic"), "1.0.0") + require.NoError(t, err) + require.NoError(t, se.Start(context.Background(), componenttest.NewNopHost())) + require.NoError(t, se.Shutdown(context.Background())) +} + +func TestCollectorCheckingCredentialsFoundInLocalStorage(t *testing.T) { + t.Parallel() + + dir, err := os.MkdirTemp("", "otelcol-sumo-store-credentials-test-*") + require.NoError(t, err) + t.Cleanup(func() { os.RemoveAll(dir) }) + + cStore, err := credentials.NewLocalFsStore( + credentials.WithCredentialsDirectory(dir), + credentials.WithLogger(zap.NewNop()), + ) + require.NoError(t, err) + + storeCredentials := func(t *testing.T, url string) { + creds := credentials.CollectorCredentials{ + CollectorName: "test-name", + Credentials: api.OpenRegisterResponsePayload{ + CollectorName: "test-name", + CollectorID: "test-id", + CollectorCredentialID: "test-credential-id", + CollectorCredentialKey: "test-credential-key", + }, + APIBaseURL: url, + } + storageKey := createHashKey(&Config{ + CollectorName: "test-name", + Credentials: accessCredentials{ + InstallationToken: "dummy_install_token", + }, + APIBaseURL: url, + }) + t.Logf("Storing collector credentials in temp dir: %s", dir) + require.NoError(t, cStore.Store(storageKey, creds)) + } + + testcases := []struct { + name string + expectedReqCount int32 + srvFn func() (*httptest.Server, *int32) + configFn func(url string) *Config + }{ + { + name: "collector checks found credentials via heartbeat call - no registration is done", + expectedReqCount: 3, + srvFn: func() (*httptest.Server, *int32) { + var reqCount int32 + + return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + reqNum := atomic.AddInt32(&reqCount, 1) + + switch reqNum { + + // heatbeat + case 1: + require.NotEqual(t, registerURL, req.URL.Path, + "collector shouldn't call the register API when credentials locally retrieved") + + assert.Equal(t, heartbeatURL, req.URL.Path) + + authHeader := req.Header.Get("Authorization") + token := base64.StdEncoding.EncodeToString( + []byte("test-credential-id:test-credential-key"), + ) + assert.Equal(t, "Basic "+token, authHeader, + "collector didn't send correct Authorization header with heartbeat request") + + w.WriteHeader(204) + + // metadata + case 2: + assert.Equal(t, metadataURL, req.URL.Path) + w.WriteHeader(200) + + // should not produce any more requests + default: + w.WriteHeader(http.StatusInternalServerError) + } + })), + &reqCount + }, + configFn: func(url string) *Config { + cfg := createDefaultConfig().(*Config) + cfg.CollectorName = "test-name" + cfg.APIBaseURL = url + cfg.Credentials.InstallationToken = "dummy_install_token" + cfg.CollectorCredentialsDirectory = dir + return cfg + }, + }, + { + name: "collector checks network issues - no registration is done", + expectedReqCount: 4, + srvFn: func() (*httptest.Server, *int32) { + var reqCount int32 + + return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + reqNum := atomic.AddInt32(&reqCount, 1) + + switch reqNum { + + // failing heatbeat + case 1: + require.NotEqual(t, registerURL, req.URL.Path, + "collector shouldn't call the register API when credentials locally retrieved") + + assert.Equal(t, heartbeatURL, req.URL.Path) + + authHeader := req.Header.Get("Authorization") + token := base64.StdEncoding.EncodeToString( + []byte("test-credential-id:test-credential-key"), + ) + assert.Equal(t, "Basic "+token, authHeader, + "collector didn't send correct Authorization header with heartbeat request") + + w.WriteHeader(http.StatusInternalServerError) + + // successful heatbeat + case 2: + require.NotEqual(t, registerURL, req.URL.Path, + "collector shouldn't call the register API when credentials locally retrieved") + + assert.Equal(t, heartbeatURL, req.URL.Path) + + authHeader := req.Header.Get("Authorization") + token := base64.StdEncoding.EncodeToString( + []byte("test-credential-id:test-credential-key"), + ) + assert.Equal(t, "Basic "+token, authHeader, + "collector didn't send correct Authorization header with heartbeat request") + + w.WriteHeader(204) + + // metadata + case 3: + assert.Equal(t, metadataURL, req.URL.Path) + w.WriteHeader(200) + + // should not produce any more requests + default: + w.WriteHeader(http.StatusInternalServerError) + } + })), + &reqCount + }, + configFn: func(url string) *Config { + cfg := createDefaultConfig().(*Config) + cfg.CollectorName = "test-name" + cfg.APIBaseURL = url + cfg.Credentials.InstallationToken = "dummy_install_token" + cfg.CollectorCredentialsDirectory = dir + return cfg + }, + }, + { + name: "collector checks network issues - registration is done", + expectedReqCount: 4, + srvFn: func() (*httptest.Server, *int32) { + var reqCount int32 + + return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + reqNum := atomic.AddInt32(&reqCount, 1) + + switch reqNum { + + // failing heatbeat + case 1: + require.NotEqual(t, registerURL, req.URL.Path, + "collector shouldn't call the register API when credentials locally retrieved") + + assert.Equal(t, heartbeatURL, req.URL.Path) + + authHeader := req.Header.Get("Authorization") + token := base64.StdEncoding.EncodeToString( + []byte("test-credential-id:test-credential-key"), + ) + assert.Equal(t, "Basic "+token, authHeader, + "collector didn't send correct Authorization header with heartbeat request") + + w.WriteHeader(http.StatusUnauthorized) + + // register + case 2: + require.Equal(t, registerURL, req.URL.Path) + + authHeader := req.Header.Get("Authorization") + assert.Equal(t, "Bearer dummy_install_token", authHeader, + "collector didn't send correct Authorization header with registration request") + + _, err := w.Write([]byte(`{ + "collectorCredentialID": "aaaaaaaaaaaaaaaaaaaa", + "collectorCredentialKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "collectorId": "000000000FFFFFFF" + }`)) + if err != nil { + w.WriteHeader(http.StatusInternalServerError) + } + + // metadata + case 3: + w.WriteHeader(200) + + // heartbeat + case 4: + w.WriteHeader(204) + + // should not produce any more requests + default: + w.WriteHeader(http.StatusInternalServerError) + } + })), + &reqCount + }, + configFn: func(url string) *Config { + cfg := createDefaultConfig().(*Config) + cfg.CollectorName = "test-name" + cfg.APIBaseURL = url + cfg.Credentials.InstallationToken = "dummy_install_token" + cfg.CollectorCredentialsDirectory = dir + return cfg + }, + }, + { + name: "collector registers when no matching credentials are found in local storage", + expectedReqCount: 3, + srvFn: func() (*httptest.Server, *int32) { + var reqCount int32 + + return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + reqNum := atomic.AddInt32(&reqCount, 1) + + switch reqNum { + + // register + case 1: + require.Equal(t, registerURL, req.URL.Path) + + authHeader := req.Header.Get("Authorization") + assert.Equal(t, "Bearer dummy_install_token", authHeader, + "collector didn't send correct Authorization header with registration request") + + _, err := w.Write([]byte(`{ + "collectorCredentialID": "aaaaaaaaaaaaaaaaaaaa", + "collectorCredentialKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "collectorId": "000000000FFFFFFF" + }`)) + if err != nil { + w.WriteHeader(http.StatusInternalServerError) + } + + // metadata + case 2: + w.WriteHeader(200) + + // heartbeat + case 3: + w.WriteHeader(204) + + // should not produce any more requests + default: + w.WriteHeader(http.StatusInternalServerError) + } + })), + &reqCount + }, + configFn: func(url string) *Config { + cfg := createDefaultConfig().(*Config) + cfg.CollectorName = "test-name-not-in-the-credentials-store" + cfg.APIBaseURL = url + cfg.Credentials.InstallationToken = "dummy_install_token" + cfg.CollectorCredentialsDirectory = dir + return cfg + }, + }, + } + + for _, tc := range testcases { + t.Run(tc.name, func(t *testing.T) { + tc := tc + + srv, reqCount := tc.srvFn() + t.Cleanup(func() { srv.Close() }) + + cfg := tc.configFn(srv.URL) + storeCredentials(t, srv.URL) + + logger, err := zap.NewDevelopment() + require.NoError(t, err) + + se, err := newSumologicExtension(cfg, logger, component.NewID("sumologic"), "1.0.0") + require.NoError(t, err) + require.NoError(t, se.Start(context.Background(), componenttest.NewNopHost())) + + if !assert.Eventually(t, + func() bool { + return atomic.LoadInt32(reqCount) == tc.expectedReqCount + }, + 5*time.Second, 100*time.Millisecond, + ) { + t.Logf("the expected number of requests (%d) wasn't reached, only got %d", + tc.expectedReqCount, atomic.LoadInt32(reqCount), + ) + } + + require.NoError(t, se.Shutdown(context.Background())) + }) + } +} + +func TestRegisterEmptyCollectorNameWithBackoff(t *testing.T) { + var retriesLimit int32 = 5 + t.Parallel() + + hostname, err := getHostname(zap.NewNop()) + require.NoError(t, err) + srv := httptest.NewServer(func() http.HandlerFunc { + var reqCount int32 + + return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + // TODO Add payload verification - verify if collectorName is set properly + reqNum := atomic.AddInt32(&reqCount, 1) + + switch { + + // register + case reqNum <= retriesLimit: + require.Equal(t, registerURL, req.URL.Path) + + authHeader := req.Header.Get("Authorization") + assert.Equal(t, "Bearer dummy_install_token", authHeader, + "collector didn't send correct Authorization header with registration request") + + if reqCount < retriesLimit { + w.WriteHeader(http.StatusTooManyRequests) + } else { + + _, err = w.Write([]byte(`{ + "collectorCredentialID": "aaaaaaaaaaaaaaaaaaaa", + "collectorCredentialKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "collectorId": "000000000FFFFFFF" + }`)) + if err != nil { + w.WriteHeader(http.StatusInternalServerError) + } + } + + // metadata + case reqNum == retriesLimit+1: + assert.Equal(t, metadataURL, req.URL.Path) + w.WriteHeader(200) + + // heartbeat + case reqNum == retriesLimit+2: + assert.Equal(t, heartbeatURL, req.URL.Path) + w.WriteHeader(204) + + // should not produce any more requests + default: + w.WriteHeader(http.StatusInternalServerError) + } + }) + }()) + + dir, err := os.MkdirTemp("", "otelcol-sumo-store-credentials-test-*") + t.Cleanup(func() { + srv.Close() + os.RemoveAll(dir) + }) + require.NoError(t, err) + + cfg := createDefaultConfig().(*Config) + cfg.CollectorName = "" + cfg.APIBaseURL = srv.URL + cfg.Credentials.InstallationToken = "dummy_install_token" + cfg.CollectorCredentialsDirectory = dir + cfg.BackOff.InitialInterval = time.Millisecond + cfg.BackOff.MaxInterval = time.Millisecond + + se, err := newSumologicExtension(cfg, zap.NewNop(), component.NewID("sumologic"), "1.0.0") + require.NoError(t, err) + require.NoError(t, se.Start(context.Background(), componenttest.NewNopHost())) + require.Equal(t, hostname, se.collectorName) +} + +func TestRegisterEmptyCollectorNameUnrecoverableError(t *testing.T) { + t.Parallel() + + hostname, err := getHostname(zap.NewNop()) + require.NoError(t, err) + srv := httptest.NewServer(func() http.HandlerFunc { + return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + // TODO Add payload verification - verify if collectorName is set properly + require.Equal(t, registerURL, req.URL.Path) + + authHeader := req.Header.Get("Authorization") + assert.Equal(t, "Bearer dummy_install_token", authHeader, + "collector didn't send correct Authorization header with registration request") + + w.WriteHeader(http.StatusNotFound) + _, err = w.Write([]byte(`{ + "id": "XXXXX-XXXXX-XXXXX", + "errors": [ + { + "code": "collector-registration:dummy_error", + "message": "The collector cannot be registered" + } + ] + }`)) + require.NoError(t, err) + }) + }()) + + var dir string + dir, err = os.MkdirTemp("", "otelcol-sumo-store-credentials-test-*") + t.Cleanup(func() { + srv.Close() + os.RemoveAll(dir) + }) + require.NoError(t, err) + + cfg := createDefaultConfig().(*Config) + cfg.CollectorName = "" + cfg.APIBaseURL = srv.URL + cfg.Credentials.InstallationToken = "dummy_install_token" + cfg.CollectorCredentialsDirectory = dir + cfg.BackOff.InitialInterval = time.Millisecond + cfg.BackOff.MaxInterval = time.Millisecond + + se, err := newSumologicExtension(cfg, zap.NewNop(), component.NewID("sumologic"), "1.0.0") + require.NoError(t, err) + require.EqualError(t, se.Start(context.Background(), componenttest.NewNopHost()), + "collector registration failed: failed to register the collector, got HTTP status code: 404") + require.Equal(t, hostname, se.collectorName) +} + +func TestRegistrationRedirect(t *testing.T) { + t.Parallel() + + var destReqCount int32 + destSrv := httptest.NewServer(http.HandlerFunc( + func(w http.ResponseWriter, req *http.Request) { + switch atomic.AddInt32(&destReqCount, 1) { + + // register + case 1: + require.Equal(t, registerURL, req.URL.Path) + + authHeader := req.Header.Get("Authorization") + + assert.Equal(t, "Bearer dummy_install_token", authHeader, + "collector didn't send correct Authorization header with registration request") + + _, err := w.Write([]byte(`{ + "collectorCredentialID": "aaaaaaaaaaaaaaaaaaaa", + "collectorCredentialKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "collectorId": "000000000FFFFFFF" + }`)) + if err != nil { + w.WriteHeader(http.StatusInternalServerError) + } + + // metadata + case 2: + assert.Equal(t, metadataURL, req.URL.Path) + w.WriteHeader(200) + + // heartbeat + case 3: + assert.Equal(t, heartbeatURL, req.URL.Path) + w.WriteHeader(204) + + // heartbeat + case 4: + assert.Equal(t, heartbeatURL, req.URL.Path) + w.WriteHeader(204) + + // metadata + case 5: + assert.Equal(t, metadataURL, req.URL.Path) + w.WriteHeader(200) + + // heartbeat + case 6: + assert.Equal(t, heartbeatURL, req.URL.Path) + w.WriteHeader(204) + + // should not produce any more requests + default: + require.Fail(t, + "extension should not make more than 5 requests to the destination server", + ) + } + }, + )) + t.Cleanup(func() { destSrv.Close() }) + + var origReqCount int32 + origSrv := httptest.NewServer(http.HandlerFunc( + func(w http.ResponseWriter, req *http.Request) { + switch atomic.AddInt32(&origReqCount, 1) { + + // register + case 1: + require.Equal(t, registerURL, req.URL.Path) + http.Redirect(w, req, destSrv.URL, http.StatusMovedPermanently) + + // should not produce any more requests + default: + require.Fail(t, + "extension should not make more than 1 request to the original server", + ) + } + }, + )) + t.Cleanup(func() { origSrv.Close() }) + + dir, err := os.MkdirTemp("", "otelcol-sumo-redirect-test-*") + require.NoError(t, err) + t.Cleanup(func() { os.RemoveAll(dir) }) + + configFn := func() *Config { + cfg := createDefaultConfig().(*Config) + cfg.CollectorName = "" + cfg.APIBaseURL = origSrv.URL + cfg.Credentials.InstallationToken = "dummy_install_token" + cfg.CollectorCredentialsDirectory = dir + return cfg + } + + logger, err := zap.NewDevelopment() + require.NoError(t, err) + + t.Run("works correctly", func(t *testing.T) { + se, err := newSumologicExtension(configFn(), logger, component.NewID("sumologic"), "1.0.0") + require.NoError(t, err) + require.NoError(t, se.Start(context.Background(), componenttest.NewNopHost())) + assert.Eventually(t, func() bool { return atomic.LoadInt32(&origReqCount) == 1 }, + 5*time.Second, 100*time.Millisecond, + "extension should only make 1 request to the original server before redirect", + ) + assert.Eventually(t, func() bool { return atomic.LoadInt32(&destReqCount) == 3 }, + 5*time.Second, 100*time.Millisecond, + "extension should make 3 requests (registration + metadata + heartbeat) to the destination server", + ) + require.NoError(t, se.Shutdown(context.Background())) + }) + + t.Run("credentials store retrieves credentials with redirected api url", func(t *testing.T) { + se, err := newSumologicExtension(configFn(), logger, component.NewID("sumologic"), "1.0.0") + require.NoError(t, err) + require.NoError(t, se.Start(context.Background(), componenttest.NewNopHost())) + + assert.Eventually(t, func() bool { return atomic.LoadInt32(&origReqCount) == 1 }, + 5*time.Second, 100*time.Millisecond, + "after restarting with locally stored credentials extension shouldn't call the original server", + ) + + assert.Eventually(t, func() bool { return atomic.LoadInt32(&destReqCount) == 6 }, + 5*time.Second, 100*time.Millisecond, + "extension should make 6 requests (registration + metadata + heartbeat, after restart "+ + "heartbeat to validate credentials, metadata update, and then the first heartbeat on "+ + "which we wait here) to the destination server", + ) + + require.NoError(t, se.Shutdown(context.Background())) + }) +} + +func TestCollectorReregistersAfterHTTPUnathorizedFromHeartbeat(t *testing.T) { + t.Parallel() + + var reqCount int32 + srv := httptest.NewServer(func() http.HandlerFunc { + return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + reqNum := atomic.AddInt32(&reqCount, 1) + + t.Logf("request: (#%d) %s", reqNum, req.URL.Path) + handlerRegister := func() { + require.Equal(t, registerURL, req.URL.Path, "request num 1") + + authHeader := req.Header.Get("Authorization") + assert.Equal(t, "Bearer dummy_install_token", authHeader, + "collector didn't send correct Authorization header with registration request") + + _, err := w.Write([]byte(`{ + "collectorCredentialID": "aaaaaaaaaaaaaaaaaaaa", + "collectorCredentialKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "collectorId": "000000000FFFFFFF", + "collectorName": "hostname-test-123456123123" + }`)) + if err != nil { + w.WriteHeader(http.StatusInternalServerError) + } + } + + switch reqNum { + // register + case 1: + assert.Equal(t, registerURL, req.URL.Path) + handlerRegister() + + // metadata + case 2: + assert.Equal(t, metadataURL, req.URL.Path) + w.WriteHeader(200) + + // heartbeat + case 3: + assert.Equal(t, heartbeatURL, req.URL.Path) + w.WriteHeader(204) + + // heartbeat + case 4: + assert.Equal(t, heartbeatURL, req.URL.Path) + // return unauthorized to mimic collector being removed from API + w.WriteHeader(http.StatusUnauthorized) + + // register + case 5: + assert.Equal(t, registerURL, req.URL.Path) + handlerRegister() + + default: + assert.Equal(t, heartbeatURL, req.URL.Path) + w.WriteHeader(204) + } + }) + }()) + + t.Cleanup(func() { srv.Close() }) + + dir, err := os.MkdirTemp("", "otelcol-sumo-reregistration-test-*") + require.NoError(t, err) + t.Cleanup(func() { os.RemoveAll(dir) }) + + cfg := createDefaultConfig().(*Config) + cfg.CollectorName = "" + cfg.APIBaseURL = srv.URL + cfg.Credentials.InstallationToken = "dummy_install_token" + cfg.CollectorCredentialsDirectory = dir + cfg.HeartBeatInterval = 100 * time.Millisecond + + logger, err := zap.NewDevelopment() + require.NoError(t, err) + + se, err := newSumologicExtension(cfg, logger, component.NewID("sumologic"), "1.0.0") + require.NoError(t, err) + require.NoError(t, se.Start(context.Background(), componenttest.NewNopHost())) + + const expectedReqCount = 10 + if !assert.Eventually(t, + func() bool { + return atomic.LoadInt32(&reqCount) == expectedReqCount + }, + 5*time.Second, 50*time.Millisecond, + ) { + t.Logf("the expected number of requests (%d) wasn't reached, got %d", + expectedReqCount, atomic.LoadInt32(&reqCount), + ) + } + + require.NoError(t, se.Shutdown(context.Background())) +} + +func TestRegistrationRequestPayload(t *testing.T) { + t.Parallel() + + hostname, err := getHostname(zap.NewNop()) + require.NoError(t, err) + var reqCount int32 + srv := httptest.NewServer(func() http.HandlerFunc { + return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + reqNum := atomic.AddInt32(&reqCount, 1) + + switch reqNum { + // register + case 1: + require.Equal(t, registerURL, req.URL.Path) + + var reqPayload api.OpenRegisterRequestPayload + require.NoError(t, json.NewDecoder(req.Body).Decode(&reqPayload)) + require.True(t, reqPayload.Clobber) + require.Equal(t, hostname, reqPayload.Hostname) + require.Equal(t, "my description", reqPayload.Description) + require.Equal(t, "my category/", reqPayload.Category) + require.EqualValues(t, + map[string]any{ + "field1": "value1", + "field2": "value2", + }, + reqPayload.Fields, + ) + require.Equal(t, "PST", reqPayload.TimeZone) + + authHeader := req.Header.Get("Authorization") + assert.Equal(t, "Bearer dummy_install_token", authHeader, + "collector didn't send correct Authorization header with registration request") + + _, err = w.Write([]byte(`{ + "collectorCredentialID": "mycredentialID", + "collectorCredentialKey": "mycredentialKey", + "collectorId": "0000000001231231", + "collectorName": "otc-test-123456123123" + }`)) + require.NoError(t, err) + // metadata + case 2: + assert.Equal(t, metadataURL, req.URL.Path) + w.WriteHeader(200) + } + + }) + }()) + + dir, err := os.MkdirTemp("", "otelcol-sumo-registration-payload-test-*") + t.Cleanup(func() { + srv.Close() + os.RemoveAll(dir) + }) + require.NoError(t, err) + + cfg := createDefaultConfig().(*Config) + cfg.CollectorName = "" + cfg.APIBaseURL = srv.URL + cfg.Credentials.InstallationToken = "dummy_install_token" + cfg.CollectorCredentialsDirectory = dir + cfg.BackOff.InitialInterval = time.Millisecond + cfg.BackOff.MaxInterval = time.Millisecond + cfg.Clobber = true + cfg.CollectorDescription = "my description" + cfg.CollectorCategory = "my category/" + cfg.CollectorFields = map[string]any{ + "field1": "value1", + "field2": "value2", + } + cfg.TimeZone = "PST" + + se, err := newSumologicExtension(cfg, zap.NewNop(), component.NewID("sumologic"), "1.0.0") + require.NoError(t, err) + require.NoError(t, se.Start(context.Background(), componenttest.NewNopHost())) + require.Equal(t, hostname, se.collectorName) + + require.NoError(t, se.Shutdown(context.Background())) +} + +func TestWatchCredentialKey(t *testing.T) { + cfg := createDefaultConfig().(*Config) + cfg.Credentials.InstallationToken = "dummy_install_token" + se, err := newSumologicExtension(cfg, zap.NewNop(), component.NewID("sumologic"), "1.0.0") + require.NoError(t, err) + + ctx := context.Background() + ctxc, cancel := context.WithCancel(ctx) + cancel() + v := se.WatchCredentialKey(ctxc, "") + require.Equal(t, v, "") + + v = se.WatchCredentialKey(context.Background(), "foobar") + require.Equal(t, v, "") + + go func() { + time.Sleep(time.Millisecond * 100) + se.credsNotifyLock.Lock() + defer se.credsNotifyLock.Unlock() + se.registrationInfo.CollectorCredentialKey = "test-credential-key" + close(se.credsNotifyUpdate) + }() + + v = se.WatchCredentialKey(context.Background(), "") + require.Equal(t, v, "test-credential-key") +} + +func TestCreateCredentialsHeader(t *testing.T) { + cfg := createDefaultConfig().(*Config) + cfg.Credentials.InstallationToken = "dummy_install_token" + se, err := newSumologicExtension(cfg, zap.NewNop(), component.NewID("sumologic"), "1.0.0") + require.NoError(t, err) + + _, err = se.CreateCredentialsHeader() + require.Error(t, err) + + se.registrationInfo.CollectorCredentialID = "test-credential-id" + se.registrationInfo.CollectorCredentialKey = "test-credential-key" + + h, err := se.CreateCredentialsHeader() + require.NoError(t, err) + + authHeader := h.Get("Authorization") + token := base64.StdEncoding.EncodeToString( + []byte("test-credential-id:test-credential-key"), + ) + assert.Equal(t, "Basic "+token, authHeader) +} + +func TestGetHostIpAddress(t *testing.T) { + ip, err := baseURL() + require.NoError(t, err) + require.NotEmpty(t, ip) +} + +func TestUpdateMetadataRequestPayload(t *testing.T) { + t.Parallel() + + srv := httptest.NewServer(func() http.HandlerFunc { + return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + require.Equal(t, metadataURL, req.URL.Path) + + var reqPayload api.OpenMetadataRequestPayload + require.NoError(t, json.NewDecoder(req.Body).Decode(&reqPayload)) + require.NotEmpty(t, reqPayload.HostDetails.Name) + require.NotEmpty(t, reqPayload.HostDetails.OsName) + // @sumo-drosiek: It happened to be empty OsVersion on my machine + // require.NotEmpty(t, reqPayload.HostDetails.OsVersion) + require.NotEmpty(t, reqPayload.NetworkDetails.HostIPAddress) + require.EqualValues(t, reqPayload.HostDetails.Environment, "EKS-1.20.2") + require.EqualValues(t, reqPayload.CollectorDetails.RunningVersion, "1.0.0") + require.EqualValues(t, reqPayload.TagDetails["team"], "A") + require.EqualValues(t, reqPayload.TagDetails["app"], "linux") + require.EqualValues(t, reqPayload.TagDetails["sumo.disco.enabled"], "true") + + _, err := w.Write([]byte(``)) + + require.NoError(t, err) + }) + }()) + + cfg := createDefaultConfig().(*Config) + cfg.CollectorName = "" + cfg.APIBaseURL = srv.URL + cfg.Credentials.InstallationToken = "dummy_install_token" + cfg.BackOff.InitialInterval = time.Millisecond + cfg.BackOff.MaxInterval = time.Millisecond + cfg.Clobber = true + cfg.CollectorEnvironment = "EKS-1.20.2" + cfg.CollectorDescription = "my description" + cfg.CollectorCategory = "my category/" + cfg.CollectorFields = map[string]any{ + "team": "A", + "app": "linux", + } + cfg.DiscoverCollectorTags = true + cfg.TimeZone = "PST" + + se, err := newSumologicExtension(cfg, zap.NewNop(), component.NewID("sumologic"), "1.0.0") + require.NoError(t, err) + + httpClient, err := se.getHTTPClient(se.conf.ClientConfig, api.OpenRegisterResponsePayload{}) + require.NoError(t, err) + + err = se.updateMetadataWithHTTPClient(context.TODO(), httpClient) + require.NoError(t, err) +} diff --git a/extension/sumologicextension/factory.go b/extension/sumologicextension/factory.go index b21f2a064b77..eb951bcac875 100644 --- a/extension/sumologicextension/factory.go +++ b/extension/sumologicextension/factory.go @@ -12,6 +12,7 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/extension" + "github.com/open-telemetry/opentelemetry-collector-contrib/extension/sumologicextension/credentials" "github.com/open-telemetry/opentelemetry-collector-contrib/extension/sumologicextension/internal/metadata" ) @@ -31,7 +32,10 @@ func NewFactory() extension.Factory { } func createDefaultConfig() component.Config { - defaultCredsPath := "" + defaultCredsPath, err := credentials.GetDefaultCollectorCredentialsDirectory() + if err != nil { + return nil + } return &Config{ APIBaseURL: DefaultAPIBaseURL, @@ -42,6 +46,7 @@ func createDefaultConfig() component.Config { ForceRegistration: false, Ephemeral: false, TimeZone: "", + StickySessionEnabled: false, BackOff: backOffConfig{ InitialInterval: backoff.DefaultInitialInterval, MaxInterval: backoff.DefaultMaxInterval, diff --git a/extension/sumologicextension/factory_test.go b/extension/sumologicextension/factory_test.go index 230e310c0a88..d5078fd3018d 100644 --- a/extension/sumologicextension/factory_test.go +++ b/extension/sumologicextension/factory_test.go @@ -1,10 +1,12 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package sumologicextension +package sumologicextension // import "github.com/open-telemetry/opentelemetry-collector-contrib/extension/sumologicextension" import ( "context" + "os" + "path" "testing" "github.com/cenkalti/backoff/v4" @@ -13,11 +15,15 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/extension" + + "github.com/open-telemetry/opentelemetry-collector-contrib/extension/sumologicextension/credentials" ) func TestFactory_CreateDefaultConfig(t *testing.T) { cfg := createDefaultConfig() - defaultCredsPath := "" + homePath, err := os.UserHomeDir() + require.NoError(t, err) + defaultCredsPath := path.Join(homePath, credentials.DefaultCollectorDataDirectory) assert.Equal(t, &Config{ HeartBeatInterval: DefaultHeartbeatInterval, APIBaseURL: DefaultAPIBaseURL, diff --git a/extension/sumologicextension/go.mod b/extension/sumologicextension/go.mod index e4f38abb0475..67112e1417d6 100644 --- a/extension/sumologicextension/go.mod +++ b/extension/sumologicextension/go.mod @@ -3,25 +3,32 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/extension/sumol go 1.21 require ( + github.com/Showmax/go-fqdn v1.0.0 github.com/cenkalti/backoff/v4 v4.2.1 + github.com/mitchellh/go-ps v1.0.0 + github.com/shirou/gopsutil/v3 v3.24.1 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.95.0 go.opentelemetry.io/collector/config/confighttp v0.95.0 go.opentelemetry.io/collector/config/configopaque v1.2.0 go.opentelemetry.io/collector/extension v0.95.0 + go.opentelemetry.io/collector/extension/auth v0.95.0 + go.opentelemetry.io/collector/featuregate v1.2.0 go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 + google.golang.org/grpc v1.61.0 ) require ( github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/davecgh/go-spew v1.1.1 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-ole/go-ole v1.2.6 // indirect github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.3 // indirect @@ -31,15 +38,21 @@ require ( 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.0 // indirect + github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect - github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect github.com/prometheus/client_golang v1.18.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/common v0.46.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rs/cors v1.10.1 // indirect + github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/tklauser/go-sysconf v0.3.12 // indirect + github.com/tklauser/numcpus v0.6.1 // indirect + github.com/yusufpapurcu/wmi v1.2.3 // indirect go.opentelemetry.io/collector v0.95.0 // indirect go.opentelemetry.io/collector/config/configauth v0.95.0 // indirect go.opentelemetry.io/collector/config/configcompression v0.95.0 // indirect @@ -47,8 +60,6 @@ require ( go.opentelemetry.io/collector/config/configtls v0.95.0 // indirect go.opentelemetry.io/collector/config/internal v0.95.0 // indirect go.opentelemetry.io/collector/confmap v0.95.0 // indirect - go.opentelemetry.io/collector/extension/auth v0.95.0 // indirect - go.opentelemetry.io/collector/featuregate v1.2.0 // indirect go.opentelemetry.io/collector/pdata v1.2.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 // indirect go.opentelemetry.io/otel v1.23.1 // indirect @@ -59,8 +70,7 @@ require ( golang.org/x/net v0.21.0 // indirect golang.org/x/sys v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac // indirect - google.golang.org/grpc v1.61.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917 // indirect google.golang.org/protobuf v1.32.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/extension/sumologicextension/go.sum b/extension/sumologicextension/go.sum index f4bc7fe5c911..80795cad43b8 100644 --- a/extension/sumologicextension/go.sum +++ b/extension/sumologicextension/go.sum @@ -1,11 +1,14 @@ +github.com/Showmax/go-fqdn v1.0.0 h1:0rG5IbmVliNT5O19Mfuvna9LL7zlHyRfsSvBPZmF9tM= +github.com/Showmax/go-fqdn v1.0.0/go.mod h1:SfrFBzmDCtCGrnHhoDjuvFnKsWjEQX/Q9ARZvOrJAko= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= -github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +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/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= @@ -15,6 +18,8 @@ github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= +github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c= github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= @@ -25,6 +30,8 @@ github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu 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.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= @@ -45,8 +52,12 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= +github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= +github.com/mitchellh/go-ps v1.0.0 h1:i6ampVEEF4wQFF+bkYfwYgY+F/uYJDktmvLPf7qIgjc= +github.com/mitchellh/go-ps v1.0.0/go.mod h1:J4lOc8z8yJs6vUwklHw2XEIiT4z4C40KtWVN3nvg8Pg= github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c h1:cqn374mizHuIWj+OSJCajGr/phAmuMug9qIX3l9CflE= github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= @@ -55,8 +66,10 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/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/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw= +github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= @@ -69,10 +82,27 @@ github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjR github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/rs/cors v1.10.1 h1:L0uuZVXIKlI1SShY2nhFfo44TYvDPQ1w4oFkUJNfhyo= github.com/rs/cors v1.10.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/shirou/gopsutil/v3 v3.24.1 h1:R3t6ondCEvmARp3wxODhXMTLC/klMa87h2PHUw5m7QI= +github.com/shirou/gopsutil/v3 v3.24.1/go.mod h1:UU7a2MSBQa+kW1uuDq8DeEBS8kmrnQwsv2b5O513rwU= +github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= +github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= +github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= +github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= +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= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= +github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= +github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= +github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw= +github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= go.opentelemetry.io/collector v0.95.0 h1:DFW0BkF2sOocpA3NUPrbMeuPSN3PWxFBrLqs/Cxn3vo= go.opentelemetry.io/collector v0.95.0/go.mod h1:Lc+VkOkSBppKqR/cAevS5oPrbtUO3JUbYzo91niRkG0= go.opentelemetry.io/collector/component v0.95.0 h1:68tI7KVy1bfpaR83+LxUvjd9/hjDh78utklGl2t6eVM= @@ -121,8 +151,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= @@ -139,7 +169,12 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -154,8 +189,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/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac h1:nUQEQmH/csSvFECKYRv6HWEyypysidKl2I6Qpsglq/0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac/go.mod h1:daQN87bsDqDoe316QbbvX60nMoJQa4r6Ds0ZuoAe5yA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917 h1:6G8oQ016D88m1xAKljMlBOOGWDZkes4kMhgGFlf8WcQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917/go.mod h1:xtjpI3tXFPP051KaWnhvxkiubL/6dJ18vLVf7q2pTOU= google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0= google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= @@ -165,5 +200,6 @@ google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHh gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/extension/sumologicextension/headers.go b/extension/sumologicextension/headers.go new file mode 100644 index 000000000000..f197adf4926a --- /dev/null +++ b/extension/sumologicextension/headers.go @@ -0,0 +1,11 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package sumologicextension // import "github.com/open-telemetry/opentelemetry-collector-contrib/extension/sumologicextension" + +import "net/http" + +func addJSONHeaders(req *http.Request) { + req.Header.Add("Content-Type", "application/json") + req.Header.Add("Accept", "application/json") +} diff --git a/extension/sumologicextension/metadata.yaml b/extension/sumologicextension/metadata.yaml index 464a9643a751..21a84f421476 100644 --- a/extension/sumologicextension/metadata.yaml +++ b/extension/sumologicextension/metadata.yaml @@ -7,3 +7,8 @@ status: distributions: [sumo] codeowners: active: [astencel-sumo, sumo-drosiek, swiatekm-sumo] + +# TODO: Update the extension to make the tests pass +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/extension/sumologicextension/testdata/config.yaml b/extension/sumologicextension/testdata/config.yaml new file mode 100644 index 000000000000..029b40e9dbec --- /dev/null +++ b/extension/sumologicextension/testdata/config.yaml @@ -0,0 +1,28 @@ +extensions: + sumologic: + collector_name: my_custom_collector + collector_description: "My custom OTC description" + collector_category: collector_category + installation_token: + heartbeat_interval: 15s + +# Data pipeline is required to load the config. +receivers: + hostmetrics: + collection_interval: 30s + scrapers: + load: + +processors: + +exporters: + debug: + verbosity: detailed + +service: + extensions: [sumologic] + pipelines: + metrics: + receivers: [hostmetrics] + processors: [] + exporters: [debug] diff --git a/go.mod b/go.mod index d68918919577..81510dab251d 100644 --- a/go.mod +++ b/go.mod @@ -55,7 +55,6 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/extension/bearertokenauthextension v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/extension/headerssetterextension v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.95.0 - github.com/open-telemetry/opentelemetry-collector-contrib/extension/httpforwarder v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/extension/jaegerremotesampling v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/extension/oauth2clientauthextension v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/dockerobserver v0.95.0 @@ -80,7 +79,6 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.95.0 - github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanmetricsprocessor v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanprocessor v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.95.0 @@ -233,24 +231,24 @@ require ( github.com/ClickHouse/ch-go v0.58.2 // indirect github.com/ClickHouse/clickhouse-go/v2 v2.17.1 // indirect github.com/DataDog/agent-payload/v5 v5.0.104 // indirect - github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.2 // indirect + github.com/DataDog/datadog-agent/pkg/obfuscate v0.51.1-0.20240301173728-334e775e420a // indirect github.com/DataDog/datadog-agent/pkg/proto v0.52.0-devel // indirect - github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.2 // indirect - github.com/DataDog/datadog-agent/pkg/trace v0.50.2 // indirect - github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.2 // indirect - github.com/DataDog/datadog-agent/pkg/util/log v0.50.2 // indirect - github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.2 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.2 // indirect + github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.51.1-0.20240301173728-334e775e420a // indirect + github.com/DataDog/datadog-agent/pkg/trace v0.51.1-0.20240301173728-334e775e420a // indirect + github.com/DataDog/datadog-agent/pkg/util/cgroups v0.51.1-0.20240301173728-334e775e420a // indirect + github.com/DataDog/datadog-agent/pkg/util/log v0.51.1-0.20240301173728-334e775e420a // indirect + github.com/DataDog/datadog-agent/pkg/util/pointer v0.51.1-0.20240301173728-334e775e420a // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.51.1-0.20240301173728-334e775e420a // indirect github.com/DataDog/datadog-api-client-go/v2 v2.22.0 // indirect - github.com/DataDog/datadog-go/v5 v5.1.1 // indirect - github.com/DataDog/go-sqllexer v0.0.8 // indirect + github.com/DataDog/datadog-go/v5 v5.5.0 // indirect + github.com/DataDog/go-sqllexer v0.0.9 // indirect github.com/DataDog/go-tuf v1.0.2-0.5.2 // indirect github.com/DataDog/gohai v0.0.0-20230524154621-4316413895ee // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.13.3 // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.13.3 // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.13.3 // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.13.3 // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.13.3 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.13.4 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.13.4 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.13.4 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.13.4 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.13.4 // indirect github.com/DataDog/sketches-go v1.4.4 // indirect github.com/DataDog/zstd v1.5.2 // indirect github.com/GehirnInc/crypt v0.0.0-20200316065508-bb7000b8a962 // indirect @@ -259,7 +257,7 @@ require ( github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/collector/googlemanagedprometheus v0.45.0 // indirect github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace v1.21.0 // indirect github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.45.0 // indirect - github.com/IBM/sarama v1.42.2 // indirect + github.com/IBM/sarama v1.43.0 // indirect github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c // indirect github.com/Masterminds/semver/v3 v3.2.0 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect @@ -278,27 +276,27 @@ require ( github.com/apache/thrift v0.19.0 // indirect github.com/ardielle/ardielle-go v1.5.2 // indirect github.com/armon/go-metrics v0.4.1 // indirect - github.com/aws/aws-sdk-go v1.50.17 // indirect - github.com/aws/aws-sdk-go-v2 v1.25.0 // indirect - github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.0 // indirect - github.com/aws/aws-sdk-go-v2/config v1.27.0 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.17.0 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.0 // indirect + github.com/aws/aws-sdk-go v1.50.27 // indirect + github.com/aws/aws-sdk-go-v2 v1.25.2 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.1 // indirect + github.com/aws/aws-sdk-go-v2/config v1.27.4 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.17.4 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.2 // indirect github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.59 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.0 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.0 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.2 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.2 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.23 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.0 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.1 // indirect github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.26 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.0 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.2 // indirect github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.14.0 // indirect - github.com/aws/aws-sdk-go-v2/service/kinesis v1.25.0 // indirect + github.com/aws/aws-sdk-go-v2/service/kinesis v1.27.1 // indirect github.com/aws/aws-sdk-go-v2/service/s3 v1.31.0 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.19.0 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.22.0 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.27.0 // indirect - github.com/aws/smithy-go v1.20.0 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.20.1 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.1 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.28.1 // indirect + github.com/aws/smithy-go v1.20.1 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/blang/semver/v4 v4.0.0 // indirect github.com/bmatcuk/doublestar/v4 v4.6.1 // indirect @@ -333,7 +331,7 @@ require ( github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.6.0 // indirect github.com/dynatrace-oss/dynatrace-metric-utils-go v0.5.0 // indirect - github.com/eapache/go-resiliency v1.5.0 // indirect + github.com/eapache/go-resiliency v1.6.0 // indirect github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 // indirect github.com/eapache/queue v1.1.0 // indirect github.com/elastic/go-elasticsearch/v7 v7.17.10 // indirect @@ -450,7 +448,7 @@ require ( github.com/json-iterator/go v1.1.12 // indirect github.com/julienschmidt/httprouter v1.3.0 // indirect github.com/karrick/godirwalk v1.17.0 // indirect - github.com/klauspost/compress v1.17.6 // indirect + github.com/klauspost/compress v1.17.7 // indirect github.com/klauspost/cpuid/v2 v2.2.5 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect github.com/knadh/koanf/providers/confmap v0.1.0 // indirect @@ -474,7 +472,7 @@ require ( github.com/mattn/go-isatty v0.0.19 // indirect github.com/mattn/go-sqlite3 v1.14.22 // indirect github.com/microsoft/ApplicationInsights-Go v0.4.4 // indirect - github.com/microsoft/go-mssqldb v1.6.0 // indirect + github.com/microsoft/go-mssqldb v1.7.0 // indirect github.com/miekg/dns v1.1.56 // indirect github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible // indirect github.com/mitchellh/copystructure v1.2.0 // indirect @@ -556,9 +554,9 @@ require ( github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect github.com/pquerna/cachecontrol v0.1.0 // indirect - github.com/prometheus/client_golang v1.18.0 // indirect + github.com/prometheus/client_golang v1.19.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect - github.com/prometheus/common v0.46.0 // indirect + github.com/prometheus/common v0.48.0 // indirect github.com/prometheus/common/sigv4 v0.1.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/prometheus/prometheus v0.48.1 // indirect @@ -581,7 +579,7 @@ require ( github.com/signalfx/sapm-proto v0.14.0 // indirect github.com/sijms/go-ora/v2 v2.8.8 // indirect github.com/sirupsen/logrus v1.9.3 // indirect - github.com/snowflakedb/gosnowflake v1.7.2 // indirect + github.com/snowflakedb/gosnowflake v1.8.0 // indirect github.com/soheilhy/cmux v0.1.5 // indirect github.com/sourcegraph/conc v0.3.0 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect @@ -619,9 +617,9 @@ require ( github.com/yuin/gopher-lua v0.0.0-20220504180219-658193537a64 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect github.com/zeebo/xxh3 v1.0.2 // indirect - go.etcd.io/bbolt v1.3.8 // indirect + go.etcd.io/bbolt v1.3.9 // indirect go.mongodb.org/atlas v0.36.0 // indirect - go.mongodb.org/mongo-driver v1.13.1 // indirect + go.mongodb.org/mongo-driver v1.14.0 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/collector v0.95.0 // indirect go.opentelemetry.io/collector/component v0.95.0 // indirect @@ -670,8 +668,8 @@ require ( go.opentelemetry.io/proto/otlp v1.1.0 // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.26.0 // indirect - golang.org/x/crypto v0.19.0 // indirect + go.uber.org/zap v1.27.0 // indirect + golang.org/x/crypto v0.20.0 // indirect golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3 // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.21.0 // indirect @@ -847,8 +845,6 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/head replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension => ./extension/healthcheckextension -replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/httpforwarder => ./extension/httpforwarder - replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/oauth2clientauthextension => ./extension/oauth2clientauthextension replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer => ./extension/observer @@ -933,8 +929,6 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/processor/reso replace github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor => ./processor/routingprocessor/ -replace github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanmetricsprocessor => ./processor/spanmetricsprocessor/ - replace github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanprocessor => ./processor/spanprocessor/ replace github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor => ./processor/tailsamplingprocessor diff --git a/go.sum b/go.sum index 9b09a1e26f86..a010da6f30ab 100644 --- a/go.sum +++ b/go.sum @@ -112,10 +112,10 @@ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1. github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0/go.mod h1:5kakwfW5CjC9KK+Q4wjXAg+ShuIm2mBMua0ZFj2C8PE= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.5.0 h1:AifHbc4mg0x9zW52WOpKbsHaDKuRhlI7TVl47thgQ70= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.5.0/go.mod h1:T5RfihdXtBDxt1Ch2wobif3TvzTdumDy29kahv6AV9A= -github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.0.0 h1:yfJe15aSwEQ6Oo6J+gdfdulPNoZ3TEhmbhLIoxZcA+U= -github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.0.0/go.mod h1:Q28U+75mpCaSCDowNEmhIo/rmgdkqmkmzI7N6TGR4UY= -github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v0.8.0 h1:T028gtTPiYt/RMUfs8nVsAL7FDQrfLlrm/NnRG/zcC4= -github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v0.8.0/go.mod h1:cw4zVQgBby0Z5f2v0itn6se2dDP17nTjbZFXW5uPyHA= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.0.1 h1:MyVTgWR8qd/Jw1Le0NZebGBUCLbtak3bJ3z1OlqZBpw= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.0.1/go.mod h1:GpPjLhVR9dnUoJMyHWSPy71xY9/lcmpzIPZXmF0FCVY= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.0.0 h1:D3occbWoio4EBLkbkevetNMAVX197GkzbUMtqjGWn80= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.0.0/go.mod h1:bTSOgj05NGRuHHhQwAdPnYr9TOdNmKlZTgGLL6nyAdI= github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.3.0 h1:IfFdxTUDiV58iZqPKgyWiz4X4fCxZeQ1pTQPImLYXpY= github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.3.0/go.mod h1:SUZc9YRRHfx2+FAQKNDGrssXehqLpxmwRv2mC/5ntj4= github.com/Azure/azure-storage-queue-go v0.0.0-20230531184854-c06a8eff66fe h1:HGuouUM1533rBXmMtR7qh5pYNSSjUZG90b/MgJAnb/A= @@ -165,45 +165,45 @@ github.com/DATA-DOG/go-sqlmock v1.5.2 h1:OcvFkGmslmlZibjAjaHm3L//6LiuBgolP7Oputl github.com/DATA-DOG/go-sqlmock v1.5.2/go.mod h1:88MAG/4G7SMwSE3CeA0ZKzrT5CiOU3OJ+JlNzwDqpNU= github.com/DataDog/agent-payload/v5 v5.0.104 h1:uxTIaLthyKB4CxBKe+2FeMgL6ca3KVxpeYxlJGNcoJg= github.com/DataDog/agent-payload/v5 v5.0.104/go.mod h1:COngtbYYCncpIPiE5D93QlXDH/3VAKk10jDNwGHcMRE= -github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.2 h1:y08IzbpFM/HBaKfgayFZe1FpcbZn6bVPXoZ++93vxv8= -github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.2/go.mod h1:A4nLJvxlg6BO/8/zg81til9yT0uRPuXDFMAzDMpmgn4= +github.com/DataDog/datadog-agent/pkg/obfuscate v0.51.1-0.20240301173728-334e775e420a h1:8t9jpJHbq3WosQmXCVDjqNfGFFPBxBT7/9mbyQqHMi0= +github.com/DataDog/datadog-agent/pkg/obfuscate v0.51.1-0.20240301173728-334e775e420a/go.mod h1:Ai57GjsZUn9AOo4L9ZOdu5uTuGaAxXMh0kin544Lgw0= github.com/DataDog/datadog-agent/pkg/proto v0.52.0-devel h1:nBejGNIU6Jk7bPBxz2bAO+f+kahAXWBXPecebY3R+Zo= github.com/DataDog/datadog-agent/pkg/proto v0.52.0-devel/go.mod h1:wjr5YlVvGip6VmAGzHrdBaGUu1LaA9B6gHvInm5kHiY= -github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.2 h1:7jn5EOu84uph4sd+pB3vF8LnsdTjhh+1/NnCvfNpG4A= -github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.2/go.mod h1:Vc+snp0Bey4MrrJyiV2tVxxJb6BmLomPvN1RgAvjGaQ= -github.com/DataDog/datadog-agent/pkg/trace v0.50.2 h1:eyjTZx3yupppiND/qwiUj6VuWHfyGfPMrqQwRgE41Rw= -github.com/DataDog/datadog-agent/pkg/trace v0.50.2/go.mod h1:SWNRcgZoBNoiyRrECEEe3xQGNCXfqzZVOB43WxDAMlc= -github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.2 h1:f+dYKVwMoGHZpOQM33Wogb/er8ZXeo4aUcbkSk17lM8= -github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.2/go.mod h1:4DalvbtHzT0nqpbj/36FP0IwfKWCSB5Zap7O/SGfPKI= -github.com/DataDog/datadog-agent/pkg/util/log v0.50.2 h1:D4jzhoZtZikiugOr2pl6Xm+MMfrwkjnZziGHgTNpBLk= -github.com/DataDog/datadog-agent/pkg/util/log v0.50.2/go.mod h1:0vyUsWVWDdIRzd6Itim0ZkjCvOF7V8Yi4IzpE5q/UPo= -github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.2 h1:yq97sYsulZz/qyl/bogRigvUskqXPSrt8c7b+xKDs4I= -github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.2/go.mod h1:eTXti9mx7qhkoi+Qg3mMmvVY5McghUUgsf4Hrk9zY8k= -github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.2 h1:xFGXfIsTyHC0VlrrfoAVaZ1pBAJUh2ARZrS7gcdAooY= -github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.2/go.mod h1:EOGgNrSPskIxY3+KgCl+yEggMjrGqrA2oL5va+/p2jM= +github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.51.1-0.20240301173728-334e775e420a h1:7Wijer1rhN7tsEm6mVjXaYZ2XjmKM8cgJKc0hkr57V8= +github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.51.1-0.20240301173728-334e775e420a/go.mod h1:Vc+snp0Bey4MrrJyiV2tVxxJb6BmLomPvN1RgAvjGaQ= +github.com/DataDog/datadog-agent/pkg/trace v0.51.1-0.20240301173728-334e775e420a h1:6ko5fCAcwToPALbUZiqR2tpjIzzqYR+uVXR7t1khRuE= +github.com/DataDog/datadog-agent/pkg/trace v0.51.1-0.20240301173728-334e775e420a/go.mod h1:qMvCrksIQC0czvZB72YdtVfxAK6/Vq2iPNJT7k6q+Bo= +github.com/DataDog/datadog-agent/pkg/util/cgroups v0.51.1-0.20240301173728-334e775e420a h1:95lqMrZdzqfrxxcLUepiEw2zHv7JCFSQhTr3/z1aKl4= +github.com/DataDog/datadog-agent/pkg/util/cgroups v0.51.1-0.20240301173728-334e775e420a/go.mod h1:m4jQb4BdnVTi7jaSETmJ0dQchgOphmZqPuMuwzjpFeM= +github.com/DataDog/datadog-agent/pkg/util/log v0.51.1-0.20240301173728-334e775e420a h1:IW8buCp4IiU0b1lC7x7W0hHlc+ADwV/hmistYtFogL0= +github.com/DataDog/datadog-agent/pkg/util/log v0.51.1-0.20240301173728-334e775e420a/go.mod h1:KdMEnEsO0dn53y3DLcbInK8NaMWnPgo+MunQsQ4cGF8= +github.com/DataDog/datadog-agent/pkg/util/pointer v0.51.1-0.20240301173728-334e775e420a h1:7FUY9948Nsrdfh1P/F1RkJ/gcUZVbTz9ippSbtl3cxo= +github.com/DataDog/datadog-agent/pkg/util/pointer v0.51.1-0.20240301173728-334e775e420a/go.mod h1:eTXti9mx7qhkoi+Qg3mMmvVY5McghUUgsf4Hrk9zY8k= +github.com/DataDog/datadog-agent/pkg/util/scrubber v0.51.1-0.20240301173728-334e775e420a h1:ENeNLL5ItDcd4400kGP148+IMzMlaIZGRfFLa3GJNdY= +github.com/DataDog/datadog-agent/pkg/util/scrubber v0.51.1-0.20240301173728-334e775e420a/go.mod h1:EOGgNrSPskIxY3+KgCl+yEggMjrGqrA2oL5va+/p2jM= github.com/DataDog/datadog-api-client-go/v2 v2.22.0 h1:+DtWu4PjGxsJU8FESjPi7C2rTDMojNungejsIzNFe70= github.com/DataDog/datadog-api-client-go/v2 v2.22.0/go.mod h1:QKOu6vscsh87fMY1lHfLEmNSunyXImj8BUaUWJXOehc= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/DataDog/datadog-go/v5 v5.1.1 h1:JLZ6s2K1pG2h9GkvEvMdEGqMDyVLEAccdX5TltWcLMU= -github.com/DataDog/datadog-go/v5 v5.1.1/go.mod h1:KhiYb2Badlv9/rofz+OznKoEF5XKTonWyhx5K83AP8E= -github.com/DataDog/go-sqllexer v0.0.8 h1:vfC8R9PhmJfeOKcFYAX9UOd890A3wu3KrjU9Kr7nM0E= -github.com/DataDog/go-sqllexer v0.0.8/go.mod h1:nB4Ea2YNsqMwtbWMc4Fm/oP98IIrSPapqwOwPioMspY= +github.com/DataDog/datadog-go/v5 v5.5.0 h1:G5KHeB8pWBNXT4Jtw0zAkhdxEAWSpWH00geHI6LDrKU= +github.com/DataDog/datadog-go/v5 v5.5.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw= +github.com/DataDog/go-sqllexer v0.0.9 h1:Cx2Cu1S0hfj4coCCA8hzjM9+UNFRkcu1avIV//RU5Qw= +github.com/DataDog/go-sqllexer v0.0.9/go.mod h1:nB4Ea2YNsqMwtbWMc4Fm/oP98IIrSPapqwOwPioMspY= github.com/DataDog/go-tuf v1.0.2-0.5.2 h1:EeZr937eKAWPxJ26IykAdWA4A0jQXJgkhUjqEI/w7+I= github.com/DataDog/go-tuf v1.0.2-0.5.2/go.mod h1:zBcq6f654iVqmkk8n2Cx81E1JnNTMOAx1UEO/wZR+P0= github.com/DataDog/gohai v0.0.0-20230524154621-4316413895ee h1:tXibLZk3G6HncIFJKaNItsdzcrk4YqILNDZlXPTNt4k= github.com/DataDog/gohai v0.0.0-20230524154621-4316413895ee/go.mod h1:nTot/Iy0kW16bXgXr6blEc8gFeAS7vTqYlhAxh+dbc0= -github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.13.3 h1:XEhjylKpZec5tUQyw+fOYYBIEnktiCr/TKsrvFUB7uA= -github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.13.3/go.mod h1:63BBpcn68W2K89ZaLzYtzUiEit49+Rf2ZsEYza2TAcc= -github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.13.3 h1:hnzEiqocvnt6U1QGxfeDFf5xhE77jt4LOjZAXW9ueWo= -github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.13.3/go.mod h1:Tk2wwdBgWeSvDPtrGGyym8CdVWSuphiToGc/tRvFoNQ= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.13.3 h1:hcYZMgGDMUz8Dz6PcOhgk6FF0yG4N7KErS5J3O/MpeU= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.13.3/go.mod h1:Z2FPxYhi8GIFkS4WLC7RrRaGolyB9TqS2RMSwNcmczk= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.13.3 h1:oaYprbAr8/mPEyFNfqnm668bxg8IG000sQ6uNuuffro= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.13.3/go.mod h1:dmNsrdpbegG62b7/ETcRi53OsOmYlfshuTThx9BAiQI= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.13.3 h1:QelZO3ixjVqlqzTa+wxIDFvYnnzy/SG9iqXci1nhouc= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.13.3/go.mod h1:AObll3Cj7UJK56bc7HRrpbGWc98C1Io0ChpFEoxS2f8= -github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.13.3 h1:9fdt/9NeSUtypPT4du2/5TTQic9nL1YqDSIaq5Ttsi4= -github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.13.3/go.mod h1:P8Tr/1BSm0vQ0UXVOtIKmJKXCgb84jdFe9HuBKJPwkc= +github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.13.4 h1:PTIZJAsfnr2XLB3V3duL+mSbZvYV8G3XQ9e57KyOuOA= +github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.13.4/go.mod h1:5yS6i90MEZS3NG+o7PrQQ8i7OaEMzwQvn4bCZ9h9Rao= +github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.13.4 h1:B2R7Wh791uphpltmorbvvdKk0rJOhoExwM4NnE7hXTg= +github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.13.4/go.mod h1:Tk2wwdBgWeSvDPtrGGyym8CdVWSuphiToGc/tRvFoNQ= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.13.4 h1:GcJUxjunnJEL62K+fY7pjyvcb4Cvqr5VtD0DFc8rp+w= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.13.4/go.mod h1:/9yo8Scnf6R0KufxJIHfQD+GAbT9cyINxaTPMDgl2Wk= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.13.4 h1:dU9oPMbAr/wYMNdzhu0pxIhAJOn1Btj1T3ZSyY6RvY0= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.13.4/go.mod h1:ud/Xr5TWUopcaGHdkh9RN8lhnCAFa95X16Rb5mrkE18= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.13.4 h1:ZuYc5Ql/GSyAEMgpKkbQiHOtIHkEpYujITW1wIVFgLE= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.13.4/go.mod h1:YSntkplFoUM1mepnPeJFsoblqD0Wdi+Avg1/d1upgZQ= +github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.13.4 h1:t/Zh8ztLDBOMRMiuVNFthWMMG5F4POgc5M6+Y3DTX9g= +github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.13.4/go.mod h1:JfdBBDreQfbIN5FYrAtZV3VmQMXnf9o4tMbaMxWqe40= github.com/DataDog/sketches-go v1.4.4 h1:dF52vzXRFSPOj2IjXSWLvXq3jubL4CI69kwYjJ1w5Z8= github.com/DataDog/sketches-go v1.4.4/go.mod h1:XR0ns2RtEEF09mDKXiKZiQg+nfZStrq1ZuL1eezeZe0= github.com/DataDog/zstd v1.5.0/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= @@ -225,8 +225,8 @@ github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapp github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.45.0/go.mod h1:qkFPtMouQjW5ugdHIOthiTbweVHUTqbS0Qsu55KqXks= github.com/HdrHistogram/hdrhistogram-go v1.1.2 h1:5IcZpTvzydCQeHzK4Ef/D5rrSqwxob0t8PQPMybUNFM= github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= -github.com/IBM/sarama v1.42.2 h1:VoY4hVIZ+WQJ8G9KNY/SQlWguBQXQ9uvFPOnrcu8hEw= -github.com/IBM/sarama v1.42.2/go.mod h1:FLPGUGwYqEs62hq2bVG6Io2+5n+pS6s/WOXVKWSLFtE= +github.com/IBM/sarama v1.43.0 h1:YFFDn8mMI2QL0wOrG0J2sFoVIAFl7hS9JQi2YZsXtJc= +github.com/IBM/sarama v1.43.0/go.mod h1:zlE6HEbC/SMQ9mhEYaF7nNLYOUyrs0obySKCckWP9BM= 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/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= @@ -335,38 +335,38 @@ github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN github.com/aws/aws-sdk-go v1.32.6/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.38.35/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go v1.44.263/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= -github.com/aws/aws-sdk-go v1.50.17 h1:KsbzUKDgGNlkDHGvoQDhiJ63a9jtZd+O+/s3pTOr/ns= -github.com/aws/aws-sdk-go v1.50.17/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.50.27 h1:96ifhrSuja+AzdP3W/T2337igqVQ2FcSIJYkk+0rCeA= +github.com/aws/aws-sdk-go v1.50.27/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/aws/aws-sdk-go-v2 v1.17.7/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= github.com/aws/aws-sdk-go-v2 v1.18.0/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= -github.com/aws/aws-sdk-go-v2 v1.25.0 h1:sv7+1JVJxOu/dD/sz/csHX7jFqmP001TIY7aytBWDSQ= -github.com/aws/aws-sdk-go-v2 v1.25.0/go.mod h1:G104G1Aho5WqF+SR3mDIobTABQzpYV0WxMsKxlMggOA= +github.com/aws/aws-sdk-go-v2 v1.25.2 h1:/uiG1avJRgLGiQM9X3qJM8+Qa6KRGK5rRPuXE0HUM+w= +github.com/aws/aws-sdk-go-v2 v1.25.2/go.mod h1:Evoc5AsmtveRt1komDwIsjHFyrP5tDuF1D1U+6z6pNo= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10/go.mod h1:VeTZetY5KRJLuD/7fkQXMU6Mw7H5m/KP2J5Iy9osMno= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.0 h1:2UO6/nT1lCZq1LqM67Oa4tdgP1CvL1sLSxvuD+VrOeE= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.0/go.mod h1:5zGj2eA85ClyedTDK+Whsu+w9yimnVIZvhvBKrDquM8= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.1 h1:gTK2uhtAPtFcdRRJilZPx8uJLL2J85xK11nKtWL0wfU= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.1/go.mod h1:sxpLb+nZk7tIfCWChfd+h4QwHNUR57d8hA1cleTkjJo= github.com/aws/aws-sdk-go-v2/config v1.18.19/go.mod h1:XvTmGMY8d52ougvakOv1RpiTLPz9dlG/OQHsKU/cMmY= github.com/aws/aws-sdk-go-v2/config v1.18.25/go.mod h1:dZnYpD5wTW/dQF0rRNLVypB396zWCcPiBIvdvSWHEg4= -github.com/aws/aws-sdk-go-v2/config v1.27.0 h1:J5sdGCAHuWKIXLeXiqr8II/adSvetkx0qdZwdbXXpb0= -github.com/aws/aws-sdk-go-v2/config v1.27.0/go.mod h1:cfh8v69nuSUohNFMbIISP2fhmblGmYEOKs5V53HiHnk= +github.com/aws/aws-sdk-go-v2/config v1.27.4 h1:AhfWb5ZwimdsYTgP7Od8E9L1u4sKmDW2ZVeLcf2O42M= +github.com/aws/aws-sdk-go-v2/config v1.27.4/go.mod h1:zq2FFXK3A416kiukwpsd+rD4ny6JC7QSkp4QdN1Mp2g= github.com/aws/aws-sdk-go-v2/credentials v1.13.18/go.mod h1:vnwlwjIe+3XJPBYKu1et30ZPABG3VaXJYr8ryohpIyM= github.com/aws/aws-sdk-go-v2/credentials v1.13.24/go.mod h1:jYPYi99wUOPIFi0rhiOvXeSEReVOzBqFNOX5bXYoG2o= -github.com/aws/aws-sdk-go-v2/credentials v1.17.0 h1:lMW2x6sKBsiAJrpi1doOXqWFyEPoE886DTb1X0wb7So= -github.com/aws/aws-sdk-go-v2/credentials v1.17.0/go.mod h1:uT41FIH8cCIxOdUYIL0PYyHlL1NoneDuDSCwg5VE/5o= +github.com/aws/aws-sdk-go-v2/credentials v1.17.4 h1:h5Vztbd8qLppiPwX+y0Q6WiwMZgpd9keKe2EAENgAuI= +github.com/aws/aws-sdk-go-v2/credentials v1.17.4/go.mod h1:+30tpwrkOgvkJL1rUZuRLoxcJwtI/OkeBLYnHxJtVe0= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.1/go.mod h1:lfUx8puBRdM5lVVMQlwt2v+ofiG/X6Ms+dy0UkG/kXw= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.3/go.mod h1:4Q0UFP0YJf0NrsEuEYHpM9fTSEVnD16Z3uyEF7J9JGM= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.0 h1:xWCwjjvVz2ojYTP4kBKUuUh9ZrXfcAXpflhOUUeXg1k= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.0/go.mod h1:j3fACuqXg4oMTQOR2yY7m0NmJY0yBK4L4sLsRXq1Ins= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.2 h1:AK0J8iYBFeUk2Ax7O8YpLtFsfhdOByh2QIkHmigpRYk= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.2/go.mod h1:iRlGzMix0SExQEviAyptRWRGdYNo3+ufW/lCzvKVTUc= github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.59 h1:E3Y+OfzOK1+rmRo/K2G0ml8Vs+Xqk0kOnf4nS0kUtBc= github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.59/go.mod h1:1M4PLSBUVfBI0aP+C9XI7SM6kZPCGYyI6izWz0TGprE= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.31/go.mod h1:QT0BqUvX1Bh2ABdTGnjqEjvjzrCfIniM9Sc8zn9Yndo= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.33/go.mod h1:7i0PF1ME/2eUPFcjkVIwq+DOygHEoK92t5cDqNgYbIw= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.0 h1:NPs/EqVO+ajwOoq56EfcGKa3L3ruWuazkIw1BqxwOPw= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.0/go.mod h1:D+duLy2ylgatV+yTlQ8JTuLfDD0BnFvnQRc+o6tbZ4M= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.2 h1:bNo4LagzUKbjdxE0tIcR9pMzLR2U/Tgie1Hq1HQ3iH8= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.2/go.mod h1:wRQv0nN6v9wDXuWThpovGQjqF1HFdcgWjporw14lS8k= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.25/go.mod h1:zBHOPwhBc3FlQjQJE/D3IfPWiWaQmT06Vq9aNukDo0k= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.27/go.mod h1:UrHnn3QV/d0pBZ6QBAEQcqFLf8FAzLmoUfPVIueOvoM= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.0 h1:ks7KGMVUMoDzcxNWUlEdI+/lokMFD136EL6DWmUOV80= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.0/go.mod h1:hL6BWM/d/qz113fVitZjbXR0E+RCTU1+x+1Idyn5NgE= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.2 h1:EtOU5jsPdIQNP+6Q2C5e3d65NKT1PeCiQk+9OdzO12Q= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.2/go.mod h1:tyF5sKccmDz0Bv4NrstEr+/9YkSPJHrcO7UsUKf7pWM= github.com/aws/aws-sdk-go-v2/internal/ini v1.3.32/go.mod h1:XGhIBZDEgfqmFIugclZ6FU7v75nHhBDtzuB4xB/tEi4= github.com/aws/aws-sdk-go-v2/internal/ini v1.3.34/go.mod h1:Etz2dj6UHYuw+Xw830KfzCfWGMzqvUTCjUj5b76GVDc= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 h1:hT8rVHwugYE2lEfdFE0QWVo81lF7jMrYJVDWI+f+VxU= @@ -374,35 +374,35 @@ github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0/go.mod h1:8tu/lYfQfFe6IGnaOdrpV github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.23 h1:DWYZIsyqagnWL00f8M/SOr9fN063OEQWn9LLTbdYXsk= github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.23/go.mod h1:uIiFgURZbACBEQJfqTZPb/jxO7R+9LeoHUFudtIdeQI= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.11/go.mod h1:iV4q2hsqtNECrfmlXyord9u4zyuFEJX9eLgLpSPzWA8= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.0 h1:a33HuFlO0KsveiP90IUJh8Xr/cx9US2PqkSroaLc+o8= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.0/go.mod h1:SxIkWpByiGbhbHYTo9CMTUnx2G4p4ZQMrDPcRRy//1c= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.1 h1:EyBZibRTVAs6ECHZOw5/wlylS9OcTzwyjeQMudmREjE= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.1/go.mod h1:JKpmtYhhPs7D97NL/ltqz7yCkERFW5dOlHyVl66ZYF8= github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.26 h1:CeuSeq/8FnYpPtnuIeLQEEvDv9zUjneuYi8EghMBdwQ= github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.26/go.mod h1:2UqAAwMUXKeRkAHIlDJqvMVgOWkUi/AUXPk/YIe+Dg4= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.25/go.mod h1:/95IA+0lMnzW6XzqYJRpjjsAbKEORVeO0anQqjd2CNU= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.27/go.mod h1:EOwBD4J4S5qYszS5/3DpkejfuK+Z5/1uzICfPaZLtqw= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.0 h1:SHN/umDLTmFTmYfI+gkanz6da3vK8Kvj/5wkqnTHbuA= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.0/go.mod h1:l8gPU5RYGOFHJqWEpPMoRTP0VoaWQSkJdKo+hwWnnDA= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.2 h1:5ffmXjPtwRExp1zc7gENLgCPyHFbhEPwVTkTiH9niSk= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.2/go.mod h1:Ru7vg1iQ7cR4i7SZ/JTLYN9kaXtbL69UdgG0OQWQxW0= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.14.0 h1:e2ooMhpYGhDnBfSvIyusvAwX7KexuZaHbQY2Dyei7VU= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.14.0/go.mod h1:bh2E0CXKZsQN+faiKVqC40vfNMAWheoULBCnEgO9K+8= -github.com/aws/aws-sdk-go-v2/service/kinesis v1.25.0 h1:tUC1pAD2bV/FbEFuTSoxGi8IVds3NL3G7epibWHHIFU= -github.com/aws/aws-sdk-go-v2/service/kinesis v1.25.0/go.mod h1:q9d/nloLNFGbRkDJJTwSFntbsKUgODmg6I0sPFx2ugo= +github.com/aws/aws-sdk-go-v2/service/kinesis v1.27.1 h1:p8dOJ/UKXOwttc1Cxw1Ek52klVmMuiaCUkhsUGxce1I= +github.com/aws/aws-sdk-go-v2/service/kinesis v1.27.1/go.mod h1:VpH1IBG1YYZHPu5qShNt7EGaqUQbHAJZrbDtEpqDvvY= github.com/aws/aws-sdk-go-v2/service/s3 v1.31.0 h1:B1G2pSPvbAtQjilPq+Y7jLIzCOwKzuVEl+aBBaNG0AQ= github.com/aws/aws-sdk-go-v2/service/s3 v1.31.0/go.mod h1:ncltU6n4Nof5uJttDtcNQ537uNuwYqsZZQcpkd2/GUQ= github.com/aws/aws-sdk-go-v2/service/sso v1.12.6/go.mod h1:Y1VOmit/Fn6Tz1uFAeCO6Q7M2fmfXSCLeL5INVYsLuY= github.com/aws/aws-sdk-go-v2/service/sso v1.12.10/go.mod h1:ouy2P4z6sJN70fR3ka3wD3Ro3KezSxU6eKGQI2+2fjI= -github.com/aws/aws-sdk-go-v2/service/sso v1.19.0 h1:u6OkVDxtBPnxPkZ9/63ynEe+8kHbtS5IfaC4PzVxzWM= -github.com/aws/aws-sdk-go-v2/service/sso v1.19.0/go.mod h1:YqbU3RS/pkDVu+v+Nwxvn0i1WB0HkNWEePWbmODEbbs= +github.com/aws/aws-sdk-go-v2/service/sso v1.20.1 h1:utEGkfdQ4L6YW/ietH7111ZYglLJvS+sLriHJ1NBJEQ= +github.com/aws/aws-sdk-go-v2/service/sso v1.20.1/go.mod h1:RsYqzYr2F2oPDdpy+PdhephuZxTfjHQe7SOBcZGoAU8= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.6/go.mod h1:Lh/bc9XUf8CfOY6Jp5aIkQtN+j1mc+nExc+KXj9jx2s= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.10/go.mod h1:AFvkxc8xfBe8XA+5St5XIHHrQQtkxqrRincx4hmMHOk= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.22.0 h1:6DL0qu5+315wbsAEEmzK+P9leRwNbkp+lGjPC+CEvb8= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.22.0/go.mod h1:olUAyg+FaoFaL/zFaeQQONjOZ9HXoxgvI/c7mQTYz7M= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.1 h1:9/GylMS45hGGFCcMrUZDVayQE1jYSIN6da9jo7RAYIw= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.1/go.mod h1:YjAPFn4kGFqKC54VsHs5fn5B6d+PCY2tziEa3U/GB5Y= github.com/aws/aws-sdk-go-v2/service/sts v1.18.7/go.mod h1:JuTnSoeePXmMVe9G8NcjjwgOKEfZ4cOjMuT2IBT/2eI= github.com/aws/aws-sdk-go-v2/service/sts v1.19.0/go.mod h1:BgQOMsg8av8jset59jelyPW7NoZcZXLVpDsXunGDrk8= -github.com/aws/aws-sdk-go-v2/service/sts v1.27.0 h1:cjTRjh700H36MQ8M0LnDn33W3JmwC77mdxIIyPWCdpM= -github.com/aws/aws-sdk-go-v2/service/sts v1.27.0/go.mod h1:nXfOBMWPokIbOY+Gi7a1psWMSvskUCemZzI+SMB7Akc= +github.com/aws/aws-sdk-go-v2/service/sts v1.28.1 h1:3I2cBEYgKhrWlwyZgfpSO2BpaMY1LHPqXYk/QGlu2ew= +github.com/aws/aws-sdk-go-v2/service/sts v1.28.1/go.mod h1:uQ7YYKZt3adCRrdCBREm1CD3efFLOUNH77MrUCvx5oA= github.com/aws/smithy-go v1.13.5/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= -github.com/aws/smithy-go v1.20.0 h1:6+kZsCXZwKxZS9RfISnPc4EXlHoyAkm2hPuM8X2BrrQ= -github.com/aws/smithy-go v1.20.0/go.mod h1:uo5RKksAl4PzhqaAbjd4rLgFoq5koTsQKYuGe7dklGc= +github.com/aws/smithy-go v1.20.1 h1:4SZlSlMr36UEqC7XOyRVb27XMeZubNcBNN+9IgEPIQw= +github.com/aws/smithy-go v1.20.1/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E= github.com/basgys/goxml2json v1.1.0 h1:4ln5i4rseYfXNd86lGEB+Vi652IsIXIvggKM/BhUKVw= github.com/basgys/goxml2json v1.1.0/go.mod h1:wH7a5Np/Q4QoECFIU8zTQlZwZkrilY0itPfecMw41Dw= github.com/beefsack/go-rate v0.0.0-20220214233405-116f4ca011a0/go.mod h1:6YNgTHLutezwnBvyneBbwvB8C82y3dcoOj5EQJIdGXA= @@ -551,8 +551,8 @@ github.com/dvsekhvalnov/jose2go v1.6.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB github.com/dynatrace-oss/dynatrace-metric-utils-go v0.5.0 h1:wHGPJSXvwKQVf/XfhjUPyrhpcPKWNy8F3ikH+eiwoBg= github.com/dynatrace-oss/dynatrace-metric-utils-go v0.5.0/go.mod h1:PseHFo8Leko7J4A/TfZ6kkHdkzKBLUta6hRZR/OEbbc= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= -github.com/eapache/go-resiliency v1.5.0 h1:dRsaR00whmQD+SgVKlq/vCRFNgtEb5yppyeVos3Yce0= -github.com/eapache/go-resiliency v1.5.0/go.mod h1:5yPzW0MIvSe0JDsv0v+DvcjEv2FyD6iZYSs1ZI+iQho= +github.com/eapache/go-resiliency v1.6.0 h1:CqGDTLtpwuWKn6Nj3uNUdflaq+/kIPsg0gfNzHton30= +github.com/eapache/go-resiliency v1.6.0/go.mod h1:5yPzW0MIvSe0JDsv0v+DvcjEv2FyD6iZYSs1ZI+iQho= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 h1:Oy0F4ALJ04o5Qqpdz8XLIpNA3WM/iSIXqxtqo7UGVws= github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3/go.mod h1:YvSRo5mw33fLEx1+DlK6L2VV43tJt5Eyel9n9XBcR+0= @@ -1082,8 +1082,8 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.10.8/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.17.6 h1:60eq2E/jlfwQXtvZEeBUYADs+BwKBWURIY+Gj2eRGjI= -github.com/klauspost/compress v1.17.6/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLAKQQg= +github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= @@ -1178,8 +1178,8 @@ github.com/maxatome/go-testdeep v1.12.0 h1:Ql7Go8Tg0C1D/uMMX59LAoYK7LffeJQ6X2T04 github.com/maxatome/go-testdeep v1.12.0/go.mod h1:lPZc/HAcJMP92l7yI6TRz1aZN5URwUBUAfUNvrclaNM= github.com/microsoft/ApplicationInsights-Go v0.4.4 h1:G4+H9WNs6ygSCe6sUyxRc2U81TI5Es90b2t/MwX5KqY= github.com/microsoft/ApplicationInsights-Go v0.4.4/go.mod h1:fKRUseBqkw6bDiXTs3ESTiU/4YTIHsQS4W3fP2ieF4U= -github.com/microsoft/go-mssqldb v1.6.0 h1:mM3gYdVwEPFrlg/Dvr2DNVEgYFG7L42l+dGc67NNNpc= -github.com/microsoft/go-mssqldb v1.6.0/go.mod h1:00mDtPbeQCRGC1HwOOR5K/gr30P1NcEG0vx6Kbv2aJU= +github.com/microsoft/go-mssqldb v1.7.0 h1:sgMPW0HA6Ihd37Yx0MzHyKD726C2kY/8KJsQtXHNaAs= +github.com/microsoft/go-mssqldb v1.7.0/go.mod h1:kOvZKUdrhhFQmxLZqbwUV0rHkNkZpthMITIb2Ko1IoA= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= @@ -1376,8 +1376,8 @@ github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3O github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= -github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= +github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= +github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -1394,8 +1394,8 @@ github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB8 github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.29.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.31.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.46.0 h1:doXzt5ybi1HBKpsZOL0sSkaNHJJqkyfEWZGGqqScV0Y= -github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1BTn+g2pa/hQ= +github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE= +github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= github.com/prometheus/common/sigv4 v0.1.0 h1:qoVebwtwwEhS85Czm2dSROY5fTo2PAPEVdDeppTwGX4= github.com/prometheus/common/sigv4 v0.1.0/go.mod h1:2Jkxxk9yYvCkE5G1sQT7GuEXm57JrvHu9k5YwTjsNtI= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= @@ -1478,8 +1478,8 @@ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVs github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/assertions v1.1.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/snowflakedb/gosnowflake v1.7.2 h1:HRSwva8YXC64WUppfmHcMNVVzSE1+EwXXaJxgS0EkTo= -github.com/snowflakedb/gosnowflake v1.7.2/go.mod h1:03tW856vc3ceM4rJuj7KO4dzqN7qoezTm+xw7aPIIFo= +github.com/snowflakedb/gosnowflake v1.8.0 h1:4bQj8eAYGMkou/nICiIEb9jSbBLDDp5cB6JaKx9WwiA= +github.com/snowflakedb/gosnowflake v1.8.0/go.mod h1:7yyY2MxtDti2eXgtvlZ8QxzCN6KV2B4qb1HuygMI+0U= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js= github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= @@ -1625,8 +1625,8 @@ github.com/zorkian/go-datadog-api v2.30.0+incompatible/go.mod h1:PkXwHX9CUQa/FpB go.einride.tech/aip v0.66.0 h1:XfV+NQX6L7EOYK11yoHHFtndeaWh3KbD9/cN/6iWEt8= go.einride.tech/aip v0.66.0/go.mod h1:qAhMsfT7plxBX+Oy7Huol6YUvZ0ZzdUz26yZsQwfl1M= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA= -go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= +go.etcd.io/bbolt v1.3.9 h1:8x7aARPEXiXbHmtUwAIv7eV2fQFHrLLavdiJ3uzJXoI= +go.etcd.io/bbolt v1.3.9/go.mod h1:zaO32+Ti0PK1ivdPtgMESzuzL2VPoIG1PCQNvOdo/dE= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= @@ -1634,8 +1634,8 @@ go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsX go.mongodb.org/atlas v0.36.0 h1:m05S3AO7zkl+bcG1qaNsEKBnAqnKx2FDwLooHpIG3j4= go.mongodb.org/atlas v0.36.0/go.mod h1:nfPldE9dSama6G2IbIzmEza02Ly7yFZjMMVscaM0uEc= go.mongodb.org/mongo-driver v1.11.4/go.mod h1:PTSz5yu21bkT/wXpkS7WR5f0ddqw5quethTUn9WM+2g= -go.mongodb.org/mongo-driver v1.13.1 h1:YIc7HTYsKndGK4RFzJ3covLz1byri52x0IoMB0Pt/vk= -go.mongodb.org/mongo-driver v1.13.1/go.mod h1:wcDf1JBCXy2mOW0bWHwO/IOYqdca1MPCwDtFu/Z9+eo= +go.mongodb.org/mongo-driver v1.14.0 h1:P98w8egYRjYe3XDjxhYJagTokP/H6HzlsnojRgZRd80= +go.mongodb.org/mongo-driver v1.14.0/go.mod h1:Vzb0Mk/pa7e6cWw85R4F/endUC3u0U9jGcNU603k65c= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= @@ -1792,8 +1792,8 @@ go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -1821,8 +1821,8 @@ golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= -golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +golang.org/x/crypto v0.20.0 h1:jmAMJJZXr5KiCw05dfYK9QnqaqKLYXijU23lsEdcQqg= +golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZPQ= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= diff --git a/internal/aws/awsutil/go.mod b/internal/aws/awsutil/go.mod index 1a44365986d4..dedb3b2f2439 100644 --- a/internal/aws/awsutil/go.mod +++ b/internal/aws/awsutil/go.mod @@ -3,10 +3,10 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/aw go 1.21 require ( - github.com/aws/aws-sdk-go v1.50.17 + github.com/aws/aws-sdk-go v1.50.27 github.com/stretchr/testify v1.8.4 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 golang.org/x/net v0.21.0 ) diff --git a/internal/aws/awsutil/go.sum b/internal/aws/awsutil/go.sum index 96e8583beb04..6a6b11642685 100644 --- a/internal/aws/awsutil/go.sum +++ b/internal/aws/awsutil/go.sum @@ -1,5 +1,5 @@ -github.com/aws/aws-sdk-go v1.50.17 h1:KsbzUKDgGNlkDHGvoQDhiJ63a9jtZd+O+/s3pTOr/ns= -github.com/aws/aws-sdk-go v1.50.17/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.50.27 h1:96ifhrSuja+AzdP3W/T2337igqVQ2FcSIJYkk+0rCeA= +github.com/aws/aws-sdk-go v1.50.27/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= 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= @@ -27,8 +27,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= diff --git a/internal/aws/containerinsight/go.mod b/internal/aws/containerinsight/go.mod index 17770e4d042e..a6fc0c1646d1 100644 --- a/internal/aws/containerinsight/go.mod +++ b/internal/aws/containerinsight/go.mod @@ -6,7 +6,7 @@ require ( github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/pdata v1.2.0 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/internal/aws/containerinsight/go.sum b/internal/aws/containerinsight/go.sum index 8fc3536c52eb..5e2607db15a9 100644 --- a/internal/aws/containerinsight/go.sum +++ b/internal/aws/containerinsight/go.sum @@ -39,8 +39,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/internal/aws/cwlogs/go.mod b/internal/aws/cwlogs/go.mod index 0a102c9c4c2e..c7c513fe461c 100644 --- a/internal/aws/cwlogs/go.mod +++ b/internal/aws/cwlogs/go.mod @@ -3,11 +3,11 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/cw go 1.21 require ( - github.com/aws/aws-sdk-go v1.50.17 + github.com/aws/aws-sdk-go v1.50.27 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.95.0 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/internal/aws/cwlogs/go.sum b/internal/aws/cwlogs/go.sum index b4b3582ab657..edbcbb830c05 100644 --- a/internal/aws/cwlogs/go.sum +++ b/internal/aws/cwlogs/go.sum @@ -1,5 +1,5 @@ -github.com/aws/aws-sdk-go v1.50.17 h1:KsbzUKDgGNlkDHGvoQDhiJ63a9jtZd+O+/s3pTOr/ns= -github.com/aws/aws-sdk-go v1.50.17/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.50.27 h1:96ifhrSuja+AzdP3W/T2337igqVQ2FcSIJYkk+0rCeA= +github.com/aws/aws-sdk-go v1.50.27/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= 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= @@ -71,8 +71,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/internal/aws/ecsutil/go.mod b/internal/aws/ecsutil/go.mod index f78a03ddbdaf..c39332ae58ee 100644 --- a/internal/aws/ecsutil/go.mod +++ b/internal/aws/ecsutil/go.mod @@ -8,7 +8,7 @@ require ( go.opentelemetry.io/collector/component v0.95.0 go.opentelemetry.io/collector/config/confighttp v0.95.0 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/internal/aws/ecsutil/go.sum b/internal/aws/ecsutil/go.sum index 458eaef5d617..6d85703d934d 100644 --- a/internal/aws/ecsutil/go.sum +++ b/internal/aws/ecsutil/go.sum @@ -119,8 +119,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/internal/aws/k8s/go.mod b/internal/aws/k8s/go.mod index bd985fd32481..e94e3d5e5bb6 100644 --- a/internal/aws/k8s/go.mod +++ b/internal/aws/k8s/go.mod @@ -3,10 +3,10 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/k8 go 1.21 require ( - github.com/aws/aws-sdk-go v1.50.17 + github.com/aws/aws-sdk-go v1.50.27 github.com/stretchr/testify v1.8.4 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 k8s.io/api v0.29.2 k8s.io/apimachinery v0.29.2 k8s.io/client-go v0.29.2 diff --git a/internal/aws/k8s/go.sum b/internal/aws/k8s/go.sum index ce82e49776fc..ec644c1f9c57 100644 --- a/internal/aws/k8s/go.sum +++ b/internal/aws/k8s/go.sum @@ -1,5 +1,5 @@ -github.com/aws/aws-sdk-go v1.50.17 h1:KsbzUKDgGNlkDHGvoQDhiJ63a9jtZd+O+/s3pTOr/ns= -github.com/aws/aws-sdk-go v1.50.17/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.50.27 h1:96ifhrSuja+AzdP3W/T2337igqVQ2FcSIJYkk+0rCeA= +github.com/aws/aws-sdk-go v1.50.27/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -92,8 +92,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/internal/aws/k8s/k8sclient/endpoint_test.go b/internal/aws/k8s/k8sclient/endpoint_test.go index e55cd7eb2e6c..1b7f0cea8540 100644 --- a/internal/aws/k8s/k8sclient/endpoint_test.go +++ b/internal/aws/k8s/k8sclient/endpoint_test.go @@ -416,5 +416,6 @@ func TestNewEndpointClient(t *testing.T) { fakeClientSet := fake.NewSimpleClientset(endpointsArray...) client := newEpClient(fakeClientSet, zap.NewNop(), setOption) assert.NotNil(t, client) + client.shutdown() removeTempKubeConfig() } diff --git a/cmd/mdatagen/internal/metadata/package_test.go b/internal/aws/k8s/k8sclient/package_test.go similarity index 91% rename from cmd/mdatagen/internal/metadata/package_test.go rename to internal/aws/k8s/k8sclient/package_test.go index 1aba5ec4bb0b..5db6b66f211b 100644 --- a/cmd/mdatagen/internal/metadata/package_test.go +++ b/internal/aws/k8s/k8sclient/package_test.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package metadata +package k8sclient import ( "testing" diff --git a/internal/aws/proxy/go.mod b/internal/aws/proxy/go.mod index 0081ae256e91..1d26cf45e2bd 100644 --- a/internal/aws/proxy/go.mod +++ b/internal/aws/proxy/go.mod @@ -3,12 +3,12 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/pr go 1.21 require ( - github.com/aws/aws-sdk-go v1.50.17 + github.com/aws/aws-sdk-go v1.50.27 github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.95.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/config/confignet v0.95.0 go.opentelemetry.io/collector/config/configtls v0.95.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/internal/aws/proxy/go.sum b/internal/aws/proxy/go.sum index 72097b46116b..c94429c978f1 100644 --- a/internal/aws/proxy/go.sum +++ b/internal/aws/proxy/go.sum @@ -1,5 +1,5 @@ -github.com/aws/aws-sdk-go v1.50.17 h1:KsbzUKDgGNlkDHGvoQDhiJ63a9jtZd+O+/s3pTOr/ns= -github.com/aws/aws-sdk-go v1.50.17/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.50.27 h1:96ifhrSuja+AzdP3W/T2337igqVQ2FcSIJYkk+0rCeA= +github.com/aws/aws-sdk-go v1.50.27/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= 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= @@ -50,8 +50,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= 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 b2f47e3f83ac..6304c9cc45c1 100644 --- a/internal/aws/xray/go.mod +++ b/internal/aws/xray/go.mod @@ -3,12 +3,12 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xr go 1.21 require ( - github.com/aws/aws-sdk-go v1.50.17 + github.com/aws/aws-sdk-go v1.50.27 github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/awsutil v0.95.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.95.0 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/internal/aws/xray/go.sum b/internal/aws/xray/go.sum index 7c45594d4c3d..e12c1a1aa754 100644 --- a/internal/aws/xray/go.sum +++ b/internal/aws/xray/go.sum @@ -1,5 +1,5 @@ -github.com/aws/aws-sdk-go v1.50.17 h1:KsbzUKDgGNlkDHGvoQDhiJ63a9jtZd+O+/s3pTOr/ns= -github.com/aws/aws-sdk-go v1.50.17/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.50.27 h1:96ifhrSuja+AzdP3W/T2337igqVQ2FcSIJYkk+0rCeA= +github.com/aws/aws-sdk-go v1.50.27/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= 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= @@ -71,8 +71,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/internal/aws/xray/testdata/sampleapp/go.mod b/internal/aws/xray/testdata/sampleapp/go.mod index b65950eba6a3..e7ae7ab66a7a 100644 --- a/internal/aws/xray/testdata/sampleapp/go.mod +++ b/internal/aws/xray/testdata/sampleapp/go.mod @@ -3,7 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xr go 1.21 require ( - github.com/aws/aws-sdk-go v1.50.17 + github.com/aws/aws-sdk-go v1.50.27 github.com/aws/aws-xray-sdk-go v1.8.3 ) diff --git a/internal/aws/xray/testdata/sampleapp/go.sum b/internal/aws/xray/testdata/sampleapp/go.sum index e21193e59a08..f2a1b720854b 100644 --- a/internal/aws/xray/testdata/sampleapp/go.sum +++ b/internal/aws/xray/testdata/sampleapp/go.sum @@ -2,8 +2,8 @@ github.com/DATA-DOG/go-sqlmock v1.4.1 h1:ThlnYciV1iM/V0OSF/dtkqWb6xo5qITT1TJBG1M github.com/DATA-DOG/go-sqlmock v1.4.1/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/andybalholm/brotli v1.0.6 h1:Yf9fFpf49Zrxb9NlQaluyE92/+X7UVHlhMNJN2sxfOI= github.com/andybalholm/brotli v1.0.6/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= -github.com/aws/aws-sdk-go v1.50.17 h1:KsbzUKDgGNlkDHGvoQDhiJ63a9jtZd+O+/s3pTOr/ns= -github.com/aws/aws-sdk-go v1.50.17/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.50.27 h1:96ifhrSuja+AzdP3W/T2337igqVQ2FcSIJYkk+0rCeA= +github.com/aws/aws-sdk-go v1.50.27/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/aws/aws-xray-sdk-go v1.8.3 h1:S8GdgVncBRhzbNnNUgTPwhEqhwt2alES/9rLASyhxjU= github.com/aws/aws-xray-sdk-go v1.8.3/go.mod h1:tv8uLMOSCABolrIF8YCcp3ghyswArsan8dfLCA1ZATk= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= diff --git a/internal/buildscripts/packaging/fpm/test.sh b/internal/buildscripts/packaging/fpm/test.sh index fffb4587c440..9baf04cb0903 100755 --- a/internal/buildscripts/packaging/fpm/test.sh +++ b/internal/buildscripts/packaging/fpm/test.sh @@ -38,6 +38,19 @@ podman build -t $image_name -f "$SCRIPT_DIR/$pkg_type/Dockerfile.test" "$SCRIPT_ podman rm -fv $container_name >/dev/null 2>&1 || true # test install +CRUN_VER='1.14.4' +mkdir -p "${HOME}/.local/bin" +curl -L "https://github.com/containers/crun/releases/download/${CRUN_VER}/crun-${CRUN_VER}-linux-amd64" -o "${HOME}/.local/bin/crun" +chmod +x "${HOME}/.local/bin/crun" +mkdir -p "${HOME}/.config/containers" +cat << EOF > "${HOME}/.config/containers/containers.conf" +[engine.runtimes] +crun = [ + "${HOME}/.local/bin/crun", + "/usr/bin/crun" +] +EOF + echo podman run --name $container_name -d $image_name install_pkg $container_name "$PKG_PATH" diff --git a/internal/common/go.mod b/internal/common/go.mod index bf3764f90fe0..b45ac99a57f7 100644 --- a/internal/common/go.mod +++ b/internal/common/go.mod @@ -6,7 +6,7 @@ require ( github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/featuregate v1.2.0 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/internal/common/go.sum b/internal/common/go.sum index 27c0caf6dd88..6020c87883e6 100644 --- a/internal/common/go.sum +++ b/internal/common/go.sum @@ -18,8 +18,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= +go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= diff --git a/internal/components/components.go b/internal/components/components.go index f1dd0c20be69..44d61ba4aa55 100644 --- a/internal/components/components.go +++ b/internal/components/components.go @@ -73,7 +73,6 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/extension/bearertokenauthextension" "github.com/open-telemetry/opentelemetry-collector-contrib/extension/headerssetterextension" "github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension" - "github.com/open-telemetry/opentelemetry-collector-contrib/extension/httpforwarder" "github.com/open-telemetry/opentelemetry-collector-contrib/extension/jaegerremotesampling" "github.com/open-telemetry/opentelemetry-collector-contrib/extension/oauth2clientauthextension" "github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/dockerobserver" @@ -98,7 +97,6 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor" "github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor" "github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor" - "github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanmetricsprocessor" "github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanprocessor" "github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor" "github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor" @@ -204,7 +202,6 @@ func Components() (otelcol.Factories, error) { headerssetterextension.NewFactory(), healthcheckextension.NewFactory(), hostobserver.NewFactory(), - httpforwarder.NewFactory(), jaegerremotesampling.NewFactory(), k8sobserver.NewFactory(), pprofextension.NewFactory(), @@ -376,7 +373,6 @@ func Components() (otelcol.Factories, error) { resourceprocessor.NewFactory(), routingprocessor.NewFactory(), tailsamplingprocessor.NewFactory(), - spanmetricsprocessor.NewFactory(), spanprocessor.NewFactory(), cumulativetodeltaprocessor.NewFactory(), deltatorateprocessor.NewFactory(), diff --git a/internal/coreinternal/go.mod b/internal/coreinternal/go.mod index 9264728ffb32..bd498d201d87 100644 --- a/internal/coreinternal/go.mod +++ b/internal/coreinternal/go.mod @@ -20,7 +20,7 @@ require ( go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 golang.org/x/text v0.14.0 ) diff --git a/internal/coreinternal/go.sum b/internal/coreinternal/go.sum index 1bd69b6c01c0..3114f7e89d29 100644 --- a/internal/coreinternal/go.sum +++ b/internal/coreinternal/go.sum @@ -179,8 +179,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/internal/datadog/agent.go b/internal/datadog/agent.go index b9c80029265c..fef56516823d 100644 --- a/internal/datadog/agent.go +++ b/internal/datadog/agent.go @@ -16,6 +16,8 @@ import ( traceconfig "github.com/DataDog/datadog-agent/pkg/trace/config" "github.com/DataDog/datadog-agent/pkg/trace/stats" "github.com/DataDog/datadog-agent/pkg/trace/telemetry" + "github.com/DataDog/datadog-agent/pkg/trace/timing" + "github.com/DataDog/datadog-go/v5/statsd" "github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics" "go.opentelemetry.io/collector/featuregate" "go.opentelemetry.io/collector/pdata/ptrace" @@ -36,21 +38,21 @@ type TraceAgent struct { exit chan struct{} } -// ConnectorPerformanceFeatureGate uses optimized code paths for the Datadog Connector. -var ConnectorPerformanceFeatureGate = featuregate.GlobalRegistry().MustRegister( +var _ = featuregate.GlobalRegistry().MustRegister( "connector.datadogconnector.performance", - featuregate.StageBeta, + featuregate.StageStable, featuregate.WithRegisterDescription("Datadog Connector will use optimized code"), + featuregate.WithRegisterToVersion("0.97.0"), ) // newAgent creates a new unstarted traceagent using the given context. Call Start to start the traceagent. // The out channel will receive outoing stats payloads resulting from spans ingested using the Ingest method. -func NewAgent(ctx context.Context, out chan *pb.StatsPayload) *TraceAgent { - return NewAgentWithConfig(ctx, traceconfig.New(), out) +func NewAgent(ctx context.Context, out chan *pb.StatsPayload, metricsClient statsd.ClientInterface, timingReporter timing.Reporter) *TraceAgent { + return NewAgentWithConfig(ctx, traceconfig.New(), out, metricsClient, timingReporter) } // newAgentWithConfig creates a new traceagent with the given config cfg. Used in tests; use newAgent instead. -func NewAgentWithConfig(ctx context.Context, cfg *traceconfig.AgentConfig, out chan *pb.StatsPayload) *TraceAgent { +func NewAgentWithConfig(ctx context.Context, cfg *traceconfig.AgentConfig, out chan *pb.StatsPayload, metricsClient statsd.ClientInterface, timingReporter timing.Reporter) *TraceAgent { // disable the HTTP receiver cfg.ReceiverPort = 0 // set the API key to succeed startup; it is never used nor needed @@ -62,16 +64,16 @@ func NewAgentWithConfig(ctx context.Context, cfg *traceconfig.AgentConfig, out c // Ingest). This gives a better user experience. cfg.Hostname = metrics.UnsetHostnamePlaceholder pchan := make(chan *api.Payload, 1000) - a := agent.NewAgent(ctx, cfg, telemetry.NewNoopCollector()) + a := agent.NewAgent(ctx, cfg, telemetry.NewNoopCollector(), metricsClient) // replace the Concentrator (the component which computes and flushes APM Stats from incoming // traces) with our own, which uses the 'out' channel. - a.Concentrator = stats.NewConcentrator(cfg, out, time.Now()) + a.Concentrator = stats.NewConcentrator(cfg, out, time.Now(), metricsClient) // ...and the same for the ClientStatsAggregator; we don't use it here, but it is also a source // of stats which should be available to us. - a.ClientStatsAggregator = stats.NewClientStatsAggregator(cfg, out) + a.ClientStatsAggregator = stats.NewClientStatsAggregator(cfg, out, metricsClient) // lastly, start the OTLP receiver, which will be used to introduce ResourceSpans into the traceagent, // so that we can transform them to Datadog spans and receive stats. - a.OTLPReceiver = api.NewOTLPReceiver(pchan, cfg) + a.OTLPReceiver = api.NewOTLPReceiver(pchan, cfg, metricsClient, timingReporter) return &TraceAgent{ Agent: a, exit: make(chan struct{}), diff --git a/internal/datadog/agent_test.go b/internal/datadog/agent_test.go index e2fddac093dc..ebacc48598e8 100644 --- a/internal/datadog/agent_test.go +++ b/internal/datadog/agent_test.go @@ -11,8 +11,10 @@ import ( pb "github.com/DataDog/datadog-agent/pkg/proto/pbgo/trace" traceconfig "github.com/DataDog/datadog-agent/pkg/trace/config" "github.com/DataDog/datadog-agent/pkg/trace/testutil" + "github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes" "github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics" "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component/componenttest" ) func TestTraceAgentConfig(t *testing.T) { @@ -20,7 +22,8 @@ func TestTraceAgentConfig(t *testing.T) { require.NotZero(t, cfg.ReceiverPort) out := make(chan *pb.StatsPayload) - agnt := NewAgentWithConfig(context.Background(), cfg, out) + _, metricClient, timingReporter := setupMetricClient() + agnt := NewAgentWithConfig(context.Background(), cfg, out, metricClient, timingReporter) require.Zero(t, cfg.ReceiverPort) require.NotEmpty(t, cfg.Endpoints[0].APIKey) require.Equal(t, metrics.UnsetHostnamePlaceholder, cfg.Hostname) @@ -29,10 +32,14 @@ func TestTraceAgentConfig(t *testing.T) { func TestTraceAgent(t *testing.T) { cfg := traceconfig.New() + attributesTranslator, err := attributes.NewTranslator(componenttest.NewNopTelemetrySettings()) + require.NoError(t, err) + cfg.OTLPReceiver.AttributesTranslator = attributesTranslator cfg.BucketInterval = 50 * time.Millisecond out := make(chan *pb.StatsPayload, 10) ctx := context.Background() - a := NewAgentWithConfig(ctx, cfg, out) + _, metricClient, timingReporter := setupMetricClient() + a := NewAgentWithConfig(ctx, cfg, out, metricClient, timingReporter) a.Start() defer a.Stop() diff --git a/internal/datadog/go.mod b/internal/datadog/go.mod index c147833349e7..780b3e3c63c2 100644 --- a/internal/datadog/go.mod +++ b/internal/datadog/go.mod @@ -4,9 +4,12 @@ go 1.21 require ( github.com/DataDog/datadog-agent/pkg/proto v0.52.0-devel - github.com/DataDog/datadog-agent/pkg/trace v0.50.2 - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.13.3 + github.com/DataDog/datadog-agent/pkg/trace v0.51.1-0.20240301173728-334e775e420a + github.com/DataDog/datadog-go/v5 v5.5.0 + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.13.4 + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.13.4 github.com/stretchr/testify v1.8.4 + go.opentelemetry.io/collector/component v0.95.0 go.opentelemetry.io/collector/featuregate v1.2.0 go.opentelemetry.io/collector/pdata v1.2.0 go.opentelemetry.io/otel v1.23.1 @@ -15,19 +18,18 @@ require ( ) require ( - github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.2 // indirect - github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.2 // indirect - github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.2 // indirect - github.com/DataDog/datadog-agent/pkg/util/log v0.50.2 // indirect - github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.2 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.2 // indirect - github.com/DataDog/datadog-go/v5 v5.1.1 // indirect - github.com/DataDog/go-sqllexer v0.0.8 // indirect + github.com/DataDog/datadog-agent/pkg/obfuscate v0.51.1-0.20240301173728-334e775e420a // indirect + github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.51.1-0.20240301173728-334e775e420a // indirect + github.com/DataDog/datadog-agent/pkg/util/cgroups v0.51.1-0.20240301173728-334e775e420a // indirect + github.com/DataDog/datadog-agent/pkg/util/log v0.51.1-0.20240301173728-334e775e420a // indirect + github.com/DataDog/datadog-agent/pkg/util/pointer v0.51.1-0.20240301173728-334e775e420a // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.51.1-0.20240301173728-334e775e420a // indirect + github.com/DataDog/go-sqllexer v0.0.9 // indirect github.com/DataDog/go-tuf v1.0.2-0.5.2 // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.13.3 // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.13.3 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.13.4 // indirect github.com/DataDog/sketches-go v1.4.4 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect + github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect github.com/containerd/cgroups/v3 v3.0.2 // indirect @@ -63,17 +65,21 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect + github.com/prometheus/client_golang v1.18.0 // indirect + github.com/prometheus/client_model v0.5.0 // indirect + github.com/prometheus/common v0.46.0 // indirect + github.com/prometheus/procfs v0.12.0 // indirect github.com/secure-systems-lab/go-securesystemslib v0.7.0 // indirect - github.com/shirou/gopsutil/v3 v3.23.10 // indirect + github.com/shirou/gopsutil/v3 v3.24.1 // indirect github.com/shoenig/go-m1cpu v0.1.6 // indirect github.com/tinylib/msgp v1.1.9 // indirect github.com/tklauser/go-sysconf v0.3.12 // indirect github.com/tklauser/numcpus v0.6.1 // indirect github.com/yusufpapurcu/wmi v1.2.3 // indirect - go.opentelemetry.io/collector/component v0.95.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.95.0 // indirect go.opentelemetry.io/collector/confmap v0.95.0 // indirect go.opentelemetry.io/collector/semconv v0.95.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.45.2 // indirect go.opentelemetry.io/otel/sdk v1.23.1 // indirect go.opentelemetry.io/otel/trace v1.23.1 // indirect go.uber.org/atomic v1.11.0 // indirect @@ -85,7 +91,7 @@ require ( golang.org/x/sys v0.16.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.4.0 // indirect - golang.org/x/tools v0.15.0 // indirect + golang.org/x/tools v0.16.1 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect google.golang.org/grpc v1.61.0 // indirect google.golang.org/protobuf v1.32.0 // indirect diff --git a/internal/datadog/go.sum b/internal/datadog/go.sum index e7bd19bc9726..e92fec47793a 100644 --- a/internal/datadog/go.sum +++ b/internal/datadog/go.sum @@ -1,33 +1,33 @@ -github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.2 h1:y08IzbpFM/HBaKfgayFZe1FpcbZn6bVPXoZ++93vxv8= -github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.2/go.mod h1:A4nLJvxlg6BO/8/zg81til9yT0uRPuXDFMAzDMpmgn4= +github.com/DataDog/datadog-agent/pkg/obfuscate v0.51.1-0.20240301173728-334e775e420a h1:8t9jpJHbq3WosQmXCVDjqNfGFFPBxBT7/9mbyQqHMi0= +github.com/DataDog/datadog-agent/pkg/obfuscate v0.51.1-0.20240301173728-334e775e420a/go.mod h1:Ai57GjsZUn9AOo4L9ZOdu5uTuGaAxXMh0kin544Lgw0= github.com/DataDog/datadog-agent/pkg/proto v0.52.0-devel h1:nBejGNIU6Jk7bPBxz2bAO+f+kahAXWBXPecebY3R+Zo= github.com/DataDog/datadog-agent/pkg/proto v0.52.0-devel/go.mod h1:wjr5YlVvGip6VmAGzHrdBaGUu1LaA9B6gHvInm5kHiY= -github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.2 h1:7jn5EOu84uph4sd+pB3vF8LnsdTjhh+1/NnCvfNpG4A= -github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.2/go.mod h1:Vc+snp0Bey4MrrJyiV2tVxxJb6BmLomPvN1RgAvjGaQ= -github.com/DataDog/datadog-agent/pkg/trace v0.50.2 h1:eyjTZx3yupppiND/qwiUj6VuWHfyGfPMrqQwRgE41Rw= -github.com/DataDog/datadog-agent/pkg/trace v0.50.2/go.mod h1:SWNRcgZoBNoiyRrECEEe3xQGNCXfqzZVOB43WxDAMlc= -github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.2 h1:f+dYKVwMoGHZpOQM33Wogb/er8ZXeo4aUcbkSk17lM8= -github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.2/go.mod h1:4DalvbtHzT0nqpbj/36FP0IwfKWCSB5Zap7O/SGfPKI= -github.com/DataDog/datadog-agent/pkg/util/log v0.50.2 h1:D4jzhoZtZikiugOr2pl6Xm+MMfrwkjnZziGHgTNpBLk= -github.com/DataDog/datadog-agent/pkg/util/log v0.50.2/go.mod h1:0vyUsWVWDdIRzd6Itim0ZkjCvOF7V8Yi4IzpE5q/UPo= -github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.2 h1:yq97sYsulZz/qyl/bogRigvUskqXPSrt8c7b+xKDs4I= -github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.2/go.mod h1:eTXti9mx7qhkoi+Qg3mMmvVY5McghUUgsf4Hrk9zY8k= -github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.2 h1:xFGXfIsTyHC0VlrrfoAVaZ1pBAJUh2ARZrS7gcdAooY= -github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.2/go.mod h1:EOGgNrSPskIxY3+KgCl+yEggMjrGqrA2oL5va+/p2jM= -github.com/DataDog/datadog-go/v5 v5.1.1 h1:JLZ6s2K1pG2h9GkvEvMdEGqMDyVLEAccdX5TltWcLMU= -github.com/DataDog/datadog-go/v5 v5.1.1/go.mod h1:KhiYb2Badlv9/rofz+OznKoEF5XKTonWyhx5K83AP8E= -github.com/DataDog/go-sqllexer v0.0.8 h1:vfC8R9PhmJfeOKcFYAX9UOd890A3wu3KrjU9Kr7nM0E= -github.com/DataDog/go-sqllexer v0.0.8/go.mod h1:nB4Ea2YNsqMwtbWMc4Fm/oP98IIrSPapqwOwPioMspY= +github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.51.1-0.20240301173728-334e775e420a h1:7Wijer1rhN7tsEm6mVjXaYZ2XjmKM8cgJKc0hkr57V8= +github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.51.1-0.20240301173728-334e775e420a/go.mod h1:Vc+snp0Bey4MrrJyiV2tVxxJb6BmLomPvN1RgAvjGaQ= +github.com/DataDog/datadog-agent/pkg/trace v0.51.1-0.20240301173728-334e775e420a h1:6ko5fCAcwToPALbUZiqR2tpjIzzqYR+uVXR7t1khRuE= +github.com/DataDog/datadog-agent/pkg/trace v0.51.1-0.20240301173728-334e775e420a/go.mod h1:qMvCrksIQC0czvZB72YdtVfxAK6/Vq2iPNJT7k6q+Bo= +github.com/DataDog/datadog-agent/pkg/util/cgroups v0.51.1-0.20240301173728-334e775e420a h1:95lqMrZdzqfrxxcLUepiEw2zHv7JCFSQhTr3/z1aKl4= +github.com/DataDog/datadog-agent/pkg/util/cgroups v0.51.1-0.20240301173728-334e775e420a/go.mod h1:m4jQb4BdnVTi7jaSETmJ0dQchgOphmZqPuMuwzjpFeM= +github.com/DataDog/datadog-agent/pkg/util/log v0.51.1-0.20240301173728-334e775e420a h1:IW8buCp4IiU0b1lC7x7W0hHlc+ADwV/hmistYtFogL0= +github.com/DataDog/datadog-agent/pkg/util/log v0.51.1-0.20240301173728-334e775e420a/go.mod h1:KdMEnEsO0dn53y3DLcbInK8NaMWnPgo+MunQsQ4cGF8= +github.com/DataDog/datadog-agent/pkg/util/pointer v0.51.1-0.20240301173728-334e775e420a h1:7FUY9948Nsrdfh1P/F1RkJ/gcUZVbTz9ippSbtl3cxo= +github.com/DataDog/datadog-agent/pkg/util/pointer v0.51.1-0.20240301173728-334e775e420a/go.mod h1:eTXti9mx7qhkoi+Qg3mMmvVY5McghUUgsf4Hrk9zY8k= +github.com/DataDog/datadog-agent/pkg/util/scrubber v0.51.1-0.20240301173728-334e775e420a h1:ENeNLL5ItDcd4400kGP148+IMzMlaIZGRfFLa3GJNdY= +github.com/DataDog/datadog-agent/pkg/util/scrubber v0.51.1-0.20240301173728-334e775e420a/go.mod h1:EOGgNrSPskIxY3+KgCl+yEggMjrGqrA2oL5va+/p2jM= +github.com/DataDog/datadog-go/v5 v5.5.0 h1:G5KHeB8pWBNXT4Jtw0zAkhdxEAWSpWH00geHI6LDrKU= +github.com/DataDog/datadog-go/v5 v5.5.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw= +github.com/DataDog/go-sqllexer v0.0.9 h1:Cx2Cu1S0hfj4coCCA8hzjM9+UNFRkcu1avIV//RU5Qw= +github.com/DataDog/go-sqllexer v0.0.9/go.mod h1:nB4Ea2YNsqMwtbWMc4Fm/oP98IIrSPapqwOwPioMspY= github.com/DataDog/go-tuf v1.0.2-0.5.2 h1:EeZr937eKAWPxJ26IykAdWA4A0jQXJgkhUjqEI/w7+I= github.com/DataDog/go-tuf v1.0.2-0.5.2/go.mod h1:zBcq6f654iVqmkk8n2Cx81E1JnNTMOAx1UEO/wZR+P0= -github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.13.3 h1:hnzEiqocvnt6U1QGxfeDFf5xhE77jt4LOjZAXW9ueWo= -github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.13.3/go.mod h1:Tk2wwdBgWeSvDPtrGGyym8CdVWSuphiToGc/tRvFoNQ= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.13.3 h1:hcYZMgGDMUz8Dz6PcOhgk6FF0yG4N7KErS5J3O/MpeU= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.13.3/go.mod h1:Z2FPxYhi8GIFkS4WLC7RrRaGolyB9TqS2RMSwNcmczk= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.13.3 h1:QelZO3ixjVqlqzTa+wxIDFvYnnzy/SG9iqXci1nhouc= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.13.3/go.mod h1:AObll3Cj7UJK56bc7HRrpbGWc98C1Io0ChpFEoxS2f8= -github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.13.3 h1:9fdt/9NeSUtypPT4du2/5TTQic9nL1YqDSIaq5Ttsi4= -github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.13.3/go.mod h1:P8Tr/1BSm0vQ0UXVOtIKmJKXCgb84jdFe9HuBKJPwkc= +github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.13.4 h1:B2R7Wh791uphpltmorbvvdKk0rJOhoExwM4NnE7hXTg= +github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.13.4/go.mod h1:Tk2wwdBgWeSvDPtrGGyym8CdVWSuphiToGc/tRvFoNQ= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.13.4 h1:GcJUxjunnJEL62K+fY7pjyvcb4Cvqr5VtD0DFc8rp+w= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.13.4/go.mod h1:/9yo8Scnf6R0KufxJIHfQD+GAbT9cyINxaTPMDgl2Wk= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.13.4 h1:ZuYc5Ql/GSyAEMgpKkbQiHOtIHkEpYujITW1wIVFgLE= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.13.4/go.mod h1:YSntkplFoUM1mepnPeJFsoblqD0Wdi+Avg1/d1upgZQ= +github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.13.4 h1:t/Zh8ztLDBOMRMiuVNFthWMMG5F4POgc5M6+Y3DTX9g= +github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.13.4/go.mod h1:JfdBBDreQfbIN5FYrAtZV3VmQMXnf9o4tMbaMxWqe40= github.com/DataDog/sketches-go v1.4.4 h1:dF52vzXRFSPOj2IjXSWLvXq3jubL4CI69kwYjJ1w5Z8= github.com/DataDog/sketches-go v1.4.4/go.mod h1:XR0ns2RtEEF09mDKXiKZiQg+nfZStrq1ZuL1eezeZe0= github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= @@ -119,10 +119,10 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.93.0 h1:R0GGB09OWAP1bSVps2brDOOln8pgSgzHU658bdzIb+g= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.93.0/go.mod h1:7SXQW+a9kZ1T1WH9tKwFqfGGefGv8mZxRG/lTsa65uo= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.93.0 h1:2AKT1xw2KNenv/nfRoWueYxQiLJe76Axhb5++4jdgiA= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.93.0/go.mod h1:VmP4/AOAPwtpAG4TYHtWha603iLbLRmO7k0d0WbRqrM= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.94.0 h1:nTayRLarCGkB9ld7p8jWJe/9wvf8gNDaS5fRjybkEpg= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.94.0/go.mod h1:xoBvqu56hbky3KZafo68nxtV2+J81+pvo1ttNirakcU= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.94.0 h1:DSGhzGAaC767esMB0Ulr+9xWe6SW0LFUYMxLrLOAkjM= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.94.0/go.mod h1:Nv4nK3E7sUpDbNv0zI0zY15g2xR4jMg+n8taV8dsMeE= github.com/opencontainers/runtime-spec v1.1.0-rc.3 h1:l04uafi6kxByhbxev7OWiuUv0LZxEsYUfDWZ6bztAuU= github.com/opencontainers/runtime-spec v1.1.0-rc.3/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/outcaste-io/ristretto v0.2.1 h1:KCItuNIGJZcursqHr3ghO7fc5ddZLEHspL9UR0cQM64= @@ -151,8 +151,8 @@ github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjR github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/secure-systems-lab/go-securesystemslib v0.7.0 h1:OwvJ5jQf9LnIAS83waAjPbcMsODrTQUpJ02eNLUoxBg= github.com/secure-systems-lab/go-securesystemslib v0.7.0/go.mod h1:/2gYnlnHVQ6xeGtfIqFy7Do03K4cdCY0A/GlJLDKLHI= -github.com/shirou/gopsutil/v3 v3.23.10 h1:/N42opWlYzegYaVkWejXWJpbzKv2JDy3mrgGzKsh9hM= -github.com/shirou/gopsutil/v3 v3.23.10/go.mod h1:JIE26kpucQi+innVlAUnIEOSBhBUkirr5b44yr55+WE= +github.com/shirou/gopsutil/v3 v3.24.1 h1:R3t6ondCEvmARp3wxODhXMTLC/klMa87h2PHUw5m7QI= +github.com/shirou/gopsutil/v3 v3.24.1/go.mod h1:UU7a2MSBQa+kW1uuDq8DeEBS8kmrnQwsv2b5O513rwU= github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= @@ -168,6 +168,7 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/tinylib/msgp v1.1.9 h1:SHf3yoO2sGA0veCJeCBYLHuttAVFHGm2RHgNodW7wQU= @@ -256,7 +257,6 @@ golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220627191245-f75cf1eec38b/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.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -271,8 +271,8 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn 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.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.15.0 h1:zdAyfUGbYmuVokhzVmghFl2ZJh5QhcfebBgmVPFYA+8= -golang.org/x/tools v0.15.0/go.mod h1:hpksKq4dtpQWS1uQ61JkdqWM3LscIS6Slf+VVkm+wQk= +golang.org/x/tools v0.16.1 h1:TLyB3WofjdOEepBHAU20JdNC1Zbg87elYofWYAY5oZA= +golang.org/x/tools v0.16.1/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= 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/internal/datadog/metrics_client.go b/internal/datadog/metrics_client.go index c5858e150116..dec569d25d39 100644 --- a/internal/datadog/metrics_client.go +++ b/internal/datadog/metrics_client.go @@ -9,7 +9,7 @@ import ( "sync" "time" - "github.com/DataDog/datadog-agent/pkg/trace/metrics" + "github.com/DataDog/datadog-go/v5/statsd" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/metric" ) @@ -20,19 +20,12 @@ type metricsClient struct { mutex sync.Mutex } -var initializeOnce sync.Once - -// InitializeMetricClient using a meter provider. If the client has already been initialized, -// this function just returns the previous one. -func InitializeMetricClient(mp metric.MeterProvider) metrics.StatsClient { - initializeOnce.Do(func() { - m := &metricsClient{ - meter: mp.Meter("datadog"), - gauges: make(map[string]float64), - } - metrics.Client = m - }) - return metrics.Client +// InitializeMetricClient using a meter provider. +func InitializeMetricClient(mp metric.MeterProvider) statsd.ClientInterface { + return &metricsClient{ + meter: mp.Meter("datadog"), + gauges: make(map[string]float64), + } } func (m *metricsClient) Gauge(name string, value float64, tags []string, _ float64) error { @@ -89,10 +82,66 @@ func (m *metricsClient) Histogram(name string, value float64, tags []string, _ f return nil } +func (m *metricsClient) Distribution(name string, value float64, tags []string, rate float64) error { + return m.Histogram(name, value, tags, rate) +} + func (m *metricsClient) Timing(name string, value time.Duration, tags []string, rate float64) error { - return m.Histogram(name, float64(value.Milliseconds()), tags, rate) + return m.TimeInMilliseconds(name, value.Seconds()*1000, tags, rate) +} + +func (m *metricsClient) TimeInMilliseconds(name string, value float64, tags []string, rate float64) error { + return m.Histogram(name, value, tags, rate) +} + +func (m *metricsClient) Decr(name string, tags []string, rate float64) error { + return m.Count(name, -1, tags, rate) +} + +func (m *metricsClient) Incr(name string, tags []string, rate float64) error { + return m.Count(name, 1, tags, rate) } func (m *metricsClient) Flush() error { return nil } + +func (m *metricsClient) Set(string, string, []string, float64) error { + return nil +} + +func (m *metricsClient) Event(*statsd.Event) error { + return nil +} + +func (m *metricsClient) SimpleEvent(string, string) error { + return nil +} + +func (m *metricsClient) ServiceCheck(*statsd.ServiceCheck) error { + return nil +} + +func (m *metricsClient) SimpleServiceCheck(string, statsd.ServiceCheckStatus) error { + return nil +} + +func (m *metricsClient) Close() error { + return nil +} + +func (m *metricsClient) IsClosed() bool { + return false +} + +func (m *metricsClient) GetTelemetry() statsd.Telemetry { + return statsd.Telemetry{} +} + +func (m *metricsClient) GaugeWithTimestamp(string, float64, []string, float64, time.Time) error { + return nil +} + +func (m *metricsClient) CountWithTimestamp(string, int64, []string, float64, time.Time) error { + return nil +} diff --git a/internal/datadog/metrics_client_test.go b/internal/datadog/metrics_client_test.go index 9f6b25ddbb8c..11a8898486bc 100644 --- a/internal/datadog/metrics_client_test.go +++ b/internal/datadog/metrics_client_test.go @@ -4,11 +4,11 @@ package datadog import ( "context" - "sync" "testing" "time" - "github.com/DataDog/datadog-agent/pkg/trace/metrics" + "github.com/DataDog/datadog-agent/pkg/trace/timing" + "github.com/DataDog/datadog-go/v5/statsd" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.opentelemetry.io/otel/attribute" @@ -17,23 +17,12 @@ import ( "go.opentelemetry.io/otel/sdk/metric/metricdata/metricdatatest" ) -func setupMetricClient() (*metric.ManualReader, metrics.StatsClient, *metric.MeterProvider) { - initializeOnce = sync.Once{} +func setupMetricClient() (*metric.ManualReader, statsd.ClientInterface, timing.Reporter) { reader := metric.NewManualReader() meterProvider := metric.NewMeterProvider(metric.WithReader(reader)) metricClient := InitializeMetricClient(meterProvider) - return reader, metricClient, meterProvider -} - -func TestNewMetricClient(t *testing.T) { - _, metricClient, _ := setupMetricClient() - assert.Equal(t, metrics.Client, metricClient) -} - -func TestNewMetricClientComplex(t *testing.T) { - _, _, meterProvider := setupMetricClient() - metricClient2 := InitializeMetricClient(meterProvider) - assert.Equal(t, metrics.Client, metricClient2) + timingReporter := timing.New(metricClient) + return reader, metricClient, timingReporter } func TestGauge(t *testing.T) { diff --git a/internal/docker/go.mod b/internal/docker/go.mod index 3929e446648b..b8579b942f56 100644 --- a/internal/docker/go.mod +++ b/internal/docker/go.mod @@ -6,7 +6,7 @@ require ( github.com/docker/docker v24.0.9+incompatible github.com/gobwas/glob v0.2.3 github.com/stretchr/testify v1.8.4 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/internal/docker/go.sum b/internal/docker/go.sum index a56ab1b03f8e..089db7231090 100644 --- a/internal/docker/go.sum +++ b/internal/docker/go.sum @@ -50,12 +50,12 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= -go.uber.org/goleak v1.2.0/go.mod h1:XJYK+MuIchqpmGmUSAzotztawfKvYLUIgg7guXrwVUo= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/internal/exp/metrics/go.mod b/internal/exp/metrics/go.mod index f61b7e1e87af..6e54eb33f229 100644 --- a/internal/exp/metrics/go.mod +++ b/internal/exp/metrics/go.mod @@ -1,19 +1,22 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/internal/exp/metrics -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil => ../../../pkg/pdatautil +go 1.21 require ( github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.95.0 + github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/pdata v1.2.0 ) require ( github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.14.0 // indirect @@ -21,8 +24,7 @@ require ( google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect google.golang.org/grpc v1.61.0 // indirect google.golang.org/protobuf v1.32.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) -go 1.21 - -toolchain go1.21.1 +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil => ../../../pkg/pdatautil diff --git a/internal/exp/metrics/go.sum b/internal/exp/metrics/go.sum index 6f3b578693b2..9a5008b4d916 100644 --- a/internal/exp/metrics/go.sum +++ b/internal/exp/metrics/go.sum @@ -16,6 +16,10 @@ 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/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -23,6 +27,8 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= @@ -74,5 +80,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/internal/exp/metrics/staleness/map.go b/internal/exp/metrics/staleness/map.go new file mode 100644 index 000000000000..77b29f5febd2 --- /dev/null +++ b/internal/exp/metrics/staleness/map.go @@ -0,0 +1,54 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package staleness // import "github.com/open-telemetry/opentelemetry-collector-contrib/internal/exp/metrics/staleness" + +import ( + "time" + + "github.com/open-telemetry/opentelemetry-collector-contrib/internal/exp/metrics/identity" +) + +// Map is an abstraction over a map +type Map[T any] interface { + // Load the value at key. If it does not exist, the boolean will be false and the value returned will be the zero value + Load(key identity.Stream) (T, bool) + // Store the given key value pair in the map + Store(key identity.Stream, value T) + // Remove the value at key from the map + Delete(key identity.Stream) + // Items returns an iterator function that in future go version can be used with range + // See: https://go.dev/wiki/RangefuncExperiment + Items() func(yield func(identity.Stream, T) bool) bool +} + +// RawMap implementation + +var _ Map[time.Time] = (*RawMap[identity.Stream, time.Time])(nil) + +// RawMap is an implementation of the Map interface using a standard golang map +type RawMap[K comparable, V any] map[K]V + +func (rm *RawMap[K, V]) Load(key K) (V, bool) { + value, ok := (*rm)[key] + return value, ok +} + +func (rm *RawMap[K, V]) Store(key K, value V) { + (*rm)[key] = value +} + +func (rm *RawMap[K, V]) Delete(key K) { + delete(*rm, key) +} + +func (rm *RawMap[K, V]) Items() func(yield func(K, V) bool) bool { + return func(yield func(K, V) bool) bool { + for k, v := range *rm { + if !yield(k, v) { + break + } + } + return false + } +} diff --git a/internal/exp/metrics/staleness/priority_queue.go b/internal/exp/metrics/staleness/priority_queue.go new file mode 100644 index 000000000000..f1b01743f95f --- /dev/null +++ b/internal/exp/metrics/staleness/priority_queue.go @@ -0,0 +1,111 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package staleness // import "github.com/open-telemetry/opentelemetry-collector-contrib/internal/exp/metrics/staleness" + +import ( + "container/heap" + "time" + + "github.com/open-telemetry/opentelemetry-collector-contrib/internal/exp/metrics/identity" +) + +// PriorityQueue represents a way to store entries sorted by their priority. +// Pop() will return the oldest entry of the set. +type PriorityQueue interface { + // Update will add or update an entry, and reshuffle the queue internally as needed to keep it sorted + Update(id identity.Stream, newPrio time.Time) + // Peek will return the entry at the HEAD of the queue *without* removing it from the queue + Peek() (identity.Stream, time.Time) + // Pop will remove the entry at the HEAD of the queue and return it + Pop() (identity.Stream, time.Time) + // Len will return the number of entries in the queue + Len() int +} + +// heapQueue implements heap.Interface. +// We use it as the inner implementation of a heap-based sorted queue +type heapQueue []*queueItem + +type queueItem struct { + key identity.Stream + prio time.Time + index int +} + +func (pq heapQueue) Len() int { return len(pq) } + +func (pq heapQueue) Less(i, j int) bool { + // We want Pop to give us the lowest priority + return pq[i].prio.Before(pq[j].prio) +} + +func (pq heapQueue) Swap(i, j int) { + pq[i], pq[j] = pq[j], pq[i] + pq[i].index = i + pq[j].index = j +} + +func (pq *heapQueue) Push(x any) { + n := len(*pq) + item := x.(*queueItem) + item.index = n + *pq = append(*pq, item) +} + +func (pq *heapQueue) Pop() any { + old := *pq + n := len(old) + item := old[n-1] + old[n-1] = nil // avoid memory leak + item.index = -1 // for safety + *pq = old[0 : n-1] + return item +} + +type heapPriorityQueue struct { + inner heapQueue + itemLookup map[identity.Stream]*queueItem +} + +func NewPriorityQueue() PriorityQueue { + pq := &heapPriorityQueue{ + inner: heapQueue{}, + itemLookup: map[identity.Stream]*queueItem{}, + } + heap.Init(&pq.inner) + + return pq +} + +func (pq *heapPriorityQueue) Update(id identity.Stream, newPrio time.Time) { + // Check if the entry already exists in the queue + item, ok := pq.itemLookup[id] + if ok { + // If so, we can update it in place + item.prio = newPrio + heap.Fix(&pq.inner, item.index) + } else { + item = &queueItem{ + key: id, + prio: newPrio, + } + heap.Push(&pq.inner, item) + pq.itemLookup[id] = item + } +} + +func (pq *heapPriorityQueue) Peek() (identity.Stream, time.Time) { + val := pq.inner[0] + return val.key, val.prio +} + +func (pq *heapPriorityQueue) Pop() (identity.Stream, time.Time) { + val := heap.Pop(&pq.inner).(*queueItem) + delete(pq.itemLookup, val.key) + return val.key, val.prio +} + +func (pq *heapPriorityQueue) Len() int { + return pq.inner.Len() +} diff --git a/internal/exp/metrics/staleness/priority_queue_test.go b/internal/exp/metrics/staleness/priority_queue_test.go new file mode 100644 index 000000000000..b58478e7c1db --- /dev/null +++ b/internal/exp/metrics/staleness/priority_queue_test.go @@ -0,0 +1,116 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package staleness + +import ( + "testing" + "time" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/pmetric" + + "github.com/open-telemetry/opentelemetry-collector-contrib/internal/exp/metrics/identity" +) + +func TestPriorityQueueImpl(t *testing.T) { + t.Parallel() + + pq := NewPriorityQueue() + + idA := generateStreamID(t, map[string]any{ + "aaa": "123", + }) + idB := generateStreamID(t, map[string]any{ + "bbb": "456", + }) + idC := generateStreamID(t, map[string]any{ + "ccc": "789", + }) + + initialTime := time.Time{} + prioA := initialTime.Add(2 * time.Second) + prioB := initialTime.Add(1 * time.Second) + prioC := initialTime.Add(3 * time.Second) + + pq.Update(idA, prioA) + pq.Update(idB, prioB) + pq.Update(idC, prioC) + + // The first item should be B + id, prio := pq.Peek() + require.Equal(t, idB, id) + require.Equal(t, prioB, prio) + + // If we peek again, nothing should change + id, prio = pq.Peek() + require.Equal(t, idB, id) + require.Equal(t, prioB, prio) + + // Pop should return the same thing + id, prio = pq.Pop() + require.Equal(t, idB, id) + require.Equal(t, prioB, prio) + + // Now if we peek again, it should be the next item + id, prio = pq.Peek() + require.Equal(t, idA, id) + require.Equal(t, prioA, prio) + + // Pop should return the same thing + id, prio = pq.Pop() + require.Equal(t, idA, id) + require.Equal(t, prioA, prio) + + // One last time + id, prio = pq.Peek() + require.Equal(t, idC, id) + require.Equal(t, prioC, prio) + + // Pop should return the same thing + id, prio = pq.Pop() + require.Equal(t, idC, id) + require.Equal(t, prioC, prio) + + // The queue should now be empty + require.Equal(t, 0, pq.Len()) + + // And the inner lookup map should also be empty + require.IsType(t, &heapPriorityQueue{}, pq) + heapQueue := pq.(*heapPriorityQueue) + require.Len(t, heapQueue.itemLookup, 0) +} + +func generateStreamID(t *testing.T, attributes map[string]any) identity.Stream { + res := pcommon.NewResource() + err := res.Attributes().FromRaw(map[string]any{ + "foo": "bar", + "asdf": "qwer", + }) + require.NoError(t, err) + + scope := pcommon.NewInstrumentationScope() + scope.SetName("TestScope") + scope.SetVersion("v1.2.3") + err = scope.Attributes().FromRaw(map[string]any{ + "aaa": "bbb", + "ccc": "ddd", + }) + require.NoError(t, err) + + metric := pmetric.NewMetric() + + sum := metric.SetEmptySum() + sum.SetIsMonotonic(true) + sum.SetAggregationTemporality(pmetric.AggregationTemporalityDelta) + + dp := sum.DataPoints().AppendEmpty() + dp.SetStartTimestamp(678) + dp.SetTimestamp(789) + dp.SetDoubleValue(123.456) + err = dp.Attributes().FromRaw(attributes) + require.NoError(t, err) + + return identity.OfStream(identity.OfResourceMetric(res, scope, metric), dp) +} diff --git a/internal/exp/metrics/staleness/staleness.go b/internal/exp/metrics/staleness/staleness.go new file mode 100644 index 000000000000..f5803ccdeb55 --- /dev/null +++ b/internal/exp/metrics/staleness/staleness.go @@ -0,0 +1,67 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package staleness // import "github.com/open-telemetry/opentelemetry-collector-contrib/internal/exp/metrics/staleness" + +import ( + "time" + + "github.com/open-telemetry/opentelemetry-collector-contrib/internal/exp/metrics/identity" +) + +// We override how Now() is returned, so we can have deterministic tests +var NowFunc = time.Now + +// Staleness a a wrapper over a map that adds an additional "staleness" value to each entry. Users can +// call ExpireOldEntries() to automatically remove all entries from the map whole staleness value is +// older than the `max` +// +// NOTE: Staleness methods are *not* thread-safe. If the user needs to use Staleness in a multi-threaded +// environment, then it is the user's responsibility to properly serialize calls to Staleness methods +type Staleness[T any] struct { + max time.Duration + + items Map[T] + pq PriorityQueue +} + +func NewStaleness[T any](max time.Duration, newMap Map[T]) *Staleness[T] { + return &Staleness[T]{ + max: max, + items: newMap, + pq: NewPriorityQueue(), + } +} + +// Load the value at key. If it does not exist, the boolean will be false and the value returned will be the zero value +func (s *Staleness[T]) Load(key identity.Stream) (T, bool) { + return s.items.Load(key) +} + +// Store the given key value pair in the map, and update the pair's staleness value to "now" +func (s *Staleness[T]) Store(id identity.Stream, value T) { + s.pq.Update(id, NowFunc()) + s.items.Store(id, value) +} + +// Items returns an iterator function that in future go version can be used with range +// See: https://go.dev/wiki/RangefuncExperiment +func (s *Staleness[T]) Items() func(yield func(identity.Stream, T) bool) bool { + return s.items.Items() +} + +// ExpireOldEntries will remove all entries whose staleness value is older than `now() - max` +// For example, if an entry has a staleness value of two hours ago, and max == 1 hour, then the entry would +// be removed. But if an entry had a stalness value of 30 minutes, then it *wouldn't* be removed. +func (s *Staleness[T]) ExpireOldEntries() { + now := NowFunc() + + for { + _, ts := s.pq.Peek() + if now.Sub(ts) < s.max { + break + } + id, _ := s.pq.Pop() + s.items.Delete(id) + } +} diff --git a/internal/exp/metrics/staleness/staleness_test.go b/internal/exp/metrics/staleness/staleness_test.go new file mode 100644 index 000000000000..4d96b41061e6 --- /dev/null +++ b/internal/exp/metrics/staleness/staleness_test.go @@ -0,0 +1,93 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package staleness + +import ( + "testing" + "time" + + "github.com/stretchr/testify/require" + + "github.com/open-telemetry/opentelemetry-collector-contrib/internal/exp/metrics/identity" +) + +func TestStaleness(t *testing.T) { + max := 1 * time.Second + stalenessMap := NewStaleness[int]( + max, + &RawMap[identity.Stream, int]{}, + ) + + idA := generateStreamID(t, map[string]any{ + "aaa": "123", + }) + idB := generateStreamID(t, map[string]any{ + "bbb": "456", + }) + idC := generateStreamID(t, map[string]any{ + "ccc": "789", + }) + idD := generateStreamID(t, map[string]any{ + "ddd": "024", + }) + + initialTime := time.Time{} + timeA := initialTime.Add(2 * time.Second) + timeB := initialTime.Add(1 * time.Second) + timeC := initialTime.Add(3 * time.Second) + timeD := initialTime.Add(4 * time.Second) + + valueA := 1 + valueB := 4 + valueC := 7 + valueD := 0 + + // Add the values to the map + NowFunc = func() time.Time { return timeA } + stalenessMap.Store(idA, valueA) + NowFunc = func() time.Time { return timeB } + stalenessMap.Store(idB, valueB) + NowFunc = func() time.Time { return timeC } + stalenessMap.Store(idC, valueC) + NowFunc = func() time.Time { return timeD } + stalenessMap.Store(idD, valueD) + + // Set the time to 2.5s and run expire + // This should remove B, but the others should remain + // (now == 2.5s, B == 1s, max == 1s) + // now > B + max + NowFunc = func() time.Time { return initialTime.Add(2500 * time.Millisecond) } + stalenessMap.ExpireOldEntries() + validateStalenessMapEntries(t, + map[identity.Stream]int{ + idA: valueA, + idC: valueC, + idD: valueD, + }, + stalenessMap, + ) + + // Set the time to 4.5s and run expire + // This should remove A and C, but D should remain + // (now == 2.5s, A == 2s, C == 3s, max == 1s) + // now > A + max AND now > C + max + NowFunc = func() time.Time { return initialTime.Add(4500 * time.Millisecond) } + stalenessMap.ExpireOldEntries() + validateStalenessMapEntries(t, + map[identity.Stream]int{ + idD: valueD, + }, + stalenessMap, + ) +} + +func validateStalenessMapEntries(t *testing.T, expected map[identity.Stream]int, sm *Staleness[int]) { + actual := map[identity.Stream]int{} + + sm.Items()(func(key identity.Stream, value int) bool { + actual[key] = value + return true + }) + require.Equal(t, expected, actual) +} diff --git a/internal/filter/go.mod b/internal/filter/go.mod index ddb1e75bfa0e..9c6a7192b9dd 100644 --- a/internal/filter/go.mod +++ b/internal/filter/go.mod @@ -15,7 +15,7 @@ require ( go.opentelemetry.io/collector/pdata v1.2.0 go.opentelemetry.io/collector/semconv v0.95.0 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/internal/filter/go.sum b/internal/filter/go.sum index 9eb249ad6f53..23dc8c4cc40a 100644 --- a/internal/filter/go.sum +++ b/internal/filter/go.sum @@ -112,8 +112,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/internal/kafka/go.mod b/internal/kafka/go.mod index 8c144f2e7df7..13a509a665da 100644 --- a/internal/kafka/go.mod +++ b/internal/kafka/go.mod @@ -3,8 +3,8 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/internal/kafka go 1.21 require ( - github.com/IBM/sarama v1.42.2 - github.com/aws/aws-sdk-go v1.50.17 + github.com/IBM/sarama v1.43.0 + github.com/aws/aws-sdk-go v1.50.27 github.com/stretchr/testify v1.8.4 github.com/xdg-go/scram v1.1.2 go.opentelemetry.io/collector/config/configtls v0.95.0 @@ -14,7 +14,7 @@ require ( require ( github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/eapache/go-resiliency v1.5.0 // indirect + github.com/eapache/go-resiliency v1.6.0 // indirect github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 // indirect github.com/eapache/queue v1.1.0 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect @@ -28,7 +28,7 @@ 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.2 // indirect + github.com/klauspost/compress v1.17.7 // indirect github.com/pierrec/lz4/v4 v4.1.21 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect diff --git a/internal/kafka/go.sum b/internal/kafka/go.sum index a8c49b93863d..db0246b317c5 100644 --- a/internal/kafka/go.sum +++ b/internal/kafka/go.sum @@ -1,13 +1,13 @@ -github.com/IBM/sarama v1.42.2 h1:VoY4hVIZ+WQJ8G9KNY/SQlWguBQXQ9uvFPOnrcu8hEw= -github.com/IBM/sarama v1.42.2/go.mod h1:FLPGUGwYqEs62hq2bVG6Io2+5n+pS6s/WOXVKWSLFtE= -github.com/aws/aws-sdk-go v1.50.17 h1:KsbzUKDgGNlkDHGvoQDhiJ63a9jtZd+O+/s3pTOr/ns= -github.com/aws/aws-sdk-go v1.50.17/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/IBM/sarama v1.43.0 h1:YFFDn8mMI2QL0wOrG0J2sFoVIAFl7hS9JQi2YZsXtJc= +github.com/IBM/sarama v1.43.0/go.mod h1:zlE6HEbC/SMQ9mhEYaF7nNLYOUyrs0obySKCckWP9BM= +github.com/aws/aws-sdk-go v1.50.27 h1:96ifhrSuja+AzdP3W/T2337igqVQ2FcSIJYkk+0rCeA= +github.com/aws/aws-sdk-go v1.50.27/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/eapache/go-resiliency v1.5.0 h1:dRsaR00whmQD+SgVKlq/vCRFNgtEb5yppyeVos3Yce0= -github.com/eapache/go-resiliency v1.5.0/go.mod h1:5yPzW0MIvSe0JDsv0v+DvcjEv2FyD6iZYSs1ZI+iQho= +github.com/eapache/go-resiliency v1.6.0 h1:CqGDTLtpwuWKn6Nj3uNUdflaq+/kIPsg0gfNzHton30= +github.com/eapache/go-resiliency v1.6.0/go.mod h1:5yPzW0MIvSe0JDsv0v+DvcjEv2FyD6iZYSs1ZI+iQho= github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 h1:Oy0F4ALJ04o5Qqpdz8XLIpNA3WM/iSIXqxtqo7UGVws= github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3/go.mod h1:YvSRo5mw33fLEx1+DlK6L2VV43tJt5Eyel9n9XBcR+0= github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc= @@ -46,8 +46,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.2 h1:RlWWUY/Dr4fL8qk9YG7DTZ7PDgME2V4csBXA8L/ixi4= -github.com/klauspost/compress v1.17.2/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLAKQQg= +github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= diff --git a/internal/kubelet/go.mod b/internal/kubelet/go.mod index b8ac01802951..5e5abe138cfb 100644 --- a/internal/kubelet/go.mod +++ b/internal/kubelet/go.mod @@ -8,7 +8,7 @@ require ( github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/config/configtls v0.95.0 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 k8s.io/client-go v0.29.2 ) diff --git a/internal/kubelet/go.sum b/internal/kubelet/go.sum index 8743a9d6d134..1c8b96b1355a 100644 --- a/internal/kubelet/go.sum +++ b/internal/kubelet/go.sum @@ -258,8 +258,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= diff --git a/internal/metadataproviders/go.mod b/internal/metadataproviders/go.mod index d898ae65f15f..4e88c936dc11 100644 --- a/internal/metadataproviders/go.mod +++ b/internal/metadataproviders/go.mod @@ -4,7 +4,7 @@ go 1.21 require ( github.com/Showmax/go-fqdn v1.0.0 - github.com/aws/aws-sdk-go v1.50.17 + github.com/aws/aws-sdk-go v1.50.27 github.com/docker/docker v24.0.9+incompatible github.com/hashicorp/consul/api v1.27.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig v0.95.0 diff --git a/internal/metadataproviders/go.sum b/internal/metadataproviders/go.sum index 95d859304a56..afbebcf0ad6b 100644 --- a/internal/metadataproviders/go.sum +++ b/internal/metadataproviders/go.sum @@ -51,8 +51,8 @@ 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.50.17 h1:KsbzUKDgGNlkDHGvoQDhiJ63a9jtZd+O+/s3pTOr/ns= -github.com/aws/aws-sdk-go v1.50.17/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.50.27 h1:96ifhrSuja+AzdP3W/T2337igqVQ2FcSIJYkk+0rCeA= +github.com/aws/aws-sdk-go v1.50.27/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= 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/internal/sqlquery/go.mod b/internal/sqlquery/go.mod index 9ca4a2bfd43b..77b5226d1b4f 100644 --- a/internal/sqlquery/go.mod +++ b/internal/sqlquery/go.mod @@ -6,22 +6,22 @@ require ( github.com/SAP/go-hdb v1.8.5 github.com/go-sql-driver/mysql v1.7.1 github.com/lib/pq v1.10.9 - github.com/microsoft/go-mssqldb v1.6.0 + github.com/microsoft/go-mssqldb v1.7.0 github.com/sijms/go-ora/v2 v2.8.8 - github.com/snowflakedb/gosnowflake v1.7.2 + github.com/snowflakedb/gosnowflake v1.8.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.95.0 go.opentelemetry.io/collector/pdata v1.2.0 go.opentelemetry.io/collector/receiver v0.95.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.1 // indirect - github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.1 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.1 // indirect github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.0.0 // indirect github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c // indirect github.com/apache/arrow/go/v14 v14.0.2 // indirect @@ -77,7 +77,7 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/mtibben/percent v0.2.1 // indirect github.com/pierrec/lz4/v4 v4.1.18 // indirect - github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect + github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_golang v1.18.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect diff --git a/internal/sqlquery/go.sum b/internal/sqlquery/go.sum index 10a88eb07b9a..562422dc9da0 100644 --- a/internal/sqlquery/go.sum +++ b/internal/sqlquery/go.sum @@ -2,20 +2,20 @@ github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMb github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4= github.com/99designs/keyring v1.2.2 h1:pZd3neh/EmUzWONb35LxQfvuY7kiSXAq3HQd97+XBn0= github.com/99designs/keyring v1.2.2/go.mod h1:wes/FrByc8j7lFOAGLGSNEg8f/PaI3cgTBqhFkHUrPk= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.1 h1:/iHxaJhsFr0+xVFfbMr5vxz848jyiWuIEDhYq3y5odY= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.1/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0 h1:vcYCAze6p19qBW7MhZybIsqD8sMV8js0NyQM8JDnVtg= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0/go.mod h1:OQeznEEkTZ9OrhHJoDD8ZDq51FHgXjqtP9z6bEwBq9U= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM= -github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.0.0 h1:yfJe15aSwEQ6Oo6J+gdfdulPNoZ3TEhmbhLIoxZcA+U= -github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.0.0/go.mod h1:Q28U+75mpCaSCDowNEmhIo/rmgdkqmkmzI7N6TGR4UY= -github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v0.8.0 h1:T028gtTPiYt/RMUfs8nVsAL7FDQrfLlrm/NnRG/zcC4= -github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v0.8.0/go.mod h1:cw4zVQgBby0Z5f2v0itn6se2dDP17nTjbZFXW5uPyHA= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.1 h1:lGlwhPtrX6EVml1hO0ivjkUxsSyl4dsiw9qcA1k/3IQ= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.1/go.mod h1:RKUqNu35KJYcVG/fqTRqmuXJZYNhYkBrnC/hX7yGbTA= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.1 h1:sO0/P7g68FrryJzljemN+6GTssUXdANk6aJ7T1ZxnsQ= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.1/go.mod h1:h8hyGFDsU5HMivxiS2iYFZsgDbU9OnnJ163x5UGVKYo= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.1 h1:6oNBlSdi1QqM1PNW7FPA6xOGA5UNsXnkaYZz9vdPGhA= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.1/go.mod h1:s4kgfzA0covAXNicZHDMN58jExvcng2mC/DepXiF1EI= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.0.1 h1:MyVTgWR8qd/Jw1Le0NZebGBUCLbtak3bJ3z1OlqZBpw= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.0.1/go.mod h1:GpPjLhVR9dnUoJMyHWSPy71xY9/lcmpzIPZXmF0FCVY= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.0.0 h1:D3occbWoio4EBLkbkevetNMAVX197GkzbUMtqjGWn80= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.0.0/go.mod h1:bTSOgj05NGRuHHhQwAdPnYr9TOdNmKlZTgGLL6nyAdI= github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.0.0 h1:u/LLAOFgsMv7HmNL4Qufg58y+qElGOt5qv0z1mURkRY= github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.0.0/go.mod h1:2e8rMJtl2+2j+HXbTBwnyGpm5Nou7KhvSfxOq8JpTag= -github.com/AzureAD/microsoft-authentication-library-for-go v1.1.0 h1:HCc0+LpPfpCKs6LGGLAhwBARt9632unrVcI6i8s/8os= -github.com/AzureAD/microsoft-authentication-library-for-go v1.1.0/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= +github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1 h1:DzHpqpoJVaCgOUdVHxE8QB52S6NiVdDQvGlny1qvPqA= +github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= 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.8.5 h1:tjWpYHS+MmYCorVe0e7viyMC/7ER/O1bEONohqovHHk= @@ -69,8 +69,8 @@ github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnG 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/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= +github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= +github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= github.com/dvsekhvalnov/jose2go v1.6.0 h1:Y9gnSnP4qEI0+/uQkHvFXeD2PLPJeXEL+ySMEA2EjTY= github.com/dvsekhvalnov/jose2go v1.6.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= github.com/form3tech-oss/jwt-go v3.2.5+incompatible h1:/l4kBbb4/vGSsdtB5nUe8L7B9mImVMaBPw9L/0TBHU8= @@ -93,8 +93,8 @@ github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6 github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE= -github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= +github.com/golang-jwt/jwt/v5 v5.2.0 h1:d/ix8ftRUorsN+5eMIlF4T6J8CAt9rch3My2winC1Jw= +github.com/golang-jwt/jwt/v5 v5.2.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 h1:au07oEsX2xN0ktxqI+Sida1w446QrXBRJ0nee3SNZlA= github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang-sql/sqlexp v0.1.0 h1:ZCD6MBpcuOVfGVqsEmY5/4FtYiKz6tSyUv9LPEDei6A= @@ -109,8 +109,8 @@ github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN 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.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= -github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +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/gorilla/securecookie v1.1.1 h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyCS8BvQ= github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= github.com/gorilla/sessions v1.2.1 h1:DHd3rPN5lE3Ts3D8rKkQ8x/0kqfeNmBAaiSi+o7FsgI= @@ -160,8 +160,8 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0 github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/microsoft/go-mssqldb v1.6.0 h1:mM3gYdVwEPFrlg/Dvr2DNVEgYFG7L42l+dGc67NNNpc= -github.com/microsoft/go-mssqldb v1.6.0/go.mod h1:00mDtPbeQCRGC1HwOOR5K/gr30P1NcEG0vx6Kbv2aJU= +github.com/microsoft/go-mssqldb v1.7.0 h1:sgMPW0HA6Ihd37Yx0MzHyKD726C2kY/8KJsQtXHNaAs= +github.com/microsoft/go-mssqldb v1.7.0/go.mod h1:kOvZKUdrhhFQmxLZqbwUV0rHkNkZpthMITIb2Ko1IoA= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c h1:cqn374mizHuIWj+OSJCajGr/phAmuMug9qIX3l9CflE= @@ -178,8 +178,8 @@ github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ib github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/pierrec/lz4/v4 v4.1.18 h1:xaKrnTkyoqfh1YItXl56+6KJNVYWlEEPuAQW9xsplYQ= github.com/pierrec/lz4/v4 v4.1.18/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= +github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= +github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= @@ -196,8 +196,8 @@ github.com/sijms/go-ora/v2 v2.8.8 h1:TvIjKrCPhVTYIzT7+rke/QKCY+ceVlTPfKXmgiuKX2s github.com/sijms/go-ora/v2 v2.8.8/go.mod h1:EHxlY6x7y9HAsdfumurRfTd+v8NrEOTR3Xl4FWlH6xk= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/snowflakedb/gosnowflake v1.7.2 h1:HRSwva8YXC64WUppfmHcMNVVzSE1+EwXXaJxgS0EkTo= -github.com/snowflakedb/gosnowflake v1.7.2/go.mod h1:03tW856vc3ceM4rJuj7KO4dzqN7qoezTm+xw7aPIIFo= +github.com/snowflakedb/gosnowflake v1.8.0 h1:4bQj8eAYGMkou/nICiIEb9jSbBLDDp5cB6JaKx9WwiA= +github.com/snowflakedb/gosnowflake v1.8.0/go.mod h1:7yyY2MxtDti2eXgtvlZ8QxzCN6KV2B4qb1HuygMI+0U= 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 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= @@ -247,8 +247,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= @@ -285,11 +285,11 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w 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-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 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.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= diff --git a/pkg/ottl/contexts/ottldatapoint/README.md b/pkg/ottl/contexts/ottldatapoint/README.md index 9e32c7dbc462..b4e605d9d175 100644 --- a/pkg/ottl/contexts/ottldatapoint/README.md +++ b/pkg/ottl/contexts/ottldatapoint/README.md @@ -41,8 +41,8 @@ The following paths are supported. | flags | the flags of the data point being processed | int64 | | count | the count of the data point being processed | int64 | | sum | the sum of the data point being processed | float64 | -| bucket_counts | the bucket counts of the data point being processed | []float64 | -| explicit_bounds | the explicit bounds of the data point being processed | []int64 | +| bucket_counts | the bucket counts of the data point being processed | []uint64 | +| explicit_bounds | the explicit bounds of the data point being processed | []float64 | | scale | the scale of the data point being processed | int64 | | zero_count | the zero_count of the data point being processed | int64 | | quantile_values | the quantile_values of the data point being processed | pmetric.SummaryDataPointValueAtQuantileSlice | @@ -65,4 +65,4 @@ In addition, it also supports an enum for metrics data type, with the numeric va | METRIC_DATA_TYPE_SUM | 2 | | METRIC_DATA_TYPE_HISTOGRAM | 3 | | METRIC_DATA_TYPE_EXPONENTIAL_HISTOGRAM | 4 | -| METRIC_DATA_TYPE_SUMMARY | 5 | \ No newline at end of file +| METRIC_DATA_TYPE_SUMMARY | 5 | diff --git a/pkg/ottl/go.mod b/pkg/ottl/go.mod index 8a33d4cb7037..aea4658e6994 100644 --- a/pkg/ottl/go.mod +++ b/pkg/ottl/go.mod @@ -15,7 +15,7 @@ require ( go.opentelemetry.io/collector/pdata v1.2.0 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc ) diff --git a/pkg/ottl/go.sum b/pkg/ottl/go.sum index 402c515aa952..5c669b1f85e0 100644 --- a/pkg/ottl/go.sum +++ b/pkg/ottl/go.sum @@ -102,8 +102,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/pkg/resourcetotelemetry/go.mod b/pkg/resourcetotelemetry/go.mod index fba71d642ddc..26bb7dc30504 100644 --- a/pkg/resourcetotelemetry/go.mod +++ b/pkg/resourcetotelemetry/go.mod @@ -33,7 +33,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 // indirect go.opentelemetry.io/otel/trace v1.23.1 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.26.0 // indirect + go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.20.0 // indirect golang.org/x/sys v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/pkg/resourcetotelemetry/go.sum b/pkg/resourcetotelemetry/go.sum index 1551d6822657..4f48a5e84c14 100644 --- a/pkg/resourcetotelemetry/go.sum +++ b/pkg/resourcetotelemetry/go.sum @@ -91,8 +91,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/pkg/stanza/docs/types/timestamp.md b/pkg/stanza/docs/types/timestamp.md index e7a50eade1d8..a7442203ee4f 100644 --- a/pkg/stanza/docs/types/timestamp.md +++ b/pkg/stanza/docs/types/timestamp.md @@ -13,6 +13,71 @@ If a timestamp block is specified, the parser operator will perform the timestam | `layout` | required | The exact layout of the timestamp to be parsed. | | `location` | `Local` | The geographic location (timezone) to use when parsing a timestamp that does not include a timezone. The available locations depend on the local IANA Time Zone database. [This page](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) contains many examples, such as `America/New_York`. | +## Layout Types + +### `strptime` and `gotime` + +The `strptime` layout type approximates familiar strptime/strftime formats. See the table below for a list of supported directives. + +The `gotime` layout type uses Golang's native time parsing capabilities. Golang takes an [unconventional approach](https://www.pauladamsmith.com/blog/2011/05/go_time.html) to time parsing. Finer details are documented [here](https://golang.org/src/time/format.go?s=25102:25148#L9). + +| `strptime` directive | `gotime` equivalent | Description | +| --- | --- | --- | +| `%Y` | `2006` | Year, zero-padded (0001, 0002, ..., 2019, 2020, ..., 9999) | +| `%y` | `06` | Year, last two digits, zero-padded (01, ..., 99) | +| `%m` | `01` | Month as a decimal number (01, 02, ..., 12) | +| `%o` | `_1` | Month as a space-padded number ( 1, 2, ..., 12) | +| `%q` | `1` | Month as a unpadded number (1,2,...,12) | +| `%b` | `Jan` | Abbreviated month name (Jan, Feb, ...) | +| `%B` | `January` | Full month name (January, February, ...) | +| `%d` | `02` | Day of the month, zero-padded (01, 02, ..., 31) | +| `%e` | `_2` | Day of the month, space-padded ( 1, 2, ..., 31) | +| `%g` | `2` | Day of the month, unpadded (1,2,...,31) | +| `%a` | `Mon` | Abbreviated weekday name (Sun, Mon, ...) | +| `%A` | `Monday` | Full weekday name (Sunday, Monday, ...) | +| `%H` | `15` | Hour (24-hour clock) as a zero-padded decimal number (00, ..., 24) | +| `%I` | `3` | Hour (12-hour clock) as a zero-padded decimal number (00, ..., 12) | +| `%l` | `03` | Hour (12-hour clock: 0, ..., 12) | +| `%p` | `PM` | Locale’s equivalent of either AM or PM | +| `%P` | `pm` | Locale’s equivalent of either am or pm | +| `%M` | `04` | Minute, zero-padded (00, 01, ..., 59) | +| `%S` | `05` | Second as a zero-padded decimal number (00, 01, ..., 59) | +| `%L` | `999` | Millisecond as a decimal number, zero-padded on the left (000, 001, ..., 999) | +| `%f` | `999999` | Microsecond as a decimal number, zero-padded on the left (000000, ..., 999999) | +| `%s` | `99999999` | Nanosecond as a decimal number, zero-padded on the left (000000, ..., 999999) | +| `%Z` | `MST` | Timezone name or abbreviation or empty (UTC, EST, CST) | +| `%z` | `Z0700` | UTC offset in the form ±HHMM[SS[.ffffff]] or empty(+0000, -0400) | +| `%i` | `-07` | UTC offset in the form ±HH or empty(+00, -04) | +| `%j` | `-07:00` | UTC offset in the form ±HH:MM or empty(+00:00, -04:00) | +| `%k` | `-07:00:00` | UTC offset in the form ±HH:MM:SS or empty(+00:00:00, -04:00:00) | +| `%D` | `01/02/2006` | Short MM/DD/YY date, equivalent to `%m/%d/%y` | +| `%F` | `2006-01-02` | Short YYYY-MM-DD date, equivalent to `%Y-%m-%d` | +| `%T` | `15:04:05` | ISO 8601 time format (HH:MM:SS), equivalent to `%H:%M:%S` | +| `%r` | `03:04:05 pm` | 12-hour clock time, equivalent to `%l:%M:%S %p` | +| `%c` | `Mon Jan 02 15:04:05 2006` | Date and time representation, equivalent to `%a %b %d %H:%M:%S %Y` | +| `%R` | `15:04` | 24-hour HH:MM time, equivalent to `%H:%M` | +| `%n` | `\n` | New-line character | +| `%t` | `\t` | Horizontal-tab character | +| `%%` | `%` | Percent sign | + +### `epoch` + +The `epoch` layout type uses can consume epoch-based timestamps. The following layouts are supported: + +| Layout | Meaning | Example | `parse_from` data type support | +| --- | --- | --- | --- | +| `s` | Seconds since the epoch | 1136214245 | `string`, `int64`, `float64` | +| `ms` | Milliseconds since the epoch | 1136214245123 | `string`, `int64`, `float64` | +| `us` | Microseconds since the epoch | 1136214245123456 | `string`, `int64`, `float64` | +| `ns` | Nanoseconds since the epoch | 1136214245123456789 | `string`, `int64`, `float64`[2] | +| `s.ms` | Seconds plus milliseconds since the epoch | 1136214245.123 | `string`, `int64`[1], `float64` | +| `s.us` | Seconds plus microseconds since the epoch | 1136214245.123456 | `string`, `int64`[1], `float64` | +| `s.ns` | Seconds plus nanoseconds since the epoch | 1136214245.123456789 | `string`, `int64`[1], `float64`[2] | + +[1] Interpretted as seconds. Equivalent to using `s` layout.
+[2] Due to floating point precision limitations, loss of up to 100ns may be expected. + + ### How to specify timestamp parsing parameters ```yaml @@ -145,8 +210,6 @@ but you could also use a `timestamp` block inside the `json_parser`. #### Parse a timestamp using a `strptime` layout -The default `layout_type` is `strptime`, which uses "directives" such as `%Y` (4-digit year) and `%H` (2-digit hour). A full list of supported directives is found [here](../../../../internal/coreinternal/timeutils/internal/ctimefmt/ctimefmt.go#L68). - Configuration: ```yaml - type: time_parser @@ -187,8 +250,6 @@ Configuration: #### Parse a timestamp using a `gotime` layout -The `gotime` layout type uses Golang's native time parsing capabilities. Golang takes an [unconventional approach](https://www.pauladamsmith.com/blog/2011/05/go_time.html) to time parsing. Finer details are well-documented [here](https://golang.org/src/time/format.go?s=25102:25148#L9). - Configuration: ```yaml - type: time_parser @@ -229,23 +290,6 @@ Configuration: #### Parse a timestamp using an `epoch` layout -The `epoch` layout type uses can consume epoch-based timestamps. The following layouts are supported: - -| Layout | Meaning | Example | `parse_from` data type support | -| --- | --- | --- | --- | -| `s` | Seconds since the epoch | 1136214245 | `string`, `int64`, `float64` | -| `ms` | Milliseconds since the epoch | 1136214245123 | `string`, `int64`, `float64` | -| `us` | Microseconds since the epoch | 1136214245123456 | `string`, `int64`, `float64` | -| `ns` | Nanoseconds since the epoch | 1136214245123456789 | `string`, `int64`, `float64`[2] | -| `s.ms` | Seconds plus milliseconds since the epoch | 1136214245.123 | `string`, `int64`[1], `float64` | -| `s.us` | Seconds plus microseconds since the epoch | 1136214245.123456 | `string`, `int64`[1], `float64` | -| `s.ns` | Seconds plus nanoseconds since the epoch | 1136214245.123456789 | `string`, `int64`[1], `float64`[2] | - -[1] Interpretted as seconds. Equivalent to using `s` layout.
-[2] Due to floating point precision limitations, loss of up to 100ns may be expected. - - - Configuration: ```yaml - type: time_parser diff --git a/pkg/stanza/errors/error_test.go b/pkg/stanza/errors/error_test.go index c7caa515c16e..b8b270d7e3c8 100644 --- a/pkg/stanza/errors/error_test.go +++ b/pkg/stanza/errors/error_test.go @@ -89,7 +89,7 @@ func TestMarshalLogObject(t *testing.T) { out, err := enc.EncodeEntry(entry, fields) require.NoError(t, err) - expected := `{"level":"debug","ts":-6795364578.8713455,"logger":"testlogger","msg":"Got an error","error":{"description":"Test error"}}` + "\n" + expected := `{"level":"debug","logger":"testlogger","msg":"Got an error","error":{"description":"Test error"}}` + "\n" require.Equal(t, expected, out.String()) }) @@ -98,7 +98,7 @@ func TestMarshalLogObject(t *testing.T) { out, err := enc.EncodeEntry(entry, fields) require.NoError(t, err) - expected := `{"level":"debug","ts":-6795364578.8713455,"logger":"testlogger","msg":"Got an error","error":{"description":"Test error","suggestion":"Fix it","details":{"foo":"bar"}}}` + "\n" + expected := `{"level":"debug","logger":"testlogger","msg":"Got an error","error":{"description":"Test error","suggestion":"Fix it","details":{"foo":"bar"}}}` + "\n" require.Equal(t, expected, out.String()) }) } diff --git a/pkg/stanza/fileconsumer/config.go b/pkg/stanza/fileconsumer/config.go index 18ad9d84fc38..ec2a4cd555b7 100644 --- a/pkg/stanza/fileconsumer/config.go +++ b/pkg/stanza/fileconsumer/config.go @@ -20,6 +20,7 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/fileconsumer/internal/fingerprint" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/fileconsumer/internal/header" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/fileconsumer/internal/reader" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/fileconsumer/internal/scanner" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/fileconsumer/matcher" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/helper" @@ -151,18 +152,19 @@ func (c Config) buildManager(logger *zap.SugaredLogger, emit emit.Callback, spli } readerFactory := reader.Factory{ - SugaredLogger: logger.With("component", "fileconsumer"), - FromBeginning: startAtBeginning, - FingerprintSize: int(c.FingerprintSize), - MaxLogSize: int(c.MaxLogSize), - Encoding: enc, - SplitFunc: splitFunc, - TrimFunc: trimFunc, - FlushTimeout: c.FlushPeriod, - EmitFunc: emit, - Attributes: c.Resolver, - HeaderConfig: hCfg, - DeleteAtEOF: c.DeleteAfterRead, + SugaredLogger: logger.With("component", "fileconsumer"), + FromBeginning: startAtBeginning, + FingerprintSize: int(c.FingerprintSize), + InitialBufferSize: scanner.DefaultBufferSize, + MaxLogSize: int(c.MaxLogSize), + Encoding: enc, + SplitFunc: splitFunc, + TrimFunc: trimFunc, + FlushTimeout: c.FlushPeriod, + EmitFunc: emit, + Attributes: c.Resolver, + HeaderConfig: hCfg, + DeleteAtEOF: c.DeleteAfterRead, } knownFiles := make([]*fileset.Fileset[*reader.Metadata], 3) for i := 0; i < len(knownFiles); i++ { diff --git a/pkg/stanza/fileconsumer/file.go b/pkg/stanza/fileconsumer/file.go index 4f3267d749b8..50fb27ec4aa9 100644 --- a/pkg/stanza/fileconsumer/file.go +++ b/pkg/stanza/fileconsumer/file.go @@ -130,7 +130,7 @@ func (m *Manager) poll(ctx context.Context) { if err != nil { m.Warnf("finding files: %v", err) } - m.Debugf("matched files", zap.Strings("paths", matches)) + m.Debugw("matched files", zap.Strings("paths", matches)) for len(matches) > m.maxBatchFiles { m.consume(ctx, matches[:m.maxBatchFiles]) @@ -201,7 +201,7 @@ func (m *Manager) makeFingerprint(path string) (*fingerprint.Fingerprint, *os.Fi return nil, nil } - if len(fp.FirstBytes) == 0 { + if fp.Len() == 0 { // Empty file, don't read it until we can compare its fingerprint if err = file.Close(); err != nil { m.Debugw("problem closing file", zap.Error(err)) diff --git a/pkg/stanza/fileconsumer/file_test.go b/pkg/stanza/fileconsumer/file_test.go index 52418ae7ce75..67621cb3aefc 100644 --- a/pkg/stanza/fileconsumer/file_test.go +++ b/pkg/stanza/fileconsumer/file_test.go @@ -70,22 +70,6 @@ func TestDefaultBehaviors(t *testing.T) { assert.Equal(t, tempName, attributes[attrs.LogFileName]) } -func TestCleanStop(t *testing.T) { - t.Parallel() - t.Skip(`Skipping due to goroutine leak in opencensus. -See this issue for details: https://github.com/census-instrumentation/opencensus-go/issues/1191#issuecomment-610440163`) - // defer goleak.VerifyNone(t) - - tempDir := t.TempDir() - cfg := NewConfig().includeDir(tempDir) - cfg.StartAt = "beginning" - operator, _ := testManager(t, cfg) - - _ = filetest.OpenTemp(t, tempDir) - require.NoError(t, operator.Start(testutil.NewUnscopedMockPersister())) - require.NoError(t, operator.Stop()) -} - // ReadExistingLogs tests that, when starting from beginning, we // read all the lines that are already there func TestReadExistingLogs(t *testing.T) { @@ -713,6 +697,7 @@ func TestRestartOffsets(t *testing.T) { } for _, tc := range testCases { + tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel() @@ -906,8 +891,8 @@ func TestEncodings(t *testing.T) { { "Nop", []byte{0xc5, '\n'}, - "", - [][]byte{{0xc5}}, + "nop", + [][]byte{{0xc5, '\n'}}, }, { "InvalidUTFReplacement", @@ -954,6 +939,7 @@ func TestEncodings(t *testing.T) { } for _, tc := range cases { + tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/stanza/fileconsumer/internal/checkpoint/checkpoint_test.go b/pkg/stanza/fileconsumer/internal/checkpoint/checkpoint_test.go index 8c09edc6c41a..fea2ca2bc5a7 100644 --- a/pkg/stanza/fileconsumer/internal/checkpoint/checkpoint_test.go +++ b/pkg/stanza/fileconsumer/internal/checkpoint/checkpoint_test.go @@ -53,7 +53,7 @@ func TestNopEncodingDifferentLogSizes(t *testing.T) { []*reader.Metadata{ { FileAttributes: make(map[string]any), - Fingerprint: &fingerprint.Fingerprint{FirstBytes: []byte("foo")}, + Fingerprint: fingerprint.New([]byte("foo")), Offset: 3, }, }, @@ -63,12 +63,12 @@ func TestNopEncodingDifferentLogSizes(t *testing.T) { []*reader.Metadata{ { FileAttributes: make(map[string]any), - Fingerprint: &fingerprint.Fingerprint{FirstBytes: []byte("foo")}, + Fingerprint: fingerprint.New([]byte("foo")), Offset: 3, }, { FileAttributes: make(map[string]any), - Fingerprint: &fingerprint.Fingerprint{FirstBytes: []byte("barrrr")}, + Fingerprint: fingerprint.New([]byte("barrrr")), Offset: 6, }, }, @@ -77,7 +77,7 @@ func TestNopEncodingDifferentLogSizes(t *testing.T) { "other_fields", []*reader.Metadata{ { - Fingerprint: &fingerprint.Fingerprint{FirstBytes: []byte("foo")}, + Fingerprint: fingerprint.New([]byte("foo")), Offset: 3, FileAttributes: map[string]any{ "hello": "world", @@ -85,12 +85,12 @@ func TestNopEncodingDifferentLogSizes(t *testing.T) { }, { FileAttributes: make(map[string]any), - Fingerprint: &fingerprint.Fingerprint{FirstBytes: []byte("barrrr")}, + Fingerprint: fingerprint.New([]byte("barrrr")), Offset: 6, HeaderFinalized: true, }, { - Fingerprint: &fingerprint.Fingerprint{FirstBytes: []byte("ab")}, + Fingerprint: fingerprint.New([]byte("ab")), Offset: 2, FileAttributes: map[string]any{ "hello2": "world2", @@ -121,7 +121,7 @@ func TestMigrateHeaderAttributes(t *testing.T) { p := testutil.NewUnscopedMockPersister() saveDeprecated(t, p, &deprecatedMetadata{ Metadata: reader.Metadata{ - Fingerprint: &fingerprint.Fingerprint{FirstBytes: []byte("foo")}, + Fingerprint: fingerprint.New([]byte("foo")), Offset: 3, FileAttributes: map[string]any{ "HeaderAttributes": map[string]any{ @@ -134,7 +134,7 @@ func TestMigrateHeaderAttributes(t *testing.T) { assert.NoError(t, err) assert.Equal(t, []*reader.Metadata{ { - Fingerprint: &fingerprint.Fingerprint{FirstBytes: []byte("foo")}, + Fingerprint: fingerprint.New([]byte("foo")), Offset: 3, FileAttributes: map[string]any{ "hello": "world", diff --git a/pkg/stanza/fileconsumer/internal/fileset/fileset_test.go b/pkg/stanza/fileconsumer/internal/fileset/fileset_test.go index 878791569f86..0d83ef8d5db6 100644 --- a/pkg/stanza/fileconsumer/internal/fileset/fileset_test.go +++ b/pkg/stanza/fileconsumer/internal/fileset/fileset_test.go @@ -59,20 +59,11 @@ func match[T Matchable](ele T, expect bool) func(t *testing.T, fileset *Fileset[ } } -func newFingerprint(bytes []byte) *fingerprint.Fingerprint { - return &fingerprint.Fingerprint{ - FirstBytes: bytes, - } -} -func newMetadata(bytes []byte) *reader.Metadata { - return &reader.Metadata{ - Fingerprint: newFingerprint(bytes), - } -} - func newReader(bytes []byte) *reader.Reader { return &reader.Reader{ - Metadata: newMetadata(bytes), + Metadata: &reader.Metadata{ + Fingerprint: fingerprint.New(bytes), + }, } } diff --git a/pkg/stanza/fileconsumer/internal/fingerprint/fingerprint.go b/pkg/stanza/fileconsumer/internal/fingerprint/fingerprint.go index fb23296afae9..a61346d8db1c 100644 --- a/pkg/stanza/fileconsumer/internal/fingerprint/fingerprint.go +++ b/pkg/stanza/fileconsumer/internal/fingerprint/fingerprint.go @@ -5,6 +5,7 @@ package fingerprint // import "github.com/open-telemetry/opentelemetry-collector import ( "bytes" + "encoding/json" "errors" "fmt" "io" @@ -18,32 +19,31 @@ const MinSize = 16 // bytes // Fingerprint is used to identify a file // A file's fingerprint is the first N bytes of the file type Fingerprint struct { - FirstBytes []byte + firstBytes []byte } -// New creates a new fingerprint from an open file -func New(file *os.File, size int) (*Fingerprint, error) { - buf := make([]byte, size) +func New(first []byte) *Fingerprint { + return &Fingerprint{firstBytes: first} +} +func NewFromFile(file *os.File, size int) (*Fingerprint, error) { + buf := make([]byte, size) n, err := file.ReadAt(buf, 0) if err != nil && !errors.Is(err, io.EOF) { return nil, fmt.Errorf("reading fingerprint bytes: %w", err) } - - fp := &Fingerprint{ - FirstBytes: buf[:n], - } - - return fp, nil + return New(buf[:n]), nil } // Copy creates a new copy of the fingerprint func (f Fingerprint) Copy() *Fingerprint { - buf := make([]byte, len(f.FirstBytes), cap(f.FirstBytes)) - n := copy(buf, f.FirstBytes) - return &Fingerprint{ - FirstBytes: buf[:n], - } + buf := make([]byte, len(f.firstBytes), cap(f.firstBytes)) + n := copy(buf, f.firstBytes) + return New(buf[:n]) +} + +func (f *Fingerprint) Len() int { + return len(f.firstBytes) } // Equal returns true if the fingerprints have the same FirstBytes, @@ -51,13 +51,13 @@ func (f Fingerprint) Copy() *Fingerprint { // because the primary purpose of a fingerprint is to convey a unique // identity, and only the FirstBytes field contributes to this goal. func (f Fingerprint) Equal(other *Fingerprint) bool { - l0 := len(other.FirstBytes) - l1 := len(f.FirstBytes) + l0 := len(other.firstBytes) + l1 := len(f.firstBytes) if l0 != l1 { return false } for i := 0; i < l0; i++ { - if other.FirstBytes[i] != f.FirstBytes[i] { + if other.firstBytes[i] != f.firstBytes[i] { return false } } @@ -71,13 +71,31 @@ func (f Fingerprint) Equal(other *Fingerprint) bool { // a fingerprint. As the file grows, its fingerprint is updated // until it reaches a maximum size, as configured on the operator func (f Fingerprint) StartsWith(old *Fingerprint) bool { - l0 := len(old.FirstBytes) + l0 := len(old.firstBytes) if l0 == 0 { return false } - l1 := len(f.FirstBytes) + l1 := len(f.firstBytes) if l0 > l1 { return false } - return bytes.Equal(old.FirstBytes[:l0], f.FirstBytes[:l0]) + return bytes.Equal(old.firstBytes[:l0], f.firstBytes[:l0]) +} + +func (f *Fingerprint) MarshalJSON() ([]byte, error) { + m := marshal{FirstBytes: f.firstBytes} + return json.Marshal(&m) +} + +func (f *Fingerprint) UnmarshalJSON(data []byte) error { + m := new(marshal) + if err := json.Unmarshal(data, m); err != nil { + return err + } + f.firstBytes = m.FirstBytes + return nil +} + +type marshal struct { + FirstBytes []byte `json:"first_bytes"` } diff --git a/pkg/stanza/fileconsumer/internal/fingerprint/fingerprint_test.go b/pkg/stanza/fileconsumer/internal/fingerprint/fingerprint_test.go index ff3532456ccd..78f844ef54ac 100644 --- a/pkg/stanza/fileconsumer/internal/fingerprint/fingerprint_test.go +++ b/pkg/stanza/fileconsumer/internal/fingerprint/fingerprint_test.go @@ -36,11 +36,11 @@ func TestNewDoesNotModifyOffset(t *testing.T) { _, err = temp.Seek(0, 0) require.NoError(t, err) - fp, err := New(temp, len(fingerprint)) + fp, err := NewFromFile(temp, len(fingerprint)) require.NoError(t, err) // Validate the fingerprint is the correct size - require.Equal(t, len(fingerprint), len(fp.FirstBytes)) + require.Equal(t, len(fingerprint), len(fp.firstBytes)) // Validate that reading the fingerprint did not adjust the // file descriptor's internal offset (as using Seek does) @@ -52,6 +52,11 @@ func TestNewDoesNotModifyOffset(t *testing.T) { } func TestNew(t *testing.T) { + fp := New([]byte("hello")) + require.Equal(t, []byte("hello"), fp.firstBytes) +} + +func TestNewFromFile(t *testing.T) { cases := []struct { name string fingerprintSize int @@ -109,6 +114,7 @@ func TestNew(t *testing.T) { } for _, tc := range cases { + tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel() @@ -125,15 +131,15 @@ func TestNew(t *testing.T) { require.NoError(t, err) require.Equal(t, tc.fileSize, int(info.Size())) - fp, err := New(temp, tc.fingerprintSize) + fp, err := NewFromFile(temp, tc.fingerprintSize) require.NoError(t, err) - require.Equal(t, tc.expectedLen, len(fp.FirstBytes)) + require.Equal(t, tc.expectedLen, len(fp.firstBytes)) }) } } -func TestFingerprintCopy(t *testing.T) { +func TestCopy(t *testing.T) { t.Parallel() cases := []string{ "", @@ -145,36 +151,36 @@ func TestFingerprintCopy(t *testing.T) { } for _, tc := range cases { - fp := &Fingerprint{FirstBytes: []byte(tc)} + fp := New([]byte(tc)) cp := fp.Copy() // Did not change original - require.Equal(t, tc, string(fp.FirstBytes)) + require.Equal(t, tc, string(fp.firstBytes)) // Copy is also good - require.Equal(t, tc, string(cp.FirstBytes)) + require.Equal(t, tc, string(cp.firstBytes)) // Modify copy - cp.FirstBytes = append(cp.FirstBytes, []byte("also")...) + cp.firstBytes = append(cp.firstBytes, []byte("also")...) // Still did not change original - require.Equal(t, tc, string(fp.FirstBytes)) + require.Equal(t, tc, string(fp.firstBytes)) // Copy is modified - require.Equal(t, tc+"also", string(cp.FirstBytes)) + require.Equal(t, tc+"also", string(cp.firstBytes)) } } func TestEqual(t *testing.T) { - empty := &Fingerprint{FirstBytes: []byte("")} - empty2 := &Fingerprint{FirstBytes: []byte("")} - hello := &Fingerprint{FirstBytes: []byte("hello")} - hello2 := &Fingerprint{FirstBytes: []byte("hello")} - world := &Fingerprint{FirstBytes: []byte("world")} - world2 := &Fingerprint{FirstBytes: []byte("world")} - helloworld := &Fingerprint{FirstBytes: []byte("helloworld")} - helloworld2 := &Fingerprint{FirstBytes: []byte("helloworld")} + empty := New([]byte("")) + empty2 := New([]byte("")) + hello := New([]byte("hello")) + hello2 := New([]byte("hello")) + world := New([]byte("world")) + world2 := New([]byte("world")) + helloworld := New([]byte("helloworld")) + helloworld2 := New([]byte("helloworld")) require.True(t, empty.Equal(empty2)) require.True(t, hello.Equal(hello2)) @@ -192,10 +198,10 @@ func TestEqual(t *testing.T) { } func TestStartsWith(t *testing.T) { - empty := &Fingerprint{FirstBytes: []byte("")} - hello := &Fingerprint{FirstBytes: []byte("hello")} - world := &Fingerprint{FirstBytes: []byte("world")} - helloworld := &Fingerprint{FirstBytes: []byte("helloworld")} + empty := New([]byte("")) + hello := New([]byte("hello")) + world := New([]byte("world")) + helloworld := New([]byte("helloworld")) // Empty never matches require.False(t, hello.StartsWith(empty)) @@ -244,7 +250,7 @@ func TestStartsWith_FromFile(t *testing.T) { _, err = fullFile.Write(content) require.NoError(t, err) - fff, err := New(fullFile, fingerprintSize) + fff, err := NewFromFile(fullFile, fingerprintSize) require.NoError(t, err) partialFile, err := os.CreateTemp(tempDir, "") @@ -262,7 +268,7 @@ func TestStartsWith_FromFile(t *testing.T) { _, err = partialFile.Write(content[i:i]) require.NoError(t, err) - pff, err := New(partialFile, fingerprintSize) + pff, err := NewFromFile(partialFile, fingerprintSize) require.NoError(t, err) require.True(t, fff.StartsWith(pff)) @@ -277,3 +283,14 @@ func tokenWithLength(length int) []byte { } return b } + +func TestMarshalUnmarshal(t *testing.T) { + fp := New([]byte("hello")) + b, err := fp.MarshalJSON() + require.NoError(t, err) + + fp2 := new(Fingerprint) + require.NoError(t, fp2.UnmarshalJSON(b)) + + require.Equal(t, fp, fp2) +} diff --git a/pkg/stanza/fileconsumer/internal/reader/factory.go b/pkg/stanza/fileconsumer/internal/reader/factory.go index 55447c9d6c4e..dab54565adfc 100644 --- a/pkg/stanza/fileconsumer/internal/reader/factory.go +++ b/pkg/stanza/fileconsumer/internal/reader/factory.go @@ -5,6 +5,7 @@ package reader // import "github.com/open-telemetry/opentelemetry-collector-cont import ( "bufio" + "errors" "fmt" "os" "time" @@ -28,21 +29,22 @@ const ( type Factory struct { *zap.SugaredLogger - HeaderConfig *header.Config - FromBeginning bool - FingerprintSize int - MaxLogSize int - Encoding encoding.Encoding - SplitFunc bufio.SplitFunc - TrimFunc trim.Func - FlushTimeout time.Duration - EmitFunc emit.Callback - Attributes attrs.Resolver - DeleteAtEOF bool + HeaderConfig *header.Config + FromBeginning bool + FingerprintSize int + InitialBufferSize int + MaxLogSize int + Encoding encoding.Encoding + SplitFunc bufio.SplitFunc + TrimFunc trim.Func + FlushTimeout time.Duration + EmitFunc emit.Callback + Attributes attrs.Resolver + DeleteAtEOF bool } func (f *Factory) NewFingerprint(file *os.File) (*fingerprint.Fingerprint, error) { - return fingerprint.New(file, f.FingerprintSize) + return fingerprint.NewFromFile(file, f.FingerprintSize) } func (f *Factory) NewReader(file *os.File, fp *fingerprint.Fingerprint) (*Reader, error) { @@ -59,15 +61,28 @@ func (f *Factory) NewReader(file *os.File, fp *fingerprint.Fingerprint) (*Reader func (f *Factory) NewReaderFromMetadata(file *os.File, m *Metadata) (r *Reader, err error) { r = &Reader{ - Metadata: m, - logger: f.SugaredLogger.With("path", file.Name()), - file: file, - fileName: file.Name(), - fingerprintSize: f.FingerprintSize, - maxLogSize: f.MaxLogSize, - decoder: decode.New(f.Encoding), - lineSplitFunc: f.SplitFunc, - deleteAtEOF: f.DeleteAtEOF, + Metadata: m, + logger: f.SugaredLogger.With("path", file.Name()), + file: file, + fileName: file.Name(), + fingerprintSize: f.FingerprintSize, + initialBufferSize: f.InitialBufferSize, + maxLogSize: f.MaxLogSize, + decoder: decode.New(f.Encoding), + lineSplitFunc: f.SplitFunc, + deleteAtEOF: f.DeleteAtEOF, + } + + if r.Fingerprint.Len() > r.fingerprintSize { + // User has reconfigured fingerprint_size + shorter, rereadErr := fingerprint.NewFromFile(file, r.fingerprintSize) + if rereadErr != nil { + return nil, fmt.Errorf("reread fingerprint: %w", err) + } + if !r.Fingerprint.StartsWith(shorter) { + return nil, errors.New("file truncated") + } + m.Fingerprint = shorter } if !f.FromBeginning { diff --git a/pkg/stanza/fileconsumer/internal/reader/factory_test.go b/pkg/stanza/fileconsumer/internal/reader/factory_test.go index 4f72341b6a05..c83537996406 100644 --- a/pkg/stanza/fileconsumer/internal/reader/factory_test.go +++ b/pkg/stanza/fileconsumer/internal/reader/factory_test.go @@ -16,6 +16,7 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/fileconsumer/internal/emittest" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/fileconsumer/internal/filetest" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/fileconsumer/internal/fingerprint" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/fileconsumer/internal/scanner" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/split" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/testutil" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/trim" @@ -28,13 +29,14 @@ const ( func testFactory(t *testing.T, opts ...testFactoryOpt) (*Factory, *emittest.Sink) { cfg := &testFactoryCfg{ - fromBeginning: true, - fingerprintSize: fingerprint.DefaultSize, - maxLogSize: defaultMaxLogSize, - encoding: unicode.UTF8, - trimFunc: trim.Whitespace, - flushPeriod: defaultFlushPeriod, - sinkCallBufferSize: 100, + fromBeginning: true, + fingerprintSize: fingerprint.DefaultSize, + initialBufferSize: scanner.DefaultBufferSize, + maxLogSize: defaultMaxLogSize, + encoding: unicode.UTF8, + trimFunc: trim.Whitespace, + flushPeriod: defaultFlushPeriod, + sinkChanSize: 100, attributes: attrs.Resolver{ IncludeFileName: true, }, @@ -46,33 +48,35 @@ func testFactory(t *testing.T, opts ...testFactoryOpt) (*Factory, *emittest.Sink splitFunc, err := cfg.splitCfg.Func(cfg.encoding, false, cfg.maxLogSize) require.NoError(t, err) - sink := emittest.NewSink(emittest.WithCallBuffer(cfg.sinkCallBufferSize)) + sink := emittest.NewSink(emittest.WithCallBuffer(cfg.sinkChanSize)) return &Factory{ - SugaredLogger: testutil.Logger(t), - FromBeginning: cfg.fromBeginning, - FingerprintSize: cfg.fingerprintSize, - MaxLogSize: cfg.maxLogSize, - Encoding: cfg.encoding, - SplitFunc: splitFunc, - TrimFunc: cfg.trimFunc, - FlushTimeout: cfg.flushPeriod, - EmitFunc: sink.Callback, - Attributes: cfg.attributes, + SugaredLogger: testutil.Logger(t), + FromBeginning: cfg.fromBeginning, + FingerprintSize: cfg.fingerprintSize, + InitialBufferSize: cfg.initialBufferSize, + MaxLogSize: cfg.maxLogSize, + Encoding: cfg.encoding, + SplitFunc: splitFunc, + TrimFunc: cfg.trimFunc, + FlushTimeout: cfg.flushPeriod, + EmitFunc: sink.Callback, + Attributes: cfg.attributes, }, sink } type testFactoryOpt func(*testFactoryCfg) type testFactoryCfg struct { - fromBeginning bool - fingerprintSize int - maxLogSize int - encoding encoding.Encoding - splitCfg split.Config - trimFunc trim.Func - flushPeriod time.Duration - sinkCallBufferSize int - attributes attrs.Resolver + fromBeginning bool + fingerprintSize int + initialBufferSize int + maxLogSize int + encoding encoding.Encoding + splitCfg split.Config + trimFunc trim.Func + flushPeriod time.Duration + sinkChanSize int + attributes attrs.Resolver } func withFingerprintSize(size int) testFactoryOpt { @@ -87,9 +91,15 @@ func withSplitConfig(cfg split.Config) testFactoryOpt { } } -func withMaxLogSize(maxLogSize int) testFactoryOpt { +func withInitialBufferSize(size int) testFactoryOpt { return func(c *testFactoryCfg) { - c.maxLogSize = maxLogSize + c.initialBufferSize = size + } +} + +func withMaxLogSize(size int) testFactoryOpt { + return func(c *testFactoryCfg) { + c.maxLogSize = size } } @@ -99,9 +109,9 @@ func withFlushPeriod(flushPeriod time.Duration) testFactoryOpt { } } -func withSinkBufferSize(n int) testFactoryOpt { +func withSinkChanSize(n int) testFactoryOpt { return func(c *testFactoryCfg) { - c.sinkCallBufferSize = n + c.sinkChanSize = n } } diff --git a/pkg/stanza/fileconsumer/internal/reader/fingerprint_test.go b/pkg/stanza/fileconsumer/internal/reader/fingerprint_test.go new file mode 100644 index 000000000000..f6ce84ee584e --- /dev/null +++ b/pkg/stanza/fileconsumer/internal/reader/fingerprint_test.go @@ -0,0 +1,349 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package reader + +import ( + "context" + "fmt" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/fileconsumer/internal/filetest" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/fileconsumer/internal/fingerprint" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/fileconsumer/internal/scanner" +) + +func TestReaderUpdateFingerprint(t *testing.T) { + bufferSizes := []int{2, 3, 5, 8, 10, 13, 20, 50} + testCases := []updateFingerprintTest{ + { + name: "new_file", + fingerprintSize: 10, + maxLogSize: 100, + initBytes: []byte(""), + moreBytes: []byte("1234567890\n"), + expectTokens: [][]byte{[]byte("1234567890")}, + expectOffset: 11, + expectFingerprint: []byte("1234567890"), + }, + { + name: "existing_partial_line_from_start", + fingerprintSize: 10, + maxLogSize: 100, + fromBeginning: true, + initBytes: []byte("foo"), + moreBytes: []byte("1234567890\n"), + expectTokens: [][]byte{[]byte("foo1234567890")}, + expectOffset: 14, + expectFingerprint: []byte("foo1234567"), + }, + { + name: "existing_partial_line", + fingerprintSize: 10, + maxLogSize: 100, + initBytes: []byte("foo"), + moreBytes: []byte("1234567890\n"), + expectTokens: [][]byte{[]byte("1234567890")}, + expectOffset: 14, + expectFingerprint: []byte("foo1234567"), + }, + { + name: "existing_full_line_from_start", + fingerprintSize: 10, + maxLogSize: 100, + fromBeginning: true, + initBytes: []byte("foo\n"), + moreBytes: []byte("1234567890\n"), + expectTokens: [][]byte{[]byte("foo"), []byte("1234567890")}, + expectOffset: 15, + expectFingerprint: []byte("foo\n123456"), + }, + { + name: "existing_full_line", + fingerprintSize: 10, + maxLogSize: 100, + initBytes: []byte("foo\n"), + moreBytes: []byte("1234567890\n"), + expectTokens: [][]byte{[]byte("1234567890")}, + expectOffset: 15, + expectFingerprint: []byte("foo\n123456"), + }, + { + name: "split_none_from_start", + fingerprintSize: 10, + maxLogSize: 100, + fromBeginning: true, + initBytes: []byte("foo"), + moreBytes: []byte("1234567890"), + expectTokens: [][]byte{}, + expectOffset: 0, + expectFingerprint: []byte("foo1234567"), + }, + { + name: "split_none", + fingerprintSize: 10, + maxLogSize: 100, + initBytes: []byte("foo"), + moreBytes: []byte("1234567890"), + expectTokens: [][]byte{}, + expectOffset: 3, + expectFingerprint: []byte("foo1234567"), + }, + { + name: "split_mid_from_start", + fingerprintSize: 10, + maxLogSize: 100, + fromBeginning: true, + initBytes: []byte("foo"), + moreBytes: []byte("12345\n67890"), + expectTokens: [][]byte{[]byte("foo12345")}, + expectOffset: 9, + expectFingerprint: []byte("foo12345\n6"), + }, + { + name: "split_mid", + fingerprintSize: 10, + maxLogSize: 100, + initBytes: []byte("foo"), + moreBytes: []byte("12345\n67890"), + expectTokens: [][]byte{[]byte("12345")}, + expectOffset: 9, + expectFingerprint: []byte("foo12345\n6"), + }, + { + name: "clean_end_from_start", + fingerprintSize: 10, + maxLogSize: 100, + fromBeginning: true, + initBytes: []byte("foo"), + moreBytes: []byte("12345\n67890\n"), + expectTokens: [][]byte{[]byte("foo12345"), []byte("67890")}, + expectOffset: 15, + expectFingerprint: []byte("foo12345\n6"), + }, + { + name: "clean_end", + fingerprintSize: 10, + maxLogSize: 100, + initBytes: []byte("foo"), + moreBytes: []byte("12345\n67890\n"), + expectTokens: [][]byte{[]byte("12345"), []byte("67890")}, + expectOffset: 15, + expectFingerprint: []byte("foo12345\n6"), + }, + { + name: "full_lines_only_from_start", + fingerprintSize: 10, + maxLogSize: 100, + fromBeginning: true, + initBytes: []byte("foo\n"), + moreBytes: []byte("12345\n67890\n"), + expectTokens: [][]byte{[]byte("foo"), []byte("12345"), []byte("67890")}, + expectOffset: 16, + expectFingerprint: []byte("foo\n12345\n"), + }, + { + name: "full_lines_only", + fingerprintSize: 10, + maxLogSize: 100, + initBytes: []byte("foo\n"), + moreBytes: []byte("12345\n67890\n"), + expectTokens: [][]byte{[]byte("12345"), []byte("67890")}, + expectOffset: 16, + expectFingerprint: []byte("foo\n12345\n"), + }, + { + name: "small_max_log_size_from_start", + fingerprintSize: 20, + maxLogSize: 4, + fromBeginning: true, + initBytes: []byte("foo"), + moreBytes: []byte("1234567890\nbar\nhelloworld\n"), + expectTokens: [][]byte{[]byte("foo1"), []byte("2345"), []byte("6789"), []byte("0"), []byte("bar"), []byte("hell"), []byte("owor"), []byte("ld")}, + expectOffset: 29, + expectFingerprint: []byte("foo1234567890\nbar\nhe"), + }, + { + name: "small_max_log_size", + fingerprintSize: 20, + maxLogSize: 4, + initBytes: []byte("foo"), + moreBytes: []byte("1234567890\nbar\nhelloworld\n"), + expectTokens: [][]byte{[]byte("1234"), []byte("5678"), []byte("90"), []byte("bar"), []byte("hell"), []byte("owor"), []byte("ld")}, + expectOffset: 29, + expectFingerprint: []byte("foo1234567890\nbar\nhe"), + }, + { + name: "leading_empty_from_start", + fingerprintSize: 10, + maxLogSize: 100, + fromBeginning: true, + initBytes: []byte(""), + moreBytes: []byte("\n12345\n67890\n"), + expectTokens: [][]byte{[]byte(""), []byte("12345"), []byte("67890")}, + expectOffset: 13, + expectFingerprint: []byte("\n12345\n678"), + }, + { + name: "leading_empty", + fingerprintSize: 10, + maxLogSize: 100, + initBytes: []byte(""), + moreBytes: []byte("\n12345\n67890\n"), + expectTokens: [][]byte{[]byte(""), []byte("12345"), []byte("67890")}, + expectOffset: 13, + expectFingerprint: []byte("\n12345\n678"), + }, + { + name: "multiple_empty_from_start", + fingerprintSize: 10, + maxLogSize: 100, + fromBeginning: true, + initBytes: []byte(""), + moreBytes: []byte("\n\n12345\n\n67890\n\n"), + expectTokens: [][]byte{[]byte(""), []byte(""), []byte("12345"), []byte(""), []byte("67890"), []byte("")}, + expectOffset: 16, + expectFingerprint: []byte("\n\n12345\n\n6"), + }, + { + name: "multiple_empty", + fingerprintSize: 10, + maxLogSize: 100, + initBytes: []byte(""), + moreBytes: []byte("\n\n12345\n\n67890\n\n"), + expectTokens: [][]byte{[]byte(""), []byte(""), []byte("12345"), []byte(""), []byte("67890"), []byte("")}, + expectOffset: 16, + expectFingerprint: []byte("\n\n12345\n\n6"), + }, + { + name: "multiple_empty_partial_end_from_start", + fingerprintSize: 10, + maxLogSize: 100, + fromBeginning: true, + initBytes: []byte(""), + moreBytes: []byte("\n\n12345\n\n67890"), + expectTokens: [][]byte{[]byte(""), []byte(""), []byte("12345"), []byte("")}, + expectOffset: 9, + expectFingerprint: []byte("\n\n12345\n\n6"), + }, + { + name: "multiple_empty_partial_end", + fingerprintSize: 10, + maxLogSize: 100, + initBytes: []byte(""), + moreBytes: []byte("\n\n12345\n\n67890"), + expectTokens: [][]byte{[]byte(""), []byte(""), []byte("12345"), []byte("")}, + expectOffset: 9, + expectFingerprint: []byte("\n\n12345\n\n6"), + }, + } + + for _, tc := range testCases { + for _, bufferSize := range bufferSizes { + t.Run(fmt.Sprintf("%s/bufferSize:%d", tc.name, bufferSize), tc.run(bufferSize)) + } + } +} + +type updateFingerprintTest struct { + name string + fingerprintSize int + maxLogSize int + fromBeginning bool + initBytes []byte + moreBytes []byte + expectTokens [][]byte + expectOffset int64 + expectFingerprint []byte +} + +func (tc updateFingerprintTest) run(bufferSize int) func(*testing.T) { + return func(t *testing.T) { + opts := []testFactoryOpt{ + withFingerprintSize(tc.fingerprintSize), + withInitialBufferSize(bufferSize), + withMaxLogSize(tc.maxLogSize), + withFlushPeriod(0), + } + if !tc.fromBeginning { + opts = append(opts, fromEnd()) + } + f, sink := testFactory(t, opts...) + + temp := filetest.OpenTemp(t, t.TempDir()) + _, err := temp.Write(tc.initBytes) + require.NoError(t, err) + + fi, err := temp.Stat() + require.NoError(t, err) + require.Equal(t, int64(len(tc.initBytes)), fi.Size()) + + fp, err := f.NewFingerprint(temp) + require.NoError(t, err) + r, err := f.NewReader(temp, fp) + require.NoError(t, err) + require.Same(t, temp, r.file) + + if tc.fromBeginning { + assert.Equal(t, int64(0), r.Offset) + } else { + assert.Equal(t, int64(len(tc.initBytes)), r.Offset) + } + assert.Equal(t, fingerprint.New(tc.initBytes), r.Fingerprint) + + i, err := temp.Write(tc.moreBytes) + require.NoError(t, err) + require.Equal(t, i, len(tc.moreBytes)) + + r.ReadToEnd(context.Background()) + + sink.ExpectTokens(t, tc.expectTokens...) + + assert.Equal(t, tc.expectOffset, r.Offset) + assert.Equal(t, fingerprint.New(tc.expectFingerprint), r.Fingerprint) + } +} + +// TestReadingWithLargeFingerPrintSizeAndFileLargerThanScannerBuf tests for reading of log file when: +// - fingerprint size is larger than the size of scanner default buffer (defaultBufSize) +// - size of the log file is lower than fingerprint size +func TestReadingWithLargeFingerPrintSizeAndFileLargerThanScannerBuf(t *testing.T) { + t.Parallel() + tempDir := t.TempDir() + + // Generate log lines + body := "abcdefghijklmnopqrstuvwxyz1234567890" + fileContent := "" + expected := [][]byte{} + fingerPrintSize := scanner.DefaultBufferSize + 2*1024 + + for i := 0; len(fileContent) < fingerPrintSize-1024; i++ { + log := fmt.Sprintf("line %d log %s, end of line %d", i, body, i) + fileContent += fmt.Sprintf("%s\n", log) + expected = append(expected, []byte(log)) + } + + temp := filetest.OpenTemp(t, tempDir) + filetest.WriteString(t, temp, fileContent) + + f, sink := testFactory(t, + withFingerprintSize(fingerPrintSize), + withMaxLogSize(defaultMaxLogSize), + withSinkChanSize(1000), + ) + + fp, err := f.NewFingerprint(temp) + require.NoError(t, err) + + r, err := f.NewReader(temp, fp) + require.NoError(t, err) + + initialFingerPrintSize := r.Fingerprint.Len() + r.ReadToEnd(context.Background()) + require.Equal(t, initialFingerPrintSize, r.Fingerprint.Len()) + + sink.ExpectTokens(t, expected...) +} diff --git a/pkg/stanza/fileconsumer/internal/reader/reader.go b/pkg/stanza/fileconsumer/internal/reader/reader.go index 3c1111a43e2b..ae5f4a5e29b9 100644 --- a/pkg/stanza/fileconsumer/internal/reader/reader.go +++ b/pkg/stanza/fileconsumer/internal/reader/reader.go @@ -30,18 +30,20 @@ type Metadata struct { // Reader manages a single file type Reader struct { *Metadata - logger *zap.SugaredLogger - fileName string - file *os.File - fingerprintSize int - maxLogSize int - lineSplitFunc bufio.SplitFunc - splitFunc bufio.SplitFunc - decoder *decode.Decoder - headerReader *header.Reader - processFunc emit.Callback - emitFunc emit.Callback - deleteAtEOF bool + logger *zap.SugaredLogger + fileName string + file *os.File + fingerprintSize int + initialBufferSize int + maxLogSize int + lineSplitFunc bufio.SplitFunc + splitFunc bufio.SplitFunc + decoder *decode.Decoder + headerReader *header.Reader + processFunc emit.Callback + emitFunc emit.Callback + deleteAtEOF bool + needsUpdateFingerprint bool } // ReadToEnd will read until the end of the file @@ -51,7 +53,13 @@ func (r *Reader) ReadToEnd(ctx context.Context) { return } - s := scanner.New(r, r.maxLogSize, scanner.DefaultBufferSize, r.Offset, r.splitFunc) + defer func() { + if r.needsUpdateFingerprint { + r.updateFingerprint() + } + }() + + s := scanner.New(r, r.maxLogSize, r.initialBufferSize, r.Offset, r.splitFunc) // Iterate over the tokenized file, emitting entries as we go for { @@ -144,32 +152,16 @@ func (r *Reader) close() { } // Read from the file and update the fingerprint if necessary -func (r *Reader) Read(dst []byte) (int, error) { - // Skip if fingerprint is already built - // or if fingerprint is behind Offset - if len(r.Fingerprint.FirstBytes) == r.fingerprintSize || int(r.Offset) > len(r.Fingerprint.FirstBytes) { - return r.file.Read(dst) - } - n, err := r.file.Read(dst) - appendCount := min0(n, r.fingerprintSize-int(r.Offset)) - // return for n == 0 or r.Offset >= r.fingerprintSize - if appendCount == 0 { - return n, err +func (r *Reader) Read(dst []byte) (n int, err error) { + n, err = r.file.Read(dst) + if n == 0 || err != nil { + return } - // for appendCount==0, the following code would add `0` to fingerprint - r.Fingerprint.FirstBytes = append(r.Fingerprint.FirstBytes[:r.Offset], dst[:appendCount]...) - return n, err -} - -func min0(a, b int) int { - if a < 0 || b < 0 { - return 0 + if !r.needsUpdateFingerprint && r.Fingerprint.Len() < r.fingerprintSize { + r.needsUpdateFingerprint = true } - if a < b { - return a - } - return b + return } func (r *Reader) NameEquals(other *Reader) bool { @@ -181,7 +173,7 @@ func (r *Reader) Validate() bool { if r.file == nil { return false } - refreshedFingerprint, err := fingerprint.New(r.file, r.fingerprintSize) + refreshedFingerprint, err := fingerprint.NewFromFile(r.file, r.fingerprintSize) if err != nil { return false } @@ -194,3 +186,18 @@ func (r *Reader) Validate() bool { func (m Metadata) GetFingerprint() *fingerprint.Fingerprint { return m.Fingerprint } + +func (r *Reader) updateFingerprint() { + r.needsUpdateFingerprint = false + if r.file == nil { + return + } + refreshedFingerprint, err := fingerprint.NewFromFile(r.file, r.fingerprintSize) + if err != nil { + return + } + if r.Fingerprint.Len() > 0 && !refreshedFingerprint.StartsWith(r.Fingerprint) { + return // fingerprint tampered, likely due to truncation + } + r.Fingerprint = refreshedFingerprint +} diff --git a/pkg/stanza/fileconsumer/internal/reader/reader_test.go b/pkg/stanza/fileconsumer/internal/reader/reader_test.go index 58baeea97277..8107fe235693 100644 --- a/pkg/stanza/fileconsumer/internal/reader/reader_test.go +++ b/pkg/stanza/fileconsumer/internal/reader/reader_test.go @@ -11,6 +11,7 @@ import ( "github.com/stretchr/testify/require" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/fileconsumer/internal/filetest" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/fileconsumer/internal/fingerprint" ) func TestFileReader_FingerprintUpdated(t *testing.T) { @@ -31,7 +32,7 @@ func TestFileReader_FingerprintUpdated(t *testing.T) { filetest.WriteString(t, temp, "testlog1\n") reader.ReadToEnd(context.Background()) sink.ExpectToken(t, []byte("testlog1")) - require.Equal(t, []byte("testlog1\n"), reader.Fingerprint.FirstBytes) + require.Equal(t, fingerprint.New([]byte("testlog1\n")), reader.Fingerprint) } // Test that a fingerprint: @@ -60,10 +61,10 @@ func TestFingerprintGrowsAndStops(t *testing.T) { temp := filetest.OpenTemp(t, tempDir) tempCopy := filetest.OpenFile(t, temp.Name()) - f, _ := testFactory(t, withSinkBufferSize(3*fpSize/lineLen), withFingerprintSize(fpSize)) + f, _ := testFactory(t, withSinkChanSize(3*fpSize/lineLen), withFingerprintSize(fpSize)) fp, err := f.NewFingerprint(temp) require.NoError(t, err) - require.Equal(t, []byte(""), fp.FirstBytes) + require.Equal(t, fingerprint.New([]byte("")), fp) reader, err := f.NewReader(tempCopy, fp) require.NoError(t, err) @@ -87,7 +88,7 @@ func TestFingerprintGrowsAndStops(t *testing.T) { filetest.WriteString(t, temp, line) reader.ReadToEnd(context.Background()) - require.Equal(t, fileContent[:expectedFP], reader.Fingerprint.FirstBytes) + require.Equal(t, fingerprint.New(fileContent[:expectedFP]), reader.Fingerprint) } }) } @@ -110,21 +111,21 @@ func TestFingerprintChangeSize(t *testing.T) { // Use prime numbers to ensure variation in // whether or not they are factors of fpSize - lineLens := []int{3, 5, 7, 11, 13, 17, 19, 23, 27} + lineLens := []int{3, 4, 5, 6, 7, 8, 11, 12, 13, 17, 19, 23, 27, 36} for _, lineLen := range lineLens { lineLen := lineLen t.Run(fmt.Sprintf("%d", lineLen), func(t *testing.T) { t.Parallel() - f, _ := testFactory(t, withSinkBufferSize(3*fpSize/lineLen), withFingerprintSize(fpSize)) + f, _ := testFactory(t, withSinkChanSize(3*fpSize/lineLen), withFingerprintSize(fpSize)) tempDir := t.TempDir() temp := filetest.OpenTemp(t, tempDir) fp, err := f.NewFingerprint(temp) require.NoError(t, err) - require.Equal(t, []byte(""), fp.FirstBytes) + require.Equal(t, fingerprint.New([]byte("")), fp) reader, err := f.NewReader(filetest.OpenFile(t, temp.Name()), fp) require.NoError(t, err) @@ -147,11 +148,12 @@ func TestFingerprintChangeSize(t *testing.T) { filetest.WriteString(t, temp, line) reader.ReadToEnd(context.Background()) - require.Equal(t, fileContent[:expectedFP], reader.Fingerprint.FirstBytes) + require.Equal(t, fingerprint.New(fileContent[:expectedFP]), reader.Fingerprint) } // Recreate the factory with a larger fingerprint size - f, _ = testFactory(t, withSinkBufferSize(3*fpSize/lineLen), withFingerprintSize(fpSize*lineLen/3)) + fpSizeUp := fpSize * 2 + f, _ = testFactory(t, withSinkChanSize(3*fpSize/lineLen), withFingerprintSize(fpSizeUp)) // Recreate the reader with the new factory reader, err = f.NewReaderFromMetadata(filetest.OpenFile(t, temp.Name()), reader.Close()) @@ -162,10 +164,11 @@ func TestFingerprintChangeSize(t *testing.T) { filetest.WriteString(t, temp, line) reader.ReadToEnd(context.Background()) - require.Equal(t, fileContent[:expectedFP], reader.Fingerprint.FirstBytes) + require.Equal(t, fingerprint.New(fileContent[:fpSizeUp]), reader.Fingerprint) // Recreate the factory with a smaller fingerprint size - f, _ = testFactory(t, withSinkBufferSize(3*fpSize/lineLen), withFingerprintSize(fpSize/2)) + fpSizeDown := fpSize / 2 + f, _ = testFactory(t, withSinkChanSize(3*fpSize/lineLen), withFingerprintSize(fpSizeDown)) // Recreate the reader with the new factory reader, err = f.NewReaderFromMetadata(filetest.OpenFile(t, temp.Name()), reader.Close()) @@ -176,7 +179,7 @@ func TestFingerprintChangeSize(t *testing.T) { filetest.WriteString(t, temp, line) reader.ReadToEnd(context.Background()) - require.Equal(t, fileContent[:expectedFP], reader.Fingerprint.FirstBytes) + require.Equal(t, fingerprint.New(fileContent[:fpSizeDown]), reader.Fingerprint) }) } } diff --git a/pkg/stanza/fileconsumer/internal/reader/split_test.go b/pkg/stanza/fileconsumer/internal/reader/split_test.go index 194009897a8c..7f9d02b78942 100644 --- a/pkg/stanza/fileconsumer/internal/reader/split_test.go +++ b/pkg/stanza/fileconsumer/internal/reader/split_test.go @@ -13,6 +13,7 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/decode" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/fileconsumer/internal/filetest" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/fileconsumer/internal/fingerprint" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/fileconsumer/internal/header" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/parser/regex" @@ -215,5 +216,5 @@ func TestHeaderFingerprintIncluded(t *testing.T) { r.ReadToEnd(context.Background()) - require.Equal(t, []byte("#header-line\naaa\n"), r.Fingerprint.FirstBytes) + require.Equal(t, fingerprint.New([]byte("#header-line\naaa\n")), r.Fingerprint) } diff --git a/pkg/stanza/fileconsumer/rotation_test.go b/pkg/stanza/fileconsumer/rotation_test.go index c302f8e27617..008bb01bb71f 100644 --- a/pkg/stanza/fileconsumer/rotation_test.go +++ b/pkg/stanza/fileconsumer/rotation_test.go @@ -64,7 +64,7 @@ func TestCopyTruncate(t *testing.T) { for rotationNum := 0; rotationNum < numRotations; rotationNum++ { for messageNum := 0; messageNum < numMessages; messageNum++ { filetest.WriteString(t, file, getMessage(fn, rotationNum, messageNum)+"\n") - time.Sleep(5 * time.Millisecond) + time.Sleep(10 * time.Millisecond) } require.NoError(t, file.Sync()) _, err := file.Seek(0, 0) diff --git a/pkg/stanza/go.mod b/pkg/stanza/go.mod index 9cc21fd17c43..fe1dc22036b2 100644 --- a/pkg/stanza/go.mod +++ b/pkg/stanza/go.mod @@ -24,7 +24,7 @@ require ( go.opentelemetry.io/collector/receiver v0.95.0 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 golang.org/x/sys v0.17.0 golang.org/x/text v0.14.0 diff --git a/pkg/stanza/go.sum b/pkg/stanza/go.sum index 645f450f2225..7d99bb5f2b0f 100644 --- a/pkg/stanza/go.sum +++ b/pkg/stanza/go.sum @@ -131,8 +131,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/pkg/stanza/operator/config.go b/pkg/stanza/operator/config.go index 49fc40271a49..f9934c6a06ff 100644 --- a/pkg/stanza/operator/config.go +++ b/pkg/stanza/operator/config.go @@ -107,7 +107,7 @@ func (c *Config) Unmarshal(component *confmap.Conf) error { } builder := builderFunc() - if err := component.Unmarshal(builder); err != nil { + if err := component.Unmarshal(builder, confmap.WithIgnoreUnused()); err != nil { return fmt.Errorf("unmarshal to %s: %w", typeString, err) } diff --git a/pkg/stanza/operator/helper/time.go b/pkg/stanza/operator/helper/time.go index b6a0bc787b48..f9326c73dd18 100644 --- a/pkg/stanza/operator/helper/time.go +++ b/pkg/stanza/operator/helper/time.go @@ -48,7 +48,7 @@ type TimeParser struct { // Unmarshal starting from default settings func (t *TimeParser) Unmarshal(component *confmap.Conf) error { cfg := NewTimeParser() - err := component.Unmarshal(&cfg) + err := component.Unmarshal(&cfg, confmap.WithIgnoreUnused()) if err != nil { return err } diff --git a/pkg/stanza/operator/parser/scope/config_test.go b/pkg/stanza/operator/parser/scope/config_test.go index e7509787aedb..a3bcb83cd2cc 100644 --- a/pkg/stanza/operator/parser/scope/config_test.go +++ b/pkg/stanza/operator/parser/scope/config_test.go @@ -35,10 +35,6 @@ func TestConfig(t *testing.T) { return cfg }(), }, - { - Name: "no_nested", - ExpectErr: true, - }, }, }.Run(t) } diff --git a/pkg/stanza/operator/parser/severity/config_test.go b/pkg/stanza/operator/parser/severity/config_test.go index 905092a41738..18fa853a485d 100644 --- a/pkg/stanza/operator/parser/severity/config_test.go +++ b/pkg/stanza/operator/parser/severity/config_test.go @@ -46,10 +46,6 @@ func TestUnmarshal(t *testing.T) { return cfg }(), }, - { - Name: "no_nested", - ExpectErr: true, - }, }, }.Run(t) } diff --git a/pkg/stanza/operator/parser/time/config_test.go b/pkg/stanza/operator/parser/time/config_test.go index 1b1b5ec7e2b5..c40c2596f319 100644 --- a/pkg/stanza/operator/parser/time/config_test.go +++ b/pkg/stanza/operator/parser/time/config_test.go @@ -49,10 +49,6 @@ func TestUnmarshal(t *testing.T) { return cfg }(), }, - { - Name: "no_nested", - ExpectErr: true, - }, }, }.Run(t) } diff --git a/pkg/stanza/trim/trim.go b/pkg/stanza/trim/trim.go index 1906aed08b3f..3cf5d4f5c2ce 100644 --- a/pkg/stanza/trim/trim.go +++ b/pkg/stanza/trim/trim.go @@ -16,6 +16,9 @@ func WithFunc(splitFunc bufio.SplitFunc, trimFunc Func) bufio.SplitFunc { } return func(data []byte, atEOF bool) (advance int, token []byte, err error) { advance, token, err = splitFunc(data, atEOF) + if advance == 0 && token == nil && err == nil { + return 0, nil, nil + } return advance, trimFunc(token), err } } diff --git a/pkg/translator/azure/go.mod b/pkg/translator/azure/go.mod index c0f2a07f26d4..39683943a3cc 100644 --- a/pkg/translator/azure/go.mod +++ b/pkg/translator/azure/go.mod @@ -11,7 +11,7 @@ require ( go.opentelemetry.io/collector/pdata v1.2.0 go.opentelemetry.io/collector/semconv v0.95.0 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc ) diff --git a/pkg/translator/azure/go.sum b/pkg/translator/azure/go.sum index cdbbfc072468..3cb7be09c967 100644 --- a/pkg/translator/azure/go.sum +++ b/pkg/translator/azure/go.sum @@ -75,8 +75,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/pkg/translator/jaeger/go.mod b/pkg/translator/jaeger/go.mod index 35687a793c85..5693543ab46d 100644 --- a/pkg/translator/jaeger/go.mod +++ b/pkg/translator/jaeger/go.mod @@ -23,7 +23,7 @@ require ( go.opentelemetry.io/otel v1.23.1 // indirect go.opentelemetry.io/otel/trace v1.23.1 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.26.0 // indirect + go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.20.0 // indirect golang.org/x/sys v0.16.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/pkg/translator/jaeger/go.sum b/pkg/translator/jaeger/go.sum index 9d75b9715b66..8113df85db90 100644 --- a/pkg/translator/jaeger/go.sum +++ b/pkg/translator/jaeger/go.sum @@ -51,8 +51,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/pkg/translator/zipkin/go.mod b/pkg/translator/zipkin/go.mod index 68b994ef5623..f8b6b8f6e614 100644 --- a/pkg/translator/zipkin/go.mod +++ b/pkg/translator/zipkin/go.mod @@ -24,7 +24,7 @@ require ( go.opentelemetry.io/otel v1.23.1 // indirect go.opentelemetry.io/otel/trace v1.23.1 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.26.0 // indirect + go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.20.0 // indirect golang.org/x/sys v0.16.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/pkg/translator/zipkin/go.sum b/pkg/translator/zipkin/go.sum index b735ceb4b028..b653e889bf95 100644 --- a/pkg/translator/zipkin/go.sum +++ b/pkg/translator/zipkin/go.sum @@ -53,8 +53,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/processor/attributesprocessor/generated_component_test.go b/processor/attributesprocessor/generated_component_test.go index 62a5682fe600..1bc1c863c777 100644 --- a/processor/attributesprocessor/generated_component_test.go +++ b/processor/attributesprocessor/generated_component_test.go @@ -5,28 +5,21 @@ package attributesprocessor import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" + "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.opentelemetry.io/collector/processor" "go.opentelemetry.io/collector/processor/processortest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -71,9 +64,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -82,19 +73,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case processor.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case processor.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case processor.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -107,3 +98,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/processor/attributesprocessor/go.mod b/processor/attributesprocessor/go.mod index 3251bab1a15f..eee56354beda 100644 --- a/processor/attributesprocessor/go.mod +++ b/processor/attributesprocessor/go.mod @@ -17,7 +17,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/processor/attributesprocessor/go.sum b/processor/attributesprocessor/go.sum index 121d5d8069ff..f182e03d9fd7 100644 --- a/processor/attributesprocessor/go.sum +++ b/processor/attributesprocessor/go.sum @@ -118,8 +118,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/processor/cumulativetodeltaprocessor/generated_component_test.go b/processor/cumulativetodeltaprocessor/generated_component_test.go index 2aa48fe2cd24..b96b0fb5bc2c 100644 --- a/processor/cumulativetodeltaprocessor/generated_component_test.go +++ b/processor/cumulativetodeltaprocessor/generated_component_test.go @@ -5,28 +5,21 @@ package cumulativetodeltaprocessor import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" + "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.opentelemetry.io/collector/processor" "go.opentelemetry.io/collector/processor/processortest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -57,9 +50,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -68,19 +59,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case processor.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case processor.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case processor.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -93,3 +84,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/processor/cumulativetodeltaprocessor/go.mod b/processor/cumulativetodeltaprocessor/go.mod index 90def5ebbfb2..4fb85a0d092b 100644 --- a/processor/cumulativetodeltaprocessor/go.mod +++ b/processor/cumulativetodeltaprocessor/go.mod @@ -3,7 +3,6 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/processor/cumul go 1.21 require ( - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.95.0 github.com/stretchr/testify v1.8.4 @@ -15,7 +14,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/processor/cumulativetodeltaprocessor/go.sum b/processor/cumulativetodeltaprocessor/go.sum index d08cb16b43f0..a17e5b65a807 100644 --- a/processor/cumulativetodeltaprocessor/go.sum +++ b/processor/cumulativetodeltaprocessor/go.sum @@ -96,8 +96,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/processor/spanmetricsprocessor/generated_component_test.go b/processor/deltatocumulativeprocessor/generated_component_test.go similarity index 56% rename from processor/spanmetricsprocessor/generated_component_test.go rename to processor/deltatocumulativeprocessor/generated_component_test.go index 23fd0f258a2b..a71882b6d0ca 100644 --- a/processor/spanmetricsprocessor/generated_component_test.go +++ b/processor/deltatocumulativeprocessor/generated_component_test.go @@ -1,32 +1,25 @@ // Code generated by mdatagen. DO NOT EDIT. -package spanmetricsprocessor +package deltatocumulativeprocessor import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" + "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.opentelemetry.io/collector/processor" "go.opentelemetry.io/collector/processor/processortest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -36,9 +29,9 @@ func TestComponentLifecycle(t *testing.T) { }{ { - name: "traces", + name: "metrics", createFn: func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) { - return factory.CreateTracesProcessor(ctx, set, cfg, consumertest.NewNop()) + return factory.CreateMetricsProcessor(ctx, set, cfg, consumertest.NewNop()) }, }, } @@ -57,12 +50,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -71,19 +59,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case processor.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case processor.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case processor.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -96,3 +84,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/processor/deltatocumulativeprocessor/go.mod b/processor/deltatocumulativeprocessor/go.mod index 5c20c3a2e315..47927686a18f 100644 --- a/processor/deltatocumulativeprocessor/go.mod +++ b/processor/deltatocumulativeprocessor/go.mod @@ -6,17 +6,21 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.95.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.95.0 + go.opentelemetry.io/collector/confmap v0.95.0 go.opentelemetry.io/collector/consumer v0.95.0 go.opentelemetry.io/collector/pdata v1.2.0 go.opentelemetry.io/collector/processor v0.95.0 go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( + github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect + github.com/go-logr/logr v1.4.1 // indirect + github.com/go-logr/stdr v1.2.2 // indirect github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.3 // indirect @@ -30,9 +34,16 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/prometheus/client_golang v1.18.0 // indirect + github.com/prometheus/client_model v0.5.0 // indirect + github.com/prometheus/common v0.46.0 // indirect + github.com/prometheus/procfs v0.12.0 // indirect + go.opentelemetry.io/collector v0.95.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.95.0 // indirect - go.opentelemetry.io/collector/confmap v0.95.0 // indirect go.opentelemetry.io/otel v1.23.1 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.45.2 // indirect + go.opentelemetry.io/otel/sdk v1.23.1 // indirect + go.opentelemetry.io/otel/sdk/metric v1.23.1 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.20.0 // indirect golang.org/x/sys v0.16.0 // indirect diff --git a/processor/deltatocumulativeprocessor/go.sum b/processor/deltatocumulativeprocessor/go.sum index b3a5acc7b942..8a803a1bf18b 100644 --- a/processor/deltatocumulativeprocessor/go.sum +++ b/processor/deltatocumulativeprocessor/go.sum @@ -5,6 +5,7 @@ github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL 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/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= @@ -63,6 +64,8 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= 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 v0.95.0 h1:DFW0BkF2sOocpA3NUPrbMeuPSN3PWxFBrLqs/Cxn3vo= +go.opentelemetry.io/collector v0.95.0/go.mod h1:Lc+VkOkSBppKqR/cAevS5oPrbtUO3JUbYzo91niRkG0= go.opentelemetry.io/collector/component v0.95.0 h1:68tI7KVy1bfpaR83+LxUvjd9/hjDh78utklGl2t6eVM= go.opentelemetry.io/collector/component v0.95.0/go.mod h1:SMt7r9zm0OOEKJF/ZUy8agD92OAXq2Xhq1FaTcfIWHw= go.opentelemetry.io/collector/config/configtelemetry v0.95.0 h1:HabJZqbOAbNQ52L3v6usXoGXg1UKA1Ofs4Ytp5sGXEo= @@ -91,8 +94,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/processor/deltatocumulativeprocessor/internal/delta/delta.go b/processor/deltatocumulativeprocessor/internal/delta/delta.go index 8246bf8e09d1..fda1e8149a84 100644 --- a/processor/deltatocumulativeprocessor/internal/delta/delta.go +++ b/processor/deltatocumulativeprocessor/internal/delta/delta.go @@ -34,29 +34,21 @@ type Accumulator[D data.Point[D]] struct { // Aggregate implements delta-to-cumulative aggregation as per spec: // https://opentelemetry.io/docs/specs/otel/metrics/data-model/#sums-delta-to-cumulative func (a *Accumulator[D]) Aggregate(id streams.Ident, dp D) (D, error) { - // make the accumulator to start with the current sample, discarding any - // earlier data. return after use - reset := func() (D, error) { - a.dps[id] = dp.Clone() - return a.dps[id], nil - } - aggr, ok := a.dps[id] - // new series: reset + // new series: initialize with current sample if !ok { - return reset() + a.dps[id] = dp.Clone() + return a.dps[id], nil } - // belongs to older series: drop - if dp.StartTimestamp() < aggr.StartTimestamp() { + + // drop bad samples + switch { + case dp.StartTimestamp() < aggr.StartTimestamp(): + // belongs to older series return aggr, ErrOlderStart{Start: aggr.StartTimestamp(), Sample: dp.StartTimestamp()} - } - // belongs to later series: reset - if dp.StartTimestamp() > aggr.StartTimestamp() { - return reset() - } - // out of order: drop - if dp.Timestamp() <= aggr.Timestamp() { + case dp.Timestamp() <= aggr.Timestamp(): + // out of order return aggr, ErrOutOfOrder{Last: aggr.Timestamp(), Sample: dp.Timestamp()} } diff --git a/processor/deltatocumulativeprocessor/internal/delta/delta_test.go b/processor/deltatocumulativeprocessor/internal/delta/delta_test.go index ae863697339f..f298d174977c 100644 --- a/processor/deltatocumulativeprocessor/internal/delta/delta_test.go +++ b/processor/deltatocumulativeprocessor/internal/delta/delta_test.go @@ -105,30 +105,45 @@ func TestAddition(t *testing.T) { // verify that start + last times are updated func TestTimes(t *testing.T) { acc := delta.Numbers() - id, data := random.Sum().Stream() - - start := pcommon.Timestamp(1234) - ts1, ts2 := pcommon.Timestamp(1234), pcommon.Timestamp(1235) - - // first sample: take timestamps of point - first := data.Clone() - first.SetStartTimestamp(start) - first.SetTimestamp(ts1) - - r1, err := acc.Aggregate(id, first) - require.NoError(t, err) - require.Equal(t, start, r1.StartTimestamp()) - require.Equal(t, ts1, r1.Timestamp()) - - // second sample: take last of point, keep start - second := data.Clone() - second.SetStartTimestamp(start) - second.SetTimestamp(ts2) - - r2, err := acc.Aggregate(id, second) - require.NoError(t, err) - require.Equal(t, start, r2.StartTimestamp()) - require.Equal(t, ts2, r2.Timestamp()) + id, base := random.Sum().Stream() + point := func(start, last pcommon.Timestamp) data.Number { + dp := base.Clone() + dp.SetStartTimestamp(start) + dp.SetTimestamp(last) + return dp + } + + // first sample: its the first ever, so take it as-is + { + dp := point(1000, 1000) + res, err := acc.Aggregate(id, dp) + + require.NoError(t, err) + require.Equal(t, time(1000), res.StartTimestamp()) + require.Equal(t, time(1000), res.Timestamp()) + } + + // second sample: its subsequent, so keep original startTime, but update lastSeen + { + dp := point(1000, 1100) + res, err := acc.Aggregate(id, dp) + + require.NoError(t, err) + require.Equal(t, time(1000), res.StartTimestamp()) + require.Equal(t, time(1100), res.Timestamp()) + } + + // third sample: its subsequent, but has a more recent startTime, which is + // PERMITTED by the spec. + // still keep original startTime, but update lastSeen. + { + dp := point(1100, 1200) + res, err := acc.Aggregate(id, dp) + + require.NoError(t, err) + require.Equal(t, time(1000), res.StartTimestamp()) + require.Equal(t, time(1200), res.Timestamp()) + } } func TestErrs(t *testing.T) { diff --git a/processor/deltatorateprocessor/generated_component_test.go b/processor/deltatorateprocessor/generated_component_test.go index 77033d728b4c..7ff3da5a92e9 100644 --- a/processor/deltatorateprocessor/generated_component_test.go +++ b/processor/deltatorateprocessor/generated_component_test.go @@ -5,28 +5,21 @@ package deltatorateprocessor import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" + "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.opentelemetry.io/collector/processor" "go.opentelemetry.io/collector/processor/processortest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -57,9 +50,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -68,19 +59,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case processor.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case processor.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case processor.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -93,3 +84,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/processor/deltatorateprocessor/go.mod b/processor/deltatorateprocessor/go.mod index 0c4b10c5c49e..d1e0fcf26e29 100644 --- a/processor/deltatorateprocessor/go.mod +++ b/processor/deltatorateprocessor/go.mod @@ -3,7 +3,6 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/processor/delta go 1.21 require ( - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.95.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.95.0 go.opentelemetry.io/collector/confmap v0.95.0 @@ -13,7 +12,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( @@ -60,11 +59,3 @@ retract ( v0.76.1 v0.65.0 ) - -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal => ../../internal/coreinternal - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil => ../../pkg/pdatautil - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden diff --git a/processor/deltatorateprocessor/go.sum b/processor/deltatorateprocessor/go.sum index 12b9ef2feb67..8a803a1bf18b 100644 --- a/processor/deltatorateprocessor/go.sum +++ b/processor/deltatorateprocessor/go.sum @@ -94,8 +94,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/processor/filterprocessor/generated_component_test.go b/processor/filterprocessor/generated_component_test.go index e543e7fe9864..3ac5aab6b0cb 100644 --- a/processor/filterprocessor/generated_component_test.go +++ b/processor/filterprocessor/generated_component_test.go @@ -5,28 +5,21 @@ package filterprocessor import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" + "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.opentelemetry.io/collector/processor" "go.opentelemetry.io/collector/processor/processortest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -71,9 +64,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -82,19 +73,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case processor.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case processor.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case processor.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -107,3 +98,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/processor/filterprocessor/go.mod b/processor/filterprocessor/go.mod index 05e9b48950aa..7799ee732e4f 100644 --- a/processor/filterprocessor/go.mod +++ b/processor/filterprocessor/go.mod @@ -18,7 +18,7 @@ require ( go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/processor/filterprocessor/go.sum b/processor/filterprocessor/go.sum index 121d5d8069ff..f182e03d9fd7 100644 --- a/processor/filterprocessor/go.sum +++ b/processor/filterprocessor/go.sum @@ -118,8 +118,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/processor/groupbyattrsprocessor/generated_component_test.go b/processor/groupbyattrsprocessor/generated_component_test.go index 1bc6a07df1a7..075254f73c76 100644 --- a/processor/groupbyattrsprocessor/generated_component_test.go +++ b/processor/groupbyattrsprocessor/generated_component_test.go @@ -5,28 +5,21 @@ package groupbyattrsprocessor import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" + "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.opentelemetry.io/collector/processor" "go.opentelemetry.io/collector/processor/processortest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -71,9 +64,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -82,19 +73,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case processor.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case processor.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case processor.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -107,3 +98,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/processor/groupbyattrsprocessor/go.mod b/processor/groupbyattrsprocessor/go.mod index 83c6d018a76a..5b15bde47c2f 100644 --- a/processor/groupbyattrsprocessor/go.mod +++ b/processor/groupbyattrsprocessor/go.mod @@ -3,7 +3,6 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/processor/group go 1.21 require ( - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.95.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.95.0 @@ -16,7 +15,7 @@ require ( go.opentelemetry.io/otel/sdk/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( @@ -63,9 +62,3 @@ retract ( v0.76.1 v0.65.0 ) - -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal => ../../internal/coreinternal - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden diff --git a/processor/groupbyattrsprocessor/go.sum b/processor/groupbyattrsprocessor/go.sum index 12b9ef2feb67..8a803a1bf18b 100644 --- a/processor/groupbyattrsprocessor/go.sum +++ b/processor/groupbyattrsprocessor/go.sum @@ -94,8 +94,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/processor/groupbytraceprocessor/generated_component_test.go b/processor/groupbytraceprocessor/generated_component_test.go index ce92838a2c07..a0503864b72d 100644 --- a/processor/groupbytraceprocessor/generated_component_test.go +++ b/processor/groupbytraceprocessor/generated_component_test.go @@ -5,28 +5,21 @@ package groupbytraceprocessor import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" + "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.opentelemetry.io/collector/processor" "go.opentelemetry.io/collector/processor/processortest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -57,9 +50,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -68,19 +59,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case processor.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case processor.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case processor.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -93,3 +84,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/processor/groupbytraceprocessor/go.mod b/processor/groupbytraceprocessor/go.mod index fa4ac1a70455..a6c80e31d6a1 100644 --- a/processor/groupbytraceprocessor/go.mod +++ b/processor/groupbytraceprocessor/go.mod @@ -3,7 +3,6 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/processor/group go 1.21 require ( - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchpersignal v0.95.0 github.com/stretchr/testify v1.8.4 go.opencensus.io v0.24.0 @@ -15,7 +14,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( @@ -63,11 +62,3 @@ retract ( v0.76.1 v0.65.0 ) - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil => ../../pkg/pdatautil - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden - -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal => ../../internal/coreinternal diff --git a/processor/groupbytraceprocessor/go.sum b/processor/groupbytraceprocessor/go.sum index 1d82e33ff5a0..f9512d6b74fb 100644 --- a/processor/groupbytraceprocessor/go.sum +++ b/processor/groupbytraceprocessor/go.sum @@ -131,8 +131,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/processor/intervalprocessor/generated_component_test.go b/processor/intervalprocessor/generated_component_test.go index 55e89c63bcaa..1bef7864d369 100644 --- a/processor/intervalprocessor/generated_component_test.go +++ b/processor/intervalprocessor/generated_component_test.go @@ -5,28 +5,21 @@ package intervalprocessor import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" + "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.opentelemetry.io/collector/processor" "go.opentelemetry.io/collector/processor/processortest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -57,9 +50,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -68,19 +59,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case processor.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case processor.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case processor.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -93,3 +84,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/processor/intervalprocessor/go.mod b/processor/intervalprocessor/go.mod index 533717deb457..54210d1d6a5b 100644 --- a/processor/intervalprocessor/go.mod +++ b/processor/intervalprocessor/go.mod @@ -3,7 +3,6 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/processor/inter go 1.21 require ( - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.95.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.95.0 go.opentelemetry.io/collector/confmap v0.95.0 @@ -12,7 +11,7 @@ require ( go.opentelemetry.io/collector/processor v0.95.0 go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( @@ -53,11 +52,3 @@ require ( google.golang.org/protobuf v1.32.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) - -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal => ../../internal/coreinternal - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil => ../../pkg/pdatautil - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden diff --git a/processor/intervalprocessor/go.sum b/processor/intervalprocessor/go.sum index 12b9ef2feb67..8a803a1bf18b 100644 --- a/processor/intervalprocessor/go.sum +++ b/processor/intervalprocessor/go.sum @@ -94,8 +94,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/processor/k8sattributesprocessor/generated_component_test.go b/processor/k8sattributesprocessor/generated_component_test.go index f0a0c25e19a8..90bb8bf0b771 100644 --- a/processor/k8sattributesprocessor/generated_component_test.go +++ b/processor/k8sattributesprocessor/generated_component_test.go @@ -5,28 +5,21 @@ package k8sattributesprocessor import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" + "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.opentelemetry.io/collector/processor" "go.opentelemetry.io/collector/processor/processortest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -71,9 +64,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -82,19 +73,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case processor.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case processor.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case processor.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -107,3 +98,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/processor/k8sattributesprocessor/go.mod b/processor/k8sattributesprocessor/go.mod index 3dddd119fec0..4c2bae587d04 100644 --- a/processor/k8sattributesprocessor/go.mod +++ b/processor/k8sattributesprocessor/go.mod @@ -5,7 +5,6 @@ go 1.21 require ( github.com/google/go-cmp v0.6.0 github.com/google/uuid v1.6.0 - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8stest v0.95.0 github.com/stretchr/testify v1.8.4 @@ -24,7 +23,7 @@ require ( go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 k8s.io/api v0.29.2 k8s.io/apimachinery v0.29.2 k8s.io/client-go v0.29.2 @@ -83,6 +82,7 @@ require ( github.com/prometheus/common v0.46.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rs/cors v1.10.1 // indirect + github.com/sirupsen/logrus v1.9.3 // indirect github.com/spf13/pflag v1.0.5 // indirect go.opentelemetry.io/collector/config/configauth v0.95.0 // indirect go.opentelemetry.io/collector/config/configcompression v0.95.0 // indirect @@ -139,11 +139,3 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8ste // ambiguous import: found package cloud.google.com/go/compute/metadata in multiple modules replace cloud.google.com/go v0.54.0 => cloud.google.com/go v0.110.10 - -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal => ../../internal/coreinternal - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil => ../../pkg/pdatautil - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden diff --git a/processor/k8sattributesprocessor/go.sum b/processor/k8sattributesprocessor/go.sum index 42e8ab52ca33..850f57c446d7 100644 --- a/processor/k8sattributesprocessor/go.sum +++ b/processor/k8sattributesprocessor/go.sum @@ -1315,8 +1315,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -1588,6 +1588,7 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/processor/logstransformprocessor/generated_component_test.go b/processor/logstransformprocessor/generated_component_test.go index 1d501d91b8b0..af4b38e3f40e 100644 --- a/processor/logstransformprocessor/generated_component_test.go +++ b/processor/logstransformprocessor/generated_component_test.go @@ -5,28 +5,21 @@ package logstransformprocessor import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" + "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.opentelemetry.io/collector/processor" "go.opentelemetry.io/collector/processor/processortest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -57,9 +50,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -68,19 +59,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case processor.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case processor.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case processor.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -93,3 +84,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/processor/logstransformprocessor/go.mod b/processor/logstransformprocessor/go.mod index cb2cbdc3fbd0..50bb76110807 100644 --- a/processor/logstransformprocessor/go.mod +++ b/processor/logstransformprocessor/go.mod @@ -16,7 +16,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/processor/logstransformprocessor/go.sum b/processor/logstransformprocessor/go.sum index fa83353e91ab..2f69554e1f30 100644 --- a/processor/logstransformprocessor/go.sum +++ b/processor/logstransformprocessor/go.sum @@ -120,8 +120,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/processor/metricsgenerationprocessor/generated_component_test.go b/processor/metricsgenerationprocessor/generated_component_test.go index 8a181b4e6698..bfea4e7ea1e5 100644 --- a/processor/metricsgenerationprocessor/generated_component_test.go +++ b/processor/metricsgenerationprocessor/generated_component_test.go @@ -5,28 +5,21 @@ package metricsgenerationprocessor import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" + "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.opentelemetry.io/collector/processor" "go.opentelemetry.io/collector/processor/processortest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -57,9 +50,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -68,19 +59,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case processor.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case processor.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case processor.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -93,3 +84,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/processor/metricsgenerationprocessor/go.mod b/processor/metricsgenerationprocessor/go.mod index 9e98e4ddfc43..85ab9614c213 100644 --- a/processor/metricsgenerationprocessor/go.mod +++ b/processor/metricsgenerationprocessor/go.mod @@ -3,7 +3,6 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/processor/metri go 1.21 require ( - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.95.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.95.0 go.opentelemetry.io/collector/confmap v0.95.0 @@ -13,7 +12,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( @@ -60,11 +59,3 @@ retract ( v0.76.1 v0.65.0 ) - -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal => ../../internal/coreinternal - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil => ../../pkg/pdatautil - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden diff --git a/processor/metricsgenerationprocessor/go.sum b/processor/metricsgenerationprocessor/go.sum index 12b9ef2feb67..8a803a1bf18b 100644 --- a/processor/metricsgenerationprocessor/go.sum +++ b/processor/metricsgenerationprocessor/go.sum @@ -94,8 +94,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/processor/metricstransformprocessor/generated_component_test.go b/processor/metricstransformprocessor/generated_component_test.go index 94671ff4cadb..71fabc61ad2d 100644 --- a/processor/metricstransformprocessor/generated_component_test.go +++ b/processor/metricstransformprocessor/generated_component_test.go @@ -5,28 +5,21 @@ package metricstransformprocessor import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" + "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.opentelemetry.io/collector/processor" "go.opentelemetry.io/collector/processor/processortest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -57,9 +50,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -68,19 +59,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case processor.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case processor.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case processor.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -93,3 +84,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/processor/metricstransformprocessor/go.mod b/processor/metricstransformprocessor/go.mod index f999755e0648..a6b31168ca6d 100644 --- a/processor/metricstransformprocessor/go.mod +++ b/processor/metricstransformprocessor/go.mod @@ -3,7 +3,6 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/processor/metri go 1.21 require ( - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.95.0 github.com/stretchr/testify v1.8.4 @@ -15,7 +14,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( @@ -69,5 +68,3 @@ retract ( ) replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden - -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal => ../../internal/coreinternal diff --git a/processor/metricstransformprocessor/go.sum b/processor/metricstransformprocessor/go.sum index 12b9ef2feb67..8a803a1bf18b 100644 --- a/processor/metricstransformprocessor/go.sum +++ b/processor/metricstransformprocessor/go.sum @@ -94,8 +94,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/processor/probabilisticsamplerprocessor/generated_component_test.go b/processor/probabilisticsamplerprocessor/generated_component_test.go index 95cd7b34399e..fe172fcee1c5 100644 --- a/processor/probabilisticsamplerprocessor/generated_component_test.go +++ b/processor/probabilisticsamplerprocessor/generated_component_test.go @@ -5,28 +5,21 @@ package probabilisticsamplerprocessor import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" + "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.opentelemetry.io/collector/processor" "go.opentelemetry.io/collector/processor/processortest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -64,9 +57,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -75,19 +66,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case processor.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case processor.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case processor.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -100,3 +91,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/processor/probabilisticsamplerprocessor/go.mod b/processor/probabilisticsamplerprocessor/go.mod index d2555d093aba..86ca96691aea 100644 --- a/processor/probabilisticsamplerprocessor/go.mod +++ b/processor/probabilisticsamplerprocessor/go.mod @@ -17,7 +17,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/processor/probabilisticsamplerprocessor/go.sum b/processor/probabilisticsamplerprocessor/go.sum index 59966ff2ed33..20f6ab6c9295 100644 --- a/processor/probabilisticsamplerprocessor/go.sum +++ b/processor/probabilisticsamplerprocessor/go.sum @@ -226,8 +226,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/processor/redactionprocessor/generated_component_test.go b/processor/redactionprocessor/generated_component_test.go index cdbdd0240117..11fd2369352c 100644 --- a/processor/redactionprocessor/generated_component_test.go +++ b/processor/redactionprocessor/generated_component_test.go @@ -5,28 +5,21 @@ package redactionprocessor import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" + "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.opentelemetry.io/collector/processor" "go.opentelemetry.io/collector/processor/processortest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -57,9 +50,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -68,19 +59,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case processor.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case processor.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case processor.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -93,3 +84,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/processor/redactionprocessor/go.mod b/processor/redactionprocessor/go.mod index a85cf5dd8f90..b6b085a5efd6 100644 --- a/processor/redactionprocessor/go.mod +++ b/processor/redactionprocessor/go.mod @@ -3,7 +3,6 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/processor/redac go 1.21 require ( - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.95.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.95.0 go.opentelemetry.io/collector/confmap v0.95.0 @@ -13,7 +12,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( @@ -60,11 +59,3 @@ retract ( v0.76.1 v0.65.0 ) - -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal => ../../internal/coreinternal - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil => ../../pkg/pdatautil - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden diff --git a/processor/redactionprocessor/go.sum b/processor/redactionprocessor/go.sum index 12b9ef2feb67..8a803a1bf18b 100644 --- a/processor/redactionprocessor/go.sum +++ b/processor/redactionprocessor/go.sum @@ -94,8 +94,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/processor/remotetapprocessor/generated_component_test.go b/processor/remotetapprocessor/generated_component_test.go index ba943ba66e8d..bc3c329746b7 100644 --- a/processor/remotetapprocessor/generated_component_test.go +++ b/processor/remotetapprocessor/generated_component_test.go @@ -5,28 +5,21 @@ package remotetapprocessor import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" + "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.opentelemetry.io/collector/processor" "go.opentelemetry.io/collector/processor/processortest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -71,9 +64,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -82,19 +73,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case processor.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case processor.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case processor.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -107,3 +98,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/processor/remotetapprocessor/go.mod b/processor/remotetapprocessor/go.mod index 53541c355248..0a4e4c250a52 100644 --- a/processor/remotetapprocessor/go.mod +++ b/processor/remotetapprocessor/go.mod @@ -4,7 +4,6 @@ go 1.21 require ( github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.95.0 - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.95.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.95.0 @@ -15,7 +14,7 @@ require ( go.opentelemetry.io/collector/processor v0.95.0 go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 golang.org/x/net v0.21.0 golang.org/x/time v0.5.0 ) @@ -75,12 +74,4 @@ require ( replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent => ../../internal/sharedcomponent -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal => ../../internal/coreinternal - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil => ../../pkg/pdatautil - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden - replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => ../../internal/common diff --git a/processor/remotetapprocessor/go.sum b/processor/remotetapprocessor/go.sum index 28de8b6e3f1b..8d2388a1fe10 100644 --- a/processor/remotetapprocessor/go.sum +++ b/processor/remotetapprocessor/go.sum @@ -126,8 +126,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/processor/resourcedetectionprocessor/README.md b/processor/resourcedetectionprocessor/README.md index 05a75bdc8bf4..a63b7739f495 100644 --- a/processor/resourcedetectionprocessor/README.md +++ b/processor/resourcedetectionprocessor/README.md @@ -4,13 +4,14 @@ | Status | | | ------------- |-----------| | Stability | [beta]: traces, metrics, logs | -| Distributions | [contrib], [aws], [liatrio], [observiq], [redhat], [splunk], [sumo] | +| Distributions | [contrib], [aws], [grafana], [liatrio], [observiq], [redhat], [splunk], [sumo] | | Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Aprocessor%2Fresourcedetection%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Aprocessor%2Fresourcedetection) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Aprocessor%2Fresourcedetection%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Aprocessor%2Fresourcedetection) | | [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@Aneurysm9](https://www.github.com/Aneurysm9), [@dashpole](https://www.github.com/dashpole) | [beta]: https://github.com/open-telemetry/opentelemetry-collector#beta [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib [aws]: https://github.com/aws-observability/aws-otel-collector +[grafana]: https://github.com/grafana/agent [liatrio]: https://github.com/liatrio/liatrio-otel-collector [observiq]: https://github.com/observIQ/observiq-otel-collector [redhat]: https://github.com/os-observability/redhat-opentelemetry-collector diff --git a/processor/resourcedetectionprocessor/generated_component_test.go b/processor/resourcedetectionprocessor/generated_component_test.go index 0856768bb12d..197358575f43 100644 --- a/processor/resourcedetectionprocessor/generated_component_test.go +++ b/processor/resourcedetectionprocessor/generated_component_test.go @@ -5,28 +5,21 @@ package resourcedetectionprocessor import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" + "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.opentelemetry.io/collector/processor" "go.opentelemetry.io/collector/processor/processortest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -71,9 +64,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -82,19 +73,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case processor.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case processor.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case processor.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -107,3 +98,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/processor/resourcedetectionprocessor/go.mod b/processor/resourcedetectionprocessor/go.mod index cae67bb1fa77..b75dc2ee8d02 100644 --- a/processor/resourcedetectionprocessor/go.mod +++ b/processor/resourcedetectionprocessor/go.mod @@ -5,12 +5,11 @@ go 1.21 require ( cloud.google.com/go/compute/metadata v0.2.3 github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.21.0 - github.com/aws/aws-sdk-go v1.50.17 + github.com/aws/aws-sdk-go v1.50.27 github.com/google/go-cmp v0.6.0 github.com/hashicorp/consul/api v1.27.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/ecsutil v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.95.0 - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders v0.95.0 github.com/shirou/gopsutil/v3 v3.24.1 @@ -29,7 +28,7 @@ require ( go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 k8s.io/apimachinery v0.29.2 k8s.io/client-go v0.29.2 ) @@ -88,6 +87,7 @@ require ( github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect + github.com/moby/term v0.5.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect @@ -104,6 +104,7 @@ require ( github.com/prometheus/procfs v0.12.0 // indirect github.com/rs/cors v1.10.1 // indirect github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/sirupsen/logrus v1.9.3 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/stretchr/objx v0.5.0 // indirect github.com/tklauser/go-sysconf v0.3.12 // indirect @@ -160,13 +161,5 @@ retract ( replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig => ../../internal/k8sconfig -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden - -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal => ../../internal/coreinternal - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil => ../../pkg/pdatautil - // openshift removed all tags from their repo, use the pseudoversion from the release-3.9 branch HEAD replace github.com/openshift/api v3.9.0+incompatible => github.com/openshift/api v0.0.0-20180801171038-322a19404e37 diff --git a/processor/resourcedetectionprocessor/go.sum b/processor/resourcedetectionprocessor/go.sum index cc03e4e299b3..d204d44b2880 100644 --- a/processor/resourcedetectionprocessor/go.sum +++ b/processor/resourcedetectionprocessor/go.sum @@ -57,8 +57,8 @@ 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.50.17 h1:KsbzUKDgGNlkDHGvoQDhiJ63a9jtZd+O+/s3pTOr/ns= -github.com/aws/aws-sdk-go v1.50.17/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.50.27 h1:96ifhrSuja+AzdP3W/T2337igqVQ2FcSIJYkk+0rCeA= +github.com/aws/aws-sdk-go v1.50.27/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= 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 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -443,6 +443,7 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf 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.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= @@ -515,8 +516,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -655,6 +656,7 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/processor/resourcedetectionprocessor/internal/aws/ec2/metadata.yaml b/processor/resourcedetectionprocessor/internal/aws/ec2/metadata.yaml index ae31e6c3c3d6..d03e83b5a514 100644 --- a/processor/resourcedetectionprocessor/internal/aws/ec2/metadata.yaml +++ b/processor/resourcedetectionprocessor/internal/aws/ec2/metadata.yaml @@ -38,4 +38,8 @@ resource_attributes: host.type: description: The host id type: string - enabled: true \ No newline at end of file + enabled: true + +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/processor/resourcedetectionprocessor/internal/aws/ecs/metadata.yaml b/processor/resourcedetectionprocessor/internal/aws/ecs/metadata.yaml index 45f102dee7e0..69c73dc7d18f 100644 --- a/processor/resourcedetectionprocessor/internal/aws/ecs/metadata.yaml +++ b/processor/resourcedetectionprocessor/internal/aws/ecs/metadata.yaml @@ -62,4 +62,8 @@ resource_attributes: aws.log.stream.arns: description: The aws.log.stream.arns type: slice - enabled: true \ No newline at end of file + enabled: true + +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/processor/resourcedetectionprocessor/internal/aws/eks/metadata.yaml b/processor/resourcedetectionprocessor/internal/aws/eks/metadata.yaml index 9911e7164b53..168b658c9e5f 100644 --- a/processor/resourcedetectionprocessor/internal/aws/eks/metadata.yaml +++ b/processor/resourcedetectionprocessor/internal/aws/eks/metadata.yaml @@ -14,4 +14,8 @@ resource_attributes: k8s.cluster.name: description: The EKS cluster name. This attribute is currently only available when running on EC2 instances, and requires permission to run the EC2:DescribeInstances action. type: string - enabled: false \ No newline at end of file + enabled: false + +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/processor/resourcedetectionprocessor/internal/aws/elasticbeanstalk/metadata.yaml b/processor/resourcedetectionprocessor/internal/aws/elasticbeanstalk/metadata.yaml index 0414b1a65041..1c0b852403f7 100644 --- a/processor/resourcedetectionprocessor/internal/aws/elasticbeanstalk/metadata.yaml +++ b/processor/resourcedetectionprocessor/internal/aws/elasticbeanstalk/metadata.yaml @@ -22,4 +22,8 @@ resource_attributes: service.version: description: The service.version type: string - enabled: true \ No newline at end of file + enabled: true + +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/processor/resourcedetectionprocessor/internal/aws/lambda/metadata.yaml b/processor/resourcedetectionprocessor/internal/aws/lambda/metadata.yaml index b5d434962765..8e48faf6d3b5 100644 --- a/processor/resourcedetectionprocessor/internal/aws/lambda/metadata.yaml +++ b/processor/resourcedetectionprocessor/internal/aws/lambda/metadata.yaml @@ -38,4 +38,8 @@ resource_attributes: faas.max_memory: description: The faas.max_memory type: string - enabled: true \ No newline at end of file + enabled: true + +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/processor/resourcedetectionprocessor/internal/azure/internal/metadata/generated_status.go b/processor/resourcedetectionprocessor/internal/azure/internal/metadata/generated_status.go deleted file mode 100644 index 6a75a48cffd7..000000000000 --- a/processor/resourcedetectionprocessor/internal/azure/internal/metadata/generated_status.go +++ /dev/null @@ -1,19 +0,0 @@ -// Code generated by mdatagen. DO NOT EDIT. - -package metadata - -import ( - "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/otel/metric" - "go.opentelemetry.io/otel/trace" -) - -const () - -func Meter(settings component.TelemetrySettings) metric.Meter { - return settings.MeterProvider.Meter("otelcol/resourcedetection") -} - -func Tracer(settings component.TelemetrySettings) trace.Tracer { - return settings.TracerProvider.Tracer("otelcol/resourcedetection") -} diff --git a/processor/resourcedetectionprocessor/internal/azure/metadata.yaml b/processor/resourcedetectionprocessor/internal/azure/metadata.yaml index 3e896d9c3e44..fc72ff86e777 100644 --- a/processor/resourcedetectionprocessor/internal/azure/metadata.yaml +++ b/processor/resourcedetectionprocessor/internal/azure/metadata.yaml @@ -3,7 +3,7 @@ type: resourcedetectionprocessor/azure parent: resourcedetection status: - class: processor + class: pkg codeowners: active: [mx-psi] @@ -47,4 +47,4 @@ resource_attributes: azure.vm.size: description: The azure.vm.size enabled: true - type: string \ No newline at end of file + type: string diff --git a/processor/resourcedetectionprocessor/internal/docker/metadata.yaml b/processor/resourcedetectionprocessor/internal/docker/metadata.yaml index 7c8fd5a7f300..b9accae32395 100644 --- a/processor/resourcedetectionprocessor/internal/docker/metadata.yaml +++ b/processor/resourcedetectionprocessor/internal/docker/metadata.yaml @@ -10,4 +10,4 @@ resource_attributes: os.type: description: The os.type type: string - enabled: true \ No newline at end of file + enabled: true diff --git a/processor/resourcedetectionprocessor/internal/heroku/internal/metadata/generated_status.go b/processor/resourcedetectionprocessor/internal/heroku/internal/metadata/generated_status.go deleted file mode 100644 index 6a75a48cffd7..000000000000 --- a/processor/resourcedetectionprocessor/internal/heroku/internal/metadata/generated_status.go +++ /dev/null @@ -1,19 +0,0 @@ -// Code generated by mdatagen. DO NOT EDIT. - -package metadata - -import ( - "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/otel/metric" - "go.opentelemetry.io/otel/trace" -) - -const () - -func Meter(settings component.TelemetrySettings) metric.Meter { - return settings.MeterProvider.Meter("otelcol/resourcedetection") -} - -func Tracer(settings component.TelemetrySettings) trace.Tracer { - return settings.TracerProvider.Tracer("otelcol/resourcedetection") -} diff --git a/processor/resourcedetectionprocessor/internal/heroku/metadata.yaml b/processor/resourcedetectionprocessor/internal/heroku/metadata.yaml index 85f166703e9c..242686f1d8f5 100644 --- a/processor/resourcedetectionprocessor/internal/heroku/metadata.yaml +++ b/processor/resourcedetectionprocessor/internal/heroku/metadata.yaml @@ -3,7 +3,7 @@ type: resourcedetectionprocessor/heroku parent: resourcedetection status: - class: processor + class: pkg codeowners: active: [atoulme] diff --git a/processor/resourcedetectionprocessor/internal/k8snode/metadata.yaml b/processor/resourcedetectionprocessor/internal/k8snode/metadata.yaml index fdda964e952f..3aac54b505e4 100644 --- a/processor/resourcedetectionprocessor/internal/k8snode/metadata.yaml +++ b/processor/resourcedetectionprocessor/internal/k8snode/metadata.yaml @@ -10,4 +10,4 @@ resource_attributes: k8s.node.name: description: The Kubernetes node name type: string - enabled: true \ No newline at end of file + enabled: true diff --git a/processor/resourcedetectionprocessor/internal/openshift/internal/metadata/generated_status.go b/processor/resourcedetectionprocessor/internal/openshift/internal/metadata/generated_status.go deleted file mode 100644 index 6a75a48cffd7..000000000000 --- a/processor/resourcedetectionprocessor/internal/openshift/internal/metadata/generated_status.go +++ /dev/null @@ -1,19 +0,0 @@ -// Code generated by mdatagen. DO NOT EDIT. - -package metadata - -import ( - "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/otel/metric" - "go.opentelemetry.io/otel/trace" -) - -const () - -func Meter(settings component.TelemetrySettings) metric.Meter { - return settings.MeterProvider.Meter("otelcol/resourcedetection") -} - -func Tracer(settings component.TelemetrySettings) trace.Tracer { - return settings.TracerProvider.Tracer("otelcol/resourcedetection") -} diff --git a/processor/resourcedetectionprocessor/internal/openshift/metadata.yaml b/processor/resourcedetectionprocessor/internal/openshift/metadata.yaml index 499c2e571a76..bae3cf3b62cc 100644 --- a/processor/resourcedetectionprocessor/internal/openshift/metadata.yaml +++ b/processor/resourcedetectionprocessor/internal/openshift/metadata.yaml @@ -3,7 +3,7 @@ type: resourcedetectionprocessor/openshift parent: resourcedetection status: - class: processor + class: pkg codeowners: active: [frzifus] @@ -23,4 +23,4 @@ resource_attributes: k8s.cluster.name: description: The k8s.cluster.name type: string - enabled: true \ No newline at end of file + enabled: true diff --git a/processor/resourcedetectionprocessor/internal/system/internal/metadata/generated_resource.go b/processor/resourcedetectionprocessor/internal/system/internal/metadata/generated_resource.go index b4470e936493..ede196ac018b 100644 --- a/processor/resourcedetectionprocessor/internal/system/internal/metadata/generated_resource.go +++ b/processor/resourcedetectionprocessor/internal/system/internal/metadata/generated_resource.go @@ -57,9 +57,9 @@ func (rb *ResourceBuilder) SetHostCPUModelName(val string) { } // SetHostCPUStepping sets provided value as "host.cpu.stepping" attribute. -func (rb *ResourceBuilder) SetHostCPUStepping(val int64) { +func (rb *ResourceBuilder) SetHostCPUStepping(val string) { if rb.config.HostCPUStepping.Enabled { - rb.res.Attributes().PutInt("host.cpu.stepping", val) + rb.res.Attributes().PutStr("host.cpu.stepping", val) } } diff --git a/processor/resourcedetectionprocessor/internal/system/internal/metadata/generated_resource_test.go b/processor/resourcedetectionprocessor/internal/system/internal/metadata/generated_resource_test.go index 2d9e2811c358..b1ebc3301a86 100644 --- a/processor/resourcedetectionprocessor/internal/system/internal/metadata/generated_resource_test.go +++ b/processor/resourcedetectionprocessor/internal/system/internal/metadata/generated_resource_test.go @@ -18,7 +18,7 @@ func TestResourceBuilder(t *testing.T) { rb.SetHostCPUFamily("host.cpu.family-val") rb.SetHostCPUModelID("host.cpu.model.id-val") rb.SetHostCPUModelName("host.cpu.model.name-val") - rb.SetHostCPUStepping(17) + rb.SetHostCPUStepping("host.cpu.stepping-val") rb.SetHostCPUVendorID("host.cpu.vendor.id-val") rb.SetHostID("host.id-val") rb.SetHostIP([]any{"host.ip-item1", "host.ip-item2"}) @@ -70,7 +70,7 @@ func TestResourceBuilder(t *testing.T) { val, ok = res.Attributes().Get("host.cpu.stepping") assert.Equal(t, test == "all_set", ok) if ok { - assert.EqualValues(t, 17, val.Int()) + assert.EqualValues(t, "host.cpu.stepping-val", val.Str()) } val, ok = res.Attributes().Get("host.cpu.vendor.id") assert.Equal(t, test == "all_set", ok) diff --git a/processor/resourcedetectionprocessor/internal/system/internal/metadata/resource_int_version.go b/processor/resourcedetectionprocessor/internal/system/internal/metadata/resource_int_version.go index be77f0644186..5864e85bf006 100644 --- a/processor/resourcedetectionprocessor/internal/system/internal/metadata/resource_int_version.go +++ b/processor/resourcedetectionprocessor/internal/system/internal/metadata/resource_int_version.go @@ -16,3 +16,10 @@ func (rb *ResourceBuilder) SetHostCPUModelIDAsInt(val int64) { rb.res.Attributes().PutInt("host.cpu.model.id", val) } } + +// SetHostCPUSteppingAsInt sets provided value as "host.cpu.stepping" attribute as int. +func (rb *ResourceBuilder) SetHostCPUSteppingAsInt(val int64) { + if rb.config.HostCPUModelID.Enabled { + rb.res.Attributes().PutInt("host.cpu.stepping", val) + } +} diff --git a/processor/resourcedetectionprocessor/internal/system/metadata.yaml b/processor/resourcedetectionprocessor/internal/system/metadata.yaml index 93de1f2f9d3c..47ebfd6faa01 100644 --- a/processor/resourcedetectionprocessor/internal/system/metadata.yaml +++ b/processor/resourcedetectionprocessor/internal/system/metadata.yaml @@ -49,7 +49,7 @@ resource_attributes: enabled: false host.cpu.stepping: description: The host.cpu.stepping - type: int + type: string enabled: false host.cpu.cache.l2.size: description: The host.cpu.cache.l2.size diff --git a/processor/resourcedetectionprocessor/internal/system/system.go b/processor/resourcedetectionprocessor/internal/system/system.go index 7d46a902fdd3..a8614584b330 100644 --- a/processor/resourcedetectionprocessor/internal/system/system.go +++ b/processor/resourcedetectionprocessor/internal/system/system.go @@ -32,6 +32,14 @@ var ( featuregate.WithRegisterFromVersion("v0.89.0"), featuregate.WithRegisterReferenceURL("https://github.com/open-telemetry/semantic-conventions/issues/495"), ) + hostCPUSteppingAsStringID = "processor.resourcedetection.hostCPUSteppingAsString" + hostCPUSteppingAsStringFeatureGate = featuregate.GlobalRegistry().MustRegister( + hostCPUSteppingAsStringID, + featuregate.StageAlpha, + featuregate.WithRegisterDescription("Change type of host.cpu.stepping to string."), + featuregate.WithRegisterFromVersion("v0.95.0"), + featuregate.WithRegisterReferenceURL("https://github.com/open-telemetry/semantic-conventions/issues/664"), + ) ) const ( @@ -232,7 +240,16 @@ func setHostCPUInfo(d *Detector, cpuInfo cpu.InfoStat) error { } d.rb.SetHostCPUModelName(cpuInfo.ModelName) - d.rb.SetHostCPUStepping(int64(cpuInfo.Stepping)) + if hostCPUSteppingAsStringFeatureGate.IsEnabled() { + d.rb.SetHostCPUStepping(fmt.Sprintf("%d", cpuInfo.Stepping)) + } else { + // https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/31136 + d.logger.Info("This attribute will change from int to string. Switch now using the feature gate.", + zap.String("attribute", "host.cpu.stepping"), + zap.String("feature gate", hostCPUSteppingAsStringID), + ) + d.rb.SetHostCPUSteppingAsInt(int64(cpuInfo.Stepping)) + } d.rb.SetHostCPUCacheL2Size(int64(cpuInfo.CacheSize)) return nil } diff --git a/processor/resourcedetectionprocessor/metadata.yaml b/processor/resourcedetectionprocessor/metadata.yaml index 9ca10b369dd9..1e7bc3ad54f1 100644 --- a/processor/resourcedetectionprocessor/metadata.yaml +++ b/processor/resourcedetectionprocessor/metadata.yaml @@ -4,9 +4,6 @@ status: class: processor stability: beta: [traces, metrics, logs] - distributions: [contrib, splunk, observiq, sumo, aws, redhat, liatrio] + distributions: [contrib, splunk, observiq, sumo, aws, redhat, liatrio, grafana] codeowners: active: [Aneurysm9, dashpole] - -tests: - config: diff --git a/processor/resourceprocessor/generated_component_test.go b/processor/resourceprocessor/generated_component_test.go index 3245c91c3eb1..8f6f2aa60949 100644 --- a/processor/resourceprocessor/generated_component_test.go +++ b/processor/resourceprocessor/generated_component_test.go @@ -5,28 +5,21 @@ package resourceprocessor import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" + "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.opentelemetry.io/collector/processor" "go.opentelemetry.io/collector/processor/processortest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -71,9 +64,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -82,19 +73,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case processor.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case processor.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case processor.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -107,3 +98,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/processor/resourceprocessor/go.mod b/processor/resourceprocessor/go.mod index c27b8631943d..2e081e179203 100644 --- a/processor/resourceprocessor/go.mod +++ b/processor/resourceprocessor/go.mod @@ -14,7 +14,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/processor/resourceprocessor/go.sum b/processor/resourceprocessor/go.sum index 96d992ce02d4..720453b15540 100644 --- a/processor/resourceprocessor/go.sum +++ b/processor/resourceprocessor/go.sum @@ -98,8 +98,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/processor/routingprocessor/generated_component_test.go b/processor/routingprocessor/generated_component_test.go index 7c7f7d1d9b01..88328c94844d 100644 --- a/processor/routingprocessor/generated_component_test.go +++ b/processor/routingprocessor/generated_component_test.go @@ -5,28 +5,21 @@ package routingprocessor import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" + "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.opentelemetry.io/collector/processor" "go.opentelemetry.io/collector/processor/processortest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -71,9 +64,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -82,19 +73,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case processor.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case processor.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case processor.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -107,3 +98,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/processor/routingprocessor/go.mod b/processor/routingprocessor/go.mod index 17541edd6cc9..d995c4f48690 100644 --- a/processor/routingprocessor/go.mod +++ b/processor/routingprocessor/go.mod @@ -3,7 +3,6 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/processor/routi go 1.21 require ( - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.95.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector v0.95.0 @@ -20,7 +19,7 @@ require ( go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 google.golang.org/grpc v1.61.0 ) @@ -52,6 +51,7 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/mostynb/go-grpc-compression v1.2.2 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.95.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_golang v1.18.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect diff --git a/processor/routingprocessor/go.sum b/processor/routingprocessor/go.sum index 03eea7fe6d28..bf6e0ca60c79 100644 --- a/processor/routingprocessor/go.sum +++ b/processor/routingprocessor/go.sum @@ -172,8 +172,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/processor/schemaprocessor/generated_component_test.go b/processor/schemaprocessor/generated_component_test.go index 3943f49464b4..fe8b6cbf66af 100644 --- a/processor/schemaprocessor/generated_component_test.go +++ b/processor/schemaprocessor/generated_component_test.go @@ -5,28 +5,21 @@ package schemaprocessor import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" + "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.opentelemetry.io/collector/processor" "go.opentelemetry.io/collector/processor/processortest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -71,9 +64,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -82,19 +73,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case processor.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case processor.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case processor.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -107,3 +98,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/processor/schemaprocessor/go.mod b/processor/schemaprocessor/go.mod index 0d9a24ac03c7..edde0a049a85 100644 --- a/processor/schemaprocessor/go.mod +++ b/processor/schemaprocessor/go.mod @@ -3,7 +3,6 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/processor/schem go 1.21 require ( - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.95.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.95.0 go.opentelemetry.io/collector/config/confighttp v0.95.0 @@ -16,7 +15,7 @@ require ( go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( @@ -77,11 +76,3 @@ retract ( v0.76.1 v0.65.0 ) - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden - -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal => ../../internal/coreinternal - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil => ../../pkg/pdatautil diff --git a/processor/schemaprocessor/go.sum b/processor/schemaprocessor/go.sum index b5ddba9a225b..87325a3fcec3 100644 --- a/processor/schemaprocessor/go.sum +++ b/processor/schemaprocessor/go.sum @@ -128,8 +128,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/processor/spanmetricsprocessor/Makefile b/processor/spanmetricsprocessor/Makefile deleted file mode 100644 index c1496226e590..000000000000 --- a/processor/spanmetricsprocessor/Makefile +++ /dev/null @@ -1 +0,0 @@ -include ../../Makefile.Common \ No newline at end of file diff --git a/processor/spanmetricsprocessor/README.md b/processor/spanmetricsprocessor/README.md deleted file mode 100644 index 4c23555cf909..000000000000 --- a/processor/spanmetricsprocessor/README.md +++ /dev/null @@ -1,155 +0,0 @@ -# Span Metrics Processor - - -| Status | | -| ------------- |-----------| -| Stability | [deprecated]: traces | -| Distributions | [contrib], [observiq], [splunk], [sumo] | -| Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Aprocessor%2Fspanmetrics%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Aprocessor%2Fspanmetrics) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Aprocessor%2Fspanmetrics%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Aprocessor%2Fspanmetrics) | -| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | | -| Emeritus | [@albertteoh](https://www.github.com/albertteoh) | - -[deprecated]: https://github.com/open-telemetry/opentelemetry-collector#deprecated -[contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib -[observiq]: https://github.com/observIQ/observiq-otel-collector -[splunk]: https://github.com/signalfx/splunk-otel-collector -[sumo]: https://github.com/SumoLogic/sumologic-otel-collector - - -**Note**: The `spanmetrics` processor is **deprecated** in favour of the [spanmetrics](../../connector/spanmetricsconnector/README.md) connector. - -**Note:** Currently experimental and subject to breaking changes (e.g. change from processor to exporter/translator component). -See: https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/403. - -Aggregates Request, Error and Duration (R.E.D) metrics from span data. - -**Request** counts are computed as the number of spans seen per unique set of dimensions, including Errors. -For example, the following metric shows 142 calls: -``` -calls_total{http_method="GET",http_status_code="200",operation="/Address",service_name="shippingservice",span_kind="SPAN_KIND_SERVER",status_code="STATUS_CODE_UNSET"} 142 -``` -Multiple metrics can be aggregated if, for instance, a user wishes to view call counts just on `service_name` and `operation`. - -**Error** counts are computed from the Request counts which have an "Error" Status Code metric dimension. -For example, the following metric indicates 220 errors: -``` -calls_total{http_method="GET",http_status_code="503",operation="/checkout",service_name="frontend",span_kind="SPAN_KIND_CLIENT",status_code="STATUS_CODE_ERROR"} 220 -``` - -**Duration** is computed from the difference between the span start and end times and inserted into the -relevant latency histogram time bucket for each unique set dimensions. -For example, the following latency buckets indicate the vast majority of spans (9K) have a 100ms latency: -``` -latency_bucket{http_method="GET",http_status_code="200",label1="value1",operation="/Address",service_name="shippingservice",span_kind="SPAN_KIND_SERVER",status_code="STATUS_CODE_UNSET",le="2"} 327 -latency_bucket{http_method="GET",http_status_code="200",label1="value1",operation="/Address",service_name="shippingservice",span_kind="SPAN_KIND_SERVER",status_code="STATUS_CODE_UNSET",le="6"} 751 -latency_bucket{http_method="GET",http_status_code="200",label1="value1",operation="/Address",service_name="shippingservice",span_kind="SPAN_KIND_SERVER",status_code="STATUS_CODE_UNSET",le="10"} 1195 -latency_bucket{http_method="GET",http_status_code="200",label1="value1",operation="/Address",service_name="shippingservice",span_kind="SPAN_KIND_SERVER",status_code="STATUS_CODE_UNSET",le="100"} 10180 -latency_bucket{http_method="GET",http_status_code="200",label1="value1",operation="/Address",service_name="shippingservice",span_kind="SPAN_KIND_SERVER",status_code="STATUS_CODE_UNSET",le="250"} 10180 -... -``` - -Each metric will have _at least_ the following dimensions because they are common across all spans: -- Service name -- Operation -- Span kind -- Status code - -This processor lets traces to continue through the pipeline unmodified. - -The following settings are required: - -- `metrics_exporter`: the name of the exporter that this processor will write metrics to. This exporter **must** be present in a pipeline. - -The following settings can be optionally configured: - -- `latency_histogram_buckets`: the list of durations defining the latency histogram buckets. - - Default: `[2ms, 4ms, 6ms, 8ms, 10ms, 50ms, 100ms, 200ms, 400ms, 800ms, 1s, 1400ms, 2s, 5s, 10s, 15s]` -- `dimensions`: the list of dimensions to add together with the default dimensions defined above. - - Each additional dimension is defined with a `name` which is looked up in the span's collection of attributes or - resource attributes (AKA process tags) such as `ip`, `host.name` or `region`. - - If the `name`d attribute is missing in the span, the optional provided `default` is used. - - If no `default` is provided, this dimension will be **omitted** from the metric. -- `dimensions_cache_size`: the size of cache for storing Dimensions to improve collectors memory usage. - - Default: `1000`. -- `aggregation_temporality`: Defines the aggregation temporality of the generated metrics. - One of either `AGGREGATION_TEMPORALITY_CUMULATIVE` or `AGGREGATION_TEMPORALITY_DELTA`. - - Default: `AGGREGATION_TEMPORALITY_CUMULATIVE` -- `namespace`: Defines the namespace of the generated metrics. If `namespace` provided, generated metric name will be added `namespace.` prefix. -- `metrics_flush_interval`: Defines the flush interval of the generated metrics. - - Default: `15s`. - -## Examples - -The following is a simple example usage of the spanmetrics processor. - -For configuration examples on other use cases, please refer to [More Examples](#more-examples). - -The full list of settings exposed for this processor are documented [here](./config.go). - -```yaml -receivers: - jaeger: - protocols: - thrift_http: - endpoint: "0.0.0.0:14278" - - # Dummy receiver that's never used, because a pipeline is required to have one. - otlp/spanmetrics: - protocols: - grpc: - endpoint: "localhost:12345" - - otlp: - protocols: - grpc: - endpoint: "localhost:55677" - -processors: - batch: - spanmetrics: - metrics_exporter: otlp/spanmetrics - latency_histogram_buckets: [100us, 1ms, 2ms, 6ms, 10ms, 100ms, 250ms] - dimensions: - - name: http.method - default: GET - - name: http.status_code - dimensions_cache_size: 1000 - aggregation_temporality: "AGGREGATION_TEMPORALITY_CUMULATIVE" - metrics_flush_interval: 15s - -exporters: - jaeger: - endpoint: localhost:14250 - - otlp/spanmetrics: - endpoint: "localhost:55677" - tls: - insecure: true - - prometheus: - endpoint: "0.0.0.0:8889" - -service: - pipelines: - traces: - receivers: [jaeger] - processors: [spanmetrics, batch] - exporters: [jaeger] - - # The exporter name must match the metrics_exporter name. - # The receiver is just a dummy and never used; added to pass validation requiring at least one receiver in a pipeline. - metrics/spanmetrics: - receivers: [otlp/spanmetrics] - exporters: [otlp/spanmetrics] - - metrics: - receivers: [otlp] - exporters: [prometheus] -``` - -### More Examples - -For more example configuration covering various other use cases, please visit the [testdata directory](./testdata). diff --git a/processor/spanmetricsprocessor/config.go b/processor/spanmetricsprocessor/config.go deleted file mode 100644 index 87c6bed3f679..000000000000 --- a/processor/spanmetricsprocessor/config.go +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package spanmetricsprocessor // import "github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanmetricsprocessor" - -import ( - "fmt" - "time" - - "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/featuregate" - "go.opentelemetry.io/collector/pdata/pmetric" -) - -const ( - delta = "AGGREGATION_TEMPORALITY_DELTA" - cumulative = "AGGREGATION_TEMPORALITY_CUMULATIVE" -) - -var dropSanitizationGate = featuregate.GlobalRegistry().MustRegister( - "processor.spanmetrics.PermissiveLabelSanitization", - featuregate.StageAlpha, - featuregate.WithRegisterDescription("Controls whether to change labels starting with '_' to 'key_'"), -) - -// Dimension defines the dimension name and optional default value if the Dimension is missing from a span attribute. -type Dimension struct { - Name string `mapstructure:"name"` - Default *string `mapstructure:"default"` -} - -// Config defines the configuration options for spanmetricsprocessor. -type Config struct { - // MetricsExporter is the name of the metrics exporter to use to ship metrics. - MetricsExporter string `mapstructure:"metrics_exporter"` - - // LatencyHistogramBuckets is the list of durations representing latency histogram buckets. - // See defaultLatencyHistogramBucketsMs in processor.go for the default value. - LatencyHistogramBuckets []time.Duration `mapstructure:"latency_histogram_buckets"` - - // Dimensions defines the list of additional dimensions on top of the provided: - // - service.name - // - operation - // - span.kind - // - status.code - // The dimensions will be fetched from the span's attributes. Examples of some conventionally used attributes: - // https://github.com/open-telemetry/opentelemetry-collector/blob/main/model/semconv/opentelemetry.go. - Dimensions []Dimension `mapstructure:"dimensions"` - - // DimensionsCacheSize defines the size of cache for storing Dimensions, which helps to avoid cache memory growing - // indefinitely over the lifetime of the collector. - // Optional. See defaultDimensionsCacheSize in processor.go for the default value. - DimensionsCacheSize int `mapstructure:"dimensions_cache_size"` - - AggregationTemporality string `mapstructure:"aggregation_temporality"` - - // skipSanitizeLabel if enabled, labels that start with _ are not sanitized - skipSanitizeLabel bool - - // MetricsEmitInterval is the time period between when metrics are flushed or emitted to the configured MetricsExporter. - MetricsFlushInterval time.Duration `mapstructure:"metrics_flush_interval"` - - // Namespace is the namespace to use for the metrics. - Namespace string `mapstructure:"namespace"` -} - -var _ component.ConfigValidator = (*Config)(nil) - -// GetAggregationTemporality converts the string value given in the config into a AggregationTemporality. -// Returns cumulative, unless delta is correctly specified. -func (c Config) GetAggregationTemporality() pmetric.AggregationTemporality { - if c.AggregationTemporality == delta { - return pmetric.AggregationTemporalityDelta - } - return pmetric.AggregationTemporalityCumulative -} - -// Validate checks if the processor configuration is valid -func (c Config) Validate() error { - err := validateDimensions(c.Dimensions, dropSanitizationGate.IsEnabled()) - if err != nil { - return err - } - - if c.DimensionsCacheSize <= 0 { - return fmt.Errorf( - "invalid cache size: %v, the maximum number of the items in the cache should be positive", - c.DimensionsCacheSize, - ) - } - - return nil -} - -// validateDimensions checks duplicates for reserved dimensions and additional dimensions. Considering -// the usage of Prometheus related exporters, we also validate the dimensions after sanitization. -func validateDimensions(dimensions []Dimension, skipSanitizeLabel bool) error { - labelNames := make(map[string]struct{}) - for _, key := range []string{serviceNameKey, spanKindKey, statusCodeKey} { - labelNames[key] = struct{}{} - labelNames[sanitize(key, skipSanitizeLabel)] = struct{}{} - } - labelNames[operationKey] = struct{}{} - - for _, key := range dimensions { - if _, ok := labelNames[key.Name]; ok { - return fmt.Errorf("duplicate dimension name %s", key.Name) - } - labelNames[key.Name] = struct{}{} - - sanitizedName := sanitize(key.Name, skipSanitizeLabel) - if sanitizedName == key.Name { - continue - } - if _, ok := labelNames[sanitizedName]; ok { - return fmt.Errorf("duplicate dimension name %s after sanitization", sanitizedName) - } - labelNames[sanitizedName] = struct{}{} - } - - return nil -} diff --git a/processor/spanmetricsprocessor/config_test.go b/processor/spanmetricsprocessor/config_test.go deleted file mode 100644 index 598a8e075d61..000000000000 --- a/processor/spanmetricsprocessor/config_test.go +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package spanmetricsprocessor - -import ( - "path/filepath" - "testing" - "time" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanmetricsprocessor/internal/metadata" -) - -func TestLoadConfig(t *testing.T) { - t.Parallel() - - defaultMethod := "GET" - tests := []struct { - name string - id component.ID - expected component.Config - }{ - { - name: "configuration with dimensions size cache", - id: component.NewIDWithName(metadata.Type, "dimensions"), - expected: &Config{ - MetricsExporter: "prometheus", - AggregationTemporality: cumulative, - DimensionsCacheSize: 500, - MetricsFlushInterval: 15 * time.Second, - }, - }, - { - name: "configuration with aggregation temporality", - id: component.NewIDWithName(metadata.Type, "temp"), - expected: &Config{ - MetricsExporter: "otlp/spanmetrics", - AggregationTemporality: cumulative, - DimensionsCacheSize: defaultDimensionsCacheSize, - MetricsFlushInterval: 15 * time.Second, - }, - }, - { - name: "configuration with all available parameters", - id: component.NewIDWithName(metadata.Type, "full"), - expected: &Config{ - MetricsExporter: "otlp/spanmetrics", - AggregationTemporality: delta, - DimensionsCacheSize: 1500, - MetricsFlushInterval: 30 * time.Second, - LatencyHistogramBuckets: []time.Duration{ - 100 * time.Microsecond, - 1 * time.Millisecond, - 2 * time.Millisecond, - 6 * time.Millisecond, - 10 * time.Millisecond, - 100 * time.Millisecond, - 250 * time.Millisecond, - }, - Dimensions: []Dimension{ - {"http.method", &defaultMethod}, - {"http.status_code", nil}, - }, - }, - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - cm, err := confmaptest.LoadConf(filepath.Join("testdata", "config.yaml")) - require.NoError(t, err) - - factory := NewFactory() - cfg := factory.CreateDefaultConfig() - - sub, err := cm.Sub(tt.id.String()) - require.NoError(t, err) - - require.NoError(t, component.UnmarshalConfig(sub, cfg)) - - assert.Equal(t, tt.expected, cfg) - }) - } -} - -func TestValidateDimensions(t *testing.T) { - for _, tc := range []struct { - name string - dimensions []Dimension - expectedErr string - skipSanitizeLabel bool - }{ - { - name: "no additional dimensions", - dimensions: []Dimension{}, - }, - { - name: "no duplicate dimensions", - dimensions: []Dimension{ - {Name: "http.service_name"}, - {Name: "http.status_code"}, - }, - }, - { - name: "duplicate dimension with reserved labels", - dimensions: []Dimension{ - {Name: "service.name"}, - }, - expectedErr: "duplicate dimension name service.name", - }, - { - name: "duplicate dimension with reserved labels after sanitization", - dimensions: []Dimension{ - {Name: "service_name"}, - }, - expectedErr: "duplicate dimension name service_name", - }, - { - name: "duplicate additional dimensions", - dimensions: []Dimension{ - {Name: "service_name"}, - {Name: "service_name"}, - }, - expectedErr: "duplicate dimension name service_name", - }, - { - name: "duplicate additional dimensions after sanitization", - dimensions: []Dimension{ - {Name: "http.status_code"}, - {Name: "http!status_code"}, - }, - expectedErr: "duplicate dimension name http_status_code after sanitization", - }, - { - name: "we skip the case if the dimension name is the same after sanitization", - dimensions: []Dimension{ - {Name: "http_status_code"}, - }, - }, - } { - t.Run(tc.name, func(t *testing.T) { - tc.skipSanitizeLabel = false - err := validateDimensions(tc.dimensions, tc.skipSanitizeLabel) - if tc.expectedErr != "" { - assert.EqualError(t, err, tc.expectedErr) - } else { - assert.NoError(t, err) - } - }) - } -} diff --git a/processor/spanmetricsprocessor/factory.go b/processor/spanmetricsprocessor/factory.go deleted file mode 100644 index a5c8ac8edd2c..000000000000 --- a/processor/spanmetricsprocessor/factory.go +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -//go:generate mdatagen metadata.yaml - -package spanmetricsprocessor // import "github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanmetricsprocessor" - -import ( - "context" - "time" - - "github.com/tilinna/clock" - "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/consumer" - "go.opentelemetry.io/collector/processor" - - "github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanmetricsprocessor/internal/metadata" -) - -// NewFactory creates a factory for the spanmetrics processor. -func NewFactory() processor.Factory { - return processor.NewFactory( - metadata.Type, - createDefaultConfig, - processor.WithTraces(createTracesProcessor, metadata.TracesStability), - ) -} - -func createDefaultConfig() component.Config { - return &Config{ - AggregationTemporality: "AGGREGATION_TEMPORALITY_CUMULATIVE", - DimensionsCacheSize: defaultDimensionsCacheSize, - skipSanitizeLabel: dropSanitizationGate.IsEnabled(), - MetricsFlushInterval: 15 * time.Second, - } -} - -func createTracesProcessor(ctx context.Context, params processor.CreateSettings, cfg component.Config, nextConsumer consumer.Traces) (processor.Traces, error) { - p, err := newProcessor(params.Logger, cfg, metricsTicker(ctx, cfg)) - if err != nil { - return nil, err - } - p.tracesConsumer = nextConsumer - return p, nil -} - -func metricsTicker(ctx context.Context, cfg component.Config) *clock.Ticker { - return clock.FromContext(ctx).NewTicker(cfg.(*Config).MetricsFlushInterval) -} diff --git a/processor/spanmetricsprocessor/factory_test.go b/processor/spanmetricsprocessor/factory_test.go deleted file mode 100644 index d32425e485b7..000000000000 --- a/processor/spanmetricsprocessor/factory_test.go +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package spanmetricsprocessor - -import ( - "context" - "testing" - "time" - - "github.com/stretchr/testify/assert" - "go.opentelemetry.io/collector/consumer/consumertest" - "go.opentelemetry.io/collector/pdata/pcommon" - "go.opentelemetry.io/collector/processor/processortest" -) - -func TestNewProcessor(t *testing.T) { - defaultMethod := "GET" - defaultMethodValue := pcommon.NewValueStr(defaultMethod) - for _, tc := range []struct { - name string - metricsExporter string - latencyHistogramBuckets []time.Duration - dimensions []Dimension - wantLatencyHistogramBuckets []float64 - wantDimensions []dimension - }{ - { - name: "simplest config (use defaults)", - wantLatencyHistogramBuckets: defaultLatencyHistogramBucketsMs, - }, - { - name: "1 configured latency histogram bucket should result in 1 explicit latency bucket (+1 implicit +Inf bucket)", - latencyHistogramBuckets: []time.Duration{2 * time.Millisecond}, - dimensions: []Dimension{ - {Name: "http.method", Default: &defaultMethod}, - {Name: "http.status_code"}, - }, - wantLatencyHistogramBuckets: []float64{2}, - wantDimensions: []dimension{ - {name: "http.method", value: &defaultMethodValue}, - {"http.status_code", nil}, - }, - }, - } { - t.Run(tc.name, func(t *testing.T) { - // Prepare - factory := NewFactory() - - creationParams := processortest.NewNopCreateSettings() - cfg := factory.CreateDefaultConfig().(*Config) - cfg.LatencyHistogramBuckets = tc.latencyHistogramBuckets - cfg.Dimensions = tc.dimensions - - // Test - traceProcessor, err := factory.CreateTracesProcessor(context.Background(), creationParams, cfg, consumertest.NewNop()) - smp := traceProcessor.(*processorImp) - - // Verify - assert.NoError(t, err) - assert.NotNil(t, smp) - - assert.Equal(t, tc.wantLatencyHistogramBuckets, smp.latencyBounds) - assert.Equal(t, tc.wantDimensions, smp.dimensions) - }) - } -} diff --git a/processor/spanmetricsprocessor/go.mod b/processor/spanmetricsprocessor/go.mod deleted file mode 100644 index 0c44fc111173..000000000000 --- a/processor/spanmetricsprocessor/go.mod +++ /dev/null @@ -1,96 +0,0 @@ -// Deprecated: use github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector instead. -module github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanmetricsprocessor - -go 1.21 - -require ( - github.com/hashicorp/golang-lru v1.0.2 - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.95.0 - github.com/stretchr/testify v1.8.4 - github.com/tilinna/clock v1.1.0 - go.opentelemetry.io/collector/component v0.95.0 - go.opentelemetry.io/collector/config/configgrpc v0.95.0 - go.opentelemetry.io/collector/confmap v0.95.0 - go.opentelemetry.io/collector/consumer v0.95.0 - go.opentelemetry.io/collector/exporter v0.95.0 - go.opentelemetry.io/collector/exporter/otlpexporter v0.95.0 - go.opentelemetry.io/collector/featuregate v1.2.0 - go.opentelemetry.io/collector/pdata v1.2.0 - go.opentelemetry.io/collector/processor v0.95.0 - go.opentelemetry.io/collector/semconv v0.95.0 - go.opentelemetry.io/otel/metric v1.23.1 - go.opentelemetry.io/otel/trace v1.23.1 - go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 - google.golang.org/grpc v1.61.0 -) - -require ( - github.com/beorn7/perks v1.0.1 // indirect - github.com/cenkalti/backoff/v4 v4.2.1 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect - github.com/go-logr/logr v1.4.1 // indirect - github.com/go-logr/stdr v1.2.2 // indirect - github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect - github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/protobuf v1.5.3 // indirect - github.com/golang/snappy v0.0.4 // indirect - github.com/hashicorp/go-version v1.6.0 // indirect - github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.17.4 // 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.0 // indirect - github.com/mitchellh/copystructure v1.2.0 // indirect - github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect - github.com/mitchellh/reflectwalk v1.0.2 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/mostynb/go-grpc-compression v1.2.2 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.18.0 // indirect - github.com/prometheus/client_model v0.5.0 // indirect - github.com/prometheus/common v0.46.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect - github.com/stretchr/objx v0.5.0 // indirect - go.opentelemetry.io/collector v0.95.0 // indirect - go.opentelemetry.io/collector/config/configauth v0.95.0 // indirect - go.opentelemetry.io/collector/config/configcompression v0.95.0 // indirect - go.opentelemetry.io/collector/config/confignet v0.95.0 // indirect - go.opentelemetry.io/collector/config/configopaque v1.2.0 // indirect - go.opentelemetry.io/collector/config/configretry v0.95.0 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.95.0 // indirect - go.opentelemetry.io/collector/config/configtls v0.95.0 // indirect - go.opentelemetry.io/collector/config/internal v0.95.0 // indirect - go.opentelemetry.io/collector/extension v0.95.0 // indirect - go.opentelemetry.io/collector/extension/auth v0.95.0 // indirect - go.opentelemetry.io/collector/receiver v0.95.0 // indirect - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0 // indirect - go.opentelemetry.io/otel v1.23.1 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.45.2 // indirect - go.opentelemetry.io/otel/sdk v1.23.1 // indirect - go.opentelemetry.io/otel/sdk/metric v1.23.1 // indirect - go.uber.org/multierr v1.11.0 // indirect - golang.org/x/net v0.20.0 // indirect - golang.org/x/sys v0.17.0 // indirect - golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917 // indirect - google.golang.org/protobuf v1.32.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect -) - -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal => ../../internal/coreinternal - -retract ( - v0.76.2 - v0.76.1 - v0.65.0 -) - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil => ../../pkg/pdatautil - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden diff --git a/processor/spanmetricsprocessor/go.sum b/processor/spanmetricsprocessor/go.sum deleted file mode 100644 index 0f8c7dbf280d..000000000000 --- a/processor/spanmetricsprocessor/go.sum +++ /dev/null @@ -1,225 +0,0 @@ -cloud.google.com/go/compute v1.23.3 h1:6sVlXXBmbd7jNX0Ipq0trII3e4n1/MsADLK6a+aiVlk= -cloud.google.com/go/compute v1.23.3/go.mod h1:VCgBUoMnIVIR0CscqQiPJLAG25E3ZRZMzcFZeQ+h8CI= -cloud.google.com/go/compute/metadata v0.2.4-0.20230617002413-005d2dfb6b68 h1:aRVqY1p2IJaBGStWMsQMpkAa83cPkCDLl80eOj0Rbz4= -cloud.google.com/go/compute/metadata v0.2.4-0.20230617002413-005d2dfb6b68/go.mod h1:1a3eRNYX12fs5UABBIXS8HXVvQbX9hRB/RkEBPORpe8= -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= -github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cncf/xds/go v0.0.0-20231109132714-523115ebc101 h1:7To3pQ+pZo0i3dsWEbinPNFs5gPSBOsJtx3wTT94VBY= -github.com/cncf/xds/go v0.0.0-20231109132714-523115ebc101/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -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/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBFApVqftFV6k087DA= -github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE= -github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= -github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= -github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= -github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= -github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c= -github.com/go-viper/mapstructure/v2 v2.0.0-alpha.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/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -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.5.5/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/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 h1:Wqo399gCIufwto+VfwCSvsnfGpF/w5E9CNxSwbpD6No= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0/go.mod h1:qmOFXW2epJhM0qSnUUYpldc7gVz2KMQwJ/QYCDIa7XU= -github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= -github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= -github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= -github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= -github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= -github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= -github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= -github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= -github.com/knadh/koanf/providers/confmap v0.1.0/go.mod h1:2uLhxQzJnyHKfxG927awZC7+fyHFdQkd697K4MdLnIU= -github.com/knadh/koanf/v2 v2.1.0 h1:eh4QmHHBuU8BybfIJ8mB8K8gsGCD/AUQTdwGq/GzId8= -github.com/knadh/koanf/v2 v2.1.0/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es= -github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= -github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= -github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= -github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c h1:cqn374mizHuIWj+OSJCajGr/phAmuMug9qIX3l9CflE= -github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= -github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -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/mostynb/go-grpc-compression v1.2.2 h1:XaDbnRvt2+1vgr0b/l0qh4mJAfIxE0bKXtz2Znl3GGI= -github.com/mostynb/go-grpc-compression v1.2.2/go.mod h1:GOCr2KBxXcblCuczg3YdLQlcin1/NfyDA348ckuCH6w= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= -github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= -github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= -github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= -github.com/prometheus/common v0.46.0 h1:doXzt5ybi1HBKpsZOL0sSkaNHJJqkyfEWZGGqqScV0Y= -github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1BTn+g2pa/hQ= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/tilinna/clock v1.1.0 h1:6IQQQCo6KoBxVudv6gwtY8o4eDfhHo8ojA5dP0MfhSs= -github.com/tilinna/clock v1.1.0/go.mod h1:ZsP7BcY7sEEz7ktc0IVy8Us6boDrK8VradlKRUGfOao= -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 v0.95.0 h1:DFW0BkF2sOocpA3NUPrbMeuPSN3PWxFBrLqs/Cxn3vo= -go.opentelemetry.io/collector v0.95.0/go.mod h1:Lc+VkOkSBppKqR/cAevS5oPrbtUO3JUbYzo91niRkG0= -go.opentelemetry.io/collector/component v0.95.0 h1:68tI7KVy1bfpaR83+LxUvjd9/hjDh78utklGl2t6eVM= -go.opentelemetry.io/collector/component v0.95.0/go.mod h1:SMt7r9zm0OOEKJF/ZUy8agD92OAXq2Xhq1FaTcfIWHw= -go.opentelemetry.io/collector/config/configauth v0.95.0 h1:peGXB3ctZW/B8PomTL7CoIpTy94V5TR3JX6fD8kakmU= -go.opentelemetry.io/collector/config/configauth v0.95.0/go.mod h1:80lAG02Mucz0JYdG+k0NIul/BQF5bUpeRGEndgg07lg= -go.opentelemetry.io/collector/config/configcompression v0.95.0 h1:G1ljjbXmh37JaePSM+2r0bRNlEoCg4l1M1UuhGgnXx0= -go.opentelemetry.io/collector/config/configcompression v0.95.0/go.mod h1:owL6s04LI1fPrNZvXiRm6o4B0jaxb3z/oFEcgrakFK4= -go.opentelemetry.io/collector/config/configgrpc v0.95.0 h1:LBB2wxtCiYhIVDMYYE7JmBZn56pXQmYolAxFGI2Cj3o= -go.opentelemetry.io/collector/config/configgrpc v0.95.0/go.mod h1:zjHif3wbSEtcu+o0qQXdtZZGftMfoMVEGwqxlREDdDk= -go.opentelemetry.io/collector/config/confignet v0.95.0 h1:GGAq0E7DFPIcwyq6h0OOPEfLyym/7LUIOB2ij6l3xtE= -go.opentelemetry.io/collector/config/confignet v0.95.0/go.mod h1:BVw5xkQ7TH2wH75cbph+dtOoxq1baWLuhdSYIAvuVu0= -go.opentelemetry.io/collector/config/configopaque v1.2.0 h1:ncnAuq4px3yREsirivGUbwr36xXEKa3K6JTOBNGlbtc= -go.opentelemetry.io/collector/config/configopaque v1.2.0/go.mod h1:6BAnSe6wok2Sg3tiNuapBbLnrduyMwzsBzbfgUSbDnI= -go.opentelemetry.io/collector/config/configretry v0.95.0 h1:YBLly9WRjLCnB91feTshPNCj3z91Yf+akLWRNiUNxps= -go.opentelemetry.io/collector/config/configretry v0.95.0/go.mod h1:Nq7hp4nk+zeH0LYYsx348NHl02O89FnV45hcCCmqdtg= -go.opentelemetry.io/collector/config/configtelemetry v0.95.0 h1:HabJZqbOAbNQ52L3v6usXoGXg1UKA1Ofs4Ytp5sGXEo= -go.opentelemetry.io/collector/config/configtelemetry v0.95.0/go.mod h1:tl8sI2RE3LSgJ0HjpadYpIwsKzw/CRA0nZUXLzMAZS0= -go.opentelemetry.io/collector/config/configtls v0.95.0 h1:LB6B5vCXwZV77jWPNhdvsgkyY8CFv8gdsRjfQS2Rioc= -go.opentelemetry.io/collector/config/configtls v0.95.0/go.mod h1:661iHIlhQTKIuUUEkQmuoyek1oq46XlsKjLu3JIzJrE= -go.opentelemetry.io/collector/config/internal v0.95.0 h1:jSifydX2KscDhVuTxGFdYtgWu+7AVKr9/7OCvBmS46Q= -go.opentelemetry.io/collector/config/internal v0.95.0/go.mod h1:KR0lphyXBwuB1DImzQDRVONoRTbwsGnH9degSG5018M= -go.opentelemetry.io/collector/confmap v0.95.0 h1:0oZwSUaeKTDCP7eewFpQSD+9SxXspiaJWjZDQYGGars= -go.opentelemetry.io/collector/confmap v0.95.0/go.mod h1:L3djzwpt+jL06wxnHAuy1jPUFcM+MdKGQAsz3B1d6pk= -go.opentelemetry.io/collector/consumer v0.95.0 h1:M/N5RDx8/6Hz5L1qWUXdtirtdoV8BEjIxCSdt6cCx+I= -go.opentelemetry.io/collector/consumer v0.95.0/go.mod h1:tM5aOolWS1zAByMbne2xVOkmVvZrF3VEKY6TkxhmkOs= -go.opentelemetry.io/collector/exporter v0.95.0 h1:orUpjMVsD2IYRzrofE0tBhEBGHjr7W4wfltERxnWhP4= -go.opentelemetry.io/collector/exporter v0.95.0/go.mod h1:5wyZskvf4T1Zmm414a7JM1xw8EPhrFZeCe5kCff6VRg= -go.opentelemetry.io/collector/exporter/otlpexporter v0.95.0 h1:3GGUHciA0EGqzjAMqw/z9n2PavZjX1vQbCJ0QdChKmo= -go.opentelemetry.io/collector/exporter/otlpexporter v0.95.0/go.mod h1:8iKJe0ueSSns5u8vQjr0jRGKF1HFNSNUuMl/d7cxAlk= -go.opentelemetry.io/collector/extension v0.95.0 h1:amE7zV/lfJRdCmZ4cqWmvBzZB5aQmIFIQqIuXmhaCjI= -go.opentelemetry.io/collector/extension v0.95.0/go.mod h1:IDt4B5GJxh/uJ/mUWxYZ+eHrJ49k4B8s8gJhuI0TRVI= -go.opentelemetry.io/collector/extension/auth v0.95.0 h1:Qu2/I6YXW1yhh+M5PZ6b5izPdzrh+bl8X7ewEeJQWGU= -go.opentelemetry.io/collector/extension/auth v0.95.0/go.mod h1:FSODnSbmqfRT9dQdJgogby7j4bcV8TmrhddTvcAjcjU= -go.opentelemetry.io/collector/featuregate v1.2.0 h1:nF8OGq5PsSNSLeuNwTWlOqThxbLW6v6DOCvSqQMc108= -go.opentelemetry.io/collector/featuregate v1.2.0/go.mod h1:mm8+xyQfgDmqhyegZRNIQmoKsNnDTwWKFLsdMoXAb7A= -go.opentelemetry.io/collector/pdata v1.2.0 h1:N6VdyEFYJyoHIKqHd0F372eNVD5b+AbH0ZQf7Z2jJ9I= -go.opentelemetry.io/collector/pdata v1.2.0/go.mod h1:mKXb6527Syb8PT4P9CZOJNbkuHOHjjGTZNNwSKESJhc= -go.opentelemetry.io/collector/processor v0.95.0 h1:iLX1K1CEJttTXTHjuSu8vxucdG7U0cGnp9l+9w+Q6HE= -go.opentelemetry.io/collector/processor v0.95.0/go.mod h1:2vxstfq5xws+7C9Yi+yeg/xQ3Nh81sD2mr56KhRXAFA= -go.opentelemetry.io/collector/receiver v0.95.0 h1:9gA8/ceXiYiPheGQUt+EmCEKTjkGpUdPkiG7iey3Md0= -go.opentelemetry.io/collector/receiver v0.95.0/go.mod h1:kQrMBxcrgZfmtvjVQa6jStYG7c2L1c8UiHe/JNb7M+E= -go.opentelemetry.io/collector/semconv v0.95.0 h1:Oa7NXmoatwKLS+RzuXtdjq9oXAeg8P0g3x238fKF0Do= -go.opentelemetry.io/collector/semconv v0.95.0/go.mod h1:zOm/U3pgMIWcvrcnPbR9Xx2HinoXj46ERMK8PUV9wrs= -go.opentelemetry.io/contrib/config v0.3.0 h1:nJxYSB7/8fckSya4EAFyFGxIytMvNlQInXSmhz/OKKg= -go.opentelemetry.io/contrib/config v0.3.0/go.mod h1:tQW0mY8be9/LGikwZNYno97PleUhF/lMal9xJ1TC2vo= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0 h1:UNQQKPfTDe1J81ViolILjTKPr9WetKW6uei2hFgJmFs= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0/go.mod h1:r9vWsPS/3AQItv3OSlEJ/E4mbrhUbbw18meOjArPtKQ= -go.opentelemetry.io/otel v1.23.1 h1:Za4UzOqJYS+MUczKI320AtqZHZb7EqxO00jAHE0jmQY= -go.opentelemetry.io/otel v1.23.1/go.mod h1:Td0134eafDLcTS4y+zQ26GE8u3dEuRBiBCTUIRHaikA= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.23.0 h1:D/cXD+03/UOphyyT87NX6h+DlU+BnplN6/P6KJwsgGc= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.23.0/go.mod h1:L669qRGbPBwLcftXLFnTVFO6ES/GyMAvITLdvRjEAIM= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.23.0 h1:VZrBiTXzP3FErizsdF1JQj0qf0yA8Ktt6LAcjUhZqbc= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.23.0/go.mod h1:xkkwo777b9MEfsyD1yUZa4g+7MCqqWAP3r2tTSZePRc= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.23.0 h1:cZXHUQvCx7YMdjGu0AlmoArUz7NZ7K6WWsT4cjSkzc0= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.23.0/go.mod h1:OHlshrAeSV9uiVQs1n+c0FVCyo8L0NrYzVf5GuLllRo= -go.opentelemetry.io/otel/exporters/prometheus v0.45.2 h1:pe2Jqk1K18As0RCw7J08QhgXNqr+6npx0a5W4IgAFA8= -go.opentelemetry.io/otel/exporters/prometheus v0.45.2/go.mod h1:B38pscHKI6bhFS44FDw0eFU3iqG3ASNIvY+fZgR5sAc= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.23.0 h1:f4N/tfYchDXfM78Ng5KKO7OjrShVzww1g4oYxZ7tyMA= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.23.0/go.mod h1:v1gipIZLj3qtxR1L1F7jF/WaPFA5ptuHk52+eq9SSRg= -go.opentelemetry.io/otel/metric v1.23.1 h1:PQJmqJ9u2QaJLBOELl1cxIdPcpbwzbkjfEyelTl2rlo= -go.opentelemetry.io/otel/metric v1.23.1/go.mod h1:mpG2QPlAfnK8yNhNJAxDZruU9Y1/HubbC+KyH8FaCWI= -go.opentelemetry.io/otel/sdk v1.23.1 h1:O7JmZw0h76if63LQdsBMKQDWNb5oEcOThG9IrxscV+E= -go.opentelemetry.io/otel/sdk v1.23.1/go.mod h1:LzdEVR5am1uKOOwfBWFef2DCi1nu3SA8XQxx2IerWFk= -go.opentelemetry.io/otel/sdk/metric v1.23.1 h1:T9/8WsYg+ZqIpMWwdISVVrlGb/N0Jr1OHjR/alpKwzg= -go.opentelemetry.io/otel/sdk/metric v1.23.1/go.mod h1:8WX6WnNtHCgUruJ4TJ+UssQjMtpxkpX0zveQC8JG/E0= -go.opentelemetry.io/otel/trace v1.23.1 h1:4LrmmEd8AU2rFvU1zegmvqW7+kWarxtNOPyeL6HmYY8= -go.opentelemetry.io/otel/trace v1.23.1/go.mod h1:4IpnpJFwr1mo/6HL8XIPJaE9y0+u1KcVmuW7dwFSVrI= -go.opentelemetry.io/proto/otlp v1.1.0 h1:2Di21piLrCqJ3U3eXGCTPHE9R8Nh+0uglSnOyxikMeI= -go.opentelemetry.io/proto/otlp v1.1.0/go.mod h1:GpBHCBWiqvVLDqmHZsoMM3C5ySeKTC7ej/RNTae6MdY= -go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= -go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= -go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= -go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= -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/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.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= -golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= -golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= -golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= -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.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.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.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -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= -golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -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= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= -google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= -google.golang.org/genproto v0.0.0-20231212172506-995d672761c0 h1:YJ5pD9rF8o9Qtta0Cmy9rdBwkSjrTCT6XTiUQVOtIos= -google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917 h1:rcS6EyEaoCO52hQDupoSfrxI3R6C2Tq741is7X8OvnM= -google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917/go.mod h1:CmlNWB9lSezaYELKS5Ym1r44VrrbPUa7JTvw+6MbpJ0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917 h1:6G8oQ016D88m1xAKljMlBOOGWDZkes4kMhgGFlf8WcQ= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917/go.mod h1:xtjpI3tXFPP051KaWnhvxkiubL/6dJ18vLVf7q2pTOU= -google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0= -google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= -google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/processor/spanmetricsprocessor/internal/cache/cache.go b/processor/spanmetricsprocessor/internal/cache/cache.go deleted file mode 100644 index 768943873079..000000000000 --- a/processor/spanmetricsprocessor/internal/cache/cache.go +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package cache // import "github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanmetricsprocessor/internal/cache" - -import ( - "github.com/hashicorp/golang-lru/simplelru" -) - -// Cache consists of an LRU cache and the evicted items from the LRU cache. -// This data structure makes sure all the cached items can be retrieved either from the LRU cache or the evictedItems -// map. In spanmetricsprocessor's use case, we need to hold all the items during the current processing step for -// building the metrics. The evicted items can/should be safely removed once the metrics are built from the current -// batch of spans. -// -// Important: This implementation is non-thread safe. -type Cache[K comparable, V any] struct { - lru simplelru.LRUCache - evictedItems map[K]V -} - -// NewCache creates a Cache. -func NewCache[K comparable, V any](size int) (*Cache[K, V], error) { - evictedItems := make(map[K]V) - lruCache, err := simplelru.NewLRU(size, func(key any, value any) { - evictedItems[key.(K)] = value.(V) - }) - if err != nil { - return nil, err - } - - return &Cache[K, V]{ - lru: lruCache, - evictedItems: evictedItems, - }, nil -} - -// RemoveEvictedItems cleans all the evicted items. -func (c *Cache[K, V]) RemoveEvictedItems() { - // we need to keep the original pointer to evictedItems map as it is used in the closure of lru.NewWithEvict - for k := range c.evictedItems { - delete(c.evictedItems, k) - } -} - -// Add a value to the cache, returns true if an eviction occurred and updates the "recently used"-ness of the key. -func (c *Cache[K, V]) Add(key K, value V) bool { - return c.lru.Add(key, value) -} - -// Get an item from the LRU cache or evicted items. -func (c *Cache[K, V]) Get(key K) (V, bool) { - if val, ok := c.lru.Get(key); ok { - return val.(V), ok - } - val, ok := c.evictedItems[key] - - // Revive from evicted items back into the main cache if a fetch was attempted. - if ok { - delete(c.evictedItems, key) - c.Add(key, val) - } - - return val, ok -} - -func (c *Cache[K, V]) Contains(key K) bool { - return c.lru.Contains(key) -} - -// Len returns the number of items in the cache. -func (c *Cache[K, V]) Len() int { - return c.lru.Len() -} - -// Purge removes all the items from the LRU cache and evicted items. -func (c *Cache[K, V]) Purge() { - c.lru.Purge() - c.RemoveEvictedItems() -} diff --git a/processor/spanmetricsprocessor/internal/cache/cache_test.go b/processor/spanmetricsprocessor/internal/cache/cache_test.go deleted file mode 100644 index 374e8e2f9ba8..000000000000 --- a/processor/spanmetricsprocessor/internal/cache/cache_test.go +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package cache - -import ( - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestNewCache(t *testing.T) { - type args struct { - size int - } - tests := []struct { - name string - args args - wantErr bool - }{ - { - name: "create a new Cache with length 10", - args: args{ - size: 10, - }, - wantErr: false, - }, - { - name: "create a new Cache with length -1", - args: args{ - size: -1, - }, - wantErr: true, - }, - { - name: "create a new Cache with length 0", - args: args{ - size: 0, - }, - wantErr: true, - }, - } - for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { - t.Parallel() - _, err := NewCache[string, string](tt.args.size) - if tt.wantErr { - assert.Error(t, err) - return - } - assert.NoError(t, err) - }) - } -} - -func TestCache_GetReviveEvicted(t *testing.T) { - cache, _ := NewCache[string, string](1) - cache.Add("key0", "val_from_LRU") - cache.evictedItems["key1"] = "val_from_evicted_items" - - gotValue, gotOk := cache.Get("key0") - assert.True(t, gotOk) - assert.Equal(t, "val_from_LRU", gotValue) - - // Should revive the evicted key back into the main LRU cache. - gotValue, gotOk = cache.Get("key1") - assert.True(t, gotOk) - assert.Equal(t, "val_from_evicted_items", gotValue) - - cache.RemoveEvictedItems() - - _, gotOk = cache.Get("key0") - assert.False(t, gotOk, "key0 should be removed from evicted items") - - gotValue, gotOk = cache.Get("key1") - assert.True(t, gotOk) - assert.Equal(t, "val_from_evicted_items", gotValue, "key1 should be in the main LRU cache") -} - -func TestCache_Get(t *testing.T) { - tests := []struct { - name string - lruCache func() *Cache[string, string] - evictedItems map[string]string - key string - wantValue string - wantOk bool - }{ - { - name: "if key is not found in LRUCache, will get key from evictedItems", - lruCache: func() *Cache[string, string] { - cache, _ := NewCache[string, string](1) - cache.evictedItems["key"] = "val" - return cache - }, - key: "key", - wantValue: "val", - wantOk: true, - }, - { - name: "if key is found in LRUCache, return the found item", - lruCache: func() *Cache[string, string] { - cache, _ := NewCache[string, string](1) - cache.Add("key", "val_from_LRU") - cache.evictedItems["key"] = "val_from_evicted_items" - return cache - }, - key: "key", - wantValue: "val_from_LRU", - wantOk: true, - }, - { - name: "if key is not found either in LRUCache or evicted items, return nothing", - lruCache: func() *Cache[string, string] { - cache, _ := NewCache[string, string](1) - return cache - }, - key: "key", - wantValue: "", - wantOk: false, - }, - } - for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { - t.Parallel() - c := tt.lruCache() - gotValue, gotOk := c.Get(tt.key) - if !assert.Equal(t, gotValue, tt.wantValue) { - t.Errorf("Get() gotValue = %v, want %v", gotValue, tt.wantValue) - } - if gotOk != tt.wantOk { - t.Errorf("Get() gotOk = %v, want %v", gotOk, tt.wantOk) - } - }) - } -} - -func TestCache_RemoveEvictedItems(t *testing.T) { - tests := []struct { - name string - lruCache func() (*Cache[string, string], error) - }{ - { - name: "no panic when there is no evicted item to remove", - lruCache: func() (*Cache[string, string], error) { - return NewCache[string, string](1) - }, - }, - { - name: "evicted items should be removed", - lruCache: func() (*Cache[string, string], error) { - cache, err := NewCache[string, string](1) - if err != nil { - return nil, err - } - cache.evictedItems["key0"] = "val0" - cache.evictedItems["key1"] = "val1" - return cache, nil - }, - }, - } - for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { - t.Parallel() - cache, err := tt.lruCache() - assert.NoError(t, err) - cache.RemoveEvictedItems() - assert.Empty(t, cache.evictedItems) - }) - } -} - -func TestCache_PurgeItems(t *testing.T) { - tests := []struct { - name string - lruCache func() (*Cache[string, string], error) - }{ - { - name: "no panic when there is no item to remove", - lruCache: func() (*Cache[string, string], error) { - return NewCache[string, string](1) - }, - }, - { - name: "remove items from the lru cache", - lruCache: func() (*Cache[string, string], error) { - cache, err := NewCache[string, string](1) - if err != nil { - return nil, err - } - cache.evictedItems["key0"] = "val0" - cache.evictedItems["key1"] = "val1" - return cache, nil - }, - }, - { - name: "remove all the items from lru cache and the evicted items", - lruCache: func() (*Cache[string, string], error) { - cache, err := NewCache[string, string](10) - if err != nil { - return nil, err - } - cache.Add("key", "val") - cache.Add("key2", "val2") - cache.evictedItems["key0"] = "val0" - cache.evictedItems["key1"] = "val1" - return cache, nil - }, - }, - } - for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { - t.Parallel() - cache, err := tt.lruCache() - assert.NoError(t, err) - cache.Purge() - assert.Zero(t, cache.Len()) - assert.Empty(t, cache.evictedItems) - }) - } -} diff --git a/processor/spanmetricsprocessor/internal/metadata/generated_status.go b/processor/spanmetricsprocessor/internal/metadata/generated_status.go deleted file mode 100644 index 0bc0033037c0..000000000000 --- a/processor/spanmetricsprocessor/internal/metadata/generated_status.go +++ /dev/null @@ -1,25 +0,0 @@ -// Code generated by mdatagen. DO NOT EDIT. - -package metadata - -import ( - "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/otel/metric" - "go.opentelemetry.io/otel/trace" -) - -var ( - Type = component.MustNewType("spanmetrics") -) - -const ( - TracesStability = component.StabilityLevelDeprecated -) - -func Meter(settings component.TelemetrySettings) metric.Meter { - return settings.MeterProvider.Meter("otelcol/spanmetrics") -} - -func Tracer(settings component.TelemetrySettings) trace.Tracer { - return settings.TracerProvider.Tracer("otelcol/spanmetrics") -} diff --git a/processor/spanmetricsprocessor/metadata.yaml b/processor/spanmetricsprocessor/metadata.yaml deleted file mode 100644 index e2d862faf9b7..000000000000 --- a/processor/spanmetricsprocessor/metadata.yaml +++ /dev/null @@ -1,14 +0,0 @@ -type: spanmetrics - -status: - class: processor - stability: - deprecated: [traces] - distributions: [contrib, observiq, splunk, sumo] - codeowners: - active: [] - emeritus: [albertteoh] - -tests: - config: - skip_lifecycle: true diff --git a/processor/spanmetricsprocessor/mocks/Host.go b/processor/spanmetricsprocessor/mocks/Host.go deleted file mode 100644 index 6992de42cad4..000000000000 --- a/processor/spanmetricsprocessor/mocks/Host.go +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -// Code generated by mockery v0.0.0-dev. DO NOT EDIT. - -package mocks - -import ( - mock "github.com/stretchr/testify/mock" - component "go.opentelemetry.io/collector/component" -) - -// Host is an autogenerated mock type for the Host type -type Host struct { - mock.Mock -} - -// GetExporters provides a mock function with given fields: -func (_m *Host) GetExporters() map[component.DataType]map[component.ID]component.Component { - ret := _m.Called() - - var r0 map[component.DataType]map[component.ID]component.Component - if rf, ok := ret.Get(0).(func() map[component.DataType]map[component.ID]component.Component); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(map[component.DataType]map[component.ID]component.Component) - } - } - - return r0 -} - -// GetExtensions provides a mock function with given fields: -func (_m *Host) GetExtensions() map[component.ID]component.Component { - ret := _m.Called() - - var r0 map[component.ID]component.Component - if rf, ok := ret.Get(0).(func() map[component.ID]component.Component); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(map[component.ID]component.Component) - } - } - - return r0 -} - -// GetFactory provides a mock function with given fields: kind, componentType -func (_m *Host) GetFactory(kind component.Kind, componentType component.Type) component.Factory { - ret := _m.Called(kind, componentType) - - var r0 component.Factory - if rf, ok := ret.Get(0).(func(component.Kind, component.Type) component.Factory); ok { - r0 = rf(kind, componentType) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(component.Factory) - } - } - - return r0 -} - -// ReportFatalError provides a mock function with given fields: err -func (_m *Host) ReportFatalError(err error) { - _m.Called(err) -} diff --git a/processor/spanmetricsprocessor/mocks/MetricsConsumer.go b/processor/spanmetricsprocessor/mocks/MetricsConsumer.go deleted file mode 100644 index c5f9e6d25828..000000000000 --- a/processor/spanmetricsprocessor/mocks/MetricsConsumer.go +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -// Code generated by mockery v0.0.0-dev. DO NOT EDIT. - -package mocks - -import ( - context "context" - - mock "github.com/stretchr/testify/mock" - component "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/consumer" - "go.opentelemetry.io/collector/pdata/pmetric" -) - -// MetricsConsumer is an autogenerated mock type for the MetricsConsumer type -type MetricsConsumer struct { - mock.Mock -} - -func (_m *MetricsConsumer) Capabilities() consumer.Capabilities { - return consumer.Capabilities{MutatesData: false} -} - -// ConsumeMetrics provides a mock function with given fields: ctx, md -func (_m *MetricsConsumer) ConsumeMetrics(ctx context.Context, md pmetric.Metrics) error { - ret := _m.Called(ctx, md) - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, pmetric.Metrics) error); ok { - r0 = rf(ctx, md) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Shutdown provides a mock function with given fields: ctx -func (_m *MetricsConsumer) Shutdown(ctx context.Context) error { - ret := _m.Called(ctx) - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context) error); ok { - r0 = rf(ctx) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Start provides a mock function with given fields: ctx, host -func (_m *MetricsConsumer) Start(ctx context.Context, host component.Host) error { - ret := _m.Called(ctx, host) - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, component.Host) error); ok { - r0 = rf(ctx, host) - } else { - r0 = ret.Error(0) - } - - return r0 -} diff --git a/processor/spanmetricsprocessor/mocks/TracesConsumer.go b/processor/spanmetricsprocessor/mocks/TracesConsumer.go deleted file mode 100644 index f5d3deba31a1..000000000000 --- a/processor/spanmetricsprocessor/mocks/TracesConsumer.go +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -// Code generated by mockery v0.0.0-dev. DO NOT EDIT. - -package mocks - -import ( - context "context" - - mock "github.com/stretchr/testify/mock" - "go.opentelemetry.io/collector/consumer" - "go.opentelemetry.io/collector/pdata/ptrace" -) - -// TracesConsumer is an autogenerated mock type for the TracesConsumer type -type TracesConsumer struct { - mock.Mock -} - -func (_m *TracesConsumer) Capabilities() consumer.Capabilities { - return consumer.Capabilities{MutatesData: false} -} - -// ConsumeTraces provides a mock function with given fields: ctx, td -func (_m *TracesConsumer) ConsumeTraces(ctx context.Context, td ptrace.Traces) error { - ret := _m.Called(ctx, td) - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, ptrace.Traces) error); ok { - r0 = rf(ctx, td) - } else { - r0 = ret.Error(0) - } - - return r0 -} diff --git a/processor/spanmetricsprocessor/processor.go b/processor/spanmetricsprocessor/processor.go deleted file mode 100644 index 291d83902c3a..000000000000 --- a/processor/spanmetricsprocessor/processor.go +++ /dev/null @@ -1,529 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package spanmetricsprocessor // import "github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanmetricsprocessor" - -import ( - "bytes" - "context" - "fmt" - "sort" - "strings" - "sync" - "time" - "unicode" - - "github.com/tilinna/clock" - "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/consumer" - "go.opentelemetry.io/collector/exporter" - "go.opentelemetry.io/collector/pdata/pcommon" - "go.opentelemetry.io/collector/pdata/pmetric" - "go.opentelemetry.io/collector/pdata/ptrace" - conventions "go.opentelemetry.io/collector/semconv/v1.6.1" - "go.uber.org/zap" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/traceutil" - "github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanmetricsprocessor/internal/cache" -) - -const ( - serviceNameKey = conventions.AttributeServiceName - operationKey = "operation" // OpenTelemetry non-standard constant. - spanKindKey = "span.kind" // OpenTelemetry non-standard constant. - statusCodeKey = "status.code" // OpenTelemetry non-standard constant. - metricKeySeparator = string(byte(0)) - - metricLatency = "latency" - metricCallsTotal = "calls_total" - - defaultDimensionsCacheSize = 1000 -) - -var defaultLatencyHistogramBucketsMs = []float64{ - 2, 4, 6, 8, 10, 50, 100, 200, 400, 800, 1000, 1400, 2000, 5000, 10_000, 15_000, -} - -type exemplar struct { - traceID pcommon.TraceID - spanID pcommon.SpanID - value float64 -} - -type metricKey string - -type processorImp struct { - lock sync.Mutex - logger *zap.Logger - config Config - - metricsConsumer consumer.Metrics - tracesConsumer consumer.Traces - - // Additional dimensions to add to metrics. - dimensions []dimension - - // The starting time of the data points. - startTimestamp pcommon.Timestamp - - // Histogram. - histograms map[metricKey]*histogram - latencyBounds []float64 - - keyBuf *bytes.Buffer - - // An LRU cache of dimension key-value maps keyed by a unique identifier formed by a concatenation of its values: - // e.g. { "foo/barOK": { "serviceName": "foo", "operation": "/bar", "status_code": "OK" }} - metricKeyToDimensions *cache.Cache[metricKey, pcommon.Map] - - ticker *clock.Ticker - done chan struct{} - started bool - - shutdownOnce sync.Once -} - -type dimension struct { - name string - value *pcommon.Value -} - -func newDimensions(cfgDims []Dimension) []dimension { - if len(cfgDims) == 0 { - return nil - } - dims := make([]dimension, len(cfgDims)) - for i := range cfgDims { - dims[i].name = cfgDims[i].Name - if cfgDims[i].Default != nil { - val := pcommon.NewValueStr(*cfgDims[i].Default) - dims[i].value = &val - } - } - return dims -} - -type histogram struct { - attributes pcommon.Map - - count uint64 - sum float64 - bucketCounts []uint64 - exemplars []exemplar - - latencyBounds []float64 -} - -// observe a measurement and adds an exemplar. -func (h *histogram) observe(latencyMs float64, traceID pcommon.TraceID, spanID pcommon.SpanID) { - h.sum += latencyMs - h.count++ - // Binary search to find the latencyMs bucket index. - index := sort.SearchFloat64s(h.latencyBounds, latencyMs) - h.bucketCounts[index]++ - h.exemplars = append(h.exemplars, exemplar{traceID: traceID, spanID: spanID, value: latencyMs}) -} - -func newProcessor(logger *zap.Logger, config component.Config, ticker *clock.Ticker) (*processorImp, error) { - logger.Info("Building spanmetrics") - pConfig := config.(*Config) - - bounds := defaultLatencyHistogramBucketsMs - if pConfig.LatencyHistogramBuckets != nil { - bounds = mapDurationsToMillis(pConfig.LatencyHistogramBuckets) - } - - metricKeyToDimensionsCache, err := cache.NewCache[metricKey, pcommon.Map](pConfig.DimensionsCacheSize) - if err != nil { - return nil, err - } - - return &processorImp{ - logger: logger, - config: *pConfig, - startTimestamp: pcommon.NewTimestampFromTime(time.Now()), - latencyBounds: bounds, - histograms: make(map[metricKey]*histogram), - dimensions: newDimensions(pConfig.Dimensions), - keyBuf: bytes.NewBuffer(make([]byte, 0, 1024)), - metricKeyToDimensions: metricKeyToDimensionsCache, - ticker: ticker, - done: make(chan struct{}), - }, nil -} - -// durationToMillis converts the given duration to the number of milliseconds it represents. -// Note that this can return sub-millisecond (i.e. < 1ms) values as well. -func durationToMillis(d time.Duration) float64 { - return float64(d.Nanoseconds()) / float64(time.Millisecond.Nanoseconds()) -} - -func mapDurationsToMillis(vs []time.Duration) []float64 { - vsm := make([]float64, len(vs)) - for i, v := range vs { - vsm[i] = durationToMillis(v) - } - return vsm -} - -// Start implements the component.Component interface. -func (p *processorImp) Start(ctx context.Context, host component.Host) error { - p.logger.Info("Starting spanmetricsprocessor") - exporters := host.GetExporters() //nolint:staticcheck - - availableMetricsExporters := make([]string, 0, len(exporters[component.DataTypeMetrics])) - - // The available list of exporters come from any configured metrics pipelines' exporters. - for k, exp := range exporters[component.DataTypeMetrics] { - metricsExp, ok := exp.(exporter.Metrics) - if !ok { - return fmt.Errorf("the exporter %q isn't a metrics exporter", k.String()) - } - - availableMetricsExporters = append(availableMetricsExporters, k.String()) - - p.logger.Debug("Looking for spanmetrics exporter from available exporters", - zap.String("spanmetrics-exporter", p.config.MetricsExporter), - zap.Any("available-exporters", availableMetricsExporters), - ) - if k.String() == p.config.MetricsExporter { - p.metricsConsumer = metricsExp - p.logger.Info("Found exporter", zap.String("spanmetrics-exporter", p.config.MetricsExporter)) - break - } - } - if p.metricsConsumer == nil { - return fmt.Errorf("failed to find metrics exporter: '%s'; please configure metrics_exporter from one of: %+v", - p.config.MetricsExporter, availableMetricsExporters) - } - - p.started = true - go func() { - for { - select { - case <-p.done: - return - case <-p.ticker.C: - p.exportMetrics(ctx) - } - } - }() - - return nil -} - -// Shutdown implements the component.Component interface. -func (p *processorImp) Shutdown(context.Context) error { - p.shutdownOnce.Do(func() { - p.logger.Info("Shutting down spanmetricsprocessor") - if p.started { - p.logger.Info("Stopping ticker") - p.ticker.Stop() - p.done <- struct{}{} - p.started = false - } - }) - return nil -} - -// Capabilities implements the consumer interface. -func (p *processorImp) Capabilities() consumer.Capabilities { - return consumer.Capabilities{MutatesData: false} -} - -// ConsumeTraces implements the consumer.Traces interface. -// It aggregates the trace data to generate metrics, forwarding these metrics to the discovered metrics exporter. -// The original input trace data will be forwarded to the next consumer, unmodified. -func (p *processorImp) ConsumeTraces(ctx context.Context, traces ptrace.Traces) error { - p.lock.Lock() - p.aggregateMetrics(traces) - p.lock.Unlock() - - // Forward trace data unmodified and propagate trace pipeline errors, if any. - return p.tracesConsumer.ConsumeTraces(ctx, traces) -} - -func (p *processorImp) exportMetrics(ctx context.Context) { - p.lock.Lock() - - m := p.buildMetrics() - - // Exemplars are only relevant to this batch of traces, so must be cleared within the lock, - // regardless of error while building metrics, before the next batch of spans is received. - p.resetExemplars() - - // If delta metrics, reset accumulated data - if p.config.GetAggregationTemporality() == pmetric.AggregationTemporalityDelta { - p.histograms = make(map[metricKey]*histogram) - p.metricKeyToDimensions.Purge() - } else { - p.metricKeyToDimensions.RemoveEvictedItems() - for key := range p.histograms { - if !p.metricKeyToDimensions.Contains(key) { - delete(p.histograms, key) - } - } - } - - // This component no longer needs to read the metrics once built, so it is safe to unlock. - p.lock.Unlock() - - if err := p.metricsConsumer.ConsumeMetrics(ctx, m); err != nil { - p.logger.Error("Failed ConsumeMetrics", zap.Error(err)) - return - } -} - -// buildMetrics collects the computed raw metrics data, builds the metrics object and -// writes the raw metrics data into the metrics object. -func (p *processorImp) buildMetrics() pmetric.Metrics { - m := pmetric.NewMetrics() - ilm := m.ResourceMetrics().AppendEmpty().ScopeMetrics().AppendEmpty() - ilm.Scope().SetName("spanmetricsprocessor") - - p.collectCallMetrics(ilm) - p.collectLatencyMetrics(ilm) - - return m -} - -// collectLatencyMetrics collects the raw latency metrics, writing the data -// into the given instrumentation library metrics. -func (p *processorImp) collectLatencyMetrics(ilm pmetric.ScopeMetrics) { - mLatency := ilm.Metrics().AppendEmpty() - mLatency.SetName(buildMetricName(p.config.Namespace, metricLatency)) - mLatency.SetUnit("ms") - mLatency.SetEmptyHistogram().SetAggregationTemporality(p.config.GetAggregationTemporality()) - dps := mLatency.Histogram().DataPoints() - dps.EnsureCapacity(len(p.histograms)) - timestamp := pcommon.NewTimestampFromTime(time.Now()) - for _, hist := range p.histograms { - dpLatency := dps.AppendEmpty() - dpLatency.SetStartTimestamp(p.startTimestamp) - dpLatency.SetTimestamp(timestamp) - dpLatency.ExplicitBounds().FromRaw(p.latencyBounds) - dpLatency.BucketCounts().FromRaw(hist.bucketCounts) - dpLatency.SetCount(hist.count) - dpLatency.SetSum(hist.sum) - setExemplars(hist.exemplars, timestamp, dpLatency.Exemplars()) - hist.attributes.CopyTo(dpLatency.Attributes()) - } -} - -// collectCallMetrics collects the raw call count metrics, writing the data -// into the given instrumentation library metrics. -func (p *processorImp) collectCallMetrics(ilm pmetric.ScopeMetrics) { - mCalls := ilm.Metrics().AppendEmpty() - mCalls.SetName(buildMetricName(p.config.Namespace, metricCallsTotal)) - mCalls.SetEmptySum().SetIsMonotonic(true) - mCalls.Sum().SetAggregationTemporality(p.config.GetAggregationTemporality()) - dps := mCalls.Sum().DataPoints() - dps.EnsureCapacity(len(p.histograms)) - timestamp := pcommon.NewTimestampFromTime(time.Now()) - for _, hist := range p.histograms { - dpCalls := dps.AppendEmpty() - dpCalls.SetStartTimestamp(p.startTimestamp) - dpCalls.SetTimestamp(timestamp) - dpCalls.SetIntValue(int64(hist.count)) - hist.attributes.CopyTo(dpCalls.Attributes()) - } -} - -// aggregateMetrics aggregates the raw metrics from the input trace data. -// Each metric is identified by a key that is built from the service name -// and span metadata such as operation, kind, status_code and any additional -// dimensions the user has configured. -func (p *processorImp) aggregateMetrics(traces ptrace.Traces) { - for i := 0; i < traces.ResourceSpans().Len(); i++ { - rspans := traces.ResourceSpans().At(i) - resourceAttr := rspans.Resource().Attributes() - serviceAttr, ok := resourceAttr.Get(conventions.AttributeServiceName) - if !ok { - continue - } - serviceName := serviceAttr.Str() - ilsSlice := rspans.ScopeSpans() - for j := 0; j < ilsSlice.Len(); j++ { - ils := ilsSlice.At(j) - spans := ils.Spans() - for k := 0; k < spans.Len(); k++ { - span := spans.At(k) - // Protect against end timestamps before start timestamps. Assume 0 duration. - latencyMs := float64(0) - startTime := span.StartTimestamp() - endTime := span.EndTimestamp() - if endTime > startTime { - latencyMs = float64(endTime-startTime) / float64(time.Millisecond.Nanoseconds()) - } - - // Always reset the buffer before re-using. - p.keyBuf.Reset() - buildKey(p.keyBuf, serviceName, span, p.dimensions, resourceAttr) - key := metricKey(p.keyBuf.String()) - - attributes, ok := p.metricKeyToDimensions.Get(key) - if !ok { - attributes = p.buildAttributes(serviceName, span, resourceAttr) - p.metricKeyToDimensions.Add(key, attributes) - } - - h := p.getOrCreateHistogram(key, attributes) - h.observe(latencyMs, span.TraceID(), span.SpanID()) - } - } - } -} - -func (p *processorImp) getOrCreateHistogram(k metricKey, attr pcommon.Map) *histogram { - h, ok := p.histograms[k] - if !ok { - h = &histogram{ - attributes: attr, - bucketCounts: make([]uint64, len(p.latencyBounds)+1), - latencyBounds: p.latencyBounds, - exemplars: []exemplar{}, - } - p.histograms[k] = h - } - - return h -} - -// resetExemplars resets the entire exemplars map so the next trace will recreate all -// the data structure. An exemplar is a punctual value that exists at specific moment in time -// and should be not considered like a metrics that persist over time. -func (p *processorImp) resetExemplars() { - for _, histo := range p.histograms { - histo.exemplars = nil - } -} - -func (p *processorImp) buildAttributes(serviceName string, span ptrace.Span, resourceAttrs pcommon.Map) pcommon.Map { - attr := pcommon.NewMap() - attr.EnsureCapacity(4 + len(p.dimensions)) - attr.PutStr(serviceNameKey, serviceName) - attr.PutStr(operationKey, span.Name()) - attr.PutStr(spanKindKey, traceutil.SpanKindStr(span.Kind())) - attr.PutStr(statusCodeKey, traceutil.StatusCodeStr(span.Status().Code())) - for _, d := range p.dimensions { - if v, ok := getDimensionValue(d, span.Attributes(), resourceAttrs); ok { - v.CopyTo(attr.PutEmpty(d.name)) - } - } - return attr -} - -func concatDimensionValue(dest *bytes.Buffer, value string, prefixSep bool) { - if prefixSep { - dest.WriteString(metricKeySeparator) - } - dest.WriteString(value) -} - -// buildKey builds the metric key from the service name and span metadata such as operation, kind, status_code and -// will attempt to add any additional dimensions the user has configured that match the span's attributes -// or resource attributes. If the dimension exists in both, the span's attributes, being the most specific, takes precedence. -// -// The metric key is a simple concatenation of dimension values, delimited by a null character. -func buildKey(dest *bytes.Buffer, serviceName string, span ptrace.Span, optionalDims []dimension, resourceAttrs pcommon.Map) { - concatDimensionValue(dest, serviceName, false) - concatDimensionValue(dest, span.Name(), true) - concatDimensionValue(dest, traceutil.SpanKindStr(span.Kind()), true) - concatDimensionValue(dest, traceutil.StatusCodeStr(span.Status().Code()), true) - - for _, d := range optionalDims { - if v, ok := getDimensionValue(d, span.Attributes(), resourceAttrs); ok { - concatDimensionValue(dest, v.AsString(), true) - } - } -} - -// getDimensionValue gets the dimension value for the given configured dimension. -// It searches through the span's attributes first, being the more specific; -// falling back to searching in resource attributes if it can't be found in the span. -// Finally, falls back to the configured default value if provided. -// -// The ok flag indicates if a dimension value was fetched in order to differentiate -// an empty string value from a state where no value was found. -func getDimensionValue(d dimension, spanAttr pcommon.Map, resourceAttr pcommon.Map) (v pcommon.Value, ok bool) { - // The more specific span attribute should take precedence. - if attr, exists := spanAttr.Get(d.name); exists { - return attr, true - } - if attr, exists := resourceAttr.Get(d.name); exists { - return attr, true - } - // Set the default if configured, otherwise this metric will have no value set for the dimension. - if d.value != nil { - return *d.value, true - } - return v, ok -} - -// copied from prometheus-go-metric-exporter -// sanitize replaces non-alphanumeric characters with underscores in s. -func sanitize(s string, skipSanitizeLabel bool) string { - if len(s) == 0 { - return s - } - - // Note: No length limit for label keys because Prometheus doesn't - // define a length limit, thus we should NOT be truncating label keys. - // See https://github.com/orijtech/prometheus-go-metrics-exporter/issues/4. - s = strings.Map(sanitizeRune, s) - if unicode.IsDigit(rune(s[0])) { - s = "key_" + s - } - // replace labels starting with _ only when skipSanitizeLabel is disabled - if !skipSanitizeLabel && strings.HasPrefix(s, "_") { - s = "key" + s - } - // labels starting with __ are reserved in prometheus - if strings.HasPrefix(s, "__") { - s = "key" + s - } - return s -} - -// copied from prometheus-go-metric-exporter -// sanitizeRune converts anything that is not a letter or digit to an underscore -func sanitizeRune(r rune) rune { - if unicode.IsLetter(r) || unicode.IsDigit(r) { - return r - } - // Everything else turns into an underscore - return '_' -} - -// setExemplars sets the histogram exemplars. -func setExemplars(exemplarsData []exemplar, timestamp pcommon.Timestamp, exemplars pmetric.ExemplarSlice) { - es := pmetric.NewExemplarSlice() - es.EnsureCapacity(len(exemplarsData)) - - for _, ed := range exemplarsData { - value := ed.value - traceID := ed.traceID - spanID := ed.spanID - - exemplar := es.AppendEmpty() - - if traceID.IsEmpty() { - continue - } - - exemplar.SetDoubleValue(value) - exemplar.SetTimestamp(timestamp) - exemplar.SetTraceID(traceID) - exemplar.SetSpanID(spanID) - } - - es.CopyTo(exemplars) -} - -// buildMetricName builds the namespace prefix for the metric name. -func buildMetricName(namespace string, name string) string { - if namespace != "" { - return namespace + "." + name - } - return name -} diff --git a/processor/spanmetricsprocessor/processor_test.go b/processor/spanmetricsprocessor/processor_test.go deleted file mode 100644 index 72c7e86b2f96..000000000000 --- a/processor/spanmetricsprocessor/processor_test.go +++ /dev/null @@ -1,1050 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package spanmetricsprocessor - -import ( - "bytes" - "context" - "fmt" - "sync" - "testing" - "time" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/stretchr/testify/require" - "github.com/tilinna/clock" - "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/config/configgrpc" - "go.opentelemetry.io/collector/consumer/consumertest" - "go.opentelemetry.io/collector/exporter" - "go.opentelemetry.io/collector/exporter/exportertest" - "go.opentelemetry.io/collector/exporter/otlpexporter" - "go.opentelemetry.io/collector/pdata/pcommon" - "go.opentelemetry.io/collector/pdata/pmetric" - "go.opentelemetry.io/collector/pdata/ptrace" - "go.opentelemetry.io/collector/processor/processortest" - conventions "go.opentelemetry.io/collector/semconv/v1.6.1" - "go.uber.org/zap" - "go.uber.org/zap/zapcore" - "go.uber.org/zap/zaptest" - "go.uber.org/zap/zaptest/observer" - "google.golang.org/grpc/metadata" - - "github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanmetricsprocessor/internal/cache" - "github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanmetricsprocessor/mocks" -) - -const ( - stringAttrName = "stringAttrName" - intAttrName = "intAttrName" - doubleAttrName = "doubleAttrName" - boolAttrName = "boolAttrName" - nullAttrName = "nullAttrName" - mapAttrName = "mapAttrName" - arrayAttrName = "arrayAttrName" - notInSpanAttrName0 = "shouldBeInMetric" - notInSpanAttrName1 = "shouldNotBeInMetric" - regionResourceAttrName = "region" - DimensionsCacheSize = 1000 - - sampleRegion = "us-east-1" - sampleLatency = float64(11) - sampleLatencyDuration = time.Duration(sampleLatency) * time.Millisecond -) - -// metricID represents the minimum attributes that uniquely identifies a metric in our tests. -type metricID struct { - service string - operation string - kind string - statusCode string -} - -type metricDataPoint interface { - Attributes() pcommon.Map -} - -type serviceSpans struct { - serviceName string - spans []span -} - -type span struct { - operation string - kind ptrace.SpanKind - statusCode ptrace.StatusCode -} - -func TestProcessorStart(t *testing.T) { - // Create otlp exporters. - otlpID, mexp, texp := newOTLPExporters(t) - - for _, tc := range []struct { - name string - exporter component.Component - metricsConsumer string - wantErrorMsg string - }{ - {"export to active otlp metrics exporter", mexp, "otlp", ""}, - {"unable to find configured exporter in active exporter list", mexp, "prometheus", "failed to find metrics exporter: 'prometheus'; please configure metrics_exporter from one of: [otlp]"}, - {"export to active otlp traces exporter should error", texp, "otlp", "the exporter \"otlp\" isn't a metrics exporter"}, - } { - t.Run(tc.name, func(t *testing.T) { - // Prepare - exporters := map[component.DataType]map[component.ID]component.Component{ - component.DataTypeMetrics: { - otlpID: tc.exporter, - }, - } - mhost := &mocks.Host{} - mhost.On("GetExporters").Return(exporters) - - // Create spanmetrics processor - factory := NewFactory() - cfg := factory.CreateDefaultConfig().(*Config) - cfg.MetricsExporter = tc.metricsConsumer - - procCreationParams := processortest.NewNopCreateSettings() - traceProcessor, err := factory.CreateTracesProcessor(context.Background(), procCreationParams, cfg, consumertest.NewNop()) - require.NoError(t, err) - - // Test - smp := traceProcessor.(*processorImp) - ctx := context.Background() - err = smp.Start(ctx, mhost) - defer func() { sdErr := smp.Shutdown(ctx); require.NoError(t, sdErr) }() - - // Verify - if tc.wantErrorMsg != "" { - assert.EqualError(t, err, tc.wantErrorMsg) - } else { - assert.NoError(t, err) - } - }) - } -} - -func TestProcessorConcurrentShutdown(t *testing.T) { - // Prepare - exporters := map[component.DataType]map[component.ID]component.Component{} - mhost := &mocks.Host{} - mhost.On("GetExporters").Return(exporters) - - ctx := context.Background() - - core, observedLogs := observer.New(zapcore.InfoLevel) - logger := zap.New(core) - - mexp := &mocks.MetricsConsumer{} - tcon := &mocks.TracesConsumer{} - - mockClock := clock.NewMock(time.Now()) - ticker := mockClock.NewTicker(time.Nanosecond) - - // Test - p := newProcessorImp(mexp, tcon, nil, cumulative, logger, ticker, DimensionsCacheSize) - err := p.Start(ctx, mhost) - require.NoError(t, err) - - // Allow goroutines time to start. - time.Sleep(time.Millisecond) - - // Simulate many goroutines trying to concurrently shutdown. - var wg sync.WaitGroup - const concurrency = 1000 - wg.Add(concurrency) - for i := 0; i < concurrency; i++ { - go func() { - err := p.Shutdown(ctx) - require.NoError(t, err) - wg.Done() - }() - } - wg.Wait() - - // Allow time for log observer to sync all logs emitted. - // Even though the WaitGroup has been given the "done" signal, there's still a potential race condition - // between the WaitGroup being unblocked and when the logs will be flushed. - var allLogs []observer.LoggedEntry - assert.Eventually(t, func() bool { - allLogs = observedLogs.All() - return len(allLogs) > 0 - }, time.Second, time.Millisecond*10) - - // Starting spanmetricsprocessor... - // Shutting down spanmetricsprocessor... - // Stopping ticker. - assert.Len(t, allLogs, 3) -} - -func TestConfigureLatencyBounds(t *testing.T) { - // Prepare - factory := NewFactory() - cfg := factory.CreateDefaultConfig().(*Config) - cfg.LatencyHistogramBuckets = []time.Duration{ - 3 * time.Nanosecond, - 3 * time.Microsecond, - 3 * time.Millisecond, - 3 * time.Second, - } - - // Test - next := new(consumertest.TracesSink) - p, err := newProcessor(zaptest.NewLogger(t), cfg, nil) - p.tracesConsumer = next - - // Verify - assert.NoError(t, err) - assert.NotNil(t, p) - assert.Equal(t, []float64{0.000003, 0.003, 3, 3000}, p.latencyBounds) -} - -func TestProcessorCapabilities(t *testing.T) { - // Prepare - factory := NewFactory() - cfg := factory.CreateDefaultConfig().(*Config) - - // Test - next := new(consumertest.TracesSink) - p, err := newProcessor(zaptest.NewLogger(t), cfg, nil) - p.tracesConsumer = next - assert.NoError(t, err) - caps := p.Capabilities() - - // Verify - assert.NotNil(t, p) - assert.Equal(t, false, caps.MutatesData) -} - -func TestProcessorConsumeTracesErrors(t *testing.T) { - // Prepare - fakeErr := fmt.Errorf("consume traces error") - - logger := zap.NewNop() - - mexp := &mocks.MetricsConsumer{} - mexp.On("ConsumeMetrics", mock.Anything, mock.Anything).Return(nil) - - tcon := &mocks.TracesConsumer{} - tcon.On("ConsumeTraces", mock.Anything, mock.Anything).Return(fakeErr) - - p := newProcessorImp(mexp, tcon, nil, cumulative, logger, nil, DimensionsCacheSize) - - traces := buildSampleTrace() - - // Test - ctx := metadata.NewIncomingContext(context.Background(), nil) - err := p.ConsumeTraces(ctx, traces) - - // Verify - require.Error(t, err) - assert.ErrorIs(t, err, fakeErr) -} - -func TestProcessorConsumeMetricsErrors(t *testing.T) { - // Prepare - fakeErr := fmt.Errorf("consume metrics error") - - core, observedLogs := observer.New(zapcore.ErrorLevel) - logger := zap.New(core) - - var wg sync.WaitGroup - mexp := &mocks.MetricsConsumer{} - mexp.On("ConsumeMetrics", mock.Anything, mock.MatchedBy(func(input pmetric.Metrics) bool { - wg.Done() - return true - })).Return(fakeErr) - - tcon := &mocks.TracesConsumer{} - tcon.On("ConsumeTraces", mock.Anything, mock.Anything).Return(nil) - - mockClock := clock.NewMock(time.Now()) - ticker := mockClock.NewTicker(time.Nanosecond) - p := newProcessorImp(mexp, tcon, nil, cumulative, logger, ticker, DimensionsCacheSize) - - exporters := map[component.DataType]map[component.ID]component.Component{} - mhost := &mocks.Host{} - mhost.On("GetExporters").Return(exporters) - - ctx := metadata.NewIncomingContext(context.Background(), nil) - err := p.Start(ctx, mhost) - defer func() { sdErr := p.Shutdown(ctx); require.NoError(t, sdErr) }() - require.NoError(t, err) - - traces := buildSampleTrace() - - // Test - err = p.ConsumeTraces(ctx, traces) - require.NoError(t, err) - - // Trigger flush. - wg.Add(1) - mockClock.Add(time.Nanosecond) - wg.Wait() - - // Allow time for log observer to sync all logs emitted. - // Even though the WaitGroup has been given the "done" signal, there's still a potential race condition - // between the WaitGroup being unblocked and when the logs will be flushed. - var allLogs []observer.LoggedEntry - assert.Eventually(t, func() bool { - allLogs = observedLogs.All() - return len(allLogs) > 0 - }, time.Second, time.Millisecond*10) - - assert.Equal(t, "Failed ConsumeMetrics", allLogs[0].Message) -} - -func TestProcessorConsumeTraces(t *testing.T) { - t.Parallel() - - testcases := []struct { - name string - aggregationTemporality string - verifier func(t testing.TB, input pmetric.Metrics) bool - traces []ptrace.Traces - }{ - { - name: "Test single consumption, three spans (Cumulative).", - aggregationTemporality: cumulative, - verifier: verifyConsumeMetricsInputCumulative, - traces: []ptrace.Traces{buildSampleTrace()}, - }, - { - name: "Test single consumption, three spans (Delta).", - aggregationTemporality: delta, - verifier: verifyConsumeMetricsInputDelta, - traces: []ptrace.Traces{buildSampleTrace()}, - }, - { - // More consumptions, should accumulate additively. - name: "Test two consumptions (Cumulative).", - aggregationTemporality: cumulative, - verifier: verifyMultipleCumulativeConsumptions(), - traces: []ptrace.Traces{buildSampleTrace(), buildSampleTrace()}, - }, - { - // More consumptions, should not accumulate. Therefore, end state should be the same as single consumption case. - name: "Test two consumptions (Delta).", - aggregationTemporality: delta, - verifier: verifyConsumeMetricsInputDelta, - traces: []ptrace.Traces{buildSampleTrace(), buildSampleTrace()}, - }, - { - // Consumptions with improper timestamps - name: "Test bad consumptions (Delta).", - aggregationTemporality: cumulative, - verifier: verifyBadMetricsOkay, - traces: []ptrace.Traces{buildBadSampleTrace()}, - }, - } - - for _, tc := range testcases { - // Since parallelism is enabled in these tests, to avoid flaky behavior, - // instantiate a copy of the test case for t.Run's closure to use. - tc := tc - t.Run(tc.name, func(t *testing.T) { - // Prepare - mexp := &mocks.MetricsConsumer{} - tcon := &mocks.TracesConsumer{} - - var wg sync.WaitGroup - // Mocked metric exporter will perform validation on metrics, during p.ConsumeTraces() - mexp.On("ConsumeMetrics", mock.Anything, mock.MatchedBy(func(input pmetric.Metrics) bool { - wg.Done() - return tc.verifier(t, input) - })).Return(nil) - tcon.On("ConsumeTraces", mock.Anything, mock.Anything).Return(nil) - - defaultNullValue := pcommon.NewValueStr("defaultNullValue") - - mockClock := clock.NewMock(time.Now()) - ticker := mockClock.NewTicker(time.Nanosecond) - - p := newProcessorImp(mexp, tcon, &defaultNullValue, tc.aggregationTemporality, zaptest.NewLogger(t), ticker, DimensionsCacheSize) - - exporters := map[component.DataType]map[component.ID]component.Component{} - mhost := &mocks.Host{} - mhost.On("GetExporters").Return(exporters) - - ctx := metadata.NewIncomingContext(context.Background(), nil) - err := p.Start(ctx, mhost) - defer func() { sdErr := p.Shutdown(ctx); require.NoError(t, sdErr) }() - require.NoError(t, err) - - for _, traces := range tc.traces { - // Test - err = p.ConsumeTraces(ctx, traces) - assert.NoError(t, err) - - // Trigger flush. - wg.Add(1) - mockClock.Add(time.Nanosecond) - wg.Wait() - } - }) - } -} - -func TestMetricCache(t *testing.T) { - var wg sync.WaitGroup - - mexp := &mocks.MetricsConsumer{} - mexp.On("ConsumeMetrics", mock.Anything, mock.MatchedBy(func(input pmetric.Metrics) bool { - wg.Done() - return true - })).Return(nil) - - tcon := &mocks.TracesConsumer{} - tcon.On("ConsumeTraces", mock.Anything, mock.Anything).Return(nil) - - defaultNullValue := pcommon.NewValueStr("defaultNullValue") - mockClock := clock.NewMock(time.Now()) - ticker := mockClock.NewTicker(time.Nanosecond) - dimensionsCacheSize := 2 - - p := newProcessorImp(mexp, tcon, &defaultNullValue, cumulative, zaptest.NewLogger(t), ticker, dimensionsCacheSize) - - exporters := map[component.DataType]map[component.ID]component.Component{} - mhost := &mocks.Host{} - mhost.On("GetExporters").Return(exporters) - - // Test - ctx := metadata.NewIncomingContext(context.Background(), nil) - err := p.Start(ctx, mhost) - require.NoError(t, err) - - // 0 key was cached at beginning - assert.Zero(t, len(p.histograms)) - - traces := buildSampleTrace() - require.Condition(t, func() bool { - return traces.SpanCount() >= dimensionsCacheSize - }) - - err = p.ConsumeTraces(ctx, traces) - wg.Add(1) - mockClock.Add(time.Nanosecond) - wg.Wait() - - // Validate - require.NoError(t, err) - // 2 key was cached, 1 key was evicted and cleaned after the processing - assert.Equal(t, len(p.histograms), dimensionsCacheSize) - - // consume another batch of traces - err = p.ConsumeTraces(ctx, traces) - require.NoError(t, err) - wg.Add(1) - mockClock.Add(time.Nanosecond) - wg.Wait() - - // 2 key was cached, other keys were evicted and cleaned after the processing - assert.Equal(t, len(p.histograms), dimensionsCacheSize) -} - -func BenchmarkProcessorConsumeTraces(b *testing.B) { - // Prepare - mexp := &mocks.MetricsConsumer{} - tcon := &mocks.TracesConsumer{} - - mexp.On("ConsumeMetrics", mock.Anything, mock.Anything).Return(nil) - tcon.On("ConsumeTraces", mock.Anything, mock.Anything).Return(nil) - - defaultNullValue := pcommon.NewValueStr("defaultNullValue") - p := newProcessorImp(mexp, tcon, &defaultNullValue, cumulative, zaptest.NewLogger(b), nil, DimensionsCacheSize) - - traces := buildSampleTrace() - - // Test - ctx := metadata.NewIncomingContext(context.Background(), nil) - for n := 0; n < b.N; n++ { - assert.NoError(b, p.ConsumeTraces(ctx, traces)) - } -} - -func newProcessorImp(mexp *mocks.MetricsConsumer, tcon *mocks.TracesConsumer, defaultNullValue *pcommon.Value, temporality string, logger *zap.Logger, ticker *clock.Ticker, cacheSize int) *processorImp { - defaultNotInSpanAttrVal := pcommon.NewValueStr("defaultNotInSpanAttrVal") - // use size 2 for LRU cache for testing purpose - metricKeyToDimensions, err := cache.NewCache[metricKey, pcommon.Map](cacheSize) - if err != nil { - panic(err) - } - return &processorImp{ - logger: logger, - config: Config{AggregationTemporality: temporality}, - metricsConsumer: mexp, - tracesConsumer: tcon, - - startTimestamp: pcommon.NewTimestampFromTime(time.Now()), - histograms: make(map[metricKey]*histogram), - latencyBounds: defaultLatencyHistogramBucketsMs, - dimensions: []dimension{ - // Set nil defaults to force a lookup for the attribute in the span. - {stringAttrName, nil}, - {intAttrName, nil}, - {doubleAttrName, nil}, - {boolAttrName, nil}, - {mapAttrName, nil}, - {arrayAttrName, nil}, - {nullAttrName, defaultNullValue}, - // Add a default value for an attribute that doesn't exist in a span - {notInSpanAttrName0, &defaultNotInSpanAttrVal}, - // Leave the default value unset to test that this dimension should not be added to the metric. - {notInSpanAttrName1, nil}, - // Add a resource attribute to test "process" attributes like IP, host, region, cluster, etc. - {regionResourceAttrName, nil}, - }, - keyBuf: new(bytes.Buffer), - metricKeyToDimensions: metricKeyToDimensions, - ticker: ticker, - done: make(chan struct{}), - } -} - -// verifyConsumeMetricsInputCumulative expects one accumulation of metrics, and marked as cumulative -func verifyConsumeMetricsInputCumulative(t testing.TB, input pmetric.Metrics) bool { - return verifyConsumeMetricsInput(t, input, pmetric.AggregationTemporalityCumulative, 1) -} - -func verifyBadMetricsOkay(_ testing.TB, _ pmetric.Metrics) bool { - return true // Validating no exception -} - -// verifyConsumeMetricsInputDelta expects one accumulation of metrics, and marked as delta -func verifyConsumeMetricsInputDelta(t testing.TB, input pmetric.Metrics) bool { - return verifyConsumeMetricsInput(t, input, pmetric.AggregationTemporalityDelta, 1) -} - -// verifyMultipleCumulativeConsumptions expects the amount of accumulations as kept track of by numCumulativeConsumptions. -// numCumulativeConsumptions acts as a multiplier for the values, since the cumulative metrics are additive. -func verifyMultipleCumulativeConsumptions() func(t testing.TB, input pmetric.Metrics) bool { - numCumulativeConsumptions := 0 - return func(t testing.TB, input pmetric.Metrics) bool { - numCumulativeConsumptions++ - return verifyConsumeMetricsInput(t, input, pmetric.AggregationTemporalityCumulative, numCumulativeConsumptions) - } -} - -// verifyConsumeMetricsInput verifies the input of the ConsumeMetrics call from this processor. -// This is the best point to verify the computed metrics from spans are as expected. -func verifyConsumeMetricsInput(t testing.TB, input pmetric.Metrics, expectedTemporality pmetric.AggregationTemporality, numCumulativeConsumptions int) bool { - require.Equal(t, 6, input.DataPointCount(), - "Should be 3 for each of call count and latency. Each group of 3 data points is made of: "+ - "service-a (server kind) -> service-a (client kind) -> service-b (service kind)", - ) - - rm := input.ResourceMetrics() - require.Equal(t, 1, rm.Len()) - - ilm := rm.At(0).ScopeMetrics() - require.Equal(t, 1, ilm.Len()) - assert.Equal(t, "spanmetricsprocessor", ilm.At(0).Scope().Name()) - - m := ilm.At(0).Metrics() - require.Equal(t, 2, m.Len()) - - seenMetricIDs := make(map[metricID]bool) - // The first 3 data points are for call counts. - assert.Equal(t, "calls_total", m.At(0).Name()) - assert.Equal(t, expectedTemporality, m.At(0).Sum().AggregationTemporality()) - assert.True(t, m.At(0).Sum().IsMonotonic()) - callsDps := m.At(0).Sum().DataPoints() - require.Equal(t, 3, callsDps.Len()) - for dpi := 0; dpi < 3; dpi++ { - dp := callsDps.At(dpi) - assert.Equal(t, int64(numCumulativeConsumptions), dp.IntValue(), "There should only be one metric per Service/operation/kind combination") - assert.NotZero(t, dp.StartTimestamp(), "StartTimestamp should be set") - assert.NotZero(t, dp.Timestamp(), "Timestamp should be set") - verifyMetricLabels(dp, t, seenMetricIDs) - } - - seenMetricIDs = make(map[metricID]bool) - // The remaining 3 data points are for latency. - assert.Equal(t, "latency", m.At(1).Name()) - assert.Equal(t, "ms", m.At(1).Unit()) - assert.Equal(t, expectedTemporality, m.At(1).Histogram().AggregationTemporality()) - latencyDps := m.At(1).Histogram().DataPoints() - require.Equal(t, 3, latencyDps.Len()) - for dpi := 0; dpi < 3; dpi++ { - dp := latencyDps.At(dpi) - assert.Equal(t, sampleLatency*float64(numCumulativeConsumptions), dp.Sum(), "Should be a 11ms latency measurement, multiplied by the number of stateful accumulations.") - assert.NotZero(t, dp.Timestamp(), "Timestamp should be set") - - // Verify bucket counts. - - // The bucket counts should be 1 greater than the explicit bounds as documented in: - // https://github.com/open-telemetry/opentelemetry-proto/blob/main/opentelemetry/proto/metrics/v1/metrics.proto. - assert.Equal(t, dp.ExplicitBounds().Len()+1, dp.BucketCounts().Len()) - - // Find the bucket index where the 11ms latency should belong in. - var foundLatencyIndex int - for foundLatencyIndex = 0; foundLatencyIndex < dp.ExplicitBounds().Len(); foundLatencyIndex++ { - if dp.ExplicitBounds().At(foundLatencyIndex) > sampleLatency { - break - } - } - - // Then verify that all histogram buckets are empty except for the bucket with the 11ms latency. - var wantBucketCount uint64 - for bi := 0; bi < dp.BucketCounts().Len(); bi++ { - wantBucketCount = 0 - if bi == foundLatencyIndex { - wantBucketCount = uint64(numCumulativeConsumptions) - } - assert.Equal(t, wantBucketCount, dp.BucketCounts().At(bi)) - } - verifyMetricLabels(dp, t, seenMetricIDs) - } - return true -} - -func verifyMetricLabels(dp metricDataPoint, t testing.TB, seenMetricIDs map[metricID]bool) { - mID := metricID{} - wantDimensions := map[string]pcommon.Value{ - stringAttrName: pcommon.NewValueStr("stringAttrValue"), - intAttrName: pcommon.NewValueInt(99), - doubleAttrName: pcommon.NewValueDouble(99.99), - boolAttrName: pcommon.NewValueBool(true), - nullAttrName: pcommon.NewValueEmpty(), - arrayAttrName: pcommon.NewValueSlice(), - mapAttrName: pcommon.NewValueMap(), - notInSpanAttrName0: pcommon.NewValueStr("defaultNotInSpanAttrVal"), - regionResourceAttrName: pcommon.NewValueStr(sampleRegion), - } - dp.Attributes().Range(func(k string, v pcommon.Value) bool { - switch k { - case serviceNameKey: - mID.service = v.Str() - case operationKey: - mID.operation = v.Str() - case spanKindKey: - mID.kind = v.Str() - case statusCodeKey: - mID.statusCode = v.Str() - case notInSpanAttrName1: - assert.Fail(t, notInSpanAttrName1+" should not be in this metric") - default: - assert.Equal(t, wantDimensions[k], v) - delete(wantDimensions, k) - } - return true - }) - assert.Empty(t, wantDimensions, "Did not see all expected dimensions in metric. Missing: ", wantDimensions) - - // Service/operation/kind should be a unique metric. - assert.False(t, seenMetricIDs[mID]) - seenMetricIDs[mID] = true -} - -func buildBadSampleTrace() ptrace.Traces { - badTrace := buildSampleTrace() - span := badTrace.ResourceSpans().At(0).ScopeSpans().At(0).Spans().At(0) - now := time.Now() - // Flipping timestamp for a bad duration - span.SetEndTimestamp(pcommon.NewTimestampFromTime(now)) - span.SetStartTimestamp(pcommon.NewTimestampFromTime(now.Add(sampleLatencyDuration))) - return badTrace -} - -// buildSampleTrace builds the following trace: -// -// service-a/ping (server) -> -// service-a/ping (client) -> -// service-b/ping (server) -func buildSampleTrace() ptrace.Traces { - traces := ptrace.NewTraces() - - initServiceSpans( - serviceSpans{ - serviceName: "service-a", - spans: []span{ - { - operation: "/ping", - kind: ptrace.SpanKindServer, - statusCode: ptrace.StatusCodeOk, - }, - { - operation: "/ping", - kind: ptrace.SpanKindClient, - statusCode: ptrace.StatusCodeOk, - }, - }, - }, traces.ResourceSpans().AppendEmpty()) - initServiceSpans( - serviceSpans{ - serviceName: "service-b", - spans: []span{ - { - operation: "/ping", - kind: ptrace.SpanKindServer, - statusCode: ptrace.StatusCodeError, - }, - }, - }, traces.ResourceSpans().AppendEmpty()) - initServiceSpans(serviceSpans{}, traces.ResourceSpans().AppendEmpty()) - return traces -} - -func initServiceSpans(serviceSpans serviceSpans, spans ptrace.ResourceSpans) { - if serviceSpans.serviceName != "" { - spans.Resource().Attributes().PutStr(conventions.AttributeServiceName, serviceSpans.serviceName) - } - - spans.Resource().Attributes().PutStr(regionResourceAttrName, sampleRegion) - - ils := spans.ScopeSpans().AppendEmpty() - for _, span := range serviceSpans.spans { - initSpan(span, ils.Spans().AppendEmpty()) - } -} - -func initSpan(span span, s ptrace.Span) { - s.SetName(span.operation) - s.SetKind(span.kind) - s.Status().SetCode(span.statusCode) - now := time.Now() - s.SetStartTimestamp(pcommon.NewTimestampFromTime(now)) - s.SetEndTimestamp(pcommon.NewTimestampFromTime(now.Add(sampleLatencyDuration))) - - s.Attributes().PutStr(stringAttrName, "stringAttrValue") - s.Attributes().PutInt(intAttrName, 99) - s.Attributes().PutDouble(doubleAttrName, 99.99) - s.Attributes().PutBool(boolAttrName, true) - s.Attributes().PutEmpty(nullAttrName) - s.Attributes().PutEmptyMap(mapAttrName) - s.Attributes().PutEmptySlice(arrayAttrName) - s.SetTraceID(pcommon.TraceID([16]byte{byte(42)})) - s.SetSpanID(pcommon.SpanID([8]byte{byte(42)})) -} - -func newOTLPExporters(t *testing.T) (component.ID, exporter.Metrics, exporter.Traces) { - otlpExpFactory := otlpexporter.NewFactory() - otlpID := component.MustNewID("otlp") - otlpConfig := &otlpexporter.Config{ - ClientConfig: configgrpc.ClientConfig{ - Endpoint: "example.com:1234", - }, - } - expCreationParams := exportertest.NewNopCreateSettings() - mexp, err := otlpExpFactory.CreateMetricsExporter(context.Background(), expCreationParams, otlpConfig) - require.NoError(t, err) - texp, err := otlpExpFactory.CreateTracesExporter(context.Background(), expCreationParams, otlpConfig) - require.NoError(t, err) - return otlpID, mexp, texp -} - -func TestBuildKeySameServiceOperationCharSequence(t *testing.T) { - span0 := ptrace.NewSpan() - span0.SetName("c") - buf := &bytes.Buffer{} - buildKey(buf, "ab", span0, nil, pcommon.NewMap()) - k0 := metricKey(buf.String()) - buf.Reset() - span1 := ptrace.NewSpan() - span1.SetName("bc") - buildKey(buf, "a", span1, nil, pcommon.NewMap()) - k1 := metricKey(buf.String()) - assert.NotEqual(t, k0, k1) - assert.Equal(t, metricKey("ab\u0000c\u0000SPAN_KIND_UNSPECIFIED\u0000STATUS_CODE_UNSET"), k0) - assert.Equal(t, metricKey("a\u0000bc\u0000SPAN_KIND_UNSPECIFIED\u0000STATUS_CODE_UNSET"), k1) -} - -func TestBuildKeyWithDimensions(t *testing.T) { - defaultFoo := pcommon.NewValueStr("bar") - for _, tc := range []struct { - name string - optionalDims []dimension - resourceAttrMap map[string]any - spanAttrMap map[string]any - wantKey string - }{ - { - name: "nil optionalDims", - wantKey: "ab\u0000c\u0000SPAN_KIND_UNSPECIFIED\u0000STATUS_CODE_UNSET", - }, - { - name: "neither span nor resource contains key, dim provides default", - optionalDims: []dimension{ - {name: "foo", value: &defaultFoo}, - }, - wantKey: "ab\u0000c\u0000SPAN_KIND_UNSPECIFIED\u0000STATUS_CODE_UNSET\u0000bar", - }, - { - name: "neither span nor resource contains key, dim provides no default", - optionalDims: []dimension{ - {name: "foo"}, - }, - wantKey: "ab\u0000c\u0000SPAN_KIND_UNSPECIFIED\u0000STATUS_CODE_UNSET", - }, - { - name: "span attribute contains dimension", - optionalDims: []dimension{ - {name: "foo"}, - }, - spanAttrMap: map[string]any{ - "foo": 99, - }, - wantKey: "ab\u0000c\u0000SPAN_KIND_UNSPECIFIED\u0000STATUS_CODE_UNSET\u000099", - }, - { - name: "resource attribute contains dimension", - optionalDims: []dimension{ - {name: "foo"}, - }, - resourceAttrMap: map[string]any{ - "foo": 99, - }, - wantKey: "ab\u0000c\u0000SPAN_KIND_UNSPECIFIED\u0000STATUS_CODE_UNSET\u000099", - }, - { - name: "both span and resource attribute contains dimension, should prefer span attribute", - optionalDims: []dimension{ - {name: "foo"}, - }, - spanAttrMap: map[string]any{ - "foo": 100, - }, - resourceAttrMap: map[string]any{ - "foo": 99, - }, - wantKey: "ab\u0000c\u0000SPAN_KIND_UNSPECIFIED\u0000STATUS_CODE_UNSET\u0000100", - }, - } { - t.Run(tc.name, func(t *testing.T) { - resAttr := pcommon.NewMap() - assert.NoError(t, resAttr.FromRaw(tc.resourceAttrMap)) - span0 := ptrace.NewSpan() - assert.NoError(t, span0.Attributes().FromRaw(tc.spanAttrMap)) - span0.SetName("c") - buf := &bytes.Buffer{} - buildKey(buf, "ab", span0, tc.optionalDims, resAttr) - assert.Equal(t, tc.wantKey, buf.String()) - }) - } -} - -func TestSanitize(t *testing.T) { - cfg := createDefaultConfig().(*Config) - require.Equal(t, "", sanitize("", cfg.skipSanitizeLabel), "") - require.Equal(t, "key_test", sanitize("_test", cfg.skipSanitizeLabel)) - require.Equal(t, "key__test", sanitize("__test", cfg.skipSanitizeLabel)) - require.Equal(t, "key_0test", sanitize("0test", cfg.skipSanitizeLabel)) - require.Equal(t, "test", sanitize("test", cfg.skipSanitizeLabel)) - require.Equal(t, "test__", sanitize("test_/", cfg.skipSanitizeLabel)) - // testcases with skipSanitizeLabel flag turned on - cfg.skipSanitizeLabel = true - require.Equal(t, "", sanitize("", cfg.skipSanitizeLabel), "") - require.Equal(t, "_test", sanitize("_test", cfg.skipSanitizeLabel)) - require.Equal(t, "key__test", sanitize("__test", cfg.skipSanitizeLabel)) - require.Equal(t, "key_0test", sanitize("0test", cfg.skipSanitizeLabel)) - require.Equal(t, "test", sanitize("test", cfg.skipSanitizeLabel)) - require.Equal(t, "test__", sanitize("test_/", cfg.skipSanitizeLabel)) -} - -func TestSetExemplars(t *testing.T) { - // ----- conditions ------------------------------------------------------- - traces := buildSampleTrace() - traceID := traces.ResourceSpans().At(0).ScopeSpans().At(0).Spans().At(0).TraceID() - spanID := traces.ResourceSpans().At(0).ScopeSpans().At(0).Spans().At(0).SpanID() - exemplarSlice := pmetric.NewExemplarSlice() - timestamp := pcommon.NewTimestampFromTime(time.Now()) - value := float64(42) - - ed := []exemplar{{traceID: traceID, spanID: spanID, value: value}} - - // ----- call ------------------------------------------------------------- - setExemplars(ed, timestamp, exemplarSlice) - - // ----- verify ----------------------------------------------------------- - traceIDValue := exemplarSlice.At(0).TraceID() - spanIDValue := exemplarSlice.At(0).SpanID() - - assert.NotEmpty(t, exemplarSlice) - assert.Equal(t, traceIDValue, traceID) - assert.Equal(t, spanIDValue, spanID) - assert.Equal(t, exemplarSlice.At(0).Timestamp(), timestamp) - assert.Equal(t, exemplarSlice.At(0).DoubleValue(), value) -} - -func TestProcessorUpdateExemplars(t *testing.T) { - // ----- conditions ------------------------------------------------------- - factory := NewFactory() - cfg := factory.CreateDefaultConfig().(*Config) - traces := buildSampleTrace() - traceID := traces.ResourceSpans().At(0).ScopeSpans().At(0).Spans().At(0).TraceID() - spanID := traces.ResourceSpans().At(0).ScopeSpans().At(0).Spans().At(0).SpanID() - key := metricKey("metricKey") - next := new(consumertest.TracesSink) - p, err := newProcessor(zaptest.NewLogger(t), cfg, nil) - p.tracesConsumer = next - value := float64(42) - - // ----- call ------------------------------------------------------------- - h := p.getOrCreateHistogram(key, pcommon.NewMap()) - h.observe(value, traceID, spanID) - - // ----- verify ----------------------------------------------------------- - assert.NoError(t, err) - assert.NotEmpty(t, p.histograms[key].exemplars) - assert.Equal(t, p.histograms[key].exemplars[0], exemplar{traceID: traceID, spanID: spanID, value: value}) - - // ----- call ------------------------------------------------------------- - p.resetExemplars() - - // ----- verify ----------------------------------------------------------- - assert.NoError(t, err) - assert.Empty(t, p.histograms[key].exemplars) -} - -func TestConsumeTracesEvictedCacheKey(t *testing.T) { - // Prepare - traces0 := ptrace.NewTraces() - - initServiceSpans( - serviceSpans{ - // This should be moved to the evicted list of the LRU cache once service-c is added - // since the cache size is configured to 2. - serviceName: "service-a", - spans: []span{ - { - operation: "/ping", - kind: ptrace.SpanKindServer, - statusCode: ptrace.StatusCodeOk, - }, - }, - }, traces0.ResourceSpans().AppendEmpty()) - initServiceSpans( - serviceSpans{ - serviceName: "service-b", - spans: []span{ - { - operation: "/ping", - kind: ptrace.SpanKindServer, - statusCode: ptrace.StatusCodeError, - }, - }, - }, traces0.ResourceSpans().AppendEmpty()) - initServiceSpans( - serviceSpans{ - serviceName: "service-c", - spans: []span{ - { - operation: "/ping", - kind: ptrace.SpanKindServer, - statusCode: ptrace.StatusCodeError, - }, - }, - }, traces0.ResourceSpans().AppendEmpty()) - - // This trace does not have service-a, and may not result in an attempt to publish metrics for - // service-a because service-a may be removed from the metricsKeyCache's evicted list. - traces1 := ptrace.NewTraces() - - initServiceSpans( - serviceSpans{ - serviceName: "service-b", - spans: []span{ - { - operation: "/ping", - kind: ptrace.SpanKindServer, - statusCode: ptrace.StatusCodeError, - }, - }, - }, traces1.ResourceSpans().AppendEmpty()) - initServiceSpans( - serviceSpans{ - serviceName: "service-c", - spans: []span{ - { - operation: "/ping", - kind: ptrace.SpanKindServer, - statusCode: ptrace.StatusCodeError, - }, - }, - }, traces1.ResourceSpans().AppendEmpty()) - - mexp := &mocks.MetricsConsumer{} - tcon := &mocks.TracesConsumer{} - - wantDataPointCounts := []int{ - 6, // (calls_total + latency) * (service-a + service-b + service-c) - 4, // (calls_total + latency) * (service-b + service-c) - } - - // Ensure the assertion that wantDataPointCounts is performed only after all ConsumeMetrics - // invocations are complete. - var wg sync.WaitGroup - wg.Add(len(wantDataPointCounts)) - - // Mocked metric exporter will perform validation on metrics, during p.ConsumeTraces() - mexp.On("ConsumeMetrics", mock.Anything, mock.MatchedBy(func(input pmetric.Metrics) bool { - defer wg.Done() - - // Verify - require.NotEmpty(t, wantDataPointCounts) - - // GreaterOrEqual is particularly necessary for the second assertion where we - // expect 4 data points; but could also be 6 due to the non-deterministic nature - // of the p.histograms map which, through the act of "Get"ting a cached key, will - // lead to updating its recent-ness. - require.GreaterOrEqual(t, input.DataPointCount(), wantDataPointCounts[0]) - wantDataPointCounts = wantDataPointCounts[1:] // Dequeue - - return true - })).Return(nil) - - tcon.On("ConsumeTraces", mock.Anything, mock.Anything).Return(nil) - - defaultNullValue := pcommon.NewValueStr("defaultNullValue") - mockClock := clock.NewMock(time.Now()) - ticker := mockClock.NewTicker(time.Nanosecond) - - p := newProcessorImp(mexp, tcon, &defaultNullValue, cumulative, zaptest.NewLogger(t), ticker, DimensionsCacheSize) - - exporters := map[component.DataType]map[component.ID]component.Component{} - - mhost := &mocks.Host{} - mhost.On("GetExporters").Return(exporters) - - ctx := metadata.NewIncomingContext(context.Background(), nil) - err := p.Start(ctx, mhost) - defer func() { sdErr := p.Shutdown(ctx); require.NoError(t, sdErr) }() - require.NoError(t, err) - - for _, traces := range []ptrace.Traces{traces0, traces1} { - // Test - err = p.ConsumeTraces(ctx, traces) - require.NoError(t, err) - - // Allow time for metrics aggregation to complete. - time.Sleep(time.Millisecond) - - // Trigger flush. - mockClock.Add(time.Nanosecond) - - // Allow time for metrics flush to complete. - time.Sleep(time.Millisecond) - } - - wg.Wait() - assert.Empty(t, wantDataPointCounts) -} - -func TestBuildMetricName(t *testing.T) { - tests := []struct { - namespace string - metricName string - expected string - }{ - {"", "metric", "metric"}, - {"ns", "metric", "ns.metric"}, - {"longer_namespace", "metric", "longer_namespace.metric"}, - } - - for _, test := range tests { - actual := buildMetricName(test.namespace, test.metricName) - assert.Equal(t, test.expected, actual) - } -} diff --git a/processor/spanmetricsprocessor/testdata/config-exporter-not-found.yaml b/processor/spanmetricsprocessor/testdata/config-exporter-not-found.yaml deleted file mode 100644 index 048a17cf27f8..000000000000 --- a/processor/spanmetricsprocessor/testdata/config-exporter-not-found.yaml +++ /dev/null @@ -1,47 +0,0 @@ -# This config demonstrates the case where the configured 'metrics_exporter' -# within spanprocessor, cannot be found in any pipeline, leading to a config validation error. -receivers: - jaeger: - protocols: - thrift_http: - endpoint: "0.0.0.0:14278" - - # Dummy receiver that's never used, because a pipeline is required to have one. - otlp/spanmetrics: - protocols: - grpc: - endpoint: "localhost:12345" - -exporters: - prometheus: - endpoint: "0.0.0.0:8889" - - jaeger: - endpoint: "localhost:14250" - tls: - insecure: true - - otlp: - endpoint: "localhost:12345" - -processors: - batch: - spanmetrics: - metrics_exporter: prometheus - -service: - pipelines: - traces: - receivers: [jaeger] - # spanmetrics will pass on span data untouched to next processor - # while also accumulating metrics to be sent to the configured 'prometheus' exporter. - processors: [spanmetrics, batch] - exporters: [jaeger] - - metrics: - # This receiver is just a dummy and never used. - # Added to pass validation requiring at least one receiver in a pipeline. - receivers: [otlp/spanmetrics] - # The metrics_exporter must be present in this list, which is not the case here - # ('prometheus' is missing). - exporters: [otlp] diff --git a/processor/spanmetricsprocessor/testdata/config-prometheusremotewrite.yaml b/processor/spanmetricsprocessor/testdata/config-prometheusremotewrite.yaml deleted file mode 100644 index 8cbd81bdd65f..000000000000 --- a/processor/spanmetricsprocessor/testdata/config-prometheusremotewrite.yaml +++ /dev/null @@ -1,73 +0,0 @@ -# This example is practical application of a 3-pipeline configuration for -# writing to a remote prometheus-compatible write endpoint. -# -# The spanmetrics processor will output data on every span batch that is received, -# that could overwhelm the remote write endpoint. -# -# Therefore, a good pattern to follow is to ratelimit the metrics coming out of -# spanmetrics by adding a prometheus exporter (to expose these metrics as snapshots) -# and a prometheus receiver to scrape these snapshots at a controlled interval, -# passing these scraped metrics onto the prometheusremotewrite exporter. -# -# The added benefit of this pattern is that it provides a regular "heartbeat" of -# datapoints that prevents gaps in the timeseries. -receivers: - jaeger: - protocols: - thrift_http: - endpoint: "0.0.0.0:14278" - - # Dummy receiver that's never used, because a pipeline is required to have one. - otlp/spanmetrics: - protocols: - grpc: - endpoint: "localhost:12345" - - prometheus: - config: - scrape_configs: - - job_name: 'ratelimiter' - scrape_interval: 15s - static_configs: - - targets: [ "0.0.0.0:8889" ] - -exporters: - prometheus: - endpoint: "0.0.0.0:8889" - - jaeger: - endpoint: "localhost:14250" - tls: - insecure: true - - prometheusremotewrite: - endpoint: "http://myremotewriteendpoint:1234" - headers: - Authorization: "Bearer mybearertoken" - -processors: - batch: - spanmetrics: - metrics_exporter: prometheus - -service: - pipelines: - traces: - receivers: [jaeger] - # spanmetrics will pass on span data untouched to next processor - # while also accumulating metrics to be sent to the configured 'otlp/spanmetrics' exporter. - processors: [spanmetrics, batch] - exporters: [jaeger] - - # This pipeline acts as a proxy to the 'metrics' pipeline below, - # allowing for further metrics processing if required. - metrics/spanmetrics: - # This receiver is just a dummy and never used. - # Added to pass validation requiring at least one receiver in a pipeline. - receivers: [otlp/spanmetrics] - exporters: [prometheus] - - metrics: - receivers: [prometheus] - # The metrics_exporter must be present in this list. - exporters: [prometheusremotewrite] diff --git a/processor/spanmetricsprocessor/testdata/config-simplest.yaml b/processor/spanmetricsprocessor/testdata/config-simplest.yaml deleted file mode 100644 index 767cc0780ab5..000000000000 --- a/processor/spanmetricsprocessor/testdata/config-simplest.yaml +++ /dev/null @@ -1,43 +0,0 @@ -# A minimal configuration where spanprocessor optional config entries are omitted, -# accepting defaults. Note that metrics are exported directly to prometheus in this case. -receivers: - jaeger: - protocols: - thrift_http: - endpoint: "0.0.0.0:14278" - - # Dummy receiver that's never used, because a pipeline is required to have one. - otlp/spanmetrics: - protocols: - grpc: - endpoint: "localhost:12345" - -exporters: - prometheus: - endpoint: "0.0.0.0:8889" - - jaeger: - endpoint: "localhost:14250" - tls: - insecure: true - -processors: - batch: - spanmetrics: - metrics_exporter: prometheus - -service: - pipelines: - traces: - receivers: [jaeger] - # spanmetrics will pass on span data untouched to next processor - # while also accumulating metrics to be sent to the configured 'prometheus' exporter. - processors: [spanmetrics, batch] - exporters: [jaeger] - - metrics: - # This receiver is just a dummy and never used. - # Added to pass validation requiring at least one receiver in a pipeline. - receivers: [otlp/spanmetrics] - # The metrics_exporter must be present in this list. - exporters: [prometheus] diff --git a/processor/spanmetricsprocessor/testdata/config.yaml b/processor/spanmetricsprocessor/testdata/config.yaml deleted file mode 100644 index 7e1ecdf8cc50..000000000000 --- a/processor/spanmetricsprocessor/testdata/config.yaml +++ /dev/null @@ -1,44 +0,0 @@ -# Config with explicit dimensions cache size configuration parameter -spanmetrics/dimensions: - metrics_exporter: prometheus - dimensions_cache_size: 500 - -# Config with explicit aggregation temporality configuration parameter -spanmetrics/temp: - metrics_exporter: otlp/spanmetrics - aggregation_temporality: "AGGREGATION_TEMPORALITY_CUMULATIVE" - - -# The config with all possible configuration parameters -spanmetrics/full: - metrics_exporter: otlp/spanmetrics - latency_histogram_buckets: [100us, 1ms, 2ms, 6ms, 10ms, 100ms, 250ms] - dimensions_cache_size: 1500 - - # Additional list of dimensions on top of: - # - service.name - # - operation - # - span.kind - # - status.code - dimensions: - # If the span is missing http.method, the processor will insert - # the http.method dimension with value 'GET'. - # For example, in the following scenario, http.method is not present in a span and so will be added as a dimension to the metric with value "GET": - # - calls_total{http_method="GET",operation="/Address",service_name="shippingservice",span_kind="SPAN_KIND_SERVER",status_code="STATUS_CODE_UNSET"} 1 - - name: http.method - default: GET - - # If a default is not provided, the http.status_code dimension will be omitted - # if the span does not contain http.status_code. - # For example, consider a scenario with two spans, one span having http.status_code=200 and another missing http.status_code. Two metrics would result with this configuration, one with the http_status_code omitted and the other included: - # - calls_total{http_status_code="200",operation="/Address",service_name="shippingservice",span_kind="SPAN_KIND_SERVER",status_code="STATUS_CODE_UNSET"} 1 - # - calls_total{operation="/Address",service_name="shippingservice",span_kind="SPAN_KIND_SERVER",status_code="STATUS_CODE_UNSET"} 1 - - name: http.status_code - - # The aggregation temporality of the generated metrics. - # Default: "AGGREGATION_TEMPORALITY_CUMULATIVE" - aggregation_temporality: "AGGREGATION_TEMPORALITY_DELTA" - - # The period on which all metrics (whose dimension keys remain in cache) will be emitted. - # Default: 15s. - metrics_flush_interval: 30s diff --git a/processor/spanprocessor/generated_component_test.go b/processor/spanprocessor/generated_component_test.go index cc4514b6ab2b..9da09da9c53d 100644 --- a/processor/spanprocessor/generated_component_test.go +++ b/processor/spanprocessor/generated_component_test.go @@ -5,28 +5,21 @@ package spanprocessor import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" + "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.opentelemetry.io/collector/processor" "go.opentelemetry.io/collector/processor/processortest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -57,9 +50,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -68,19 +59,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case processor.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case processor.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case processor.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -93,3 +84,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/processor/spanprocessor/go.mod b/processor/spanprocessor/go.mod index aba4b51178b6..7508fa27589d 100644 --- a/processor/spanprocessor/go.mod +++ b/processor/spanprocessor/go.mod @@ -57,7 +57,7 @@ require ( go.opentelemetry.io/otel/sdk v1.23.1 // indirect go.opentelemetry.io/otel/sdk/metric v1.23.1 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.26.0 // indirect + go.uber.org/zap v1.27.0 // indirect golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc // indirect golang.org/x/net v0.20.0 // indirect golang.org/x/sys v0.16.0 // indirect diff --git a/processor/spanprocessor/go.sum b/processor/spanprocessor/go.sum index 6bc71541e03a..d9ff29b3b4f5 100644 --- a/processor/spanprocessor/go.sum +++ b/processor/spanprocessor/go.sum @@ -116,8 +116,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/processor/sumologicprocessor/generated_component_test.go b/processor/sumologicprocessor/generated_component_test.go index 8542cb7fd838..b5c597d28d04 100644 --- a/processor/sumologicprocessor/generated_component_test.go +++ b/processor/sumologicprocessor/generated_component_test.go @@ -5,28 +5,21 @@ package sumologicprocessor import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" + "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.opentelemetry.io/collector/processor" "go.opentelemetry.io/collector/processor/processortest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -71,9 +64,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -82,19 +73,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case processor.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case processor.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case processor.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -107,3 +98,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/processor/sumologicprocessor/go.mod b/processor/sumologicprocessor/go.mod index 20b99beadc0e..ba6491b4eb74 100644 --- a/processor/sumologicprocessor/go.mod +++ b/processor/sumologicprocessor/go.mod @@ -3,7 +3,6 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/processor/sumol go 1.21 require ( - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.95.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.95.0 go.opentelemetry.io/collector/confmap v0.95.0 @@ -15,7 +14,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( @@ -88,6 +87,7 @@ require ( go.opentelemetry.io/otel/sdk/metric v1.23.1 // indirect go.opentelemetry.io/proto/otlp v1.1.0 // indirect go.uber.org/multierr v1.11.0 // indirect + golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 // indirect golang.org/x/net v0.20.0 // indirect golang.org/x/sys v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect @@ -98,11 +98,3 @@ require ( google.golang.org/protobuf v1.32.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil => ../../pkg/pdatautil - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden - -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal => ../../internal/coreinternal diff --git a/processor/sumologicprocessor/go.sum b/processor/sumologicprocessor/go.sum index a04e93caadec..74aa5e450c44 100644 --- a/processor/sumologicprocessor/go.sum +++ b/processor/sumologicprocessor/go.sum @@ -228,8 +228,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/processor/tailsamplingprocessor/generated_component_test.go b/processor/tailsamplingprocessor/generated_component_test.go index db4d577b3811..6381259b3ffd 100644 --- a/processor/tailsamplingprocessor/generated_component_test.go +++ b/processor/tailsamplingprocessor/generated_component_test.go @@ -5,28 +5,21 @@ package tailsamplingprocessor import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" + "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.opentelemetry.io/collector/processor" "go.opentelemetry.io/collector/processor/processortest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -57,9 +50,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -68,19 +59,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case processor.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case processor.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case processor.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -93,3 +84,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/processor/tailsamplingprocessor/go.mod b/processor/tailsamplingprocessor/go.mod index b13533c84f19..ad0d5b717baa 100644 --- a/processor/tailsamplingprocessor/go.mod +++ b/processor/tailsamplingprocessor/go.mod @@ -20,7 +20,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/processor/tailsamplingprocessor/go.sum b/processor/tailsamplingprocessor/go.sum index bfbd4508fb63..39cc1fc9c112 100644 --- a/processor/tailsamplingprocessor/go.sum +++ b/processor/tailsamplingprocessor/go.sum @@ -152,8 +152,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/processor/transformprocessor/generated_component_test.go b/processor/transformprocessor/generated_component_test.go index 7733983b756d..3a39289897ef 100644 --- a/processor/transformprocessor/generated_component_test.go +++ b/processor/transformprocessor/generated_component_test.go @@ -5,28 +5,21 @@ package transformprocessor import ( "context" "testing" + "time" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" + "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.opentelemetry.io/collector/processor" "go.opentelemetry.io/collector/processor/processortest" - - "go.opentelemetry.io/collector/confmap/confmaptest" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -71,9 +64,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -82,19 +73,19 @@ func TestComponentLifecycle(t *testing.T) { require.NotPanics(t, func() { switch e := c.(type) { case processor.Logs: - logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + logs := generateLifecycleTestLogs() if !e.Capabilities().MutatesData { logs.MarkReadOnly() } err = e.ConsumeLogs(context.Background(), logs) case processor.Metrics: - metrics := testdata.GenerateMetricsTwoMetrics() + metrics := generateLifecycleTestMetrics() if !e.Capabilities().MutatesData { metrics.MarkReadOnly() } err = e.ConsumeMetrics(context.Background(), metrics) case processor.Traces: - traces := testdata.GenerateTracesTwoSpansSameResource() + traces := generateLifecycleTestTraces() if !e.Capabilities().MutatesData { traces.MarkReadOnly() } @@ -107,3 +98,38 @@ func TestComponentLifecycle(t *testing.T) { }) } } + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/processor/transformprocessor/go.mod b/processor/transformprocessor/go.mod index 49caa567853c..2c14bb290301 100644 --- a/processor/transformprocessor/go.mod +++ b/processor/transformprocessor/go.mod @@ -4,7 +4,6 @@ go 1.21 require ( github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.95.0 - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.95.0 github.com/stretchr/testify v1.8.4 @@ -18,7 +17,7 @@ require ( go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( @@ -44,6 +43,7 @@ require ( github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.95.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.95.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_golang v1.18.0 // indirect diff --git a/processor/transformprocessor/go.sum b/processor/transformprocessor/go.sum index 8c0eca6681b6..583a538c1584 100644 --- a/processor/transformprocessor/go.sum +++ b/processor/transformprocessor/go.sum @@ -112,8 +112,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/activedirectorydsreceiver/README.md b/receiver/activedirectorydsreceiver/README.md index 338cbde1df61..69ddd4087489 100644 --- a/receiver/activedirectorydsreceiver/README.md +++ b/receiver/activedirectorydsreceiver/README.md @@ -6,7 +6,7 @@ | Stability | [beta]: metrics | | Distributions | [contrib], [observiq], [sumo] | | Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Areceiver%2Factivedirectoryds%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Areceiver%2Factivedirectoryds) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Areceiver%2Factivedirectoryds%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Areceiver%2Factivedirectoryds) | -| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@djaglowski](https://www.github.com/djaglowski), [@BinaryFissionGames](https://www.github.com/BinaryFissionGames) | +| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@djaglowski](https://www.github.com/djaglowski), [@BinaryFissionGames](https://www.github.com/BinaryFissionGames) \| Seeking more code owners! | [beta]: https://github.com/open-telemetry/opentelemetry-collector#beta [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib diff --git a/receiver/activedirectorydsreceiver/go.mod b/receiver/activedirectorydsreceiver/go.mod index 0417a5b95555..2ecb4b274960 100644 --- a/receiver/activedirectorydsreceiver/go.mod +++ b/receiver/activedirectorydsreceiver/go.mod @@ -17,7 +17,7 @@ require ( go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/activedirectorydsreceiver/go.sum b/receiver/activedirectorydsreceiver/go.sum index dce80dc70e96..213c963f8055 100644 --- a/receiver/activedirectorydsreceiver/go.sum +++ b/receiver/activedirectorydsreceiver/go.sum @@ -94,8 +94,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/activedirectorydsreceiver/metadata.yaml b/receiver/activedirectorydsreceiver/metadata.yaml index 57cff4929074..9459a4ee6fdd 100644 --- a/receiver/activedirectorydsreceiver/metadata.yaml +++ b/receiver/activedirectorydsreceiver/metadata.yaml @@ -7,6 +7,8 @@ status: distributions: [contrib, observiq, sumo] codeowners: active: [djaglowski, BinaryFissionGames] + seeking_new: true + unsupported_platforms: [darwin, linux] attributes: direction: @@ -208,3 +210,8 @@ metrics: aggregation_temporality: cumulative value_type: double enabled: true + +# TODO: Update the receiver to pass the tests +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/receiver/aerospikereceiver/README.md b/receiver/aerospikereceiver/README.md index 2a3a41e12ada..8c8bbc80ffd3 100644 --- a/receiver/aerospikereceiver/README.md +++ b/receiver/aerospikereceiver/README.md @@ -6,7 +6,7 @@ | Stability | [alpha]: metrics | | Distributions | [contrib], [observiq], [sumo] | | Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Areceiver%2Faerospike%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Areceiver%2Faerospike) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Areceiver%2Faerospike%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Areceiver%2Faerospike) | -| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@djaglowski](https://www.github.com/djaglowski), [@antonblock](https://www.github.com/antonblock) | +| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@djaglowski](https://www.github.com/djaglowski), [@antonblock](https://www.github.com/antonblock) \| Seeking more code owners! | [alpha]: https://github.com/open-telemetry/opentelemetry-collector#alpha [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib diff --git a/receiver/aerospikereceiver/generated_component_test.go b/receiver/aerospikereceiver/generated_component_test.go index 578febbe0a07..124e5f195923 100644 --- a/receiver/aerospikereceiver/generated_component_test.go +++ b/receiver/aerospikereceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/aerospikereceiver/go.mod b/receiver/aerospikereceiver/go.mod index fc7fc569923f..1ed763b025d0 100644 --- a/receiver/aerospikereceiver/go.mod +++ b/receiver/aerospikereceiver/go.mod @@ -21,7 +21,7 @@ require ( go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/aerospikereceiver/go.sum b/receiver/aerospikereceiver/go.sum index dbc20ebabe5e..754916fc89ae 100644 --- a/receiver/aerospikereceiver/go.sum +++ b/receiver/aerospikereceiver/go.sum @@ -192,8 +192,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/aerospikereceiver/metadata.yaml b/receiver/aerospikereceiver/metadata.yaml index 2bee22a609ab..7249af1abfa6 100644 --- a/receiver/aerospikereceiver/metadata.yaml +++ b/receiver/aerospikereceiver/metadata.yaml @@ -7,6 +7,7 @@ status: distributions: [contrib, observiq, sumo] codeowners: active: [djaglowski, antonblock] + seeking_new: true resource_attributes: aerospike.node.name: @@ -248,6 +249,3 @@ metrics: input_type: string monotonic: true aggregation_temporality: cumulative - -tests: - config: diff --git a/receiver/apachereceiver/generated_component_test.go b/receiver/apachereceiver/generated_component_test.go index 2f2908694978..6211b6eafbe7 100644 --- a/receiver/apachereceiver/generated_component_test.go +++ b/receiver/apachereceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/apachereceiver/go.mod b/receiver/apachereceiver/go.mod index c7bd78e0af07..c73f3c54755a 100644 --- a/receiver/apachereceiver/go.mod +++ b/receiver/apachereceiver/go.mod @@ -19,7 +19,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/apachereceiver/go.sum b/receiver/apachereceiver/go.sum index efee19ab5599..1a04b670bfb6 100644 --- a/receiver/apachereceiver/go.sum +++ b/receiver/apachereceiver/go.sum @@ -203,8 +203,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/apachereceiver/metadata.yaml b/receiver/apachereceiver/metadata.yaml index 83d51a319898..a5bec812ed4a 100644 --- a/receiver/apachereceiver/metadata.yaml +++ b/receiver/apachereceiver/metadata.yaml @@ -173,6 +173,3 @@ metrics: monotonic: false aggregation_temporality: cumulative attributes: [scoreboard_state] - -tests: - config: diff --git a/receiver/apachesparkreceiver/generated_component_test.go b/receiver/apachesparkreceiver/generated_component_test.go index da9dfc0d2ec7..3fdd6702728a 100644 --- a/receiver/apachesparkreceiver/generated_component_test.go +++ b/receiver/apachesparkreceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/apachesparkreceiver/go.mod b/receiver/apachesparkreceiver/go.mod index 2fa6cc3cbb6e..4816df997c48 100644 --- a/receiver/apachesparkreceiver/go.mod +++ b/receiver/apachesparkreceiver/go.mod @@ -18,7 +18,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/apachesparkreceiver/go.sum b/receiver/apachesparkreceiver/go.sum index 857320d7736c..171d4c1f6cc3 100644 --- a/receiver/apachesparkreceiver/go.sum +++ b/receiver/apachesparkreceiver/go.sum @@ -204,8 +204,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/awscloudwatchmetricsreceiver/generated_component_test.go b/receiver/awscloudwatchmetricsreceiver/generated_component_test.go index 0bebbfc1789e..1fd4d58323cb 100644 --- a/receiver/awscloudwatchmetricsreceiver/generated_component_test.go +++ b/receiver/awscloudwatchmetricsreceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/awscloudwatchmetricsreceiver/go.mod b/receiver/awscloudwatchmetricsreceiver/go.mod index dc2e59fa6be7..c060e70601cc 100644 --- a/receiver/awscloudwatchmetricsreceiver/go.mod +++ b/receiver/awscloudwatchmetricsreceiver/go.mod @@ -11,7 +11,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/awscloudwatchmetricsreceiver/go.sum b/receiver/awscloudwatchmetricsreceiver/go.sum index 719c6cc274cb..62432b79162a 100644 --- a/receiver/awscloudwatchmetricsreceiver/go.sum +++ b/receiver/awscloudwatchmetricsreceiver/go.sum @@ -94,8 +94,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/awscloudwatchreceiver/README.md b/receiver/awscloudwatchreceiver/README.md index 801b14c7997f..dfcf39249328 100644 --- a/receiver/awscloudwatchreceiver/README.md +++ b/receiver/awscloudwatchreceiver/README.md @@ -6,7 +6,7 @@ | Stability | [alpha]: logs | | Distributions | [contrib], [observiq], [sumo] | | Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Areceiver%2Fawscloudwatch%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Areceiver%2Fawscloudwatch) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Areceiver%2Fawscloudwatch%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Areceiver%2Fawscloudwatch) | -| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@djaglowski](https://www.github.com/djaglowski), [@schmikei](https://www.github.com/schmikei) | +| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@djaglowski](https://www.github.com/djaglowski), [@schmikei](https://www.github.com/schmikei) \| Seeking more code owners! | [alpha]: https://github.com/open-telemetry/opentelemetry-collector#alpha [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib diff --git a/receiver/awscloudwatchreceiver/generated_component_test.go b/receiver/awscloudwatchreceiver/generated_component_test.go index f0abe66e5225..271cdd14ee29 100644 --- a/receiver/awscloudwatchreceiver/generated_component_test.go +++ b/receiver/awscloudwatchreceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/awscloudwatchreceiver/go.mod b/receiver/awscloudwatchreceiver/go.mod index b906c8ddb046..6b597bbda886 100644 --- a/receiver/awscloudwatchreceiver/go.mod +++ b/receiver/awscloudwatchreceiver/go.mod @@ -3,7 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awsclo go 1.21 require ( - github.com/aws/aws-sdk-go v1.50.17 + github.com/aws/aws-sdk-go v1.50.27 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.95.0 github.com/stretchr/testify v1.8.4 @@ -15,7 +15,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/awscloudwatchreceiver/go.sum b/receiver/awscloudwatchreceiver/go.sum index bb5859c3aa2d..09a7e2bd4d14 100644 --- a/receiver/awscloudwatchreceiver/go.sum +++ b/receiver/awscloudwatchreceiver/go.sum @@ -1,5 +1,5 @@ -github.com/aws/aws-sdk-go v1.50.17 h1:KsbzUKDgGNlkDHGvoQDhiJ63a9jtZd+O+/s3pTOr/ns= -github.com/aws/aws-sdk-go v1.50.17/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.50.27 h1:96ifhrSuja+AzdP3W/T2337igqVQ2FcSIJYkk+0rCeA= +github.com/aws/aws-sdk-go v1.50.27/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= @@ -105,8 +105,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/awscloudwatchreceiver/metadata.yaml b/receiver/awscloudwatchreceiver/metadata.yaml index 11a375a93ad6..18323ce0ca51 100644 --- a/receiver/awscloudwatchreceiver/metadata.yaml +++ b/receiver/awscloudwatchreceiver/metadata.yaml @@ -7,6 +7,7 @@ status: distributions: [contrib, observiq, sumo] codeowners: active: [djaglowski, schmikei] + seeking_new: true tests: config: diff --git a/receiver/awscontainerinsightreceiver/generated_component_test.go b/receiver/awscontainerinsightreceiver/generated_component_test.go index ee5e63f39a30..143f89a86bdf 100644 --- a/receiver/awscontainerinsightreceiver/generated_component_test.go +++ b/receiver/awscontainerinsightreceiver/generated_component_test.go @@ -8,23 +8,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,22 +44,5 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - require.NoError(t, err) - require.NoError(t, firstRcvr.Start(context.Background(), host)) - require.NoError(t, firstRcvr.Shutdown(context.Background())) - secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - require.NoError(t, secondRcvr.Start(context.Background(), host)) - require.NoError(t, secondRcvr.Shutdown(context.Background())) - }) } } diff --git a/receiver/awscontainerinsightreceiver/go.mod b/receiver/awscontainerinsightreceiver/go.mod index f5f164ca91aa..85ae8568bfc6 100644 --- a/receiver/awscontainerinsightreceiver/go.mod +++ b/receiver/awscontainerinsightreceiver/go.mod @@ -3,7 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awscon go 1.21 require ( - github.com/aws/aws-sdk-go v1.50.17 + github.com/aws/aws-sdk-go v1.50.27 github.com/google/cadvisor v0.48.1 github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/awsutil v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/containerinsight v0.95.0 @@ -22,7 +22,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 k8s.io/api v0.29.2 k8s.io/apimachinery v0.29.2 k8s.io/client-go v0.29.2 diff --git a/receiver/awscontainerinsightreceiver/go.sum b/receiver/awscontainerinsightreceiver/go.sum index 25aff89d014f..c7660d2285b7 100644 --- a/receiver/awscontainerinsightreceiver/go.sum +++ b/receiver/awscontainerinsightreceiver/go.sum @@ -38,8 +38,8 @@ github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb0 github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/aws/aws-sdk-go v1.50.17 h1:KsbzUKDgGNlkDHGvoQDhiJ63a9jtZd+O+/s3pTOr/ns= -github.com/aws/aws-sdk-go v1.50.17/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.50.27 h1:96ifhrSuja+AzdP3W/T2337igqVQ2FcSIJYkk+0rCeA= +github.com/aws/aws-sdk-go v1.50.27/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= 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/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= @@ -435,8 +435,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= diff --git a/receiver/awscontainerinsightreceiver/metadata.yaml b/receiver/awscontainerinsightreceiver/metadata.yaml index ab16d85dbf6f..fb1e6797281b 100644 --- a/receiver/awscontainerinsightreceiver/metadata.yaml +++ b/receiver/awscontainerinsightreceiver/metadata.yaml @@ -9,6 +9,6 @@ status: codeowners: active: [Aneurysm9, pxaws] +# TODO: Update the receiver to pass the tests tests: - config: skip_lifecycle: true diff --git a/receiver/awsecscontainermetricsreceiver/go.mod b/receiver/awsecscontainermetricsreceiver/go.mod index e6e7f8bc19f9..b339f3140254 100644 --- a/receiver/awsecscontainermetricsreceiver/go.mod +++ b/receiver/awsecscontainermetricsreceiver/go.mod @@ -3,7 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awsecs go 1.21 require ( - github.com/aws/aws-sdk-go v1.50.17 + github.com/aws/aws-sdk-go v1.50.27 github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/ecsutil v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.95.0 github.com/stretchr/testify v1.8.4 @@ -17,7 +17,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/awsecscontainermetricsreceiver/go.sum b/receiver/awsecscontainermetricsreceiver/go.sum index fcd163736c73..099b659ee9a9 100644 --- a/receiver/awsecscontainermetricsreceiver/go.sum +++ b/receiver/awsecscontainermetricsreceiver/go.sum @@ -1,5 +1,5 @@ -github.com/aws/aws-sdk-go v1.50.17 h1:KsbzUKDgGNlkDHGvoQDhiJ63a9jtZd+O+/s3pTOr/ns= -github.com/aws/aws-sdk-go v1.50.17/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.50.27 h1:96ifhrSuja+AzdP3W/T2337igqVQ2FcSIJYkk+0rCeA= +github.com/aws/aws-sdk-go v1.50.27/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= @@ -132,8 +132,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/awsecscontainermetricsreceiver/metadata.yaml b/receiver/awsecscontainermetricsreceiver/metadata.yaml index d51d95cc9de9..bb64c684c61d 100644 --- a/receiver/awsecscontainermetricsreceiver/metadata.yaml +++ b/receiver/awsecscontainermetricsreceiver/metadata.yaml @@ -7,3 +7,8 @@ status: distributions: [contrib, aws, observiq, sumo] codeowners: active: [Aneurysm9] + +# TODO: Update the receiver to pass the tests +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/receiver/awsfirehosereceiver/generated_component_test.go b/receiver/awsfirehosereceiver/generated_component_test.go index 57c8684fa755..433dd2fe85ca 100644 --- a/receiver/awsfirehosereceiver/generated_component_test.go +++ b/receiver/awsfirehosereceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/awsfirehosereceiver/go.mod b/receiver/awsfirehosereceiver/go.mod index 37c5ee61a6ef..71bde1d13b6f 100644 --- a/receiver/awsfirehosereceiver/go.mod +++ b/receiver/awsfirehosereceiver/go.mod @@ -17,7 +17,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/awsfirehosereceiver/go.sum b/receiver/awsfirehosereceiver/go.sum index 6696903d5a6f..00191bd6769f 100644 --- a/receiver/awsfirehosereceiver/go.sum +++ b/receiver/awsfirehosereceiver/go.sum @@ -128,8 +128,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/awsxrayreceiver/go.mod b/receiver/awsxrayreceiver/go.mod index a405f75629c6..1b3f975ffde1 100644 --- a/receiver/awsxrayreceiver/go.mod +++ b/receiver/awsxrayreceiver/go.mod @@ -3,7 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awsxra go 1.21 require ( - github.com/aws/aws-sdk-go v1.50.17 + github.com/aws/aws-sdk-go v1.50.27 github.com/google/go-cmp v0.6.0 github.com/google/uuid v1.6.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/proxy v0.95.0 @@ -23,7 +23,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/awsxrayreceiver/go.sum b/receiver/awsxrayreceiver/go.sum index fa82788fc623..9c508345a460 100644 --- a/receiver/awsxrayreceiver/go.sum +++ b/receiver/awsxrayreceiver/go.sum @@ -1,5 +1,5 @@ -github.com/aws/aws-sdk-go v1.50.17 h1:KsbzUKDgGNlkDHGvoQDhiJ63a9jtZd+O+/s3pTOr/ns= -github.com/aws/aws-sdk-go v1.50.17/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.50.27 h1:96ifhrSuja+AzdP3W/T2337igqVQ2FcSIJYkk+0rCeA= +github.com/aws/aws-sdk-go v1.50.27/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= @@ -118,8 +118,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/awsxrayreceiver/metadata.yaml b/receiver/awsxrayreceiver/metadata.yaml index a7b197099a08..fe3999c18a28 100644 --- a/receiver/awsxrayreceiver/metadata.yaml +++ b/receiver/awsxrayreceiver/metadata.yaml @@ -6,4 +6,9 @@ status: beta: [traces] distributions: [contrib, aws, observiq, sumo] codeowners: - active: [wangzlei, srprash] \ No newline at end of file + active: [wangzlei, srprash] + +# TODO: Update the receiver to make the tests pass +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/receiver/azureblobreceiver/generated_component_test.go b/receiver/azureblobreceiver/generated_component_test.go index 500866ae200a..f73afbe84fe4 100644 --- a/receiver/azureblobreceiver/generated_component_test.go +++ b/receiver/azureblobreceiver/generated_component_test.go @@ -8,23 +8,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -62,22 +51,5 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - require.NoError(t, err) - require.NoError(t, firstRcvr.Start(context.Background(), host)) - require.NoError(t, firstRcvr.Shutdown(context.Background())) - secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - require.NoError(t, secondRcvr.Start(context.Background(), host)) - require.NoError(t, secondRcvr.Shutdown(context.Background())) - }) } } diff --git a/receiver/azureblobreceiver/go.mod b/receiver/azureblobreceiver/go.mod index 64054b71bb49..3cf3f5f612dd 100644 --- a/receiver/azureblobreceiver/go.mod +++ b/receiver/azureblobreceiver/go.mod @@ -16,7 +16,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/azureblobreceiver/go.sum b/receiver/azureblobreceiver/go.sum index 6513640d0fb4..6f3e1c80d7e8 100644 --- a/receiver/azureblobreceiver/go.sum +++ b/receiver/azureblobreceiver/go.sum @@ -300,8 +300,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/azureblobreceiver/metadata.yaml b/receiver/azureblobreceiver/metadata.yaml index d9cbacf8e7d8..1543d785c020 100644 --- a/receiver/azureblobreceiver/metadata.yaml +++ b/receiver/azureblobreceiver/metadata.yaml @@ -8,6 +8,7 @@ status: codeowners: active: [eedorenko, mx-psi] +# TODO: Update the exporter to pass the tests tests: config: connection_string: DefaultEndpointsProtocol=https;AccountName=accountName;AccountKey=+idLkHYcL0MUWIKYHm2j4Q==;EndpointSuffix=core.windows.net diff --git a/receiver/azureeventhubreceiver/README.md b/receiver/azureeventhubreceiver/README.md index f7621f9f12c9..25ec75f8cb7e 100644 --- a/receiver/azureeventhubreceiver/README.md +++ b/receiver/azureeventhubreceiver/README.md @@ -6,7 +6,7 @@ | Stability | [alpha]: metrics, logs | | Distributions | [contrib], [observiq], [splunk], [sumo] | | Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Areceiver%2Fazureeventhub%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Areceiver%2Fazureeventhub) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Areceiver%2Fazureeventhub%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Areceiver%2Fazureeventhub) | -| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@atoulme](https://www.github.com/atoulme), [@djaglowski](https://www.github.com/djaglowski), [@cparkins](https://www.github.com/cparkins) | +| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@atoulme](https://www.github.com/atoulme), [@djaglowski](https://www.github.com/djaglowski), [@cparkins](https://www.github.com/cparkins) \| Seeking more code owners! | [alpha]: https://github.com/open-telemetry/opentelemetry-collector#alpha [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib diff --git a/receiver/azureeventhubreceiver/generated_component_test.go b/receiver/azureeventhubreceiver/generated_component_test.go index b0f794eba7c0..668a50791266 100644 --- a/receiver/azureeventhubreceiver/generated_component_test.go +++ b/receiver/azureeventhubreceiver/generated_component_test.go @@ -8,23 +8,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -62,22 +51,5 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - require.NoError(t, err) - require.NoError(t, firstRcvr.Start(context.Background(), host)) - require.NoError(t, firstRcvr.Shutdown(context.Background())) - secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - require.NoError(t, secondRcvr.Start(context.Background(), host)) - require.NoError(t, secondRcvr.Shutdown(context.Background())) - }) } } diff --git a/receiver/azureeventhubreceiver/go.mod b/receiver/azureeventhubreceiver/go.mod index a7527db0eca0..91cbaab309e0 100644 --- a/receiver/azureeventhubreceiver/go.mod +++ b/receiver/azureeventhubreceiver/go.mod @@ -21,7 +21,7 @@ require ( go.opentelemetry.io/collector/semconv v0.95.0 go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/azureeventhubreceiver/go.sum b/receiver/azureeventhubreceiver/go.sum index 63f6a3fdec2e..1fca5ff66341 100644 --- a/receiver/azureeventhubreceiver/go.sum +++ b/receiver/azureeventhubreceiver/go.sum @@ -292,8 +292,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/azureeventhubreceiver/metadata.yaml b/receiver/azureeventhubreceiver/metadata.yaml index c2801a03efc3..8b4e481cc459 100644 --- a/receiver/azureeventhubreceiver/metadata.yaml +++ b/receiver/azureeventhubreceiver/metadata.yaml @@ -7,6 +7,7 @@ status: distributions: [contrib, splunk, observiq, sumo] codeowners: active: [atoulme, djaglowski, cparkins] + seeking_new: true tests: config: diff --git a/receiver/azuremonitorreceiver/generated_component_test.go b/receiver/azuremonitorreceiver/generated_component_test.go index 10b69303e405..972607e3e4fb 100644 --- a/receiver/azuremonitorreceiver/generated_component_test.go +++ b/receiver/azuremonitorreceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/azuremonitorreceiver/go.mod b/receiver/azuremonitorreceiver/go.mod index 0930fa7a93df..a0a5c081afca 100644 --- a/receiver/azuremonitorreceiver/go.mod +++ b/receiver/azuremonitorreceiver/go.mod @@ -20,7 +20,7 @@ require ( go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/azuremonitorreceiver/go.sum b/receiver/azuremonitorreceiver/go.sum index 7e4e6b8724a1..0170cc5555af 100644 --- a/receiver/azuremonitorreceiver/go.sum +++ b/receiver/azuremonitorreceiver/go.sum @@ -120,8 +120,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/bigipreceiver/README.md b/receiver/bigipreceiver/README.md index acc85b4e5075..03038f7b22f5 100644 --- a/receiver/bigipreceiver/README.md +++ b/receiver/bigipreceiver/README.md @@ -6,7 +6,7 @@ | Stability | [beta]: metrics | | Distributions | [contrib], [observiq], [sumo] | | Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Areceiver%2Fbigip%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Areceiver%2Fbigip) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Areceiver%2Fbigip%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Areceiver%2Fbigip) | -| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@djaglowski](https://www.github.com/djaglowski), [@StefanKurek](https://www.github.com/StefanKurek) | +| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@djaglowski](https://www.github.com/djaglowski), [@StefanKurek](https://www.github.com/StefanKurek) \| Seeking more code owners! | [beta]: https://github.com/open-telemetry/opentelemetry-collector#beta [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib diff --git a/receiver/bigipreceiver/generated_component_test.go b/receiver/bigipreceiver/generated_component_test.go index 8690b68ddff6..8dfc0bc1ea3b 100644 --- a/receiver/bigipreceiver/generated_component_test.go +++ b/receiver/bigipreceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/bigipreceiver/go.mod b/receiver/bigipreceiver/go.mod index 3ffbb8d7ed1d..3c08919c6cca 100644 --- a/receiver/bigipreceiver/go.mod +++ b/receiver/bigipreceiver/go.mod @@ -20,7 +20,7 @@ require ( go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/bigipreceiver/go.sum b/receiver/bigipreceiver/go.sum index 857320d7736c..171d4c1f6cc3 100644 --- a/receiver/bigipreceiver/go.sum +++ b/receiver/bigipreceiver/go.sum @@ -204,8 +204,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/bigipreceiver/metadata.yaml b/receiver/bigipreceiver/metadata.yaml index da040235361a..9fc5c77984b5 100644 --- a/receiver/bigipreceiver/metadata.yaml +++ b/receiver/bigipreceiver/metadata.yaml @@ -7,6 +7,7 @@ status: distributions: [contrib, observiq, sumo] codeowners: active: [djaglowski, StefanKurek] + seeking_new: true resource_attributes: bigip.virtual_server.name: @@ -286,6 +287,3 @@ metrics: value_type: int attributes: [enabled.status] enabled: true - -tests: - config: diff --git a/receiver/carbonreceiver/generated_component_test.go b/receiver/carbonreceiver/generated_component_test.go index 1c3348241a94..00ba32db9799 100644 --- a/receiver/carbonreceiver/generated_component_test.go +++ b/receiver/carbonreceiver/generated_component_test.go @@ -8,23 +8,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,22 +44,5 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - require.NoError(t, err) - require.NoError(t, firstRcvr.Start(context.Background(), host)) - require.NoError(t, firstRcvr.Shutdown(context.Background())) - secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - require.NoError(t, secondRcvr.Start(context.Background(), host)) - require.NoError(t, secondRcvr.Shutdown(context.Background())) - }) } } diff --git a/receiver/carbonreceiver/go.mod b/receiver/carbonreceiver/go.mod index 6338324f66ee..a9ba7d772459 100644 --- a/receiver/carbonreceiver/go.mod +++ b/receiver/carbonreceiver/go.mod @@ -15,7 +15,7 @@ require ( go.opentelemetry.io/otel/sdk v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/carbonreceiver/go.sum b/receiver/carbonreceiver/go.sum index 0d9804408d4c..1df6fac2c6d4 100644 --- a/receiver/carbonreceiver/go.sum +++ b/receiver/carbonreceiver/go.sum @@ -100,8 +100,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/carbonreceiver/metadata.yaml b/receiver/carbonreceiver/metadata.yaml index 194e14c46e45..e105b8390a46 100644 --- a/receiver/carbonreceiver/metadata.yaml +++ b/receiver/carbonreceiver/metadata.yaml @@ -8,6 +8,6 @@ status: codeowners: active: [aboguszewski-sumo] +# TODO: Update the exporter to pass the tests tests: - config: skip_lifecycle: true diff --git a/receiver/chronyreceiver/factory.go b/receiver/chronyreceiver/factory.go index ac0195111481..3ca0008dab82 100644 --- a/receiver/chronyreceiver/factory.go +++ b/receiver/chronyreceiver/factory.go @@ -34,13 +34,15 @@ func newMetricsReceiver( return nil, fmt.Errorf("wrong config provided: %w", errInvalidValue) } - chronyc, err := chrony.New(cfg.Endpoint, cfg.Timeout) - if err != nil { - return nil, err - } + s := newScraper(ctx, cfg, set) scraper, err := scraperhelper.NewScraper( metadata.Type.String(), - newScraper(ctx, chronyc, cfg, set).scrape, + s.scrape, + scraperhelper.WithStart(func(ctx context.Context, host component.Host) error { + chronyc, err := chrony.New(cfg.Endpoint, cfg.Timeout) + s.client = chronyc + return err + }), ) if err != nil { return nil, err diff --git a/receiver/chronyreceiver/generated_component_test.go b/receiver/chronyreceiver/generated_component_test.go new file mode 100644 index 000000000000..d788aa646f15 --- /dev/null +++ b/receiver/chronyreceiver/generated_component_test.go @@ -0,0 +1,48 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package chronyreceiver + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/consumer/consumertest" + "go.opentelemetry.io/collector/receiver" + "go.opentelemetry.io/collector/receiver/receivertest" +) + +func TestComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "metrics", + createFn: func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateMetricsReceiver(ctx, set, cfg, consumertest.NewNop()) + }, + }, + } + + cm, err := confmaptest.LoadConf("metadata.yaml") + require.NoError(t, err) + cfg := factory.CreateDefaultConfig() + sub, err := cm.Sub("tests::config") + require.NoError(t, err) + require.NoError(t, component.UnmarshalConfig(sub, cfg)) + + for _, test := range tests { + t.Run(test.name+"-shutdown", func(t *testing.T) { + c, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + } +} diff --git a/receiver/chronyreceiver/go.mod b/receiver/chronyreceiver/go.mod index 8f1dd9f76400..55d63d461971 100644 --- a/receiver/chronyreceiver/go.mod +++ b/receiver/chronyreceiver/go.mod @@ -16,7 +16,7 @@ require ( go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/chronyreceiver/go.sum b/receiver/chronyreceiver/go.sum index 93dd41a98369..f7df57c76c8c 100644 --- a/receiver/chronyreceiver/go.sum +++ b/receiver/chronyreceiver/go.sum @@ -106,8 +106,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/chronyreceiver/metadata.yaml b/receiver/chronyreceiver/metadata.yaml index 50fc1adb4d50..346f16a00bf0 100644 --- a/receiver/chronyreceiver/metadata.yaml +++ b/receiver/chronyreceiver/metadata.yaml @@ -74,3 +74,7 @@ metrics: value_type: double attributes: - leap.status + +# TODO: Update the exporter to pass the tests +tests: + skip_lifecycle: true diff --git a/receiver/chronyreceiver/scraper.go b/receiver/chronyreceiver/scraper.go index f0c6f53b51f9..3ed4426da6a3 100644 --- a/receiver/chronyreceiver/scraper.go +++ b/receiver/chronyreceiver/scraper.go @@ -20,9 +20,8 @@ type chronyScraper struct { mb *metadata.MetricsBuilder } -func newScraper(ctx context.Context, client chrony.Client, cfg *Config, set receiver.CreateSettings) *chronyScraper { +func newScraper(ctx context.Context, cfg *Config, set receiver.CreateSettings) *chronyScraper { return &chronyScraper{ - client: client, mb: metadata.NewMetricsBuilder(cfg.MetricsBuilderConfig, set, metadata.WithStartTime(pcommon.NewTimestampFromTime(clock.FromContext(ctx).Now())), ), diff --git a/receiver/chronyreceiver/scraper_test.go b/receiver/chronyreceiver/scraper_test.go index 53bd23f70d4a..b53e78661d3d 100644 --- a/receiver/chronyreceiver/scraper_test.go +++ b/receiver/chronyreceiver/scraper_test.go @@ -115,7 +115,8 @@ func TestChronyScraper(t *testing.T) { chronym.On("GetTrackingData").Return(tc.mockTracking, tc.mockErr) ctx := clock.Context(context.Background(), clck) - scraper := newScraper(ctx, chronym, tc.conf, receivertest.NewNopCreateSettings()) + scraper := newScraper(ctx, tc.conf, receivertest.NewNopCreateSettings()) + scraper.client = chronym metrics, err := scraper.scrape(ctx) diff --git a/receiver/cloudflarereceiver/README.md b/receiver/cloudflarereceiver/README.md index 974f16e1ec2e..d7f037518439 100644 --- a/receiver/cloudflarereceiver/README.md +++ b/receiver/cloudflarereceiver/README.md @@ -6,7 +6,7 @@ | Stability | [alpha]: logs | | Distributions | [contrib], [observiq], [sumo] | | Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Areceiver%2Fcloudflare%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Areceiver%2Fcloudflare) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Areceiver%2Fcloudflare%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Areceiver%2Fcloudflare) | -| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@dehaansa](https://www.github.com/dehaansa), [@djaglowski](https://www.github.com/djaglowski) | +| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@dehaansa](https://www.github.com/dehaansa), [@djaglowski](https://www.github.com/djaglowski) \| Seeking more code owners! | [alpha]: https://github.com/open-telemetry/opentelemetry-collector#alpha [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib diff --git a/receiver/cloudflarereceiver/generated_component_test.go b/receiver/cloudflarereceiver/generated_component_test.go index d42e6c792254..2a5f91af7e68 100644 --- a/receiver/cloudflarereceiver/generated_component_test.go +++ b/receiver/cloudflarereceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/cloudflarereceiver/go.mod b/receiver/cloudflarereceiver/go.mod index bad30987e38e..c8d047ace1f0 100644 --- a/receiver/cloudflarereceiver/go.mod +++ b/receiver/cloudflarereceiver/go.mod @@ -17,7 +17,7 @@ require ( go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/cloudflarereceiver/go.sum b/receiver/cloudflarereceiver/go.sum index a238d0ee7509..6a4b9ee47eb9 100644 --- a/receiver/cloudflarereceiver/go.sum +++ b/receiver/cloudflarereceiver/go.sum @@ -104,8 +104,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/cloudflarereceiver/metadata.yaml b/receiver/cloudflarereceiver/metadata.yaml index 2742bce9107d..5e08524ff758 100644 --- a/receiver/cloudflarereceiver/metadata.yaml +++ b/receiver/cloudflarereceiver/metadata.yaml @@ -7,6 +7,4 @@ status: distributions: [contrib, observiq, sumo] codeowners: active: [dehaansa, djaglowski] - -tests: - config: + seeking_new: true diff --git a/receiver/cloudfoundryreceiver/generated_component_test.go b/receiver/cloudfoundryreceiver/generated_component_test.go index 1eb595b4151b..7a3551cef00c 100644 --- a/receiver/cloudfoundryreceiver/generated_component_test.go +++ b/receiver/cloudfoundryreceiver/generated_component_test.go @@ -8,23 +8,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,22 +44,5 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - require.NoError(t, err) - require.NoError(t, firstRcvr.Start(context.Background(), host)) - require.NoError(t, firstRcvr.Shutdown(context.Background())) - secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - require.NoError(t, secondRcvr.Start(context.Background(), host)) - require.NoError(t, secondRcvr.Shutdown(context.Background())) - }) } } diff --git a/receiver/cloudfoundryreceiver/go.mod b/receiver/cloudfoundryreceiver/go.mod index a8b3b4358147..18666a82262e 100644 --- a/receiver/cloudfoundryreceiver/go.mod +++ b/receiver/cloudfoundryreceiver/go.mod @@ -17,7 +17,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/cloudfoundryreceiver/go.sum b/receiver/cloudfoundryreceiver/go.sum index 9503a24ecf1a..456f64457026 100644 --- a/receiver/cloudfoundryreceiver/go.sum +++ b/receiver/cloudfoundryreceiver/go.sum @@ -164,8 +164,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/collectdreceiver/generated_component_test.go b/receiver/collectdreceiver/generated_component_test.go index d478481c256b..0be55502cca6 100644 --- a/receiver/collectdreceiver/generated_component_test.go +++ b/receiver/collectdreceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/collectdreceiver/go.mod b/receiver/collectdreceiver/go.mod index c0ce94b89e45..d7d05d4c416b 100644 --- a/receiver/collectdreceiver/go.mod +++ b/receiver/collectdreceiver/go.mod @@ -17,7 +17,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/collectdreceiver/go.sum b/receiver/collectdreceiver/go.sum index b07358504160..1eb8b1e14f3f 100644 --- a/receiver/collectdreceiver/go.sum +++ b/receiver/collectdreceiver/go.sum @@ -126,8 +126,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/collectdreceiver/metadata.yaml b/receiver/collectdreceiver/metadata.yaml index 3796acd9422a..04e7fb48825c 100644 --- a/receiver/collectdreceiver/metadata.yaml +++ b/receiver/collectdreceiver/metadata.yaml @@ -7,6 +7,3 @@ status: distributions: [contrib, splunk, observiq, sumo] codeowners: active: [atoulme] - -tests: - config: diff --git a/receiver/couchdbreceiver/README.md b/receiver/couchdbreceiver/README.md index 250f0a3e9c1f..32d3cc21fd0a 100644 --- a/receiver/couchdbreceiver/README.md +++ b/receiver/couchdbreceiver/README.md @@ -6,7 +6,7 @@ | Stability | [beta]: metrics | | Distributions | [contrib], [observiq], [sumo] | | Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Areceiver%2Fcouchdb%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Areceiver%2Fcouchdb) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Areceiver%2Fcouchdb%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Areceiver%2Fcouchdb) | -| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@djaglowski](https://www.github.com/djaglowski) | +| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@djaglowski](https://www.github.com/djaglowski) \| Seeking more code owners! | [beta]: https://github.com/open-telemetry/opentelemetry-collector#beta [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib diff --git a/receiver/couchdbreceiver/generated_component_test.go b/receiver/couchdbreceiver/generated_component_test.go index 30e2cec7365c..49e5b404c019 100644 --- a/receiver/couchdbreceiver/generated_component_test.go +++ b/receiver/couchdbreceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/couchdbreceiver/go.mod b/receiver/couchdbreceiver/go.mod index f5ca903d7bc2..a0fdf5d5c08c 100644 --- a/receiver/couchdbreceiver/go.mod +++ b/receiver/couchdbreceiver/go.mod @@ -19,7 +19,7 @@ require ( go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/couchdbreceiver/go.sum b/receiver/couchdbreceiver/go.sum index 061fb480a92c..ceaf27566274 100644 --- a/receiver/couchdbreceiver/go.sum +++ b/receiver/couchdbreceiver/go.sum @@ -131,8 +131,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/couchdbreceiver/metadata.yaml b/receiver/couchdbreceiver/metadata.yaml index 06c5b700544b..4e37f82371b9 100644 --- a/receiver/couchdbreceiver/metadata.yaml +++ b/receiver/couchdbreceiver/metadata.yaml @@ -7,6 +7,7 @@ status: distributions: [contrib,observiq, sumo] codeowners: active: [djaglowski] + seeking_new: true resource_attributes: couchdb.node.name: @@ -98,5 +99,3 @@ metrics: monotonic: true aggregation_temporality: cumulative attributes: [ operation ] -tests: - config: \ No newline at end of file diff --git a/receiver/datadogreceiver/generated_component_test.go b/receiver/datadogreceiver/generated_component_test.go new file mode 100644 index 000000000000..02675f4dd58e --- /dev/null +++ b/receiver/datadogreceiver/generated_component_test.go @@ -0,0 +1,61 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package datadogreceiver + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/consumer/consumertest" + "go.opentelemetry.io/collector/receiver" + "go.opentelemetry.io/collector/receiver/receivertest" +) + +func TestComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "traces", + createFn: func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateTracesReceiver(ctx, set, cfg, consumertest.NewNop()) + }, + }, + } + + cm, err := confmaptest.LoadConf("metadata.yaml") + require.NoError(t, err) + cfg := factory.CreateDefaultConfig() + sub, err := cm.Sub("tests::config") + require.NoError(t, err) + require.NoError(t, component.UnmarshalConfig(sub, cfg)) + + for _, test := range tests { + t.Run(test.name+"-shutdown", func(t *testing.T) { + c, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + t.Run(test.name+"-lifecycle", func(t *testing.T) { + firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := componenttest.NewNopHost() + require.NoError(t, err) + require.NoError(t, firstRcvr.Start(context.Background(), host)) + require.NoError(t, firstRcvr.Shutdown(context.Background())) + secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + require.NoError(t, secondRcvr.Start(context.Background(), host)) + require.NoError(t, secondRcvr.Shutdown(context.Background())) + }) + } +} diff --git a/receiver/datadogreceiver/go.mod b/receiver/datadogreceiver/go.mod index e723ada0f624..3cd7c0c468e1 100644 --- a/receiver/datadogreceiver/go.mod +++ b/receiver/datadogreceiver/go.mod @@ -3,12 +3,13 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/receiver/datado go 1.21 require ( - github.com/DataDog/datadog-agent/pkg/proto v0.50.2 + github.com/DataDog/datadog-agent/pkg/proto v0.51.1-0.20240301173728-334e775e420a github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.95.0 github.com/stretchr/testify v1.8.4 github.com/vmihailenco/msgpack/v4 v4.3.13 go.opentelemetry.io/collector/component v0.95.0 go.opentelemetry.io/collector/config/confighttp v0.95.0 + go.opentelemetry.io/collector/confmap v0.95.0 go.opentelemetry.io/collector/consumer v0.95.0 go.opentelemetry.io/collector/pdata v1.2.0 go.opentelemetry.io/collector/receiver v0.95.0 @@ -59,7 +60,6 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.95.0 // indirect go.opentelemetry.io/collector/config/configtls v0.95.0 // indirect go.opentelemetry.io/collector/config/internal v0.95.0 // indirect - go.opentelemetry.io/collector/confmap v0.95.0 // indirect go.opentelemetry.io/collector/extension v0.95.0 // indirect go.opentelemetry.io/collector/extension/auth v0.95.0 // indirect go.opentelemetry.io/collector/featuregate v1.2.0 // indirect diff --git a/receiver/datadogreceiver/go.sum b/receiver/datadogreceiver/go.sum index 64f6ea5e2717..009bedd424ba 100644 --- a/receiver/datadogreceiver/go.sum +++ b/receiver/datadogreceiver/go.sum @@ -1,5 +1,5 @@ -github.com/DataDog/datadog-agent/pkg/proto v0.50.2 h1:dDg+U7ERLvir5D/TkJ6xA/RvU1hXcujTjCJoZG03KZE= -github.com/DataDog/datadog-agent/pkg/proto v0.50.2/go.mod h1:HvK26YCxg6MfYvPJgpHC7nSjw6DTpNhd75Wlb0GAvis= +github.com/DataDog/datadog-agent/pkg/proto v0.51.1-0.20240301173728-334e775e420a h1:vN5cl8mKqADznzz6cnz/lgoBfHVs4zDgz0fr0ZkeXa4= +github.com/DataDog/datadog-agent/pkg/proto v0.51.1-0.20240301173728-334e775e420a/go.mod h1:wjr5YlVvGip6VmAGzHrdBaGUu1LaA9B6gHvInm5kHiY= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= diff --git a/receiver/dockerstatsreceiver/generated_component_test.go b/receiver/dockerstatsreceiver/generated_component_test.go new file mode 100644 index 000000000000..535e9ed45fc2 --- /dev/null +++ b/receiver/dockerstatsreceiver/generated_component_test.go @@ -0,0 +1,62 @@ +// Code generated by mdatagen. DO NOT EDIT. +//go:build !darwin && !windows + +package dockerstatsreceiver + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/consumer/consumertest" + "go.opentelemetry.io/collector/receiver" + "go.opentelemetry.io/collector/receiver/receivertest" +) + +func TestComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "metrics", + createFn: func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateMetricsReceiver(ctx, set, cfg, consumertest.NewNop()) + }, + }, + } + + cm, err := confmaptest.LoadConf("metadata.yaml") + require.NoError(t, err) + cfg := factory.CreateDefaultConfig() + sub, err := cm.Sub("tests::config") + require.NoError(t, err) + require.NoError(t, component.UnmarshalConfig(sub, cfg)) + + for _, test := range tests { + t.Run(test.name+"-shutdown", func(t *testing.T) { + c, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + t.Run(test.name+"-lifecycle", func(t *testing.T) { + firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := componenttest.NewNopHost() + require.NoError(t, err) + require.NoError(t, firstRcvr.Start(context.Background(), host)) + require.NoError(t, firstRcvr.Shutdown(context.Background())) + secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + require.NoError(t, secondRcvr.Start(context.Background(), host)) + require.NoError(t, secondRcvr.Shutdown(context.Background())) + }) + } +} diff --git a/receiver/dockerstatsreceiver/go.mod b/receiver/dockerstatsreceiver/go.mod index 1f9469afdc5d..00d97fc631c3 100644 --- a/receiver/dockerstatsreceiver/go.mod +++ b/receiver/dockerstatsreceiver/go.mod @@ -21,7 +21,7 @@ require ( go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/dockerstatsreceiver/go.sum b/receiver/dockerstatsreceiver/go.sum index 055691ff695a..6e66f1b69053 100644 --- a/receiver/dockerstatsreceiver/go.sum +++ b/receiver/dockerstatsreceiver/go.sum @@ -181,8 +181,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/dockerstatsreceiver/metadata.yaml b/receiver/dockerstatsreceiver/metadata.yaml index b14799670197..3c54921e49d7 100644 --- a/receiver/dockerstatsreceiver/metadata.yaml +++ b/receiver/dockerstatsreceiver/metadata.yaml @@ -7,6 +7,7 @@ status: distributions: [contrib, observiq, sumo] codeowners: active: [rmfitzpatrick, jamesmoessis] + unsupported_platforms: [darwin, windows] sem_conv_version: 1.6.1 diff --git a/receiver/elasticsearchreceiver/README.md b/receiver/elasticsearchreceiver/README.md index ff7ed63a0c52..1a5f74d8e617 100644 --- a/receiver/elasticsearchreceiver/README.md +++ b/receiver/elasticsearchreceiver/README.md @@ -6,7 +6,7 @@ | Stability | [beta]: metrics | | Distributions | [contrib], [observiq], [sumo] | | Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Areceiver%2Felasticsearch%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Areceiver%2Felasticsearch) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Areceiver%2Felasticsearch%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Areceiver%2Felasticsearch) | -| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@djaglowski](https://www.github.com/djaglowski), [@BinaryFissionGames](https://www.github.com/BinaryFissionGames) | +| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@djaglowski](https://www.github.com/djaglowski), [@BinaryFissionGames](https://www.github.com/BinaryFissionGames) \| Seeking more code owners! | [beta]: https://github.com/open-telemetry/opentelemetry-collector#beta [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib diff --git a/receiver/elasticsearchreceiver/generated_component_test.go b/receiver/elasticsearchreceiver/generated_component_test.go new file mode 100644 index 000000000000..8cbe5223840e --- /dev/null +++ b/receiver/elasticsearchreceiver/generated_component_test.go @@ -0,0 +1,61 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package elasticsearchreceiver + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/consumer/consumertest" + "go.opentelemetry.io/collector/receiver" + "go.opentelemetry.io/collector/receiver/receivertest" +) + +func TestComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "metrics", + createFn: func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateMetricsReceiver(ctx, set, cfg, consumertest.NewNop()) + }, + }, + } + + cm, err := confmaptest.LoadConf("metadata.yaml") + require.NoError(t, err) + cfg := factory.CreateDefaultConfig() + sub, err := cm.Sub("tests::config") + require.NoError(t, err) + require.NoError(t, component.UnmarshalConfig(sub, cfg)) + + for _, test := range tests { + t.Run(test.name+"-shutdown", func(t *testing.T) { + c, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + t.Run(test.name+"-lifecycle", func(t *testing.T) { + firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := componenttest.NewNopHost() + require.NoError(t, err) + require.NoError(t, firstRcvr.Start(context.Background(), host)) + require.NoError(t, firstRcvr.Shutdown(context.Background())) + secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + require.NoError(t, secondRcvr.Start(context.Background(), host)) + require.NoError(t, secondRcvr.Shutdown(context.Background())) + }) + } +} diff --git a/receiver/elasticsearchreceiver/go.mod b/receiver/elasticsearchreceiver/go.mod index e13f61382537..5d99a196c9bc 100644 --- a/receiver/elasticsearchreceiver/go.mod +++ b/receiver/elasticsearchreceiver/go.mod @@ -22,7 +22,7 @@ require ( go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/elasticsearchreceiver/go.sum b/receiver/elasticsearchreceiver/go.sum index 857320d7736c..171d4c1f6cc3 100644 --- a/receiver/elasticsearchreceiver/go.sum +++ b/receiver/elasticsearchreceiver/go.sum @@ -204,8 +204,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/elasticsearchreceiver/metadata.yaml b/receiver/elasticsearchreceiver/metadata.yaml index 36e85e4c6ed0..3d5952fddf3e 100644 --- a/receiver/elasticsearchreceiver/metadata.yaml +++ b/receiver/elasticsearchreceiver/metadata.yaml @@ -7,6 +7,7 @@ status: distributions: [contrib, observiq, sumo] codeowners: active: [djaglowski, BinaryFissionGames] + seeking_new: true resource_attributes: elasticsearch.cluster.name: @@ -994,3 +995,6 @@ metrics: value_type: int attributes: [ ] enabled: false + +tests: + config: diff --git a/receiver/expvarreceiver/generated_component_test.go b/receiver/expvarreceiver/generated_component_test.go index 1c4b8dd5ada1..2920748654fe 100644 --- a/receiver/expvarreceiver/generated_component_test.go +++ b/receiver/expvarreceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/expvarreceiver/go.mod b/receiver/expvarreceiver/go.mod index fb438b9303d2..b396cbb2f6cb 100644 --- a/receiver/expvarreceiver/go.mod +++ b/receiver/expvarreceiver/go.mod @@ -16,7 +16,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/expvarreceiver/go.sum b/receiver/expvarreceiver/go.sum index b07358504160..1eb8b1e14f3f 100644 --- a/receiver/expvarreceiver/go.sum +++ b/receiver/expvarreceiver/go.sum @@ -126,8 +126,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/expvarreceiver/metadata.yaml b/receiver/expvarreceiver/metadata.yaml index d45631c63959..7fad22e4fcd6 100644 --- a/receiver/expvarreceiver/metadata.yaml +++ b/receiver/expvarreceiver/metadata.yaml @@ -264,5 +264,3 @@ metrics: unit: 1 gauge: value_type: double -tests: - config: \ No newline at end of file diff --git a/receiver/filelogreceiver/filelog_test.go b/receiver/filelogreceiver/filelog_test.go index ccc6917e80e5..4540ca0d6a04 100644 --- a/receiver/filelogreceiver/filelog_test.go +++ b/receiver/filelogreceiver/filelog_test.go @@ -123,7 +123,6 @@ func TestReadStaticFile(t *testing.T) { } func TestReadRotatingFiles(t *testing.T) { - tests := []rotationTest{ { name: "CopyTruncate", @@ -181,13 +180,19 @@ func (rt *rotationTest) Run(t *testing.T) { require.NoError(t, rcvr.Start(context.Background(), componenttest.NewNopHost())) file, err := os.OpenFile(fileName, os.O_CREATE|os.O_RDWR, 0600) + defer func() { + require.NoError(t, file.Close()) + }() require.NoError(t, err) for i := 0; i < numLogs; i++ { if (i+1)%maxLinesPerFile == 0 { if rt.copyTruncate { // Recreate the backup file - require.NoError(t, os.Remove(backupFileName)) + // if backupFileName exists + if _, err = os.Stat(backupFileName); err == nil { + require.NoError(t, os.Remove(backupFileName)) + } backupFile, openErr := os.OpenFile(backupFileName, os.O_CREATE|os.O_RDWR, 0600) require.NoError(t, openErr) diff --git a/receiver/filelogreceiver/generated_component_test.go b/receiver/filelogreceiver/generated_component_test.go new file mode 100644 index 000000000000..4e27aa020248 --- /dev/null +++ b/receiver/filelogreceiver/generated_component_test.go @@ -0,0 +1,61 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package filelogreceiver + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/consumer/consumertest" + "go.opentelemetry.io/collector/receiver" + "go.opentelemetry.io/collector/receiver/receivertest" +) + +func TestComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "logs", + createFn: func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateLogsReceiver(ctx, set, cfg, consumertest.NewNop()) + }, + }, + } + + cm, err := confmaptest.LoadConf("metadata.yaml") + require.NoError(t, err) + cfg := factory.CreateDefaultConfig() + sub, err := cm.Sub("tests::config") + require.NoError(t, err) + require.NoError(t, component.UnmarshalConfig(sub, cfg)) + + for _, test := range tests { + t.Run(test.name+"-shutdown", func(t *testing.T) { + c, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + t.Run(test.name+"-lifecycle", func(t *testing.T) { + firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := componenttest.NewNopHost() + require.NoError(t, err) + require.NoError(t, firstRcvr.Start(context.Background(), host)) + require.NoError(t, firstRcvr.Shutdown(context.Background())) + secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + require.NoError(t, secondRcvr.Start(context.Background(), host)) + require.NoError(t, secondRcvr.Shutdown(context.Background())) + }) + } +} diff --git a/receiver/filelogreceiver/go.mod b/receiver/filelogreceiver/go.mod index 86adfb6b6ec7..c53ebd4b3c0c 100644 --- a/receiver/filelogreceiver/go.mod +++ b/receiver/filelogreceiver/go.mod @@ -15,7 +15,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/filelogreceiver/go.sum b/receiver/filelogreceiver/go.sum index 2d7b807a2379..54856be7c33a 100644 --- a/receiver/filelogreceiver/go.sum +++ b/receiver/filelogreceiver/go.sum @@ -120,8 +120,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/filelogreceiver/metadata.yaml b/receiver/filelogreceiver/metadata.yaml index 9ad32ef8ffdf..0bb530ac73e9 100644 --- a/receiver/filelogreceiver/metadata.yaml +++ b/receiver/filelogreceiver/metadata.yaml @@ -7,3 +7,7 @@ status: distributions: [contrib, splunk, observiq, sumo] codeowners: active: [djaglowski] + +tests: + config: + include: [ testdata/simple.log ] diff --git a/receiver/filestatsreceiver/generated_component_test.go b/receiver/filestatsreceiver/generated_component_test.go index e340a168ee79..d3311760e131 100644 --- a/receiver/filestatsreceiver/generated_component_test.go +++ b/receiver/filestatsreceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/filestatsreceiver/go.mod b/receiver/filestatsreceiver/go.mod index 4fdbd3ae24b3..7eda225ece65 100644 --- a/receiver/filestatsreceiver/go.mod +++ b/receiver/filestatsreceiver/go.mod @@ -17,7 +17,7 @@ require ( go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/filestatsreceiver/go.sum b/receiver/filestatsreceiver/go.sum index 03f0050d70a8..29bd97e8c9c0 100644 --- a/receiver/filestatsreceiver/go.sum +++ b/receiver/filestatsreceiver/go.sum @@ -175,8 +175,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/filestatsreceiver/metadata.yaml b/receiver/filestatsreceiver/metadata.yaml index eb24d6acae28..cea57fb58023 100644 --- a/receiver/filestatsreceiver/metadata.yaml +++ b/receiver/filestatsreceiver/metadata.yaml @@ -63,5 +63,3 @@ metrics: gauge: value_type: int unit: "{file}" -tests: - config: \ No newline at end of file diff --git a/receiver/flinkmetricsreceiver/README.md b/receiver/flinkmetricsreceiver/README.md index 904fd88cf9dc..1c5b2ab91184 100644 --- a/receiver/flinkmetricsreceiver/README.md +++ b/receiver/flinkmetricsreceiver/README.md @@ -6,7 +6,7 @@ | Stability | [alpha]: metrics | | Distributions | [contrib], [observiq], [sumo] | | Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Areceiver%2Fflinkmetrics%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Areceiver%2Fflinkmetrics) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Areceiver%2Fflinkmetrics%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Areceiver%2Fflinkmetrics) | -| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@JonathanWamsley](https://www.github.com/JonathanWamsley), [@djaglowski](https://www.github.com/djaglowski) | +| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@JonathanWamsley](https://www.github.com/JonathanWamsley), [@djaglowski](https://www.github.com/djaglowski) \| Seeking more code owners! | [alpha]: https://github.com/open-telemetry/opentelemetry-collector#alpha [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib diff --git a/receiver/flinkmetricsreceiver/generated_component_test.go b/receiver/flinkmetricsreceiver/generated_component_test.go index 67a33cdb1f32..5880edfdfbad 100644 --- a/receiver/flinkmetricsreceiver/generated_component_test.go +++ b/receiver/flinkmetricsreceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/flinkmetricsreceiver/go.mod b/receiver/flinkmetricsreceiver/go.mod index 8bb69c2ff86d..709b0c901f03 100644 --- a/receiver/flinkmetricsreceiver/go.mod +++ b/receiver/flinkmetricsreceiver/go.mod @@ -17,7 +17,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/flinkmetricsreceiver/go.sum b/receiver/flinkmetricsreceiver/go.sum index 061fb480a92c..ceaf27566274 100644 --- a/receiver/flinkmetricsreceiver/go.sum +++ b/receiver/flinkmetricsreceiver/go.sum @@ -131,8 +131,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/flinkmetricsreceiver/metadata.yaml b/receiver/flinkmetricsreceiver/metadata.yaml index 8454dc23fabd..0c7a7216a542 100644 --- a/receiver/flinkmetricsreceiver/metadata.yaml +++ b/receiver/flinkmetricsreceiver/metadata.yaml @@ -7,6 +7,7 @@ status: distributions: [contrib,observiq, sumo] codeowners: active: [JonathanWamsley, djaglowski] + seeking_new: true resource_attributes: # These resource attributes are Flinks system scope variables, which contains context information about metrics. These are required to uniquely identify incoming metrics as the same job can run multiple times concurrently. See https://nightlies.apache.org/flink/flink-docs-release-1.14/docs/ops/metrics/#system-scope for more information. diff --git a/receiver/fluentforwardreceiver/generated_component_test.go b/receiver/fluentforwardreceiver/generated_component_test.go index 4dcf11c8c675..5542a309e13b 100644 --- a/receiver/fluentforwardreceiver/generated_component_test.go +++ b/receiver/fluentforwardreceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/fluentforwardreceiver/go.mod b/receiver/fluentforwardreceiver/go.mod index 8d1cc858bc7d..1caf6db1d450 100644 --- a/receiver/fluentforwardreceiver/go.mod +++ b/receiver/fluentforwardreceiver/go.mod @@ -15,7 +15,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/fluentforwardreceiver/go.sum b/receiver/fluentforwardreceiver/go.sum index d07970e0e829..7e4fff0067a7 100644 --- a/receiver/fluentforwardreceiver/go.sum +++ b/receiver/fluentforwardreceiver/go.sum @@ -136,8 +136,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/gitproviderreceiver/generated_component_test.go b/receiver/gitproviderreceiver/generated_component_test.go index be0c3cbc6557..2dd6541ea179 100644 --- a/receiver/gitproviderreceiver/generated_component_test.go +++ b/receiver/gitproviderreceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/gitproviderreceiver/go.mod b/receiver/gitproviderreceiver/go.mod index 594756da5f50..989bbe0079dd 100644 --- a/receiver/gitproviderreceiver/go.mod +++ b/receiver/gitproviderreceiver/go.mod @@ -18,7 +18,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/gitproviderreceiver/go.sum b/receiver/gitproviderreceiver/go.sum index 57921be4cb17..888f5a37fa7e 100644 --- a/receiver/gitproviderreceiver/go.sum +++ b/receiver/gitproviderreceiver/go.sum @@ -265,8 +265,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/googlecloudpubsubreceiver/go.mod b/receiver/googlecloudpubsubreceiver/go.mod index b7a64c51a982..925c160f7199 100644 --- a/receiver/googlecloudpubsubreceiver/go.mod +++ b/receiver/googlecloudpubsubreceiver/go.mod @@ -18,7 +18,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 google.golang.org/api v0.165.0 google.golang.org/genproto v0.0.0-20240125205218-1f4bbc51befe google.golang.org/genproto/googleapis/api v0.0.0-20240125205218-1f4bbc51befe diff --git a/receiver/googlecloudpubsubreceiver/go.sum b/receiver/googlecloudpubsubreceiver/go.sum index 99a0da86279b..fd892303d345 100644 --- a/receiver/googlecloudpubsubreceiver/go.sum +++ b/receiver/googlecloudpubsubreceiver/go.sum @@ -178,8 +178,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/googlecloudpubsubreceiver/metadata.yaml b/receiver/googlecloudpubsubreceiver/metadata.yaml index ca8b4d5a503d..fbdeaa8b45b5 100644 --- a/receiver/googlecloudpubsubreceiver/metadata.yaml +++ b/receiver/googlecloudpubsubreceiver/metadata.yaml @@ -15,3 +15,5 @@ tests: timeout: 20s subscription: projects/my-project/subscriptions/otlp-subscription skip_lifecycle: true + skip_shutdown: true + diff --git a/receiver/googlecloudspannerreceiver/generated_component_test.go b/receiver/googlecloudspannerreceiver/generated_component_test.go index aedc0fa97c10..ef66a685415f 100644 --- a/receiver/googlecloudspannerreceiver/generated_component_test.go +++ b/receiver/googlecloudspannerreceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/googlecloudspannerreceiver/go.mod b/receiver/googlecloudspannerreceiver/go.mod index 9c03fdd3b12a..cfbe55756485 100644 --- a/receiver/googlecloudspannerreceiver/go.mod +++ b/receiver/googlecloudspannerreceiver/go.mod @@ -16,7 +16,7 @@ require ( go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 google.golang.org/api v0.165.0 google.golang.org/grpc v1.61.0 gopkg.in/yaml.v3 v3.0.1 diff --git a/receiver/googlecloudspannerreceiver/go.sum b/receiver/googlecloudspannerreceiver/go.sum index 4a32a96e2353..beeb15aa0068 100644 --- a/receiver/googlecloudspannerreceiver/go.sum +++ b/receiver/googlecloudspannerreceiver/go.sum @@ -182,8 +182,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/haproxyreceiver/generated_component_test.go b/receiver/haproxyreceiver/generated_component_test.go index 585940882035..69af3a3369cc 100644 --- a/receiver/haproxyreceiver/generated_component_test.go +++ b/receiver/haproxyreceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/haproxyreceiver/go.mod b/receiver/haproxyreceiver/go.mod index daee3d573f70..fb70951a71f8 100644 --- a/receiver/haproxyreceiver/go.mod +++ b/receiver/haproxyreceiver/go.mod @@ -19,7 +19,7 @@ require ( go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/haproxyreceiver/go.sum b/receiver/haproxyreceiver/go.sum index efee19ab5599..1a04b670bfb6 100644 --- a/receiver/haproxyreceiver/go.sum +++ b/receiver/haproxyreceiver/go.sum @@ -203,8 +203,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/haproxyreceiver/metadata.yaml b/receiver/haproxyreceiver/metadata.yaml index c949ccb0938b..260f045184f4 100644 --- a/receiver/haproxyreceiver/metadata.yaml +++ b/receiver/haproxyreceiver/metadata.yaml @@ -261,6 +261,3 @@ metrics: value_type: double input_type: string unit: "{sessions}" - -tests: - config: \ No newline at end of file diff --git a/receiver/hostmetricsreceiver/generated_component_test.go b/receiver/hostmetricsreceiver/generated_component_test.go index 9f42596cc606..b0cc2ac45a86 100644 --- a/receiver/hostmetricsreceiver/generated_component_test.go +++ b/receiver/hostmetricsreceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/hostmetricsreceiver/go.mod b/receiver/hostmetricsreceiver/go.mod index 68ff14382cb8..ccc4140f4c7c 100644 --- a/receiver/hostmetricsreceiver/go.mod +++ b/receiver/hostmetricsreceiver/go.mod @@ -23,7 +23,7 @@ require ( go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 golang.org/x/sys v0.17.0 ) diff --git a/receiver/hostmetricsreceiver/go.sum b/receiver/hostmetricsreceiver/go.sum index dc7975a1c4f0..25505f88d811 100644 --- a/receiver/hostmetricsreceiver/go.sum +++ b/receiver/hostmetricsreceiver/go.sum @@ -421,8 +421,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= diff --git a/receiver/hostmetricsreceiver/internal/scraper/processscraper/process_scraper_test.go b/receiver/hostmetricsreceiver/internal/scraper/processscraper/process_scraper_test.go index 0873f284aa83..546608ac9f91 100644 --- a/receiver/hostmetricsreceiver/internal/scraper/processscraper/process_scraper_test.go +++ b/receiver/hostmetricsreceiver/internal/scraper/processscraper/process_scraper_test.go @@ -681,7 +681,7 @@ func TestScrapeMetrics_ProcessErrors(t *testing.T) { type testCase struct { name string - osFilter string + osFilter []string nameError error exeError error cgroupError error @@ -704,13 +704,13 @@ func TestScrapeMetrics_ProcessErrors(t *testing.T) { testCases := []testCase{ { name: "Name Error", - osFilter: "windows", + osFilter: []string{"windows"}, nameError: errors.New("err1"), expectedError: `error reading process name for pid 1: err1`, }, { name: "Exe Error", - osFilter: "darwin", + osFilter: []string{"darwin"}, exeError: errors.New("err1"), expectedError: func() string { if runtime.GOOS == "windows" { @@ -722,15 +722,15 @@ func TestScrapeMetrics_ProcessErrors(t *testing.T) { }, { name: "Cgroup Error", - osFilter: "linux", + osFilter: []string{"darwin", "windows"}, cgroupError: errors.New("err1"), expectedError: func() string { - return `error reading cgroup for pid 1: err1` + return `error reading process cgroup for pid 1: err1` }(), }, { name: "Cmdline Error", - osFilter: "darwin", + osFilter: []string{"darwin"}, cmdlineError: errors.New("err2"), expectedError: `error reading command for process "test" (pid 1): err2`, }, @@ -756,55 +756,55 @@ func TestScrapeMetrics_ProcessErrors(t *testing.T) { }, { name: "Memory Percent Error", - osFilter: "darwin", + osFilter: []string{"darwin"}, memoryPercentError: errors.New("err-mem-percent"), expectedError: `error reading memory utilization for process "test" (pid 1): err-mem-percent`, }, { name: "IO Counters Error", - osFilter: "darwin", + osFilter: []string{"darwin"}, ioCountersError: errors.New("err7"), expectedError: `error reading disk usage for process "test" (pid 1): err7`, }, { name: "Parent PID Error", - osFilter: "darwin", + osFilter: []string{"darwin"}, parentPidError: errors.New("err8"), expectedError: `error reading parent pid for process "test" (pid 1): err8`, }, { name: "Page Faults Error", - osFilter: "darwin", + osFilter: []string{"darwin"}, pageFaultsError: errors.New("err-paging"), expectedError: `error reading memory paging info for process "test" (pid 1): err-paging`, }, { name: "Thread count Error", - osFilter: "darwin", + osFilter: []string{"darwin"}, numThreadsError: errors.New("err8"), expectedError: `error reading thread info for process "test" (pid 1): err8`, }, { name: "Context Switches Error", - osFilter: "darwin", + osFilter: []string{"darwin"}, numCtxSwitchesError: errors.New("err9"), expectedError: `error reading context switch counts for process "test" (pid 1): err9`, }, { name: "File Descriptors Error", - osFilter: "darwin", + osFilter: []string{"darwin"}, numFDsError: errors.New("err10"), expectedError: `error reading open file descriptor count for process "test" (pid 1): err10`, }, { name: "Signals Pending Error", - osFilter: "darwin", + osFilter: []string{"darwin"}, rlimitError: errors.New("err-rlimit"), expectedError: `error reading pending signals for process "test" (pid 1): err-rlimit`, }, { name: "Multiple Errors", - osFilter: "darwin", + osFilter: []string{"darwin"}, cmdlineError: errors.New("err2"), usernameError: errors.New("err3"), createTimeError: errors.New("err4"), @@ -843,8 +843,10 @@ func TestScrapeMetrics_ProcessErrors(t *testing.T) { for _, test := range testCases { t.Run(test.name, func(t *testing.T) { - if test.osFilter == runtime.GOOS { - t.Skipf("skipping test %v on %v", test.name, runtime.GOOS) + for _, os := range test.osFilter { + if os == runtime.GOOS { + t.Skipf("skipping test %v on %v", test.name, runtime.GOOS) + } } metricsBuilderConfig := metadata.DefaultMetricsBuilderConfig() @@ -902,7 +904,7 @@ func TestScrapeMetrics_ProcessErrors(t *testing.T) { executableError = test.cmdlineError } - expectedResourceMetricsLen, expectedMetricsLen := getExpectedLengthOfReturnedMetrics(test.nameError, executableError, test.timesError, test.memoryInfoError, test.memoryPercentError, test.ioCountersError, test.pageFaultsError, test.numThreadsError, test.numCtxSwitchesError, test.numFDsError, test.rlimitError) + expectedResourceMetricsLen, expectedMetricsLen := getExpectedLengthOfReturnedMetrics(test.nameError, executableError, test.timesError, test.memoryInfoError, test.memoryPercentError, test.ioCountersError, test.pageFaultsError, test.numThreadsError, test.numCtxSwitchesError, test.numFDsError, test.rlimitError, test.cgroupError) assert.Equal(t, expectedResourceMetricsLen, md.ResourceMetrics().Len()) assert.Equal(t, expectedMetricsLen, md.MetricCount()) @@ -910,7 +912,7 @@ func TestScrapeMetrics_ProcessErrors(t *testing.T) { isPartial := scrapererror.IsPartialScrapeError(err) assert.True(t, isPartial) if isPartial { - expectedFailures := getExpectedScrapeFailures(test.nameError, executableError, test.timesError, test.memoryInfoError, test.memoryPercentError, test.ioCountersError, test.pageFaultsError, test.numThreadsError, test.numCtxSwitchesError, test.numFDsError, test.rlimitError) + expectedFailures := getExpectedScrapeFailures(test.nameError, executableError, test.timesError, test.memoryInfoError, test.memoryPercentError, test.ioCountersError, test.pageFaultsError, test.numThreadsError, test.numCtxSwitchesError, test.numFDsError, test.rlimitError, test.cgroupError) var scraperErr scrapererror.PartialScrapeError require.ErrorAs(t, err, &scraperErr) assert.Equal(t, expectedFailures, scraperErr.Failed) @@ -919,10 +921,13 @@ func TestScrapeMetrics_ProcessErrors(t *testing.T) { } } -func getExpectedLengthOfReturnedMetrics(nameError, exeError, timeError, memError, memPercentError, diskError, pageFaultsError, threadError, contextSwitchError, fileDescriptorError, rlimitError error) (int, int) { +func getExpectedLengthOfReturnedMetrics(nameError, exeError, timeError, memError, memPercentError, diskError, pageFaultsError, threadError, contextSwitchError, fileDescriptorError, rlimitError, cgroupError error) (int, int) { if runtime.GOOS == "windows" && exeError != nil { return 0, 0 } + if runtime.GOOS == "linux" && cgroupError != nil { + return 0, 0 + } if nameError != nil { return 0, 0 @@ -963,15 +968,18 @@ func getExpectedLengthOfReturnedMetrics(nameError, exeError, timeError, memError return 1, expectedLen } -func getExpectedScrapeFailures(nameError, exeError, timeError, memError, memPercentError, diskError, pageFaultsError, threadError, contextSwitchError, fileDescriptorError error, rlimitError error) int { +func getExpectedScrapeFailures(nameError, exeError, timeError, memError, memPercentError, diskError, pageFaultsError, threadError, contextSwitchError, fileDescriptorError error, rlimitError error, cgroupError error) int { if runtime.GOOS == "windows" && exeError != nil { return 2 } + if runtime.GOOS == "linux" && cgroupError != nil { + return 1 + } if nameError != nil || exeError != nil { return 1 } - _, expectedMetricsLen := getExpectedLengthOfReturnedMetrics(nameError, exeError, timeError, memError, memPercentError, diskError, pageFaultsError, threadError, contextSwitchError, fileDescriptorError, rlimitError) + _, expectedMetricsLen := getExpectedLengthOfReturnedMetrics(nameError, exeError, timeError, memError, memPercentError, diskError, pageFaultsError, threadError, contextSwitchError, fileDescriptorError, rlimitError, cgroupError) // excluding unsupported metrics from darwin 'metricsLen' if runtime.GOOS == "darwin" { diff --git a/receiver/httpcheckreceiver/generated_component_test.go b/receiver/httpcheckreceiver/generated_component_test.go index 43db337cfbf7..6414eaa6707d 100644 --- a/receiver/httpcheckreceiver/generated_component_test.go +++ b/receiver/httpcheckreceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/httpcheckreceiver/go.mod b/receiver/httpcheckreceiver/go.mod index aac22ee386d0..ce4dc8d0990c 100644 --- a/receiver/httpcheckreceiver/go.mod +++ b/receiver/httpcheckreceiver/go.mod @@ -18,7 +18,7 @@ require ( go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/httpcheckreceiver/go.sum b/receiver/httpcheckreceiver/go.sum index b07358504160..1eb8b1e14f3f 100644 --- a/receiver/httpcheckreceiver/go.sum +++ b/receiver/httpcheckreceiver/go.sum @@ -126,8 +126,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/httpcheckreceiver/metadata.yaml b/receiver/httpcheckreceiver/metadata.yaml index 583e1d833e52..d828bc5ce7f7 100644 --- a/receiver/httpcheckreceiver/metadata.yaml +++ b/receiver/httpcheckreceiver/metadata.yaml @@ -54,6 +54,3 @@ metrics: monotonic: false unit: "{error}" attributes: [http.url, error.message] - -tests: - config: diff --git a/receiver/iisreceiver/README.md b/receiver/iisreceiver/README.md index 9d1e17d23f32..b97372b314ed 100644 --- a/receiver/iisreceiver/README.md +++ b/receiver/iisreceiver/README.md @@ -6,7 +6,7 @@ | Stability | [beta]: metrics | | Distributions | [contrib], [observiq], [sumo] | | Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Areceiver%2Fiis%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Areceiver%2Fiis) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Areceiver%2Fiis%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Areceiver%2Fiis) | -| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@Mrod1598](https://www.github.com/Mrod1598), [@djaglowski](https://www.github.com/djaglowski) | +| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@Mrod1598](https://www.github.com/Mrod1598), [@djaglowski](https://www.github.com/djaglowski) \| Seeking more code owners! | [beta]: https://github.com/open-telemetry/opentelemetry-collector#beta [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib diff --git a/receiver/iisreceiver/generated_component_test.go b/receiver/iisreceiver/generated_component_test.go new file mode 100644 index 000000000000..4fb4c0108a06 --- /dev/null +++ b/receiver/iisreceiver/generated_component_test.go @@ -0,0 +1,62 @@ +// Code generated by mdatagen. DO NOT EDIT. +//go:build !linux && !darwin + +package iisreceiver + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/consumer/consumertest" + "go.opentelemetry.io/collector/receiver" + "go.opentelemetry.io/collector/receiver/receivertest" +) + +func TestComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "metrics", + createFn: func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateMetricsReceiver(ctx, set, cfg, consumertest.NewNop()) + }, + }, + } + + cm, err := confmaptest.LoadConf("metadata.yaml") + require.NoError(t, err) + cfg := factory.CreateDefaultConfig() + sub, err := cm.Sub("tests::config") + require.NoError(t, err) + require.NoError(t, component.UnmarshalConfig(sub, cfg)) + + for _, test := range tests { + t.Run(test.name+"-shutdown", func(t *testing.T) { + c, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + t.Run(test.name+"-lifecycle", func(t *testing.T) { + firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := componenttest.NewNopHost() + require.NoError(t, err) + require.NoError(t, firstRcvr.Start(context.Background(), host)) + require.NoError(t, firstRcvr.Shutdown(context.Background())) + secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + require.NoError(t, secondRcvr.Start(context.Background(), host)) + require.NoError(t, secondRcvr.Shutdown(context.Background())) + }) + } +} diff --git a/receiver/iisreceiver/go.mod b/receiver/iisreceiver/go.mod index c358a897af0d..84db346f60cc 100644 --- a/receiver/iisreceiver/go.mod +++ b/receiver/iisreceiver/go.mod @@ -18,7 +18,7 @@ require ( go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/iisreceiver/go.sum b/receiver/iisreceiver/go.sum index 0cfab0458a08..25acf375464f 100644 --- a/receiver/iisreceiver/go.sum +++ b/receiver/iisreceiver/go.sum @@ -173,8 +173,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/iisreceiver/metadata.yaml b/receiver/iisreceiver/metadata.yaml index 3481f782d319..452d28bebae6 100644 --- a/receiver/iisreceiver/metadata.yaml +++ b/receiver/iisreceiver/metadata.yaml @@ -7,6 +7,8 @@ status: distributions: [contrib, observiq, sumo] codeowners: active: [Mrod1598, djaglowski] + seeking_new: true + unsupported_platforms: [linux, darwin] resource_attributes: iis.site: diff --git a/receiver/influxdbreceiver/generated_component_test.go b/receiver/influxdbreceiver/generated_component_test.go index 41c5c3d26d51..9eb82c0c8937 100644 --- a/receiver/influxdbreceiver/generated_component_test.go +++ b/receiver/influxdbreceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/influxdbreceiver/go.mod b/receiver/influxdbreceiver/go.mod index 2f874b3645c6..97ae117c0557 100644 --- a/receiver/influxdbreceiver/go.mod +++ b/receiver/influxdbreceiver/go.mod @@ -19,7 +19,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/influxdbreceiver/go.sum b/receiver/influxdbreceiver/go.sum index d8493072e974..91c6e674ff07 100644 --- a/receiver/influxdbreceiver/go.sum +++ b/receiver/influxdbreceiver/go.sum @@ -172,8 +172,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/influxdbreceiver/metadata.yaml b/receiver/influxdbreceiver/metadata.yaml index 1004879a5549..1778488433ff 100644 --- a/receiver/influxdbreceiver/metadata.yaml +++ b/receiver/influxdbreceiver/metadata.yaml @@ -7,5 +7,3 @@ status: distributions: [contrib, observiq, sumo] codeowners: active: [jacobmarble] -tests: - config: diff --git a/receiver/jaegerreceiver/generated_component_test.go b/receiver/jaegerreceiver/generated_component_test.go index b464abefee2e..b062bbc3b321 100644 --- a/receiver/jaegerreceiver/generated_component_test.go +++ b/receiver/jaegerreceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/jaegerreceiver/go.mod b/receiver/jaegerreceiver/go.mod index 61e2e2c5c432..26cab08d25ed 100644 --- a/receiver/jaegerreceiver/go.mod +++ b/receiver/jaegerreceiver/go.mod @@ -23,7 +23,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 google.golang.org/grpc v1.61.0 ) diff --git a/receiver/jaegerreceiver/go.sum b/receiver/jaegerreceiver/go.sum index 0fced4d4d3b8..8c1dc1e6f47a 100644 --- a/receiver/jaegerreceiver/go.sum +++ b/receiver/jaegerreceiver/go.sum @@ -190,8 +190,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/jmxreceiver/generated_component_test.go b/receiver/jmxreceiver/generated_component_test.go new file mode 100644 index 000000000000..8883d147b45a --- /dev/null +++ b/receiver/jmxreceiver/generated_component_test.go @@ -0,0 +1,61 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package jmxreceiver + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/consumer/consumertest" + "go.opentelemetry.io/collector/receiver" + "go.opentelemetry.io/collector/receiver/receivertest" +) + +func TestComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "metrics", + createFn: func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateMetricsReceiver(ctx, set, cfg, consumertest.NewNop()) + }, + }, + } + + cm, err := confmaptest.LoadConf("metadata.yaml") + require.NoError(t, err) + cfg := factory.CreateDefaultConfig() + sub, err := cm.Sub("tests::config") + require.NoError(t, err) + require.NoError(t, component.UnmarshalConfig(sub, cfg)) + + for _, test := range tests { + t.Run(test.name+"-shutdown", func(t *testing.T) { + c, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + t.Run(test.name+"-lifecycle", func(t *testing.T) { + firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := componenttest.NewNopHost() + require.NoError(t, err) + require.NoError(t, firstRcvr.Start(context.Background(), host)) + require.NoError(t, firstRcvr.Shutdown(context.Background())) + secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + require.NoError(t, secondRcvr.Start(context.Background(), host)) + require.NoError(t, secondRcvr.Shutdown(context.Background())) + }) + } +} diff --git a/receiver/jmxreceiver/go.mod b/receiver/jmxreceiver/go.mod index 71a36862d0ad..2e5a631bf06e 100644 --- a/receiver/jmxreceiver/go.mod +++ b/receiver/jmxreceiver/go.mod @@ -19,7 +19,7 @@ require ( go.opentelemetry.io/collector/receiver/otlpreceiver v0.95.0 go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/jmxreceiver/go.sum b/receiver/jmxreceiver/go.sum index f3e0a6247012..d66c9f59ebe9 100644 --- a/receiver/jmxreceiver/go.sum +++ b/receiver/jmxreceiver/go.sum @@ -239,8 +239,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/jmxreceiver/metadata.yaml b/receiver/jmxreceiver/metadata.yaml index 871628d5a6d8..42f2c47eaca9 100644 --- a/receiver/jmxreceiver/metadata.yaml +++ b/receiver/jmxreceiver/metadata.yaml @@ -7,3 +7,7 @@ status: distributions: [contrib, splunk, observiq, sumo] codeowners: active: [rmfitzpatrick] + +tests: + config: + endpoint: myendpoint:12345 diff --git a/receiver/journaldreceiver/go.mod b/receiver/journaldreceiver/go.mod index 212d74e2fe9a..04543f6b2dd6 100644 --- a/receiver/journaldreceiver/go.mod +++ b/receiver/journaldreceiver/go.mod @@ -54,7 +54,7 @@ require ( go.opentelemetry.io/otel/sdk v1.23.1 // indirect go.opentelemetry.io/otel/sdk/metric v1.23.1 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.26.0 // indirect + go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.20.0 // indirect golang.org/x/sys v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/receiver/journaldreceiver/go.sum b/receiver/journaldreceiver/go.sum index d9c873e7c09f..3e81d70c7d47 100644 --- a/receiver/journaldreceiver/go.sum +++ b/receiver/journaldreceiver/go.sum @@ -118,8 +118,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/journaldreceiver/metadata.yaml b/receiver/journaldreceiver/metadata.yaml index 87907040efa7..32c047296f0a 100644 --- a/receiver/journaldreceiver/metadata.yaml +++ b/receiver/journaldreceiver/metadata.yaml @@ -7,3 +7,8 @@ status: distributions: [contrib, splunk, observiq, sumo] codeowners: active: [sumo-drosiek, djaglowski] + +# TODO: Update the receiver to pass the tests +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/receiver/k8sclusterreceiver/README.md b/receiver/k8sclusterreceiver/README.md index 9cd60947cfd1..c2973f6aae25 100644 --- a/receiver/k8sclusterreceiver/README.md +++ b/receiver/k8sclusterreceiver/README.md @@ -3,14 +3,14 @@ | Status | | | ------------- |-----------| -| Stability | [beta]: metrics | -| | [development]: logs | +| Stability | [development]: logs | +| | [beta]: metrics | | Distributions | [contrib], [liatrio], [observiq], [splunk], [sumo] | | Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Areceiver%2Fk8scluster%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Areceiver%2Fk8scluster) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Areceiver%2Fk8scluster%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Areceiver%2Fk8scluster) | | [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@dmitryax](https://www.github.com/dmitryax), [@TylerHelmuth](https://www.github.com/TylerHelmuth), [@povilasv](https://www.github.com/povilasv) | -[beta]: https://github.com/open-telemetry/opentelemetry-collector#beta [development]: https://github.com/open-telemetry/opentelemetry-collector#development +[beta]: https://github.com/open-telemetry/opentelemetry-collector#beta [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib [liatrio]: https://github.com/liatrio/liatrio-otel-collector [observiq]: https://github.com/observIQ/observiq-otel-collector diff --git a/receiver/k8sclusterreceiver/documentation.md b/receiver/k8sclusterreceiver/documentation.md index 78d0339742a1..aac9303e25b5 100644 --- a/receiver/k8sclusterreceiver/documentation.md +++ b/receiver/k8sclusterreceiver/documentation.md @@ -439,7 +439,6 @@ Current status reason of the pod (1 - Evicted, 2 - NodeAffinity, 3 - NodeLost, 4 | k8s.job.name | The k8s pod name. | Any Str | true | | k8s.job.uid | The k8s job uid. | Any Str | true | | k8s.kubelet.version | The version of Kubelet running on the node. | Any Str | false | -| k8s.kubeproxy.version | The version of Kube Proxy running on the node. | Any Str | false | | k8s.namespace.name | The k8s namespace name. | Any Str | true | | k8s.namespace.uid | The k8s namespace uid. | Any Str | true | | k8s.node.name | The k8s node name. | Any Str | true | diff --git a/receiver/k8sclusterreceiver/generated_component_test.go b/receiver/k8sclusterreceiver/generated_component_test.go new file mode 100644 index 000000000000..da5dad3d67d3 --- /dev/null +++ b/receiver/k8sclusterreceiver/generated_component_test.go @@ -0,0 +1,55 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package k8sclusterreceiver + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/consumer/consumertest" + "go.opentelemetry.io/collector/receiver" + "go.opentelemetry.io/collector/receiver/receivertest" +) + +func TestComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "logs", + createFn: func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateLogsReceiver(ctx, set, cfg, consumertest.NewNop()) + }, + }, + + { + name: "metrics", + createFn: func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateMetricsReceiver(ctx, set, cfg, consumertest.NewNop()) + }, + }, + } + + cm, err := confmaptest.LoadConf("metadata.yaml") + require.NoError(t, err) + cfg := factory.CreateDefaultConfig() + sub, err := cm.Sub("tests::config") + require.NoError(t, err) + require.NoError(t, component.UnmarshalConfig(sub, cfg)) + + for _, test := range tests { + t.Run(test.name+"-shutdown", func(t *testing.T) { + c, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + } +} diff --git a/receiver/k8sclusterreceiver/go.mod b/receiver/k8sclusterreceiver/go.mod index e6b2e085e55e..469361e896f0 100644 --- a/receiver/k8sclusterreceiver/go.mod +++ b/receiver/k8sclusterreceiver/go.mod @@ -26,7 +26,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 k8s.io/api v0.29.2 k8s.io/apimachinery v0.29.2 k8s.io/client-go v0.29.2 diff --git a/receiver/k8sclusterreceiver/go.sum b/receiver/k8sclusterreceiver/go.sum index db4b012b22d6..708e845e01d0 100644 --- a/receiver/k8sclusterreceiver/go.sum +++ b/receiver/k8sclusterreceiver/go.sum @@ -390,8 +390,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= diff --git a/receiver/k8sclusterreceiver/internal/metadata/generated_config.go b/receiver/k8sclusterreceiver/internal/metadata/generated_config.go index 0ce3c13724b4..182e9f812853 100644 --- a/receiver/k8sclusterreceiver/internal/metadata/generated_config.go +++ b/receiver/k8sclusterreceiver/internal/metadata/generated_config.go @@ -246,7 +246,6 @@ type ResourceAttributesConfig struct { K8sJobName ResourceAttributeConfig `mapstructure:"k8s.job.name"` K8sJobUID ResourceAttributeConfig `mapstructure:"k8s.job.uid"` K8sKubeletVersion ResourceAttributeConfig `mapstructure:"k8s.kubelet.version"` - K8sKubeproxyVersion ResourceAttributeConfig `mapstructure:"k8s.kubeproxy.version"` K8sNamespaceName ResourceAttributeConfig `mapstructure:"k8s.namespace.name"` K8sNamespaceUID ResourceAttributeConfig `mapstructure:"k8s.namespace.uid"` K8sNodeName ResourceAttributeConfig `mapstructure:"k8s.node.name"` @@ -321,9 +320,6 @@ func DefaultResourceAttributesConfig() ResourceAttributesConfig { K8sKubeletVersion: ResourceAttributeConfig{ Enabled: false, }, - K8sKubeproxyVersion: ResourceAttributeConfig{ - Enabled: false, - }, K8sNamespaceName: ResourceAttributeConfig{ Enabled: true, }, diff --git a/receiver/k8sclusterreceiver/internal/metadata/generated_config_test.go b/receiver/k8sclusterreceiver/internal/metadata/generated_config_test.go index 15e165e2ce75..712cc9048298 100644 --- a/receiver/k8sclusterreceiver/internal/metadata/generated_config_test.go +++ b/receiver/k8sclusterreceiver/internal/metadata/generated_config_test.go @@ -89,7 +89,6 @@ func TestMetricsBuilderConfig(t *testing.T) { K8sJobName: ResourceAttributeConfig{Enabled: true}, K8sJobUID: ResourceAttributeConfig{Enabled: true}, K8sKubeletVersion: ResourceAttributeConfig{Enabled: true}, - K8sKubeproxyVersion: ResourceAttributeConfig{Enabled: true}, K8sNamespaceName: ResourceAttributeConfig{Enabled: true}, K8sNamespaceUID: ResourceAttributeConfig{Enabled: true}, K8sNodeName: ResourceAttributeConfig{Enabled: true}, @@ -179,7 +178,6 @@ func TestMetricsBuilderConfig(t *testing.T) { K8sJobName: ResourceAttributeConfig{Enabled: false}, K8sJobUID: ResourceAttributeConfig{Enabled: false}, K8sKubeletVersion: ResourceAttributeConfig{Enabled: false}, - K8sKubeproxyVersion: ResourceAttributeConfig{Enabled: false}, K8sNamespaceName: ResourceAttributeConfig{Enabled: false}, K8sNamespaceUID: ResourceAttributeConfig{Enabled: false}, K8sNodeName: ResourceAttributeConfig{Enabled: false}, @@ -252,7 +250,6 @@ func TestResourceAttributesConfig(t *testing.T) { K8sJobName: ResourceAttributeConfig{Enabled: true}, K8sJobUID: ResourceAttributeConfig{Enabled: true}, K8sKubeletVersion: ResourceAttributeConfig{Enabled: true}, - K8sKubeproxyVersion: ResourceAttributeConfig{Enabled: true}, K8sNamespaceName: ResourceAttributeConfig{Enabled: true}, K8sNamespaceUID: ResourceAttributeConfig{Enabled: true}, K8sNodeName: ResourceAttributeConfig{Enabled: true}, @@ -294,7 +291,6 @@ func TestResourceAttributesConfig(t *testing.T) { K8sJobName: ResourceAttributeConfig{Enabled: false}, K8sJobUID: ResourceAttributeConfig{Enabled: false}, K8sKubeletVersion: ResourceAttributeConfig{Enabled: false}, - K8sKubeproxyVersion: ResourceAttributeConfig{Enabled: false}, K8sNamespaceName: ResourceAttributeConfig{Enabled: false}, K8sNamespaceUID: ResourceAttributeConfig{Enabled: false}, K8sNodeName: ResourceAttributeConfig{Enabled: false}, diff --git a/receiver/k8sclusterreceiver/internal/metadata/generated_metrics.go b/receiver/k8sclusterreceiver/internal/metadata/generated_metrics.go index c4a7d7c735fb..3d1bf97bcc37 100644 --- a/receiver/k8sclusterreceiver/internal/metadata/generated_metrics.go +++ b/receiver/k8sclusterreceiver/internal/metadata/generated_metrics.go @@ -2249,9 +2249,6 @@ func WithStartTime(startTime pcommon.Timestamp) metricBuilderOption { } func NewMetricsBuilder(mbc MetricsBuilderConfig, settings receiver.CreateSettings, options ...metricBuilderOption) *MetricsBuilder { - if mbc.ResourceAttributes.K8sKubeproxyVersion.enabledSetByUser { - settings.Logger.Warn("[WARNING] `k8s.kubeproxy.version` should not be configured: k8s.kubeproxy.version resource attribute is deprecated and will be removed soon.") - } mb := &MetricsBuilder{ config: mbc, startTime: pcommon.NewTimestampFromTime(time.Now()), diff --git a/receiver/k8sclusterreceiver/internal/metadata/generated_metrics_test.go b/receiver/k8sclusterreceiver/internal/metadata/generated_metrics_test.go index 18b67c686dbd..e424dccfd551 100644 --- a/receiver/k8sclusterreceiver/internal/metadata/generated_metrics_test.go +++ b/receiver/k8sclusterreceiver/internal/metadata/generated_metrics_test.go @@ -49,10 +49,6 @@ func TestMetricsBuilder(t *testing.T) { mb := NewMetricsBuilder(loadMetricsBuilderConfig(t, test.name), settings, WithStartTime(start)) expectedWarnings := 0 - if test.configSet == testSetAll || test.configSet == testSetNone { - assert.Equal(t, "[WARNING] `k8s.kubeproxy.version` should not be configured: k8s.kubeproxy.version resource attribute is deprecated and will be removed soon.", observedLogs.All()[expectedWarnings].Message) - expectedWarnings++ - } assert.Equal(t, expectedWarnings, observedLogs.Len()) @@ -251,7 +247,6 @@ func TestMetricsBuilder(t *testing.T) { rb.SetK8sJobName("k8s.job.name-val") rb.SetK8sJobUID("k8s.job.uid-val") rb.SetK8sKubeletVersion("k8s.kubelet.version-val") - rb.SetK8sKubeproxyVersion("k8s.kubeproxy.version-val") rb.SetK8sNamespaceName("k8s.namespace.name-val") rb.SetK8sNamespaceUID("k8s.namespace.uid-val") rb.SetK8sNodeName("k8s.node.name-val") diff --git a/receiver/k8sclusterreceiver/internal/metadata/generated_resource.go b/receiver/k8sclusterreceiver/internal/metadata/generated_resource.go index 6002f6e6e053..6f09fd36190a 100644 --- a/receiver/k8sclusterreceiver/internal/metadata/generated_resource.go +++ b/receiver/k8sclusterreceiver/internal/metadata/generated_resource.go @@ -140,13 +140,6 @@ func (rb *ResourceBuilder) SetK8sKubeletVersion(val string) { } } -// SetK8sKubeproxyVersion sets provided value as "k8s.kubeproxy.version" attribute. -func (rb *ResourceBuilder) SetK8sKubeproxyVersion(val string) { - if rb.config.K8sKubeproxyVersion.Enabled { - rb.res.Attributes().PutStr("k8s.kubeproxy.version", val) - } -} - // SetK8sNamespaceName sets provided value as "k8s.namespace.name" attribute. func (rb *ResourceBuilder) SetK8sNamespaceName(val string) { if rb.config.K8sNamespaceName.Enabled { diff --git a/receiver/k8sclusterreceiver/internal/metadata/generated_resource_test.go b/receiver/k8sclusterreceiver/internal/metadata/generated_resource_test.go index ead39ea2bc2b..915bf92cd9d6 100644 --- a/receiver/k8sclusterreceiver/internal/metadata/generated_resource_test.go +++ b/receiver/k8sclusterreceiver/internal/metadata/generated_resource_test.go @@ -30,7 +30,6 @@ func TestResourceBuilder(t *testing.T) { rb.SetK8sJobName("k8s.job.name-val") rb.SetK8sJobUID("k8s.job.uid-val") rb.SetK8sKubeletVersion("k8s.kubelet.version-val") - rb.SetK8sKubeproxyVersion("k8s.kubeproxy.version-val") rb.SetK8sNamespaceName("k8s.namespace.name-val") rb.SetK8sNamespaceUID("k8s.namespace.uid-val") rb.SetK8sNodeName("k8s.node.name-val") @@ -58,7 +57,7 @@ func TestResourceBuilder(t *testing.T) { case "default": assert.Equal(t, 30, res.Attributes().Len()) case "all_set": - assert.Equal(t, 37, res.Attributes().Len()) + assert.Equal(t, 36, res.Attributes().Len()) case "none_set": assert.Equal(t, 0, res.Attributes().Len()) return @@ -151,11 +150,6 @@ func TestResourceBuilder(t *testing.T) { if ok { assert.EqualValues(t, "k8s.kubelet.version-val", val.Str()) } - val, ok = res.Attributes().Get("k8s.kubeproxy.version") - assert.Equal(t, test == "all_set", ok) - if ok { - assert.EqualValues(t, "k8s.kubeproxy.version-val", val.Str()) - } val, ok = res.Attributes().Get("k8s.namespace.name") assert.True(t, ok) if ok { diff --git a/receiver/k8sclusterreceiver/internal/metadata/generated_status.go b/receiver/k8sclusterreceiver/internal/metadata/generated_status.go index 290d9fefb06b..13fc6d64c54f 100644 --- a/receiver/k8sclusterreceiver/internal/metadata/generated_status.go +++ b/receiver/k8sclusterreceiver/internal/metadata/generated_status.go @@ -13,8 +13,8 @@ var ( ) const ( - MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelDevelopment + MetricsStability = component.StabilityLevelBeta ) func Meter(settings component.TelemetrySettings) metric.Meter { diff --git a/receiver/k8sclusterreceiver/internal/metadata/testdata/config.yaml b/receiver/k8sclusterreceiver/internal/metadata/testdata/config.yaml index bd8704d966e3..942580b5a61d 100644 --- a/receiver/k8sclusterreceiver/internal/metadata/testdata/config.yaml +++ b/receiver/k8sclusterreceiver/internal/metadata/testdata/config.yaml @@ -124,8 +124,6 @@ all_set: enabled: true k8s.kubelet.version: enabled: true - k8s.kubeproxy.version: - enabled: true k8s.namespace.name: enabled: true k8s.namespace.uid: @@ -289,8 +287,6 @@ none_set: enabled: false k8s.kubelet.version: enabled: false - k8s.kubeproxy.version: - enabled: false k8s.namespace.name: enabled: false k8s.namespace.uid: diff --git a/receiver/k8sclusterreceiver/internal/node/nodes.go b/receiver/k8sclusterreceiver/internal/node/nodes.go index 8c63d3b965a0..2c4ca73abf3f 100644 --- a/receiver/k8sclusterreceiver/internal/node/nodes.go +++ b/receiver/k8sclusterreceiver/internal/node/nodes.go @@ -36,7 +36,6 @@ func Transform(node *corev1.Node) *corev1.Node { Allocatable: node.Status.Allocatable, NodeInfo: corev1.NodeSystemInfo{ KubeletVersion: node.Status.NodeInfo.KubeletVersion, - KubeProxyVersion: node.Status.NodeInfo.KubeProxyVersion, ContainerRuntimeVersion: node.Status.NodeInfo.ContainerRuntimeVersion, OSImage: node.Status.NodeInfo.OSImage, OperatingSystem: node.Status.NodeInfo.OperatingSystem, @@ -60,7 +59,6 @@ func RecordMetrics(mb *imetadata.MetricsBuilder, node *corev1.Node, ts pcommon.T rb.SetK8sNodeUID(string(node.UID)) rb.SetK8sNodeName(node.Name) rb.SetK8sKubeletVersion(node.Status.NodeInfo.KubeletVersion) - rb.SetK8sKubeproxyVersion(node.Status.NodeInfo.KubeProxyVersion) mb.EmitForResource(imetadata.WithResource(rb.Emit())) } @@ -114,7 +112,6 @@ func CustomMetrics(set receiver.CreateSettings, rb *metadata.ResourceBuilder, no rb.SetK8sNodeUID(string(node.UID)) rb.SetK8sNodeName(node.Name) rb.SetK8sKubeletVersion(node.Status.NodeInfo.KubeletVersion) - rb.SetK8sKubeproxyVersion(node.Status.NodeInfo.KubeProxyVersion) rb.SetOsType(node.Status.NodeInfo.OperatingSystem) runtime, version := getContainerRuntimeInfo(node.Status.NodeInfo.ContainerRuntimeVersion) diff --git a/receiver/k8sclusterreceiver/internal/node/nodes_test.go b/receiver/k8sclusterreceiver/internal/node/nodes_test.go index 5bb613b4abf2..2705fe26a01a 100644 --- a/receiver/k8sclusterreceiver/internal/node/nodes_test.go +++ b/receiver/k8sclusterreceiver/internal/node/nodes_test.go @@ -65,7 +65,6 @@ func TestNodeOptionalMetrics(t *testing.T) { n := testutils.NewNode("2") rac := metadata.DefaultResourceAttributesConfig() rac.K8sKubeletVersion.Enabled = true - rac.K8sKubeproxyVersion.Enabled = true rac.ContainerRuntime.Enabled = true rac.ContainerRuntimeVersion.Enabled = true rac.OsType.Enabled = true @@ -255,7 +254,6 @@ func TestTransform(t *testing.T) { }, NodeInfo: corev1.NodeSystemInfo{ KubeletVersion: "v1.25.3", - KubeProxyVersion: "v1.25.3", OSImage: "Ubuntu 22.04.1 LTS", ContainerRuntimeVersion: "containerd://1.6.9", OperatingSystem: "linux", diff --git a/receiver/k8sclusterreceiver/internal/node/testdata/expected_optional.yaml b/receiver/k8sclusterreceiver/internal/node/testdata/expected_optional.yaml index 9c95a3edf621..2a8756e50f09 100644 --- a/receiver/k8sclusterreceiver/internal/node/testdata/expected_optional.yaml +++ b/receiver/k8sclusterreceiver/internal/node/testdata/expected_optional.yaml @@ -10,9 +10,6 @@ resourceMetrics: - key: k8s.kubelet.version value: stringValue: v1.25.3 - - key: k8s.kubeproxy.version - value: - stringValue: v1.25.3 - key: container.runtime.version value: stringValue: "1.6.9" diff --git a/receiver/k8sclusterreceiver/internal/testutils/objects.go b/receiver/k8sclusterreceiver/internal/testutils/objects.go index 84bd3983bd24..228383cd380c 100644 --- a/receiver/k8sclusterreceiver/internal/testutils/objects.go +++ b/receiver/k8sclusterreceiver/internal/testutils/objects.go @@ -202,7 +202,6 @@ func NewNode(id string) *corev1.Node { }, NodeInfo: corev1.NodeSystemInfo{ KubeletVersion: "v1.25.3", - KubeProxyVersion: "v1.25.3", OSImage: "Ubuntu 22.04.1 LTS", ContainerRuntimeVersion: "containerd://1.6.9", OperatingSystem: "linux", diff --git a/receiver/k8sclusterreceiver/metadata.yaml b/receiver/k8sclusterreceiver/metadata.yaml index 70fe006ff7c6..a36ba6d3eab7 100644 --- a/receiver/k8sclusterreceiver/metadata.yaml +++ b/receiver/k8sclusterreceiver/metadata.yaml @@ -182,13 +182,6 @@ resource_attributes: type: string enabled: false - k8s.kubeproxy.version: - description: The version of Kube Proxy running on the node. - type: string - enabled: false - warnings: - if_configured: k8s.kubeproxy.version resource attribute is deprecated and will be removed soon. - openshift.clusterquota.uid: description: The k8s ClusterResourceQuota uid. type: string @@ -517,3 +510,7 @@ metrics: # k8s.node.allocatable_* metrics (k8s.node.allocatable_cpu, k8s.node.allocatable_memory, etc) are controlled # by allocatable_types_to_report config option. By default, none of them are reported. + +tests: + config: + skip_lifecycle: true diff --git a/receiver/k8seventsreceiver/generated_component_test.go b/receiver/k8seventsreceiver/generated_component_test.go index 9b4b39824574..af79071367a4 100644 --- a/receiver/k8seventsreceiver/generated_component_test.go +++ b/receiver/k8seventsreceiver/generated_component_test.go @@ -8,23 +8,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,22 +44,5 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - require.NoError(t, err) - require.NoError(t, firstRcvr.Start(context.Background(), host)) - require.NoError(t, firstRcvr.Shutdown(context.Background())) - secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - require.NoError(t, secondRcvr.Start(context.Background(), host)) - require.NoError(t, secondRcvr.Shutdown(context.Background())) - }) } } diff --git a/receiver/k8seventsreceiver/go.mod b/receiver/k8seventsreceiver/go.mod index 9b49f47d1ef4..6dca347a03e9 100644 --- a/receiver/k8seventsreceiver/go.mod +++ b/receiver/k8seventsreceiver/go.mod @@ -13,7 +13,7 @@ require ( go.opentelemetry.io/collector/semconv v0.95.0 go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 k8s.io/api v0.29.2 k8s.io/apimachinery v0.29.2 k8s.io/client-go v0.29.2 diff --git a/receiver/k8seventsreceiver/go.sum b/receiver/k8seventsreceiver/go.sum index aee77a51ee26..2155563f0b4c 100644 --- a/receiver/k8seventsreceiver/go.sum +++ b/receiver/k8seventsreceiver/go.sum @@ -299,8 +299,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= diff --git a/receiver/k8seventsreceiver/metadata.yaml b/receiver/k8seventsreceiver/metadata.yaml index febae1aca702..241b92d25089 100644 --- a/receiver/k8seventsreceiver/metadata.yaml +++ b/receiver/k8seventsreceiver/metadata.yaml @@ -8,6 +8,6 @@ status: codeowners: active: [dmitryax, TylerHelmuth] +# TODO: Update the receiver to pass the tests tests: - config: skip_lifecycle: true diff --git a/receiver/k8sobjectsreceiver/factory_test.go b/receiver/k8sobjectsreceiver/factory_test.go index 2f4f227ff667..77e3676dbc4b 100644 --- a/receiver/k8sobjectsreceiver/factory_test.go +++ b/receiver/k8sobjectsreceiver/factory_test.go @@ -9,6 +9,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver/receivertest" @@ -42,8 +43,9 @@ func TestCreateReceiver(t *testing.T) { context.Background(), receivertest.NewNopCreateSettings(), rCfg, consumertest.NewNop(), ) + assert.NoError(t, err) + err = r.Start(context.Background(), componenttest.NewNopHost()) assert.Error(t, err) - assert.Nil(t, r) // Override for test. rCfg.makeDynamicClient = newMockDynamicClient().getMockDynamicClient diff --git a/receiver/k8sobjectsreceiver/generated_component_test.go b/receiver/k8sobjectsreceiver/generated_component_test.go new file mode 100644 index 000000000000..e55bd7d112cd --- /dev/null +++ b/receiver/k8sobjectsreceiver/generated_component_test.go @@ -0,0 +1,48 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package k8sobjectsreceiver + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/consumer/consumertest" + "go.opentelemetry.io/collector/receiver" + "go.opentelemetry.io/collector/receiver/receivertest" +) + +func TestComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "logs", + createFn: func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateLogsReceiver(ctx, set, cfg, consumertest.NewNop()) + }, + }, + } + + cm, err := confmaptest.LoadConf("metadata.yaml") + require.NoError(t, err) + cfg := factory.CreateDefaultConfig() + sub, err := cm.Sub("tests::config") + require.NoError(t, err) + require.NoError(t, component.UnmarshalConfig(sub, cfg)) + + for _, test := range tests { + t.Run(test.name+"-shutdown", func(t *testing.T) { + c, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + } +} diff --git a/receiver/k8sobjectsreceiver/go.mod b/receiver/k8sobjectsreceiver/go.mod index 1fc534bc3cb3..2afba842f9fc 100644 --- a/receiver/k8sobjectsreceiver/go.mod +++ b/receiver/k8sobjectsreceiver/go.mod @@ -18,7 +18,7 @@ require ( go.opentelemetry.io/collector/semconv v0.95.0 go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 k8s.io/apimachinery v0.29.2 k8s.io/client-go v0.29.2 ) diff --git a/receiver/k8sobjectsreceiver/go.sum b/receiver/k8sobjectsreceiver/go.sum index f1f5b56d530c..40bd4c3a4023 100644 --- a/receiver/k8sobjectsreceiver/go.sum +++ b/receiver/k8sobjectsreceiver/go.sum @@ -388,8 +388,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= diff --git a/receiver/k8sobjectsreceiver/metadata.yaml b/receiver/k8sobjectsreceiver/metadata.yaml index 1b3be8ed15ae..1a3f089ec5ec 100644 --- a/receiver/k8sobjectsreceiver/metadata.yaml +++ b/receiver/k8sobjectsreceiver/metadata.yaml @@ -7,3 +7,7 @@ status: distributions: [contrib, splunk, sumo] codeowners: active: [dmitryax, hvaghani221, TylerHelmuth] + +tests: + config: + skip_lifecycle: true \ No newline at end of file diff --git a/receiver/k8sobjectsreceiver/receiver.go b/receiver/k8sobjectsreceiver/receiver.go index 71e32c75cba0..c1c4c05a2c08 100644 --- a/receiver/k8sobjectsreceiver/receiver.go +++ b/receiver/k8sobjectsreceiver/receiver.go @@ -28,7 +28,7 @@ import ( type k8sobjectsreceiver struct { setting receiver.CreateSettings - objects []*K8sObjectsConfig + config *Config stopperChanList []chan struct{} client dynamic.Interface consumer consumer.Logs @@ -38,10 +38,6 @@ type k8sobjectsreceiver struct { func newReceiver(params receiver.CreateSettings, config *Config, consumer consumer.Logs) (receiver.Logs, error) { transport := "http" - client, err := config.getDynamicClient() - if err != nil { - return nil, err - } obsrecv, err := receiverhelper.NewObsReport(receiverhelper.ObsReportSettings{ ReceiverID: params.ID, @@ -60,19 +56,23 @@ func newReceiver(params receiver.CreateSettings, config *Config, consumer consum } return &k8sobjectsreceiver{ - client: client, setting: params, consumer: consumer, - objects: config.Objects, + config: config, obsrecv: obsrecv, mu: sync.Mutex{}, }, nil } func (kr *k8sobjectsreceiver) Start(ctx context.Context, _ component.Host) error { + client, err := kr.config.getDynamicClient() + if err != nil { + return err + } + kr.client = client kr.setting.Logger.Info("Object Receiver started") - for _, object := range kr.objects { + for _, object := range kr.config.Objects { kr.start(ctx, object) } return nil diff --git a/receiver/kafkametricsreceiver/generated_component_test.go b/receiver/kafkametricsreceiver/generated_component_test.go index 41209177681d..c1f0ddd8ccbb 100644 --- a/receiver/kafkametricsreceiver/generated_component_test.go +++ b/receiver/kafkametricsreceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/kafkametricsreceiver/go.mod b/receiver/kafkametricsreceiver/go.mod index 1f9bd6d5fb02..2cd8c62d0995 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.21 require ( - github.com/IBM/sarama v1.42.2 + github.com/IBM/sarama v1.43.0 github.com/google/go-cmp v0.6.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/kafka v0.95.0 github.com/stretchr/testify v1.8.4 @@ -17,15 +17,15 @@ require ( go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( - github.com/aws/aws-sdk-go v1.50.17 // indirect + github.com/aws/aws-sdk-go v1.50.27 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/eapache/go-resiliency v1.5.0 // indirect + github.com/eapache/go-resiliency v1.6.0 // indirect github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 // indirect github.com/eapache/queue v1.1.0 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect @@ -45,7 +45,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.2 // indirect + github.com/klauspost/compress v1.17.7 // 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.0 // indirect diff --git a/receiver/kafkametricsreceiver/go.sum b/receiver/kafkametricsreceiver/go.sum index 36d0fbddfc7a..ca8775f58bca 100644 --- a/receiver/kafkametricsreceiver/go.sum +++ b/receiver/kafkametricsreceiver/go.sum @@ -1,7 +1,7 @@ -github.com/IBM/sarama v1.42.2 h1:VoY4hVIZ+WQJ8G9KNY/SQlWguBQXQ9uvFPOnrcu8hEw= -github.com/IBM/sarama v1.42.2/go.mod h1:FLPGUGwYqEs62hq2bVG6Io2+5n+pS6s/WOXVKWSLFtE= -github.com/aws/aws-sdk-go v1.50.17 h1:KsbzUKDgGNlkDHGvoQDhiJ63a9jtZd+O+/s3pTOr/ns= -github.com/aws/aws-sdk-go v1.50.17/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/IBM/sarama v1.43.0 h1:YFFDn8mMI2QL0wOrG0J2sFoVIAFl7hS9JQi2YZsXtJc= +github.com/IBM/sarama v1.43.0/go.mod h1:zlE6HEbC/SMQ9mhEYaF7nNLYOUyrs0obySKCckWP9BM= +github.com/aws/aws-sdk-go v1.50.27 h1:96ifhrSuja+AzdP3W/T2337igqVQ2FcSIJYkk+0rCeA= +github.com/aws/aws-sdk-go v1.50.27/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= @@ -10,8 +10,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/eapache/go-resiliency v1.5.0 h1:dRsaR00whmQD+SgVKlq/vCRFNgtEb5yppyeVos3Yce0= -github.com/eapache/go-resiliency v1.5.0/go.mod h1:5yPzW0MIvSe0JDsv0v+DvcjEv2FyD6iZYSs1ZI+iQho= +github.com/eapache/go-resiliency v1.6.0 h1:CqGDTLtpwuWKn6Nj3uNUdflaq+/kIPsg0gfNzHton30= +github.com/eapache/go-resiliency v1.6.0/go.mod h1:5yPzW0MIvSe0JDsv0v+DvcjEv2FyD6iZYSs1ZI+iQho= github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 h1:Oy0F4ALJ04o5Qqpdz8XLIpNA3WM/iSIXqxtqo7UGVws= github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3/go.mod h1:YvSRo5mw33fLEx1+DlK6L2VV43tJt5Eyel9n9XBcR+0= github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc= @@ -68,8 +68,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.2 h1:RlWWUY/Dr4fL8qk9YG7DTZ7PDgME2V4csBXA8L/ixi4= -github.com/klauspost/compress v1.17.2/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLAKQQg= +github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= @@ -162,8 +162,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/kafkareceiver/generated_component_test.go b/receiver/kafkareceiver/generated_component_test.go index 18f3eca1908b..5535405eb885 100644 --- a/receiver/kafkareceiver/generated_component_test.go +++ b/receiver/kafkareceiver/generated_component_test.go @@ -8,23 +8,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -69,22 +58,5 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - require.NoError(t, err) - require.NoError(t, firstRcvr.Start(context.Background(), host)) - require.NoError(t, firstRcvr.Shutdown(context.Background())) - secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - require.NoError(t, secondRcvr.Start(context.Background(), host)) - require.NoError(t, secondRcvr.Shutdown(context.Background())) - }) } } diff --git a/receiver/kafkareceiver/go.mod b/receiver/kafkareceiver/go.mod index a66eed9119d1..b9fd9d210fca 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.21 require ( - github.com/IBM/sarama v1.42.2 + github.com/IBM/sarama v1.43.0 github.com/apache/thrift v0.19.0 github.com/gogo/protobuf v1.3.2 github.com/jaegertracing/jaeger v1.54.0 @@ -27,16 +27,16 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( - github.com/aws/aws-sdk-go v1.50.17 // indirect + github.com/aws/aws-sdk-go v1.50.27 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/eapache/go-resiliency v1.5.0 // indirect + github.com/eapache/go-resiliency v1.6.0 // indirect github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 // indirect github.com/eapache/queue v1.1.0 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect @@ -54,7 +54,7 @@ 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.4 // indirect + github.com/klauspost/compress v1.17.7 // 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.0 // indirect diff --git a/receiver/kafkareceiver/go.sum b/receiver/kafkareceiver/go.sum index 292ed02b0f7a..f67841d7c976 100644 --- a/receiver/kafkareceiver/go.sum +++ b/receiver/kafkareceiver/go.sum @@ -1,11 +1,11 @@ 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/IBM/sarama v1.42.2 h1:VoY4hVIZ+WQJ8G9KNY/SQlWguBQXQ9uvFPOnrcu8hEw= -github.com/IBM/sarama v1.42.2/go.mod h1:FLPGUGwYqEs62hq2bVG6Io2+5n+pS6s/WOXVKWSLFtE= +github.com/IBM/sarama v1.43.0 h1:YFFDn8mMI2QL0wOrG0J2sFoVIAFl7hS9JQi2YZsXtJc= +github.com/IBM/sarama v1.43.0/go.mod h1:zlE6HEbC/SMQ9mhEYaF7nNLYOUyrs0obySKCckWP9BM= github.com/apache/thrift v0.19.0 h1:sOqkWPzMj7w6XaYbJQG7m4sGqVolaW/0D28Ln7yPzMk= github.com/apache/thrift v0.19.0/go.mod h1:SUALL216IiaOw2Oy+5Vs9lboJ/t9g40C+G07Dc0QC1I= -github.com/aws/aws-sdk-go v1.50.17 h1:KsbzUKDgGNlkDHGvoQDhiJ63a9jtZd+O+/s3pTOr/ns= -github.com/aws/aws-sdk-go v1.50.17/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.50.27 h1:96ifhrSuja+AzdP3W/T2337igqVQ2FcSIJYkk+0rCeA= +github.com/aws/aws-sdk-go v1.50.27/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= @@ -19,8 +19,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/eapache/go-resiliency v1.5.0 h1:dRsaR00whmQD+SgVKlq/vCRFNgtEb5yppyeVos3Yce0= -github.com/eapache/go-resiliency v1.5.0/go.mod h1:5yPzW0MIvSe0JDsv0v+DvcjEv2FyD6iZYSs1ZI+iQho= +github.com/eapache/go-resiliency v1.6.0 h1:CqGDTLtpwuWKn6Nj3uNUdflaq+/kIPsg0gfNzHton30= +github.com/eapache/go-resiliency v1.6.0/go.mod h1:5yPzW0MIvSe0JDsv0v+DvcjEv2FyD6iZYSs1ZI+iQho= github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 h1:Oy0F4ALJ04o5Qqpdz8XLIpNA3WM/iSIXqxtqo7UGVws= github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3/go.mod h1:YvSRo5mw33fLEx1+DlK6L2VV43tJt5Eyel9n9XBcR+0= github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc= @@ -104,8 +104,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.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= -github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLAKQQg= +github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= @@ -212,8 +212,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/kafkareceiver/metadata.yaml b/receiver/kafkareceiver/metadata.yaml index 9c63977b4a8b..d0538c21cd75 100644 --- a/receiver/kafkareceiver/metadata.yaml +++ b/receiver/kafkareceiver/metadata.yaml @@ -15,6 +15,6 @@ status: codeowners: active: [pavolloffay, MovieStoreGuy] +# TODO: Update the receiver to pass the tests tests: - config: skip_lifecycle: true diff --git a/receiver/kubeletstatsreceiver/generated_component_test.go b/receiver/kubeletstatsreceiver/generated_component_test.go new file mode 100644 index 000000000000..f14afe4bf861 --- /dev/null +++ b/receiver/kubeletstatsreceiver/generated_component_test.go @@ -0,0 +1,61 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package kubeletstatsreceiver + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/consumer/consumertest" + "go.opentelemetry.io/collector/receiver" + "go.opentelemetry.io/collector/receiver/receivertest" +) + +func TestComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "metrics", + createFn: func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateMetricsReceiver(ctx, set, cfg, consumertest.NewNop()) + }, + }, + } + + cm, err := confmaptest.LoadConf("metadata.yaml") + require.NoError(t, err) + cfg := factory.CreateDefaultConfig() + sub, err := cm.Sub("tests::config") + require.NoError(t, err) + require.NoError(t, component.UnmarshalConfig(sub, cfg)) + + for _, test := range tests { + t.Run(test.name+"-shutdown", func(t *testing.T) { + c, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + t.Run(test.name+"-lifecycle", func(t *testing.T) { + firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := componenttest.NewNopHost() + require.NoError(t, err) + require.NoError(t, firstRcvr.Start(context.Background(), host)) + require.NoError(t, firstRcvr.Shutdown(context.Background())) + secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + require.NoError(t, secondRcvr.Start(context.Background(), host)) + require.NoError(t, secondRcvr.Shutdown(context.Background())) + }) + } +} diff --git a/receiver/kubeletstatsreceiver/go.mod b/receiver/kubeletstatsreceiver/go.mod index 7b5da1767643..7d4bef583454 100644 --- a/receiver/kubeletstatsreceiver/go.mod +++ b/receiver/kubeletstatsreceiver/go.mod @@ -23,7 +23,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 k8s.io/api v0.29.2 k8s.io/apimachinery v0.29.2 k8s.io/client-go v0.29.2 diff --git a/receiver/kubeletstatsreceiver/go.sum b/receiver/kubeletstatsreceiver/go.sum index fb7b502a6cdc..a09f08f341e2 100644 --- a/receiver/kubeletstatsreceiver/go.sum +++ b/receiver/kubeletstatsreceiver/go.sum @@ -388,8 +388,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= diff --git a/receiver/kubeletstatsreceiver/metadata.yaml b/receiver/kubeletstatsreceiver/metadata.yaml index 1fb375175825..b42cab70ca1a 100644 --- a/receiver/kubeletstatsreceiver/metadata.yaml +++ b/receiver/kubeletstatsreceiver/metadata.yaml @@ -499,3 +499,9 @@ metrics: gauge: value_type: int attributes: [] + +tests: + config: + ca_file: "testdata/testcert.crt" + key_file: "testdata/testkey.key" + cert_file: "testdata/testcert.crt" \ No newline at end of file diff --git a/receiver/lokireceiver/generated_component_test.go b/receiver/lokireceiver/generated_component_test.go index 903fa0308f6a..6479b4b06180 100644 --- a/receiver/lokireceiver/generated_component_test.go +++ b/receiver/lokireceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/lokireceiver/go.mod b/receiver/lokireceiver/go.mod index e5e8768b3b77..672ba25c9635 100644 --- a/receiver/lokireceiver/go.mod +++ b/receiver/lokireceiver/go.mod @@ -20,7 +20,7 @@ require ( go.opentelemetry.io/collector/confmap v0.95.0 go.opentelemetry.io/collector/consumer v0.95.0 go.opentelemetry.io/collector/receiver v0.95.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 google.golang.org/grpc v1.61.0 ) diff --git a/receiver/lokireceiver/go.sum b/receiver/lokireceiver/go.sum index 7fd2ece33f50..86a238dec87c 100644 --- a/receiver/lokireceiver/go.sum +++ b/receiver/lokireceiver/go.sum @@ -194,8 +194,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/lokireceiver/metadata.yaml b/receiver/lokireceiver/metadata.yaml index a3a0572731b5..edad5b935124 100644 --- a/receiver/lokireceiver/metadata.yaml +++ b/receiver/lokireceiver/metadata.yaml @@ -9,6 +9,3 @@ status: - sumo codeowners: active: [mar4uk, jpkrohling] - -tests: - config: diff --git a/receiver/memcachedreceiver/README.md b/receiver/memcachedreceiver/README.md index ee45c5bceda9..1194c117d099 100644 --- a/receiver/memcachedreceiver/README.md +++ b/receiver/memcachedreceiver/README.md @@ -6,7 +6,7 @@ | Stability | [beta]: metrics | | Distributions | [contrib], [observiq], [sumo] | | Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Areceiver%2Fmemcached%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Areceiver%2Fmemcached) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Areceiver%2Fmemcached%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Areceiver%2Fmemcached) | -| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@djaglowski](https://www.github.com/djaglowski) | +| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@djaglowski](https://www.github.com/djaglowski) \| Seeking more code owners! | [beta]: https://github.com/open-telemetry/opentelemetry-collector#beta [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib diff --git a/receiver/memcachedreceiver/generated_component_test.go b/receiver/memcachedreceiver/generated_component_test.go index c3cf580cf53b..88130d45a777 100644 --- a/receiver/memcachedreceiver/generated_component_test.go +++ b/receiver/memcachedreceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/memcachedreceiver/go.mod b/receiver/memcachedreceiver/go.mod index 5caa53343fba..521cd3fe1a48 100644 --- a/receiver/memcachedreceiver/go.mod +++ b/receiver/memcachedreceiver/go.mod @@ -19,7 +19,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/memcachedreceiver/go.sum b/receiver/memcachedreceiver/go.sum index 82e5bea2e7cb..e24b25d18aee 100644 --- a/receiver/memcachedreceiver/go.sum +++ b/receiver/memcachedreceiver/go.sum @@ -177,8 +177,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/memcachedreceiver/metadata.yaml b/receiver/memcachedreceiver/metadata.yaml index dc53328f6ed6..fb18d7d8b9be 100644 --- a/receiver/memcachedreceiver/metadata.yaml +++ b/receiver/memcachedreceiver/metadata.yaml @@ -7,6 +7,7 @@ status: distributions: [contrib, observiq, sumo] codeowners: active: [djaglowski] + seeking_new: true attributes: command: @@ -139,6 +140,3 @@ metrics: monotonic: false aggregation_temporality: cumulative attributes: [] - -tests: - config: diff --git a/receiver/mongodbatlasreceiver/README.md b/receiver/mongodbatlasreceiver/README.md index 29118d287b6c..eb90aad97500 100644 --- a/receiver/mongodbatlasreceiver/README.md +++ b/receiver/mongodbatlasreceiver/README.md @@ -6,7 +6,7 @@ | Stability | [beta]: metrics, logs | | Distributions | [contrib], [observiq], [splunk], [sumo] | | Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Areceiver%2Fmongodbatlas%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Areceiver%2Fmongodbatlas) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Areceiver%2Fmongodbatlas%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Areceiver%2Fmongodbatlas) | -| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@djaglowski](https://www.github.com/djaglowski), [@schmikei](https://www.github.com/schmikei) | +| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@djaglowski](https://www.github.com/djaglowski), [@schmikei](https://www.github.com/schmikei) \| Seeking more code owners! | [beta]: https://github.com/open-telemetry/opentelemetry-collector#beta [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib diff --git a/receiver/mongodbatlasreceiver/generated_component_test.go b/receiver/mongodbatlasreceiver/generated_component_test.go new file mode 100644 index 000000000000..d50d36c9b4a0 --- /dev/null +++ b/receiver/mongodbatlasreceiver/generated_component_test.go @@ -0,0 +1,68 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package mongodbatlasreceiver + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/consumer/consumertest" + "go.opentelemetry.io/collector/receiver" + "go.opentelemetry.io/collector/receiver/receivertest" +) + +func TestComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "logs", + createFn: func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateLogsReceiver(ctx, set, cfg, consumertest.NewNop()) + }, + }, + + { + name: "metrics", + createFn: func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateMetricsReceiver(ctx, set, cfg, consumertest.NewNop()) + }, + }, + } + + cm, err := confmaptest.LoadConf("metadata.yaml") + require.NoError(t, err) + cfg := factory.CreateDefaultConfig() + sub, err := cm.Sub("tests::config") + require.NoError(t, err) + require.NoError(t, component.UnmarshalConfig(sub, cfg)) + + for _, test := range tests { + t.Run(test.name+"-shutdown", func(t *testing.T) { + c, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + t.Run(test.name+"-lifecycle", func(t *testing.T) { + firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := componenttest.NewNopHost() + require.NoError(t, err) + require.NoError(t, firstRcvr.Start(context.Background(), host)) + require.NoError(t, firstRcvr.Shutdown(context.Background())) + secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + require.NoError(t, secondRcvr.Start(context.Background(), host)) + require.NoError(t, secondRcvr.Shutdown(context.Background())) + }) + } +} diff --git a/receiver/mongodbatlasreceiver/go.mod b/receiver/mongodbatlasreceiver/go.mod index 6a47a21bc348..838683c8b814 100644 --- a/receiver/mongodbatlasreceiver/go.mod +++ b/receiver/mongodbatlasreceiver/go.mod @@ -25,7 +25,7 @@ require ( go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/mongodbatlasreceiver/go.sum b/receiver/mongodbatlasreceiver/go.sum index 89c8e7da3d7d..cc91661abe19 100644 --- a/receiver/mongodbatlasreceiver/go.sum +++ b/receiver/mongodbatlasreceiver/go.sum @@ -138,8 +138,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/mongodbatlasreceiver/metadata.yaml b/receiver/mongodbatlasreceiver/metadata.yaml index 70c480db697d..73107d16da22 100644 --- a/receiver/mongodbatlasreceiver/metadata.yaml +++ b/receiver/mongodbatlasreceiver/metadata.yaml @@ -7,6 +7,7 @@ status: distributions: [contrib, splunk, observiq, sumo] codeowners: active: [djaglowski, schmikei] + seeking_new: true resource_attributes: mongodb_atlas.org_name: @@ -728,3 +729,8 @@ metrics: attributes: [cpu_state] gauge: value_type: double + +tests: + config: + alerts: + enabled: true diff --git a/receiver/mongodbreceiver/README.md b/receiver/mongodbreceiver/README.md index ab01a808c778..48edf6525209 100644 --- a/receiver/mongodbreceiver/README.md +++ b/receiver/mongodbreceiver/README.md @@ -6,7 +6,7 @@ | Stability | [beta]: metrics | | Distributions | [contrib], [observiq], [sumo] | | Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Areceiver%2Fmongodb%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Areceiver%2Fmongodb) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Areceiver%2Fmongodb%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Areceiver%2Fmongodb) | -| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@djaglowski](https://www.github.com/djaglowski), [@schmikei](https://www.github.com/schmikei) | +| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@djaglowski](https://www.github.com/djaglowski), [@schmikei](https://www.github.com/schmikei) \| Seeking more code owners! | [beta]: https://github.com/open-telemetry/opentelemetry-collector#beta [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib diff --git a/receiver/mongodbreceiver/generated_component_test.go b/receiver/mongodbreceiver/generated_component_test.go index d9c8121165a2..c1c01c227dfd 100644 --- a/receiver/mongodbreceiver/generated_component_test.go +++ b/receiver/mongodbreceiver/generated_component_test.go @@ -8,23 +8,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,22 +44,5 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - require.NoError(t, err) - require.NoError(t, firstRcvr.Start(context.Background(), host)) - require.NoError(t, firstRcvr.Shutdown(context.Background())) - secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - require.NoError(t, secondRcvr.Start(context.Background(), host)) - require.NoError(t, secondRcvr.Shutdown(context.Background())) - }) } } diff --git a/receiver/mongodbreceiver/go.mod b/receiver/mongodbreceiver/go.mod index 29313218f694..e27a0cbed151 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.95.0 github.com/stretchr/testify v1.8.4 github.com/testcontainers/testcontainers-go v0.27.0 - go.mongodb.org/mongo-driver v1.13.1 + go.mongodb.org/mongo-driver v1.14.0 go.opentelemetry.io/collector/component v0.95.0 go.opentelemetry.io/collector/config/confignet v0.95.0 go.opentelemetry.io/collector/config/configopaque v1.2.0 @@ -24,7 +24,7 @@ require ( go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/mongodbreceiver/go.sum b/receiver/mongodbreceiver/go.sum index c8841df1d81c..f96485846be9 100644 --- a/receiver/mongodbreceiver/go.sum +++ b/receiver/mongodbreceiver/go.sum @@ -49,10 +49,8 @@ github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69 github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= 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.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= @@ -67,7 +65,6 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.17.2 h1:RlWWUY/Dr4fL8qk9YG7DTZ7PDgME2V4csBXA8L/ixi4= github.com/klauspost/compress v1.17.2/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= @@ -164,8 +161,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.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw= github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= -go.mongodb.org/mongo-driver v1.13.1 h1:YIc7HTYsKndGK4RFzJ3covLz1byri52x0IoMB0Pt/vk= -go.mongodb.org/mongo-driver v1.13.1/go.mod h1:wcDf1JBCXy2mOW0bWHwO/IOYqdca1MPCwDtFu/Z9+eo= +go.mongodb.org/mongo-driver v1.14.0 h1:P98w8egYRjYe3XDjxhYJagTokP/H6HzlsnojRgZRd80= +go.mongodb.org/mongo-driver v1.14.0/go.mod h1:Vzb0Mk/pa7e6cWw85R4F/endUC3u0U9jGcNU603k65c= go.opentelemetry.io/collector v0.95.0 h1:DFW0BkF2sOocpA3NUPrbMeuPSN3PWxFBrLqs/Cxn3vo= go.opentelemetry.io/collector v0.95.0/go.mod h1:Lc+VkOkSBppKqR/cAevS5oPrbtUO3JUbYzo91niRkG0= go.opentelemetry.io/collector/component v0.95.0 h1:68tI7KVy1bfpaR83+LxUvjd9/hjDh78utklGl2t6eVM= @@ -204,13 +201,12 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 h1:FqrVOBQxQ8r/UwwXibI0KMolVhvFiGobSfdE33deHJM= @@ -225,7 +221,6 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL 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.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= @@ -241,7 +236,6 @@ golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7w 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-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -255,10 +249,8 @@ golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9sn golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= 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.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= diff --git a/receiver/mongodbreceiver/metadata.yaml b/receiver/mongodbreceiver/metadata.yaml index 1ed1593190cd..76dd526542c5 100644 --- a/receiver/mongodbreceiver/metadata.yaml +++ b/receiver/mongodbreceiver/metadata.yaml @@ -7,6 +7,7 @@ status: distributions: [contrib, observiq, sumo] codeowners: active: [djaglowski, schmikei] + seeking_new: true resource_attributes: database: @@ -350,6 +351,6 @@ metrics: aggregation_temporality: cumulative attributes: [ ] +# TODO: Update the receiver to pass the tests tests: - config: skip_lifecycle: true diff --git a/receiver/mysqlreceiver/generated_component_test.go b/receiver/mysqlreceiver/generated_component_test.go index 7604a6875e26..b257f39c8402 100644 --- a/receiver/mysqlreceiver/generated_component_test.go +++ b/receiver/mysqlreceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/mysqlreceiver/go.mod b/receiver/mysqlreceiver/go.mod index ebee10022fa4..be617d6d7a65 100644 --- a/receiver/mysqlreceiver/go.mod +++ b/receiver/mysqlreceiver/go.mod @@ -21,7 +21,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/mysqlreceiver/go.sum b/receiver/mysqlreceiver/go.sum index 9b9cce20ed2c..eb25334bda5e 100644 --- a/receiver/mysqlreceiver/go.sum +++ b/receiver/mysqlreceiver/go.sum @@ -183,8 +183,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/mysqlreceiver/metadata.yaml b/receiver/mysqlreceiver/metadata.yaml index 34349e7f69ac..a82e65fa7bfc 100644 --- a/receiver/mysqlreceiver/metadata.yaml +++ b/receiver/mysqlreceiver/metadata.yaml @@ -579,6 +579,3 @@ metrics: input_type: string monotonic: true aggregation_temporality: cumulative - -tests: - config: \ No newline at end of file diff --git a/receiver/namedpipereceiver/generated_component_test.go b/receiver/namedpipereceiver/generated_component_test.go new file mode 100644 index 000000000000..15b61aa479e2 --- /dev/null +++ b/receiver/namedpipereceiver/generated_component_test.go @@ -0,0 +1,62 @@ +// Code generated by mdatagen. DO NOT EDIT. +//go:build !windows && !darwin + +package namedpipereceiver + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/consumer/consumertest" + "go.opentelemetry.io/collector/receiver" + "go.opentelemetry.io/collector/receiver/receivertest" +) + +func TestComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "logs", + createFn: func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateLogsReceiver(ctx, set, cfg, consumertest.NewNop()) + }, + }, + } + + cm, err := confmaptest.LoadConf("metadata.yaml") + require.NoError(t, err) + cfg := factory.CreateDefaultConfig() + sub, err := cm.Sub("tests::config") + require.NoError(t, err) + require.NoError(t, component.UnmarshalConfig(sub, cfg)) + + for _, test := range tests { + t.Run(test.name+"-shutdown", func(t *testing.T) { + c, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + t.Run(test.name+"-lifecycle", func(t *testing.T) { + firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := componenttest.NewNopHost() + require.NoError(t, err) + require.NoError(t, firstRcvr.Start(context.Background(), host)) + require.NoError(t, firstRcvr.Shutdown(context.Background())) + secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + require.NoError(t, secondRcvr.Start(context.Background(), host)) + require.NoError(t, secondRcvr.Shutdown(context.Background())) + }) + } +} diff --git a/receiver/namedpipereceiver/go.mod b/receiver/namedpipereceiver/go.mod index 08e8587658ca..6ab38e0c09cf 100644 --- a/receiver/namedpipereceiver/go.mod +++ b/receiver/namedpipereceiver/go.mod @@ -12,7 +12,7 @@ require ( go.opentelemetry.io/collector/receiver v0.95.0 go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/namedpipereceiver/go.sum b/receiver/namedpipereceiver/go.sum index 4a350b28b78e..88efe3135959 100644 --- a/receiver/namedpipereceiver/go.sum +++ b/receiver/namedpipereceiver/go.sum @@ -120,8 +120,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/namedpipereceiver/metadata.yaml b/receiver/namedpipereceiver/metadata.yaml index 7a2484200808..ce61a5b535b8 100644 --- a/receiver/namedpipereceiver/metadata.yaml +++ b/receiver/namedpipereceiver/metadata.yaml @@ -7,3 +7,9 @@ status: distributions: [contrib] codeowners: active: [djaglowski] + unsupported_platforms: [windows, darwin] + +tests: + config: + path: /tmp/pipe + mode: 0600 diff --git a/receiver/nginxreceiver/generated_component_test.go b/receiver/nginxreceiver/generated_component_test.go index 786dfe6a9c2d..b26ff510de4e 100644 --- a/receiver/nginxreceiver/generated_component_test.go +++ b/receiver/nginxreceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/nginxreceiver/go.mod b/receiver/nginxreceiver/go.mod index 8219714de2bb..fe477fa263e8 100644 --- a/receiver/nginxreceiver/go.mod +++ b/receiver/nginxreceiver/go.mod @@ -20,7 +20,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/nginxreceiver/go.sum b/receiver/nginxreceiver/go.sum index 936f990e0467..1384f69e7639 100644 --- a/receiver/nginxreceiver/go.sum +++ b/receiver/nginxreceiver/go.sum @@ -205,8 +205,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/nginxreceiver/metadata.yaml b/receiver/nginxreceiver/metadata.yaml index 4303ff3b32a1..c5cd9aa4987f 100644 --- a/receiver/nginxreceiver/metadata.yaml +++ b/receiver/nginxreceiver/metadata.yaml @@ -55,6 +55,3 @@ metrics: monotonic: false aggregation_temporality: cumulative attributes: [state] - -tests: - config: diff --git a/receiver/nsxtreceiver/generated_component_test.go b/receiver/nsxtreceiver/generated_component_test.go index 4c2d48f77354..1feff04ed41c 100644 --- a/receiver/nsxtreceiver/generated_component_test.go +++ b/receiver/nsxtreceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/nsxtreceiver/go.mod b/receiver/nsxtreceiver/go.mod index a621e024754d..792dc5520dc2 100644 --- a/receiver/nsxtreceiver/go.mod +++ b/receiver/nsxtreceiver/go.mod @@ -19,7 +19,7 @@ require ( go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/nsxtreceiver/go.sum b/receiver/nsxtreceiver/go.sum index 18170c958daf..aa66b9d877e0 100644 --- a/receiver/nsxtreceiver/go.sum +++ b/receiver/nsxtreceiver/go.sum @@ -137,8 +137,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/nsxtreceiver/metadata.yaml b/receiver/nsxtreceiver/metadata.yaml index 6a6d357c289d..08ba878f6dff 100644 --- a/receiver/nsxtreceiver/metadata.yaml +++ b/receiver/nsxtreceiver/metadata.yaml @@ -112,5 +112,3 @@ metrics: value_type: int aggregation_temporality: cumulative enabled: true -tests: - config: \ No newline at end of file diff --git a/receiver/opencensusreceiver/generated_component_test.go b/receiver/opencensusreceiver/generated_component_test.go index 11f4704d8487..55f390324d6d 100644 --- a/receiver/opencensusreceiver/generated_component_test.go +++ b/receiver/opencensusreceiver/generated_component_test.go @@ -8,23 +8,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -62,22 +51,5 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - require.NoError(t, err) - require.NoError(t, firstRcvr.Start(context.Background(), host)) - require.NoError(t, firstRcvr.Shutdown(context.Background())) - secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - require.NoError(t, secondRcvr.Start(context.Background(), host)) - require.NoError(t, secondRcvr.Shutdown(context.Background())) - }) } } diff --git a/receiver/opencensusreceiver/go.mod b/receiver/opencensusreceiver/go.mod index 3e30a44e0851..b7f72c9cdd4f 100644 --- a/receiver/opencensusreceiver/go.mod +++ b/receiver/opencensusreceiver/go.mod @@ -74,7 +74,7 @@ require ( go.opentelemetry.io/otel/exporters/prometheus v0.45.2 // indirect go.opentelemetry.io/otel/sdk/metric v1.23.1 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.26.0 // indirect + go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.20.0 // indirect golang.org/x/sys v0.16.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/receiver/opencensusreceiver/go.sum b/receiver/opencensusreceiver/go.sum index 3e0af2a2ef40..42ad27bd0151 100644 --- a/receiver/opencensusreceiver/go.sum +++ b/receiver/opencensusreceiver/go.sum @@ -183,8 +183,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/oracledbreceiver/factory.go b/receiver/oracledbreceiver/factory.go index 9e5f0be7071d..0fce68e160bd 100644 --- a/receiver/oracledbreceiver/factory.go +++ b/receiver/oracledbreceiver/factory.go @@ -57,7 +57,7 @@ func createReceiverFunc(sqlOpenerFunc sqlOpenerFunc, clientProviderFunc clientPr return nil, err } - mp, err := newScraper(settings.ID, metricsBuilder, sqlCfg.MetricsBuilderConfig, sqlCfg.ScraperControllerSettings, settings.TelemetrySettings.Logger, func() (*sql.DB, error) { + mp, err := newScraper(metricsBuilder, sqlCfg.MetricsBuilderConfig, sqlCfg.ScraperControllerSettings, settings.TelemetrySettings.Logger, func() (*sql.DB, error) { return sqlOpenerFunc(getDataSource(*sqlCfg)) }, clientProviderFunc, instanceName) if err != nil { diff --git a/receiver/oracledbreceiver/generated_component_test.go b/receiver/oracledbreceiver/generated_component_test.go index 02d427463457..065e362f78b6 100644 --- a/receiver/oracledbreceiver/generated_component_test.go +++ b/receiver/oracledbreceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/oracledbreceiver/go.mod b/receiver/oracledbreceiver/go.mod index 4062417eb189..62fc1078365c 100644 --- a/receiver/oracledbreceiver/go.mod +++ b/receiver/oracledbreceiver/go.mod @@ -15,7 +15,7 @@ require ( go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/oracledbreceiver/go.sum b/receiver/oracledbreceiver/go.sum index d6d7e27f4175..376eeed75c41 100644 --- a/receiver/oracledbreceiver/go.sum +++ b/receiver/oracledbreceiver/go.sum @@ -96,8 +96,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/oracledbreceiver/metadata.yaml b/receiver/oracledbreceiver/metadata.yaml index d4d0be3ac398..25d2fddc478e 100644 --- a/receiver/oracledbreceiver/metadata.yaml +++ b/receiver/oracledbreceiver/metadata.yaml @@ -252,6 +252,3 @@ metrics: value_type: int input_type: string unit: "{gets}" - -tests: - config: diff --git a/receiver/oracledbreceiver/scraper.go b/receiver/oracledbreceiver/scraper.go index 01d1a44ed03e..18b9d5aeaa71 100644 --- a/receiver/oracledbreceiver/scraper.go +++ b/receiver/oracledbreceiver/scraper.go @@ -64,7 +64,7 @@ type scraper struct { metricsBuilderConfig metadata.MetricsBuilderConfig } -func newScraper(id component.ID, metricsBuilder *metadata.MetricsBuilder, metricsBuilderConfig metadata.MetricsBuilderConfig, scrapeCfg scraperhelper.ScraperControllerSettings, logger *zap.Logger, providerFunc dbProviderFunc, clientProviderFunc clientProviderFunc, instanceName string) (scraperhelper.Scraper, error) { +func newScraper(metricsBuilder *metadata.MetricsBuilder, metricsBuilderConfig metadata.MetricsBuilderConfig, scrapeCfg scraperhelper.ScraperControllerSettings, logger *zap.Logger, providerFunc dbProviderFunc, clientProviderFunc clientProviderFunc, instanceName string) (scraperhelper.Scraper, error) { s := &scraper{ mb: metricsBuilder, metricsBuilderConfig: metricsBuilderConfig, @@ -74,7 +74,7 @@ func newScraper(id component.ID, metricsBuilder *metadata.MetricsBuilder, metric clientProviderFunc: clientProviderFunc, instanceName: instanceName, } - return scraperhelper.NewScraper(id.String(), s.scrape, scraperhelper.WithShutdown(s.shutdown), scraperhelper.WithStart(s.start)) + return scraperhelper.NewScraper(metadata.Type.String(), s.scrape, scraperhelper.WithShutdown(s.shutdown), scraperhelper.WithStart(s.start)) } func (s *scraper) start(context.Context, component.Host) error { diff --git a/receiver/osqueryreceiver/metadata.yaml b/receiver/osqueryreceiver/metadata.yaml index 192c72af1d4b..c478b71c16a9 100644 --- a/receiver/osqueryreceiver/metadata.yaml +++ b/receiver/osqueryreceiver/metadata.yaml @@ -6,3 +6,8 @@ status: development: [logs] codeowners: active: [codeboten, nslaughter, smithclay] + +# TODO: Update the receiver to pass the tests +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/receiver/otelarrowreceiver/generated_component_test.go b/receiver/otelarrowreceiver/generated_component_test.go new file mode 100644 index 000000000000..d1b9a1f016a3 --- /dev/null +++ b/receiver/otelarrowreceiver/generated_component_test.go @@ -0,0 +1,75 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package otelarrowreceiver + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/consumer/consumertest" + "go.opentelemetry.io/collector/receiver" + "go.opentelemetry.io/collector/receiver/receivertest" +) + +func TestComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "logs", + createFn: func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateLogsReceiver(ctx, set, cfg, consumertest.NewNop()) + }, + }, + + { + name: "metrics", + createFn: func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateMetricsReceiver(ctx, set, cfg, consumertest.NewNop()) + }, + }, + + { + name: "traces", + createFn: func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateTracesReceiver(ctx, set, cfg, consumertest.NewNop()) + }, + }, + } + + cm, err := confmaptest.LoadConf("metadata.yaml") + require.NoError(t, err) + cfg := factory.CreateDefaultConfig() + sub, err := cm.Sub("tests::config") + require.NoError(t, err) + require.NoError(t, component.UnmarshalConfig(sub, cfg)) + + for _, test := range tests { + t.Run(test.name+"-shutdown", func(t *testing.T) { + c, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + t.Run(test.name+"-lifecycle", func(t *testing.T) { + firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := componenttest.NewNopHost() + require.NoError(t, err) + require.NoError(t, firstRcvr.Start(context.Background(), host)) + require.NoError(t, firstRcvr.Shutdown(context.Background())) + secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + require.NoError(t, secondRcvr.Start(context.Background(), host)) + require.NoError(t, secondRcvr.Shutdown(context.Background())) + }) + } +} diff --git a/receiver/otelarrowreceiver/go.mod b/receiver/otelarrowreceiver/go.mod index 672abfd465e6..9c99423175a0 100644 --- a/receiver/otelarrowreceiver/go.mod +++ b/receiver/otelarrowreceiver/go.mod @@ -18,7 +18,7 @@ require ( go.opentelemetry.io/collector/receiver v0.95.0 go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 google.golang.org/grpc v1.61.0 ) diff --git a/receiver/otelarrowreceiver/go.sum b/receiver/otelarrowreceiver/go.sum index 5a98c998d9e7..083ea5b1d83d 100644 --- a/receiver/otelarrowreceiver/go.sum +++ b/receiver/otelarrowreceiver/go.sum @@ -181,8 +181,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= diff --git a/receiver/otlpjsonfilereceiver/generated_component_test.go b/receiver/otlpjsonfilereceiver/generated_component_test.go index 96f3e8ca3b60..92eed6ad71ad 100644 --- a/receiver/otlpjsonfilereceiver/generated_component_test.go +++ b/receiver/otlpjsonfilereceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -69,9 +59,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/otlpjsonfilereceiver/go.mod b/receiver/otlpjsonfilereceiver/go.mod index 4f8b69499276..dcbcdd6d7f8d 100644 --- a/receiver/otlpjsonfilereceiver/go.mod +++ b/receiver/otlpjsonfilereceiver/go.mod @@ -55,7 +55,7 @@ require ( go.opentelemetry.io/otel/sdk v1.23.1 // indirect go.opentelemetry.io/otel/sdk/metric v1.23.1 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.26.0 // indirect + go.uber.org/zap v1.27.0 // indirect golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 // indirect golang.org/x/net v0.20.0 // indirect golang.org/x/sys v0.17.0 // indirect diff --git a/receiver/otlpjsonfilereceiver/go.sum b/receiver/otlpjsonfilereceiver/go.sum index 2d7b807a2379..54856be7c33a 100644 --- a/receiver/otlpjsonfilereceiver/go.sum +++ b/receiver/otlpjsonfilereceiver/go.sum @@ -120,8 +120,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/podmanreceiver/generated_component_test.go b/receiver/podmanreceiver/generated_component_test.go index a91562b4a688..ccaca5212782 100644 --- a/receiver/podmanreceiver/generated_component_test.go +++ b/receiver/podmanreceiver/generated_component_test.go @@ -1,5 +1,4 @@ // Code generated by mdatagen. DO NOT EDIT. - //go:build !windows package podmanreceiver @@ -10,23 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -57,22 +45,5 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - require.NoError(t, err) - require.NoError(t, firstRcvr.Start(context.Background(), host)) - require.NoError(t, firstRcvr.Shutdown(context.Background())) - secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - require.NoError(t, secondRcvr.Start(context.Background(), host)) - require.NoError(t, secondRcvr.Shutdown(context.Background())) - }) } } diff --git a/receiver/podmanreceiver/go.mod b/receiver/podmanreceiver/go.mod index 5ce66ce9613c..60601baa2dc6 100644 --- a/receiver/podmanreceiver/go.mod +++ b/receiver/podmanreceiver/go.mod @@ -14,8 +14,8 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 - golang.org/x/crypto v0.19.0 + go.uber.org/zap v1.27.0 + golang.org/x/crypto v0.20.0 ) require ( @@ -47,7 +47,7 @@ require ( go.opentelemetry.io/otel/exporters/prometheus v0.45.2 // indirect go.opentelemetry.io/otel/sdk v1.23.1 // indirect go.opentelemetry.io/otel/sdk/metric v1.23.1 // indirect - golang.org/x/net v0.20.0 // indirect + golang.org/x/net v0.21.0 // indirect golang.org/x/sys v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917 // indirect diff --git a/receiver/podmanreceiver/go.sum b/receiver/podmanreceiver/go.sum index ae1e4e327978..8424f51c52cc 100644 --- a/receiver/podmanreceiver/go.sum +++ b/receiver/podmanreceiver/go.sum @@ -98,21 +98,21 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +golang.org/x/crypto v0.20.0 h1:jmAMJJZXr5KiCw05dfYK9QnqaqKLYXijU23lsEdcQqg= +golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZPQ= 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.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= -golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= +golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= 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/receiver/podmanreceiver/metadata.yaml b/receiver/podmanreceiver/metadata.yaml index 1cfb023e01b5..5f0f8c0fd979 100644 --- a/receiver/podmanreceiver/metadata.yaml +++ b/receiver/podmanreceiver/metadata.yaml @@ -9,6 +9,6 @@ status: active: [rogercoll] unsupported_platforms: [windows] +# TODO: Update the receiver to pass the tests tests: - config: skip_lifecycle: true diff --git a/receiver/postgresqlreceiver/generated_component_test.go b/receiver/postgresqlreceiver/generated_component_test.go index 9b09d44ee21c..4e02cbca32a9 100644 --- a/receiver/postgresqlreceiver/generated_component_test.go +++ b/receiver/postgresqlreceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/postgresqlreceiver/go.mod b/receiver/postgresqlreceiver/go.mod index b6a47e9344e8..b8084aceac49 100644 --- a/receiver/postgresqlreceiver/go.mod +++ b/receiver/postgresqlreceiver/go.mod @@ -24,7 +24,7 @@ require ( go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/postgresqlreceiver/go.sum b/receiver/postgresqlreceiver/go.sum index 6a24871706c7..872f19a5826c 100644 --- a/receiver/postgresqlreceiver/go.sum +++ b/receiver/postgresqlreceiver/go.sum @@ -188,8 +188,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/prometheusreceiver/generated_component_test.go b/receiver/prometheusreceiver/generated_component_test.go index f97f5456ad38..8cd217f54e7c 100644 --- a/receiver/prometheusreceiver/generated_component_test.go +++ b/receiver/prometheusreceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/prometheusreceiver/go.mod b/receiver/prometheusreceiver/go.mod index 1e5014fee735..9bd24269503f 100644 --- a/receiver/prometheusreceiver/go.mod +++ b/receiver/prometheusreceiver/go.mod @@ -27,7 +27,7 @@ require ( go.opentelemetry.io/collector/semconv v0.95.0 go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 google.golang.org/protobuf v1.32.0 gopkg.in/yaml.v2 v2.4.0 ) diff --git a/receiver/prometheusreceiver/go.sum b/receiver/prometheusreceiver/go.sum index ebc677f3fee7..4262b9075fb0 100644 --- a/receiver/prometheusreceiver/go.sum +++ b/receiver/prometheusreceiver/go.sum @@ -672,8 +672,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= diff --git a/receiver/pulsarreceiver/generated_component_test.go b/receiver/pulsarreceiver/generated_component_test.go index 152ecc3d1656..ee4d9dbb920b 100644 --- a/receiver/pulsarreceiver/generated_component_test.go +++ b/receiver/pulsarreceiver/generated_component_test.go @@ -8,23 +8,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -69,22 +58,5 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - require.NoError(t, err) - require.NoError(t, firstRcvr.Start(context.Background(), host)) - require.NoError(t, firstRcvr.Shutdown(context.Background())) - secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - require.NoError(t, secondRcvr.Start(context.Background(), host)) - require.NoError(t, secondRcvr.Shutdown(context.Background())) - }) } } diff --git a/receiver/pulsarreceiver/go.mod b/receiver/pulsarreceiver/go.mod index f344e809a5b9..f8b4508d1286 100644 --- a/receiver/pulsarreceiver/go.mod +++ b/receiver/pulsarreceiver/go.mod @@ -20,7 +20,7 @@ require ( go.opentelemetry.io/collector/semconv v0.95.0 go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/pulsarreceiver/go.sum b/receiver/pulsarreceiver/go.sum index f4a92e5aa894..c9033b085960 100644 --- a/receiver/pulsarreceiver/go.sum +++ b/receiver/pulsarreceiver/go.sum @@ -461,8 +461,8 @@ go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9i 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.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= diff --git a/receiver/pulsarreceiver/metadata.yaml b/receiver/pulsarreceiver/metadata.yaml index e90b33d89578..bfeda5351712 100644 --- a/receiver/pulsarreceiver/metadata.yaml +++ b/receiver/pulsarreceiver/metadata.yaml @@ -7,6 +7,7 @@ status: distributions: [contrib] codeowners: active: [dmitryax, dao-jun] + +# TODO: Update the receiver to pass the tests tests: - config: skip_lifecycle: true diff --git a/receiver/purefareceiver/generated_component_test.go b/receiver/purefareceiver/generated_component_test.go index 16d8653d1741..d27f75d7a4e2 100644 --- a/receiver/purefareceiver/generated_component_test.go +++ b/receiver/purefareceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/purefareceiver/go.mod b/receiver/purefareceiver/go.mod index 65f0cc1879bb..cb2d8392889b 100644 --- a/receiver/purefareceiver/go.mod +++ b/receiver/purefareceiver/go.mod @@ -149,7 +149,7 @@ require ( go.opentelemetry.io/otel/sdk v1.23.1 // indirect go.opentelemetry.io/otel/sdk/metric v1.23.1 // indirect go.uber.org/atomic v1.11.0 // indirect - go.uber.org/zap v1.26.0 // indirect + go.uber.org/zap v1.27.0 // indirect golang.org/x/crypto v0.19.0 // indirect golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect golang.org/x/mod v0.14.0 // indirect diff --git a/receiver/purefareceiver/go.sum b/receiver/purefareceiver/go.sum index 8ea61cff3549..289afb2f7552 100644 --- a/receiver/purefareceiver/go.sum +++ b/receiver/purefareceiver/go.sum @@ -663,8 +663,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= diff --git a/receiver/purefareceiver/metadata.yaml b/receiver/purefareceiver/metadata.yaml index 18f1d6f5df2f..6d2f2f3fb08f 100644 --- a/receiver/purefareceiver/metadata.yaml +++ b/receiver/purefareceiver/metadata.yaml @@ -7,6 +7,3 @@ status: distributions: [contrib, sumo] codeowners: active: [jpkrohling, dgoscn, chrroberts-pure] - -tests: - config: diff --git a/receiver/purefbreceiver/generated_component_test.go b/receiver/purefbreceiver/generated_component_test.go index 21eb2c9daeea..be9c8424035b 100644 --- a/receiver/purefbreceiver/generated_component_test.go +++ b/receiver/purefbreceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/purefbreceiver/go.mod b/receiver/purefbreceiver/go.mod index 44f7ceb0ff12..fd805660e31b 100644 --- a/receiver/purefbreceiver/go.mod +++ b/receiver/purefbreceiver/go.mod @@ -149,7 +149,7 @@ require ( go.opentelemetry.io/otel/sdk v1.23.1 // indirect go.opentelemetry.io/otel/sdk/metric v1.23.1 // indirect go.uber.org/atomic v1.11.0 // indirect - go.uber.org/zap v1.26.0 // indirect + go.uber.org/zap v1.27.0 // indirect golang.org/x/crypto v0.19.0 // indirect golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect golang.org/x/mod v0.14.0 // indirect diff --git a/receiver/purefbreceiver/go.sum b/receiver/purefbreceiver/go.sum index 8ea61cff3549..289afb2f7552 100644 --- a/receiver/purefbreceiver/go.sum +++ b/receiver/purefbreceiver/go.sum @@ -663,8 +663,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= diff --git a/receiver/purefbreceiver/metadata.yaml b/receiver/purefbreceiver/metadata.yaml index cf9a19b5fec7..5c4c52d2612f 100644 --- a/receiver/purefbreceiver/metadata.yaml +++ b/receiver/purefbreceiver/metadata.yaml @@ -7,6 +7,3 @@ status: distributions: [contrib, sumo] codeowners: active: [jpkrohling, dgoscn, chrroberts-pure] - -tests: - config: diff --git a/receiver/rabbitmqreceiver/README.md b/receiver/rabbitmqreceiver/README.md index b96ab7e735f3..1e551f4c964a 100644 --- a/receiver/rabbitmqreceiver/README.md +++ b/receiver/rabbitmqreceiver/README.md @@ -6,7 +6,7 @@ | Stability | [beta]: metrics | | Distributions | [contrib], [observiq], [sumo] | | Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Areceiver%2Frabbitmq%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Areceiver%2Frabbitmq) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Areceiver%2Frabbitmq%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Areceiver%2Frabbitmq) | -| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@djaglowski](https://www.github.com/djaglowski), [@cpheps](https://www.github.com/cpheps) | +| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@djaglowski](https://www.github.com/djaglowski), [@cpheps](https://www.github.com/cpheps) \| Seeking more code owners! | [beta]: https://github.com/open-telemetry/opentelemetry-collector#beta [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib diff --git a/receiver/rabbitmqreceiver/generated_component_test.go b/receiver/rabbitmqreceiver/generated_component_test.go index 45321cf08a77..f643003fe279 100644 --- a/receiver/rabbitmqreceiver/generated_component_test.go +++ b/receiver/rabbitmqreceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/rabbitmqreceiver/go.mod b/receiver/rabbitmqreceiver/go.mod index 773e3a1a2c72..fb5f59ab8c53 100644 --- a/receiver/rabbitmqreceiver/go.mod +++ b/receiver/rabbitmqreceiver/go.mod @@ -19,7 +19,7 @@ require ( go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/rabbitmqreceiver/go.sum b/receiver/rabbitmqreceiver/go.sum index 061fb480a92c..ceaf27566274 100644 --- a/receiver/rabbitmqreceiver/go.sum +++ b/receiver/rabbitmqreceiver/go.sum @@ -131,8 +131,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/rabbitmqreceiver/metadata.yaml b/receiver/rabbitmqreceiver/metadata.yaml index 930a680e6fba..9d6a0642f90b 100644 --- a/receiver/rabbitmqreceiver/metadata.yaml +++ b/receiver/rabbitmqreceiver/metadata.yaml @@ -7,6 +7,7 @@ status: distributions: [contrib, observiq, sumo] codeowners: active: [djaglowski, cpheps] + seeking_new: true resource_attributes: rabbitmq.queue.name: @@ -80,6 +81,3 @@ metrics: value_type: int attributes: [message.state] enabled: true - -tests: - config: diff --git a/receiver/receivercreator/README.md b/receiver/receivercreator/README.md index 03e2bcea9181..05b87b09e4ef 100644 --- a/receiver/receivercreator/README.md +++ b/receiver/receivercreator/README.md @@ -157,89 +157,89 @@ targeting it will have different variables available. ### Pod -| Variable | Description | -|-------------|-----------------------------------| -| type | `"pod"` | -| id | ID of source endpoint | -| name | name of the pod | -| namespace | namespace of the pod | -| uid | unique id of the pod | -| labels | map of labels set on the pod | -| annotations | map of annotations set on the pod | +| Variable | Description | Data Type | +|-------------|-----------------------------------|-------------------------------| +| type | `"pod"` | String | +| id | ID of source endpoint | String | +| name | name of the pod | String | +| namespace | namespace of the pod | String | +| uid | unique id of the pod | String | +| labels | map of labels set on the pod | Map with String key and value | +| annotations | map of annotations set on the pod | Map with String key and value | ### Port -| Variable | Description | -|-----------------|-----------------------------------------| -| type | `"port"` | -| id | ID of source endpoint | -| name | container port name | -| port | port number | -| protocol | The transport protocol ("TCP" or "UDP") | -| pod.name | name of the owning pod | -| pod.namespace | namespace of the pod | -| pod.uid | unique id of the pod | -| pod.labels | map of labels of the owning pod | -| pod.annotations | map of annotations of the owning pod | +| Variable | Description | Data Type | +|-----------------|-----------------------------------------|-------------------------------| +| type | `"port"` | String | +| id | ID of source endpoint | String | +| name | container port name | String | +| port | port number | Integer | +| protocol | The transport protocol ("TCP" or "UDP") | String | +| pod.name | name of the owning pod | String | +| pod.namespace | namespace of the pod | String | +| pod.uid | unique id of the pod | String | +| pod.labels | map of labels of the owning pod | Map with String key and value | +| pod.annotations | map of annotations of the owning pod | Map with String key and value | ### Host Port -| Variable | Description | -|---------------|--------------------------------------------------| -| type | `"hostport"` | -| id | ID of source endpoint | -| process_name | Name of the process | -| command | Command line with the used to invoke the process | -| is_ipv6 | true if endpoint is IPv6, otherwise false | -| port | Port number | -| transport | The transport protocol ("TCP" or "UDP") | +| Variable | Description | Data Type | +|---------------|--------------------------------------------------|-------------------------------| +| type | `"hostport"` | String | +| id | ID of source endpoint | String | +| process_name | Name of the process | String | +| command | Command line with the used to invoke the process | String | +| is_ipv6 | true if endpoint is IPv6, otherwise false | Boolean | +| port | Port number | Integer | +| transport | The transport protocol ("TCP" or "UDP") | String | ### Container -| Variable | Description | -|----------------|-------------------------------------------------------------------| -| type | `"container"` | -| id | ID of source endpoint | -| name | Primary name of the container | -| image | Name of the container image | -| port | Exposed port of the container | -| alternate_port | Exposed port accessed through redirection, such as a mapped port | -| command | The command used to invoke the process of the container | -| container_id | ID of the container | -| host | Hostname or IP of the underlying host the container is running on | -| transport | Transport protocol used by the endpoint (TCP or UDP) | -| labels | User-specified metadata labels on the container | +| Variable | Description | Data Type | +|----------------|-------------------------------------------------------------------|-------------------------------| +| type | `"container"` | String | +| id | ID of source endpoint | String | +| name | Primary name of the container | String | +| image | Name of the container image | String | +| port | Exposed port of the container | Integer | +| alternate_port | Exposed port accessed through redirection, such as a mapped port | Integer | +| command | The command used to invoke the process of the container | String | +| container_id | ID of the container | String | +| host | Hostname or IP of the underlying host the container is running on | String | +| transport | Transport protocol used by the endpoint (TCP or UDP) | String | +| labels | User-specified metadata labels on the container | Map with String key and value | ### Kubernetes Service -| Variable | Description | -|----------------|-------------------------------------------------------------------| -| type | `"k8s.service"` | -| id | ID of source endpoint | -| name | The name of the Kubernetes service | -| namespace | The namespace of the service | -| uid | The unique ID for the service | -| labels | The map of labels set on the service | -| annotations | The map of annotations set on the service | -| service_type | The type of the kubernetes service: ClusterIP, NodePort, LoadBalancer, ExternalName | -| cluster_ip | The cluster IP assigned to the service | +| Variable | Description | Data Type | +|----------------|---------------------------------------------------------------------------------------|-------------------------------| +| type | `"k8s.service"` | String | +| id | ID of source endpoint | String | +| name | The name of the Kubernetes service | String | +| namespace | The namespace of the service | String | +| uid | The unique ID for the service | String | +| labels | The map of labels set on the service | Map with String key and value | +| annotations | The map of annotations set on the service | Map with String key and value | +| service_type | The type of the kubernetes service: ClusterIP, NodePort, LoadBalancer, ExternalName | String | +| cluster_ip | The cluster IP assigned to the service | String | ### Kubernetes Node -| Variable | Description | -|----------------|-------------------------------------------------------------------| -| type | `"k8s.node"` | -| id | ID of source endpoint | -| name | The name of the Kubernetes node | -| uid | The unique ID for the node | -| hostname | The node's hostname as reported by its Status object | -| external_ip | The node's external IP address as reported by its Status object | -| internal_ip | The node's internal IP address as reported by its Status object | -| external_dns | The node's external DNS record as reported by its Status object | -| internal_dns | The node's internal DNS record as reported by its Status object | -| annotations | A key-value map of non-identifying, user-specified node metadata | -| labels | A key-value map of user-specified node metadata | -| kubelet_endpoint_port | The node Status object's DaemonEndpoints.KubeletEndpoint.Port value | +| Variable | Description | Data Type | +|-----------------------|----------------------------------------------------------------------|-------------------------------| +| type | `"k8s.node"` | String | +| id | ID of source endpoint | String | +| name | The name of the Kubernetes node | String | +| uid | The unique ID for the node | String | +| hostname | The node's hostname as reported by its Status object | String | +| external_ip | The node's external IP address as reported by its Status object | String | +| internal_ip | The node's internal IP address as reported by its Status object | String | +| external_dns | The node's external DNS record as reported by its Status object | String | +| internal_dns | The node's internal DNS record as reported by its Status object | String | +| annotations | A key-value map of non-identifying, user-specified node metadata | Map with String key and value | +| labels | A key-value map of user-specified node metadata | Map with String key and value | +| kubelet_endpoint_port | The node Status object's DaemonEndpoints.KubeletEndpoint.Port value | Integer | ## Examples diff --git a/receiver/receivercreator/generated_component_test.go b/receiver/receivercreator/generated_component_test.go new file mode 100644 index 000000000000..a6a6efa9d0eb --- /dev/null +++ b/receiver/receivercreator/generated_component_test.go @@ -0,0 +1,75 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package receivercreator + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/consumer/consumertest" + "go.opentelemetry.io/collector/receiver" + "go.opentelemetry.io/collector/receiver/receivertest" +) + +func TestComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "logs", + createFn: func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateLogsReceiver(ctx, set, cfg, consumertest.NewNop()) + }, + }, + + { + name: "metrics", + createFn: func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateMetricsReceiver(ctx, set, cfg, consumertest.NewNop()) + }, + }, + + { + name: "traces", + createFn: func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateTracesReceiver(ctx, set, cfg, consumertest.NewNop()) + }, + }, + } + + cm, err := confmaptest.LoadConf("metadata.yaml") + require.NoError(t, err) + cfg := factory.CreateDefaultConfig() + sub, err := cm.Sub("tests::config") + require.NoError(t, err) + require.NoError(t, component.UnmarshalConfig(sub, cfg)) + + for _, test := range tests { + t.Run(test.name+"-shutdown", func(t *testing.T) { + c, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + t.Run(test.name+"-lifecycle", func(t *testing.T) { + firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := componenttest.NewNopHost() + require.NoError(t, err) + require.NoError(t, firstRcvr.Start(context.Background(), host)) + require.NoError(t, firstRcvr.Shutdown(context.Background())) + secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + require.NoError(t, secondRcvr.Start(context.Background(), host)) + require.NoError(t, secondRcvr.Shutdown(context.Background())) + }) + } +} diff --git a/receiver/receivercreator/go.mod b/receiver/receivercreator/go.mod index 0efee9378a70..101abf1e5927 100644 --- a/receiver/receivercreator/go.mod +++ b/receiver/receivercreator/go.mod @@ -21,7 +21,7 @@ require ( go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/receivercreator/go.sum b/receiver/receivercreator/go.sum index b415ebc5bd1a..b4e63c585720 100644 --- a/receiver/receivercreator/go.sum +++ b/receiver/receivercreator/go.sum @@ -233,8 +233,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/redisreceiver/generated_component_test.go b/receiver/redisreceiver/generated_component_test.go index c70e816e51b9..9933348adbab 100644 --- a/receiver/redisreceiver/generated_component_test.go +++ b/receiver/redisreceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/redisreceiver/go.mod b/receiver/redisreceiver/go.mod index 1e5dfcb83b8e..c1114e9f3fda 100644 --- a/receiver/redisreceiver/go.mod +++ b/receiver/redisreceiver/go.mod @@ -20,7 +20,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/redisreceiver/go.sum b/receiver/redisreceiver/go.sum index 547d2f44c9b7..1388a4531208 100644 --- a/receiver/redisreceiver/go.sum +++ b/receiver/redisreceiver/go.sum @@ -189,8 +189,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/redisreceiver/metadata.yaml b/receiver/redisreceiver/metadata.yaml index 69153dbc4309..78afe847d9cf 100644 --- a/receiver/redisreceiver/metadata.yaml +++ b/receiver/redisreceiver/metadata.yaml @@ -351,6 +351,7 @@ metrics: unit: "By" gauge: value_type: int + tests: config: endpoint: localhost:6379 diff --git a/receiver/riakreceiver/README.md b/receiver/riakreceiver/README.md index baea896a019f..7d05ad225c84 100644 --- a/receiver/riakreceiver/README.md +++ b/receiver/riakreceiver/README.md @@ -6,7 +6,7 @@ | Stability | [beta]: metrics | | Distributions | [contrib], [observiq], [sumo] | | Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Areceiver%2Friak%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Areceiver%2Friak) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Areceiver%2Friak%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Areceiver%2Friak) | -| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@djaglowski](https://www.github.com/djaglowski), [@armstrmi](https://www.github.com/armstrmi) | +| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@djaglowski](https://www.github.com/djaglowski), [@armstrmi](https://www.github.com/armstrmi) \| Seeking more code owners! | [beta]: https://github.com/open-telemetry/opentelemetry-collector#beta [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib diff --git a/receiver/riakreceiver/generated_component_test.go b/receiver/riakreceiver/generated_component_test.go index 8630ffb49746..a4ad88bdfe48 100644 --- a/receiver/riakreceiver/generated_component_test.go +++ b/receiver/riakreceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/riakreceiver/go.mod b/receiver/riakreceiver/go.mod index d95845c654e1..4c9bf081d501 100644 --- a/receiver/riakreceiver/go.mod +++ b/receiver/riakreceiver/go.mod @@ -19,7 +19,7 @@ require ( go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/riakreceiver/go.sum b/receiver/riakreceiver/go.sum index 061fb480a92c..ceaf27566274 100644 --- a/receiver/riakreceiver/go.sum +++ b/receiver/riakreceiver/go.sum @@ -131,8 +131,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/riakreceiver/metadata.yaml b/receiver/riakreceiver/metadata.yaml index 7e37d272a5ea..72c22bf52029 100644 --- a/receiver/riakreceiver/metadata.yaml +++ b/receiver/riakreceiver/metadata.yaml @@ -7,6 +7,7 @@ status: distributions: [contrib, observiq, sumo] codeowners: active: [djaglowski, armstrmi] + seeking_new: true resource_attributes: riak.node.name: @@ -80,6 +81,3 @@ metrics: value_type: int attributes: [operation] enabled: true - -tests: - config: diff --git a/receiver/saphanareceiver/generated_component_test.go b/receiver/saphanareceiver/generated_component_test.go index d6073e8043c1..6b19379f6d9f 100644 --- a/receiver/saphanareceiver/generated_component_test.go +++ b/receiver/saphanareceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/saphanareceiver/go.mod b/receiver/saphanareceiver/go.mod index ec9743157160..8fdb4fe8754d 100644 --- a/receiver/saphanareceiver/go.mod +++ b/receiver/saphanareceiver/go.mod @@ -20,7 +20,7 @@ require ( go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/saphanareceiver/go.sum b/receiver/saphanareceiver/go.sum index c18899e97ee9..9ad62fe96fbc 100644 --- a/receiver/saphanareceiver/go.sum +++ b/receiver/saphanareceiver/go.sum @@ -109,8 +109,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/saphanareceiver/metadata.yaml b/receiver/saphanareceiver/metadata.yaml index b5cb97f93726..ae249d0b1454 100644 --- a/receiver/saphanareceiver/metadata.yaml +++ b/receiver/saphanareceiver/metadata.yaml @@ -644,6 +644,3 @@ metrics: input_type: string attributes: [] enabled: true - -tests: - config: diff --git a/receiver/sapmreceiver/generated_component_test.go b/receiver/sapmreceiver/generated_component_test.go index edb13a1dff55..ebbf6df2ab3b 100644 --- a/receiver/sapmreceiver/generated_component_test.go +++ b/receiver/sapmreceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/sapmreceiver/go.mod b/receiver/sapmreceiver/go.mod index 654f75940975..11d73b51a21b 100644 --- a/receiver/sapmreceiver/go.mod +++ b/receiver/sapmreceiver/go.mod @@ -5,7 +5,7 @@ go 1.21 require ( github.com/gorilla/mux v1.8.1 github.com/jaegertracing/jaeger v1.54.0 - github.com/klauspost/compress v1.17.6 + github.com/klauspost/compress v1.17.7 github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/splunk v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.95.0 @@ -71,7 +71,7 @@ require ( go.opentelemetry.io/otel/sdk v1.23.1 // indirect go.opentelemetry.io/otel/sdk/metric v1.23.1 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.26.0 // indirect + go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.21.0 // indirect golang.org/x/sys v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/receiver/sapmreceiver/go.sum b/receiver/sapmreceiver/go.sum index 9608f75ca5bd..ac31b29c0362 100644 --- a/receiver/sapmreceiver/go.sum +++ b/receiver/sapmreceiver/go.sum @@ -42,8 +42,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.6 h1:60eq2E/jlfwQXtvZEeBUYADs+BwKBWURIY+Gj2eRGjI= -github.com/klauspost/compress v1.17.6/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLAKQQg= +github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= @@ -144,8 +144,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/sapmreceiver/metadata.yaml b/receiver/sapmreceiver/metadata.yaml index d6ba89598d34..9466d25eed5a 100644 --- a/receiver/sapmreceiver/metadata.yaml +++ b/receiver/sapmreceiver/metadata.yaml @@ -7,6 +7,3 @@ status: distributions: [contrib, splunk, observiq, sumo] codeowners: active: [atoulme] - -tests: - config: diff --git a/receiver/signalfxreceiver/generated_component_test.go b/receiver/signalfxreceiver/generated_component_test.go index eb116cffd2e9..fcb1f6a8d892 100644 --- a/receiver/signalfxreceiver/generated_component_test.go +++ b/receiver/signalfxreceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -62,9 +52,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/signalfxreceiver/go.mod b/receiver/signalfxreceiver/go.mod index 0a650eb425ab..5a771673b660 100644 --- a/receiver/signalfxreceiver/go.mod +++ b/receiver/signalfxreceiver/go.mod @@ -21,7 +21,7 @@ require ( go.opentelemetry.io/collector/receiver v0.95.0 go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/signalfxreceiver/go.sum b/receiver/signalfxreceiver/go.sum index 5460131a31e6..fb7007a669cb 100644 --- a/receiver/signalfxreceiver/go.sum +++ b/receiver/signalfxreceiver/go.sum @@ -174,8 +174,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/signalfxreceiver/metadata.yaml b/receiver/signalfxreceiver/metadata.yaml index 598fa13bf08e..1ab2bb674571 100644 --- a/receiver/signalfxreceiver/metadata.yaml +++ b/receiver/signalfxreceiver/metadata.yaml @@ -8,6 +8,3 @@ status: codeowners: active: ["dmitryax"] emeritus: - -tests: - config: diff --git a/receiver/simpleprometheusreceiver/examples/federation/prom-counter/go.mod b/receiver/simpleprometheusreceiver/examples/federation/prom-counter/go.mod index 21897a62cbc9..c3876bf3920a 100644 --- a/receiver/simpleprometheusreceiver/examples/federation/prom-counter/go.mod +++ b/receiver/simpleprometheusreceiver/examples/federation/prom-counter/go.mod @@ -3,12 +3,12 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/receiver/simple go 1.21 require ( - github.com/prometheus/client_golang v1.18.0 + github.com/prometheus/client_golang v1.19.0 go.opentelemetry.io/otel v1.23.1 go.opentelemetry.io/otel/exporters/prometheus v0.45.2 go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/sdk/metric v1.23.1 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( @@ -16,9 +16,8 @@ require ( github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect - github.com/prometheus/common v0.45.0 // indirect + github.com/prometheus/common v0.48.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect go.opentelemetry.io/otel/sdk v1.23.1 // indirect go.opentelemetry.io/otel/trace v1.23.1 // indirect diff --git a/receiver/simpleprometheusreceiver/examples/federation/prom-counter/go.sum b/receiver/simpleprometheusreceiver/examples/federation/prom-counter/go.sum index 8c4806504175..308dbcf1b006 100644 --- a/receiver/simpleprometheusreceiver/examples/federation/prom-counter/go.sum +++ b/receiver/simpleprometheusreceiver/examples/federation/prom-counter/go.sum @@ -11,16 +11,14 @@ 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/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= -github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= -github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= +github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= +github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= -github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM= -github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= +github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE= +github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= @@ -37,12 +35,12 @@ go.opentelemetry.io/otel/sdk/metric v1.23.1 h1:T9/8WsYg+ZqIpMWwdISVVrlGb/N0Jr1OH go.opentelemetry.io/otel/sdk/metric v1.23.1/go.mod h1:8WX6WnNtHCgUruJ4TJ+UssQjMtpxkpX0zveQC8JG/E0= go.opentelemetry.io/otel/trace v1.23.1 h1:4LrmmEd8AU2rFvU1zegmvqW7+kWarxtNOPyeL6HmYY8= go.opentelemetry.io/otel/trace v1.23.1/go.mod h1:4IpnpJFwr1mo/6HL8XIPJaE9y0+u1KcVmuW7dwFSVrI= -go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= -go.uber.org/goleak v1.2.0/go.mod h1:XJYK+MuIchqpmGmUSAzotztawfKvYLUIgg7guXrwVUo= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= diff --git a/receiver/simpleprometheusreceiver/generated_component_test.go b/receiver/simpleprometheusreceiver/generated_component_test.go index eb8451e85e1d..0c3da740d801 100644 --- a/receiver/simpleprometheusreceiver/generated_component_test.go +++ b/receiver/simpleprometheusreceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/simpleprometheusreceiver/go.mod b/receiver/simpleprometheusreceiver/go.mod index 338a25d3ff79..bb9dacd2f265 100644 --- a/receiver/simpleprometheusreceiver/go.mod +++ b/receiver/simpleprometheusreceiver/go.mod @@ -149,7 +149,7 @@ require ( go.opentelemetry.io/otel/sdk/metric v1.23.1 // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.26.0 // indirect + go.uber.org/zap v1.27.0 // indirect golang.org/x/crypto v0.19.0 // indirect golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect golang.org/x/mod v0.14.0 // indirect diff --git a/receiver/simpleprometheusreceiver/go.sum b/receiver/simpleprometheusreceiver/go.sum index 389f04727b15..d4b6113828b6 100644 --- a/receiver/simpleprometheusreceiver/go.sum +++ b/receiver/simpleprometheusreceiver/go.sum @@ -663,8 +663,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= diff --git a/receiver/skywalkingreceiver/README.md b/receiver/skywalkingreceiver/README.md index d850f461866a..c79d3922e4d0 100644 --- a/receiver/skywalkingreceiver/README.md +++ b/receiver/skywalkingreceiver/README.md @@ -3,14 +3,14 @@ | Status | | | ------------- |-----------| -| Stability | [beta]: traces | -| | [development]: metrics | +| Stability | [development]: metrics | +| | [beta]: traces | | Distributions | [contrib], [sumo] | | Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Areceiver%2Fskywalking%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Areceiver%2Fskywalking) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Areceiver%2Fskywalking%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Areceiver%2Fskywalking) | | [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@JaredTan95](https://www.github.com/JaredTan95) | -[beta]: https://github.com/open-telemetry/opentelemetry-collector#beta [development]: https://github.com/open-telemetry/opentelemetry-collector#development +[beta]: https://github.com/open-telemetry/opentelemetry-collector#beta [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib [sumo]: https://github.com/SumoLogic/sumologic-otel-collector diff --git a/receiver/skywalkingreceiver/generated_component_test.go b/receiver/skywalkingreceiver/generated_component_test.go index 77c684da67f5..4f594dea8bd1 100644 --- a/receiver/skywalkingreceiver/generated_component_test.go +++ b/receiver/skywalkingreceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -62,9 +52,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/skywalkingreceiver/go.mod b/receiver/skywalkingreceiver/go.mod index 059a4d0a41f9..85bda687cde1 100644 --- a/receiver/skywalkingreceiver/go.mod +++ b/receiver/skywalkingreceiver/go.mod @@ -74,7 +74,7 @@ require ( go.opentelemetry.io/otel/exporters/prometheus v0.45.2 // indirect go.opentelemetry.io/otel/sdk v1.23.1 // indirect go.opentelemetry.io/otel/sdk/metric v1.23.1 // indirect - go.uber.org/zap v1.26.0 // indirect + go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.21.0 // indirect golang.org/x/sys v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/receiver/skywalkingreceiver/go.sum b/receiver/skywalkingreceiver/go.sum index 81f9c16c1e81..e109df16369a 100644 --- a/receiver/skywalkingreceiver/go.sum +++ b/receiver/skywalkingreceiver/go.sum @@ -197,8 +197,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/skywalkingreceiver/internal/metadata/generated_status.go b/receiver/skywalkingreceiver/internal/metadata/generated_status.go index bd87fceb2344..e3109c2114e4 100644 --- a/receiver/skywalkingreceiver/internal/metadata/generated_status.go +++ b/receiver/skywalkingreceiver/internal/metadata/generated_status.go @@ -13,8 +13,8 @@ var ( ) const ( - TracesStability = component.StabilityLevelBeta MetricsStability = component.StabilityLevelDevelopment + TracesStability = component.StabilityLevelBeta ) func Meter(settings component.TelemetrySettings) metric.Meter { diff --git a/receiver/snmpreceiver/generated_component_test.go b/receiver/snmpreceiver/generated_component_test.go index 6e9d72f3172f..c3784c2e32c8 100644 --- a/receiver/snmpreceiver/generated_component_test.go +++ b/receiver/snmpreceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/snmpreceiver/go.mod b/receiver/snmpreceiver/go.mod index 908fc21cd410..753216e9e9bb 100644 --- a/receiver/snmpreceiver/go.mod +++ b/receiver/snmpreceiver/go.mod @@ -18,7 +18,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/snmpreceiver/go.sum b/receiver/snmpreceiver/go.sum index 1c83388e535f..ca1a50d9dad3 100644 --- a/receiver/snmpreceiver/go.sum +++ b/receiver/snmpreceiver/go.sum @@ -282,8 +282,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/snowflakereceiver/generated_component_test.go b/receiver/snowflakereceiver/generated_component_test.go index b2d7d4efaabf..9a1e04fccfbf 100644 --- a/receiver/snowflakereceiver/generated_component_test.go +++ b/receiver/snowflakereceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/snowflakereceiver/go.mod b/receiver/snowflakereceiver/go.mod index d48a82236e08..fff1a5c2eba5 100644 --- a/receiver/snowflakereceiver/go.mod +++ b/receiver/snowflakereceiver/go.mod @@ -7,7 +7,7 @@ require ( github.com/google/go-cmp v0.6.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.95.0 - github.com/snowflakedb/gosnowflake v1.7.2 + github.com/snowflakedb/gosnowflake v1.8.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.95.0 go.opentelemetry.io/collector/config/configopaque v1.2.0 @@ -19,7 +19,7 @@ require ( go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/snowflakereceiver/go.sum b/receiver/snowflakereceiver/go.sum index decbafd2bded..2f7350868340 100644 --- a/receiver/snowflakereceiver/go.sum +++ b/receiver/snowflakereceiver/go.sum @@ -173,8 +173,8 @@ github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjR github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/snowflakedb/gosnowflake v1.7.2 h1:HRSwva8YXC64WUppfmHcMNVVzSE1+EwXXaJxgS0EkTo= -github.com/snowflakedb/gosnowflake v1.7.2/go.mod h1:03tW856vc3ceM4rJuj7KO4dzqN7qoezTm+xw7aPIIFo= +github.com/snowflakedb/gosnowflake v1.8.0 h1:4bQj8eAYGMkou/nICiIEb9jSbBLDDp5cB6JaKx9WwiA= +github.com/snowflakedb/gosnowflake v1.8.0/go.mod h1:7yyY2MxtDti2eXgtvlZ8QxzCN6KV2B4qb1HuygMI+0U= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= @@ -220,8 +220,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/solacereceiver/generated_component_test.go b/receiver/solacereceiver/generated_component_test.go index 7ad824a8c1c6..97e623799dca 100644 --- a/receiver/solacereceiver/generated_component_test.go +++ b/receiver/solacereceiver/generated_component_test.go @@ -8,23 +8,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,22 +44,5 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - require.NoError(t, err) - require.NoError(t, firstRcvr.Start(context.Background(), host)) - require.NoError(t, firstRcvr.Shutdown(context.Background())) - secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - require.NoError(t, secondRcvr.Start(context.Background(), host)) - require.NoError(t, secondRcvr.Shutdown(context.Background())) - }) } } diff --git a/receiver/solacereceiver/go.mod b/receiver/solacereceiver/go.mod index 7497bff09562..3bd6bedcf7db 100644 --- a/receiver/solacereceiver/go.mod +++ b/receiver/solacereceiver/go.mod @@ -20,7 +20,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 google.golang.org/protobuf v1.32.0 ) diff --git a/receiver/solacereceiver/go.sum b/receiver/solacereceiver/go.sum index 2b5c0e42a9cc..e272c9c62910 100644 --- a/receiver/solacereceiver/go.sum +++ b/receiver/solacereceiver/go.sum @@ -142,8 +142,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/solacereceiver/metadata.yaml b/receiver/solacereceiver/metadata.yaml index d724eacd2b06..ed96b3f2b5d0 100644 --- a/receiver/solacereceiver/metadata.yaml +++ b/receiver/solacereceiver/metadata.yaml @@ -8,6 +8,7 @@ status: codeowners: active: [djaglowski, mcardy] +# TODO: Update the receiver to pass the tests tests: config: auth: diff --git a/receiver/splunkenterprisereceiver/generated_component_test.go b/receiver/splunkenterprisereceiver/generated_component_test.go index 56a98e36226e..8c27f93f0a17 100644 --- a/receiver/splunkenterprisereceiver/generated_component_test.go +++ b/receiver/splunkenterprisereceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/splunkenterprisereceiver/go.mod b/receiver/splunkenterprisereceiver/go.mod index 25d43b0b84da..8617632d090d 100644 --- a/receiver/splunkenterprisereceiver/go.mod +++ b/receiver/splunkenterprisereceiver/go.mod @@ -20,7 +20,7 @@ require ( go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/splunkenterprisereceiver/go.sum b/receiver/splunkenterprisereceiver/go.sum index b07358504160..1eb8b1e14f3f 100644 --- a/receiver/splunkenterprisereceiver/go.sum +++ b/receiver/splunkenterprisereceiver/go.sum @@ -126,8 +126,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/splunkenterprisereceiver/metadata.yaml b/receiver/splunkenterprisereceiver/metadata.yaml index cfaa9efef72f..0a2307e33bb9 100644 --- a/receiver/splunkenterprisereceiver/metadata.yaml +++ b/receiver/splunkenterprisereceiver/metadata.yaml @@ -239,3 +239,5 @@ metrics: value_type: int attributes: [splunk.queue.name] +tests: + config: diff --git a/receiver/splunkhecreceiver/generated_component_test.go b/receiver/splunkhecreceiver/generated_component_test.go index b2589738386f..cde400895bf0 100644 --- a/receiver/splunkhecreceiver/generated_component_test.go +++ b/receiver/splunkhecreceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -62,9 +52,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/splunkhecreceiver/go.mod b/receiver/splunkhecreceiver/go.mod index 547116b8a312..059a78a69204 100644 --- a/receiver/splunkhecreceiver/go.mod +++ b/receiver/splunkhecreceiver/go.mod @@ -22,7 +22,7 @@ require ( go.opentelemetry.io/collector/semconv v0.95.0 go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/splunkhecreceiver/go.sum b/receiver/splunkhecreceiver/go.sum index c87e0e614b01..778f7faf237a 100644 --- a/receiver/splunkhecreceiver/go.sum +++ b/receiver/splunkhecreceiver/go.sum @@ -235,8 +235,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/splunkhecreceiver/metadata.yaml b/receiver/splunkhecreceiver/metadata.yaml index c9196ae58e36..e38c35598960 100644 --- a/receiver/splunkhecreceiver/metadata.yaml +++ b/receiver/splunkhecreceiver/metadata.yaml @@ -8,5 +8,3 @@ status: codeowners: active: ["atoulme"] emeritus: -tests: - config: \ No newline at end of file diff --git a/receiver/sqlqueryreceiver/README.md b/receiver/sqlqueryreceiver/README.md index 66cd80bb1fa9..a43f004ab870 100644 --- a/receiver/sqlqueryreceiver/README.md +++ b/receiver/sqlqueryreceiver/README.md @@ -3,15 +3,15 @@ | Status | | | ------------- |-----------| -| Stability | [alpha]: metrics | -| | [development]: logs | +| Stability | [development]: logs | +| | [alpha]: metrics | | Distributions | [contrib], [observiq], [splunk], [sumo] | | Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Areceiver%2Fsqlquery%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Areceiver%2Fsqlquery) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Areceiver%2Fsqlquery%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Areceiver%2Fsqlquery) | | [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@dmitryax](https://www.github.com/dmitryax), [@crobert-1](https://www.github.com/crobert-1) | | Emeritus | [@pmcollins](https://www.github.com/pmcollins) | -[alpha]: https://github.com/open-telemetry/opentelemetry-collector#alpha [development]: https://github.com/open-telemetry/opentelemetry-collector#development +[alpha]: https://github.com/open-telemetry/opentelemetry-collector#alpha [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib [observiq]: https://github.com/observIQ/observiq-otel-collector [splunk]: https://github.com/signalfx/splunk-otel-collector diff --git a/receiver/sqlqueryreceiver/generated_component_test.go b/receiver/sqlqueryreceiver/generated_component_test.go index 2b4b001fd6e7..0b2ab7e685bb 100644 --- a/receiver/sqlqueryreceiver/generated_component_test.go +++ b/receiver/sqlqueryreceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -62,9 +52,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/sqlqueryreceiver/go.mod b/receiver/sqlqueryreceiver/go.mod index 7e7f30ffb2e8..b1b7402529d2 100644 --- a/receiver/sqlqueryreceiver/go.mod +++ b/receiver/sqlqueryreceiver/go.mod @@ -20,15 +20,15 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( dario.cat/mergo v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.1 // indirect - github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.1 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.1 // indirect github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.0 // indirect github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c // indirect @@ -76,7 +76,7 @@ require ( github.com/golang-sql/sqlexp v0.1.0 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/google/flatbuffers v23.5.26+incompatible // indirect - github.com/google/uuid v1.4.0 // indirect + github.com/google/uuid v1.6.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/haimrubinstein/go-syslog/v3 v3.0.0 // indirect github.com/hashicorp/go-uuid v1.0.3 // indirect @@ -98,7 +98,7 @@ require ( github.com/lib/pq v1.10.9 // indirect github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect github.com/magiconair/properties v1.8.7 // indirect - github.com/microsoft/go-mssqldb v1.6.0 // indirect + github.com/microsoft/go-mssqldb v1.7.0 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect @@ -115,7 +115,7 @@ require ( github.com/opencontainers/image-spec v1.1.0-rc5 // indirect github.com/opencontainers/runc v1.1.12 // indirect github.com/pierrec/lz4/v4 v4.1.18 // indirect - github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect + github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect @@ -127,7 +127,7 @@ require ( github.com/shoenig/go-m1cpu v0.1.6 // indirect github.com/sijms/go-ora/v2 v2.8.8 // indirect github.com/sirupsen/logrus v1.9.3 // indirect - github.com/snowflakedb/gosnowflake v1.7.2 // indirect + github.com/snowflakedb/gosnowflake v1.8.0 // indirect github.com/tklauser/go-sysconf v0.3.12 // indirect github.com/tklauser/numcpus v0.6.1 // indirect github.com/valyala/fastjson v1.6.4 // indirect diff --git a/receiver/sqlqueryreceiver/go.sum b/receiver/sqlqueryreceiver/go.sum index a83c584e3dab..cd36edeecd4f 100644 --- a/receiver/sqlqueryreceiver/go.sum +++ b/receiver/sqlqueryreceiver/go.sum @@ -6,24 +6,24 @@ github.com/99designs/keyring v1.2.2 h1:pZd3neh/EmUzWONb35LxQfvuY7kiSXAq3HQd97+XB github.com/99designs/keyring v1.2.2/go.mod h1:wes/FrByc8j7lFOAGLGSNEg8f/PaI3cgTBqhFkHUrPk= github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 h1:bvDV9vkmnHYOMsOr4WLk+Vo07yKIzd94sVoIqshQ4bU= github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.1 h1:/iHxaJhsFr0+xVFfbMr5vxz848jyiWuIEDhYq3y5odY= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.1/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0 h1:vcYCAze6p19qBW7MhZybIsqD8sMV8js0NyQM8JDnVtg= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0/go.mod h1:OQeznEEkTZ9OrhHJoDD8ZDq51FHgXjqtP9z6bEwBq9U= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.1 h1:lGlwhPtrX6EVml1hO0ivjkUxsSyl4dsiw9qcA1k/3IQ= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.1/go.mod h1:RKUqNu35KJYcVG/fqTRqmuXJZYNhYkBrnC/hX7yGbTA= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.1 h1:sO0/P7g68FrryJzljemN+6GTssUXdANk6aJ7T1ZxnsQ= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.1/go.mod h1:h8hyGFDsU5HMivxiS2iYFZsgDbU9OnnJ163x5UGVKYo= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.1 h1:6oNBlSdi1QqM1PNW7FPA6xOGA5UNsXnkaYZz9vdPGhA= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.1/go.mod h1:s4kgfzA0covAXNicZHDMN58jExvcng2mC/DepXiF1EI= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.2.0 h1:Ma67P/GGprNwsslzEH6+Kb8nybI8jpDTm4Wmzu2ReK8= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.2.0/go.mod h1:c+Lifp3EDEamAkPVzMooRNOK6CZjNSdEnf1A7jsI9u4= -github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.0.0 h1:yfJe15aSwEQ6Oo6J+gdfdulPNoZ3TEhmbhLIoxZcA+U= -github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.0.0/go.mod h1:Q28U+75mpCaSCDowNEmhIo/rmgdkqmkmzI7N6TGR4UY= -github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v0.8.0 h1:T028gtTPiYt/RMUfs8nVsAL7FDQrfLlrm/NnRG/zcC4= -github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v0.8.0/go.mod h1:cw4zVQgBby0Z5f2v0itn6se2dDP17nTjbZFXW5uPyHA= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.0.1 h1:MyVTgWR8qd/Jw1Le0NZebGBUCLbtak3bJ3z1OlqZBpw= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.0.1/go.mod h1:GpPjLhVR9dnUoJMyHWSPy71xY9/lcmpzIPZXmF0FCVY= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.0.0 h1:D3occbWoio4EBLkbkevetNMAVX197GkzbUMtqjGWn80= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.0.0/go.mod h1:bTSOgj05NGRuHHhQwAdPnYr9TOdNmKlZTgGLL6nyAdI= github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.0 h1:gggzg0SUMs6SQbEw+3LoSsYf9YMjkupeAnHMX8O9mmY= github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.0/go.mod h1:+6KLcKIVgxoBDMqMO/Nvy7bZ9a0nbU3I1DtFQK3YvB4= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= -github.com/AzureAD/microsoft-authentication-library-for-go v1.1.0 h1:HCc0+LpPfpCKs6LGGLAhwBARt9632unrVcI6i8s/8os= -github.com/AzureAD/microsoft-authentication-library-for-go v1.1.0/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= +github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1 h1:DzHpqpoJVaCgOUdVHxE8QB52S6NiVdDQvGlny1qvPqA= +github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= 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/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= @@ -136,8 +136,8 @@ github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+ github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE= -github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= +github.com/golang-jwt/jwt/v5 v5.2.0 h1:d/ix8ftRUorsN+5eMIlF4T6J8CAt9rch3My2winC1Jw= +github.com/golang-jwt/jwt/v5 v5.2.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 h1:au07oEsX2xN0ktxqI+Sida1w446QrXBRJ0nee3SNZlA= github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang-sql/sqlexp v0.1.0 h1:ZCD6MBpcuOVfGVqsEmY5/4FtYiKz6tSyUv9LPEDei6A= @@ -155,8 +155,8 @@ github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN 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.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= -github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +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/gorilla/securecookie v1.1.1 h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyCS8BvQ= github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= github.com/gorilla/sessions v1.2.1 h1:DHd3rPN5lE3Ts3D8rKkQ8x/0kqfeNmBAaiSi+o7FsgI= @@ -219,8 +219,8 @@ github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= -github.com/microsoft/go-mssqldb v1.6.0 h1:mM3gYdVwEPFrlg/Dvr2DNVEgYFG7L42l+dGc67NNNpc= -github.com/microsoft/go-mssqldb v1.6.0/go.mod h1:00mDtPbeQCRGC1HwOOR5K/gr30P1NcEG0vx6Kbv2aJU= +github.com/microsoft/go-mssqldb v1.7.0 h1:sgMPW0HA6Ihd37Yx0MzHyKD726C2kY/8KJsQtXHNaAs= +github.com/microsoft/go-mssqldb v1.7.0/go.mod h1:kOvZKUdrhhFQmxLZqbwUV0rHkNkZpthMITIb2Ko1IoA= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c h1:cqn374mizHuIWj+OSJCajGr/phAmuMug9qIX3l9CflE= @@ -251,8 +251,8 @@ github.com/opencontainers/runc v1.1.12 h1:BOIssBaW1La0/qbNZHXOOa71dZfZEQOzW7dqQf github.com/opencontainers/runc v1.1.12/go.mod h1:S+lQwSfncpBha7XTy/5lBwWgm5+y5Ma/O44Ekby9FK8= github.com/pierrec/lz4/v4 v4.1.18 h1:xaKrnTkyoqfh1YItXl56+6KJNVYWlEEPuAQW9xsplYQ= github.com/pierrec/lz4/v4 v4.1.18/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= +github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= +github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -279,8 +279,8 @@ github.com/sijms/go-ora/v2 v2.8.8 h1:TvIjKrCPhVTYIzT7+rke/QKCY+ceVlTPfKXmgiuKX2s github.com/sijms/go-ora/v2 v2.8.8/go.mod h1:EHxlY6x7y9HAsdfumurRfTd+v8NrEOTR3Xl4FWlH6xk= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/snowflakedb/gosnowflake v1.7.2 h1:HRSwva8YXC64WUppfmHcMNVVzSE1+EwXXaJxgS0EkTo= -github.com/snowflakedb/gosnowflake v1.7.2/go.mod h1:03tW856vc3ceM4rJuj7KO4dzqN7qoezTm+xw7aPIIFo= +github.com/snowflakedb/gosnowflake v1.8.0 h1:4bQj8eAYGMkou/nICiIEb9jSbBLDDp5cB6JaKx9WwiA= +github.com/snowflakedb/gosnowflake v1.8.0/go.mod h1:7yyY2MxtDti2eXgtvlZ8QxzCN6KV2B4qb1HuygMI+0U= 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 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= @@ -345,8 +345,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= @@ -385,12 +385,12 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 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.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/receiver/sqlqueryreceiver/internal/metadata/generated_status.go b/receiver/sqlqueryreceiver/internal/metadata/generated_status.go index 4a818d0e2a13..4f62c5d4b01c 100644 --- a/receiver/sqlqueryreceiver/internal/metadata/generated_status.go +++ b/receiver/sqlqueryreceiver/internal/metadata/generated_status.go @@ -13,8 +13,8 @@ var ( ) const ( - MetricsStability = component.StabilityLevelAlpha LogsStability = component.StabilityLevelDevelopment + MetricsStability = component.StabilityLevelAlpha ) func Meter(settings component.TelemetrySettings) metric.Meter { diff --git a/receiver/sqlqueryreceiver/metadata.yaml b/receiver/sqlqueryreceiver/metadata.yaml index dbe4d52791cd..d76b2dcac828 100644 --- a/receiver/sqlqueryreceiver/metadata.yaml +++ b/receiver/sqlqueryreceiver/metadata.yaml @@ -9,6 +9,3 @@ status: codeowners: active: [dmitryax, crobert-1] emeritus: [pmcollins] - -tests: - config: diff --git a/receiver/sqlserverreceiver/README.md b/receiver/sqlserverreceiver/README.md index 708be0d6ae26..e054dd3f9245 100644 --- a/receiver/sqlserverreceiver/README.md +++ b/receiver/sqlserverreceiver/README.md @@ -6,7 +6,7 @@ | Stability | [beta]: metrics | | Distributions | [contrib], [observiq], [sumo] | | Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Areceiver%2Fsqlserver%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Areceiver%2Fsqlserver) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Areceiver%2Fsqlserver%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Areceiver%2Fsqlserver) | -| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@djaglowski](https://www.github.com/djaglowski), [@StefanKurek](https://www.github.com/StefanKurek) | +| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@djaglowski](https://www.github.com/djaglowski), [@StefanKurek](https://www.github.com/StefanKurek) \| Seeking more code owners! | [beta]: https://github.com/open-telemetry/opentelemetry-collector#beta [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib diff --git a/receiver/sqlserverreceiver/generated_component_test.go b/receiver/sqlserverreceiver/generated_component_test.go new file mode 100644 index 000000000000..3cdf4b1bfb84 --- /dev/null +++ b/receiver/sqlserverreceiver/generated_component_test.go @@ -0,0 +1,62 @@ +// Code generated by mdatagen. DO NOT EDIT. +//go:build !darwin && !linux + +package sqlserverreceiver + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/consumer/consumertest" + "go.opentelemetry.io/collector/receiver" + "go.opentelemetry.io/collector/receiver/receivertest" +) + +func TestComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "metrics", + createFn: func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateMetricsReceiver(ctx, set, cfg, consumertest.NewNop()) + }, + }, + } + + cm, err := confmaptest.LoadConf("metadata.yaml") + require.NoError(t, err) + cfg := factory.CreateDefaultConfig() + sub, err := cm.Sub("tests::config") + require.NoError(t, err) + require.NoError(t, component.UnmarshalConfig(sub, cfg)) + + for _, test := range tests { + t.Run(test.name+"-shutdown", func(t *testing.T) { + c, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + t.Run(test.name+"-lifecycle", func(t *testing.T) { + firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := componenttest.NewNopHost() + require.NoError(t, err) + require.NoError(t, firstRcvr.Start(context.Background(), host)) + require.NoError(t, firstRcvr.Shutdown(context.Background())) + secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + require.NoError(t, secondRcvr.Start(context.Background(), host)) + require.NoError(t, secondRcvr.Shutdown(context.Background())) + }) + } +} diff --git a/receiver/sqlserverreceiver/go.mod b/receiver/sqlserverreceiver/go.mod index 880e97710829..4161fdb3cb99 100644 --- a/receiver/sqlserverreceiver/go.mod +++ b/receiver/sqlserverreceiver/go.mod @@ -17,7 +17,7 @@ require ( go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/sqlserverreceiver/go.sum b/receiver/sqlserverreceiver/go.sum index 362f67077d1f..2918031296ee 100644 --- a/receiver/sqlserverreceiver/go.sum +++ b/receiver/sqlserverreceiver/go.sum @@ -99,8 +99,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/sqlserverreceiver/metadata.yaml b/receiver/sqlserverreceiver/metadata.yaml index a8097c874de2..9d4b45b06e5c 100644 --- a/receiver/sqlserverreceiver/metadata.yaml +++ b/receiver/sqlserverreceiver/metadata.yaml @@ -7,6 +7,8 @@ status: distributions: [contrib, observiq, sumo] codeowners: active: [djaglowski, StefanKurek] + seeking_new: true + unsupported_platforms: [darwin, linux] resource_attributes: sqlserver.database.name: @@ -155,3 +157,6 @@ metrics: unit: "{transactions}/s" gauge: value_type: double + +tests: + config: diff --git a/receiver/sshcheckreceiver/generated_component_test.go b/receiver/sshcheckreceiver/generated_component_test.go index 237250e02178..a5304d1ebc3e 100644 --- a/receiver/sshcheckreceiver/generated_component_test.go +++ b/receiver/sshcheckreceiver/generated_component_test.go @@ -1,5 +1,4 @@ // Code generated by mdatagen. DO NOT EDIT. - //go:build !windows package sshcheckreceiver @@ -11,22 +10,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -57,9 +46,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/sshcheckreceiver/go.mod b/receiver/sshcheckreceiver/go.mod index f64ad6238d1b..c0c00f723680 100644 --- a/receiver/sshcheckreceiver/go.mod +++ b/receiver/sshcheckreceiver/go.mod @@ -17,7 +17,7 @@ require ( go.opentelemetry.io/collector/receiver v0.95.0 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - golang.org/x/crypto v0.19.0 + golang.org/x/crypto v0.20.0 ) require ( @@ -61,8 +61,8 @@ require ( go.opentelemetry.io/otel v1.23.1 // indirect go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 - go.uber.org/zap v1.26.0 - golang.org/x/net v0.20.0 // indirect + go.uber.org/zap v1.27.0 + golang.org/x/net v0.21.0 // indirect golang.org/x/sys v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect google.golang.org/grpc v1.61.0 // indirect diff --git a/receiver/sshcheckreceiver/go.sum b/receiver/sshcheckreceiver/go.sum index 5b839a194367..efae03b8670e 100644 --- a/receiver/sshcheckreceiver/go.sum +++ b/receiver/sshcheckreceiver/go.sum @@ -106,15 +106,15 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= -golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +golang.org/x/crypto v0.20.0 h1:jmAMJJZXr5KiCw05dfYK9QnqaqKLYXijU23lsEdcQqg= +golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZPQ= 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= @@ -125,8 +125,8 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= -golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= +golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= 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/receiver/sshcheckreceiver/metadata.yaml b/receiver/sshcheckreceiver/metadata.yaml index 92846a93301b..a5e408bea000 100644 --- a/receiver/sshcheckreceiver/metadata.yaml +++ b/receiver/sshcheckreceiver/metadata.yaml @@ -66,6 +66,3 @@ metrics: monotonic: false unit: "{error}" attributes: [error.message] - -tests: - config: diff --git a/receiver/statsdreceiver/generated_component_test.go b/receiver/statsdreceiver/generated_component_test.go index df92432bd884..a1e58e5504e2 100644 --- a/receiver/statsdreceiver/generated_component_test.go +++ b/receiver/statsdreceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/statsdreceiver/go.mod b/receiver/statsdreceiver/go.mod index 246d70e076f2..eaa16fb60ee6 100644 --- a/receiver/statsdreceiver/go.mod +++ b/receiver/statsdreceiver/go.mod @@ -14,12 +14,13 @@ require ( go.opentelemetry.io/collector/consumer v0.95.0 go.opentelemetry.io/collector/pdata v1.2.0 go.opentelemetry.io/collector/receiver v0.95.0 + go.opentelemetry.io/collector/semconv v0.95.0 go.opentelemetry.io/otel v1.23.1 go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 gonum.org/v1/gonum v0.14.0 ) diff --git a/receiver/statsdreceiver/go.sum b/receiver/statsdreceiver/go.sum index b6170a4499fb..364c674a8381 100644 --- a/receiver/statsdreceiver/go.sum +++ b/receiver/statsdreceiver/go.sum @@ -104,8 +104,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/statsdreceiver/internal/protocol/metric_translator.go b/receiver/statsdreceiver/internal/protocol/metric_translator.go index 9dc7e7573d9f..cd79d10e34db 100644 --- a/receiver/statsdreceiver/internal/protocol/metric_translator.go +++ b/receiver/statsdreceiver/internal/protocol/metric_translator.go @@ -34,13 +34,20 @@ func buildCounterMetric(parsedMetric statsDMetric, isMonotonicCounter bool) pmet dp.Attributes().PutStr(string(i.Attribute().Key), i.Attribute().Value.AsString()) } + if parsedMetric.timestamp != 0 { + dp.SetTimestamp(pcommon.Timestamp(parsedMetric.timestamp)) + } + return ilm } func setTimestampsForCounterMetric(ilm pmetric.ScopeMetrics, startTime, timeNow time.Time) { dp := ilm.Metrics().At(0).Sum().DataPoints().At(0) dp.SetStartTimestamp(pcommon.NewTimestampFromTime(startTime)) - dp.SetTimestamp(pcommon.NewTimestampFromTime(timeNow)) + + if dp.Timestamp() == 0 { + dp.SetTimestamp(pcommon.NewTimestampFromTime(timeNow)) + } } func buildGaugeMetric(parsedMetric statsDMetric, timeNow time.Time) pmetric.ScopeMetrics { diff --git a/receiver/statsdreceiver/internal/protocol/statsd_parser.go b/receiver/statsdreceiver/internal/protocol/statsd_parser.go index 474fe03945ba..ccbcdd6d108a 100644 --- a/receiver/statsdreceiver/internal/protocol/statsd_parser.go +++ b/receiver/statsdreceiver/internal/protocol/statsd_parser.go @@ -16,6 +16,7 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/pmetric" + semconv "go.opentelemetry.io/collector/semconv/v1.22.0" "go.opentelemetry.io/otel/attribute" ) @@ -128,6 +129,7 @@ type statsDMetric struct { addition bool unit string sampleRate float64 + timestamp uint64 } type statsDMetricDescription struct { @@ -430,6 +432,28 @@ func parseMessageToMetric(line string, enableMetricType bool, enableSimpleTags b kvs = append(kvs, attribute.String(k, v)) } + case strings.HasPrefix(part, "c:"): + // As per DogStatD protocol v1.2: + // https://docs.datadoghq.com/developers/dogstatsd/datagram_shell/?tab=metrics#dogstatsd-protocol-v12 + containerID := strings.TrimPrefix(part, "c:") + + if containerID != "" { + kvs = append(kvs, attribute.String(semconv.AttributeContainerID, containerID)) + } + case strings.HasPrefix(part, "T"): + // As per DogStatD protocol v1.3: + // https://docs.datadoghq.com/developers/dogstatsd/datagram_shell/?tab=metrics#dogstatsd-protocol-v13 + if inType != CounterType && inType != GaugeType { + return result, fmt.Errorf("only GAUGE and COUNT metrics support a timestamp") + } + + timestampStr := strings.TrimPrefix(part, "T") + timestampSeconds, err := strconv.ParseUint(timestampStr, 10, 64) + if err != nil { + return result, fmt.Errorf("invalid timestamp: %s", timestampStr) + } + + result.timestamp = timestampSeconds * 1e9 // Convert seconds to nanoseconds default: return result, fmt.Errorf("unrecognized message part: %s", part) } diff --git a/receiver/statsdreceiver/internal/protocol/statsd_parser_test.go b/receiver/statsdreceiver/internal/protocol/statsd_parser_test.go index d91ee7c3ed27..d37b8579aba6 100644 --- a/receiver/statsdreceiver/internal/protocol/statsd_parser_test.go +++ b/receiver/statsdreceiver/internal/protocol/statsd_parser_test.go @@ -14,6 +14,7 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/pdata/pmetric" + semconv "go.opentelemetry.io/collector/semconv/v1.22.0" "go.opentelemetry.io/otel/attribute" "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/metricstestutil" @@ -68,7 +69,7 @@ func Test_ParseMessageToMetric(t *testing.T) { "test.metric", 42, false, - "c", 0, nil, nil), + "c", 0, nil, nil, 0), }, { name: "integer counter", @@ -77,7 +78,7 @@ func Test_ParseMessageToMetric(t *testing.T) { "test.metric", 42, false, - "c", 0, nil, nil), + "c", 0, nil, nil, 0), }, { name: "invalid counter metric value", @@ -99,7 +100,37 @@ func Test_ParseMessageToMetric(t *testing.T) { "c", 0.1, []string{"key"}, - []string{"value"}), + []string{"value"}, + 0, + ), + }, + { + name: "counter metric with container ID", + input: "test.metric:42|c|#key:value|c:abc123", + wantMetric: testStatsDMetric( + "test.metric", + 42, + false, + "c", + 0, + []string{"key", semconv.AttributeContainerID}, + []string{"value", "abc123"}, + 0, + ), + }, + { + name: "counter metric with timestamp", + input: "test.metric:42|c|T1656581400", + wantMetric: testStatsDMetric( + "test.metric", + 42, + false, + "c", + 0, + nil, + nil, + 1656581400000000000, // Transformed to nanoseconds + ), }, { name: "counter metric with sample rate(not divisible) and tag", @@ -111,7 +142,9 @@ func Test_ParseMessageToMetric(t *testing.T) { "c", 0.8, []string{"key"}, - []string{"value"}), + []string{"value"}, + 0, + ), }, { name: "counter metric with sample rate(not divisible) and two tags", @@ -123,7 +156,9 @@ func Test_ParseMessageToMetric(t *testing.T) { "c", 0.8, []string{"key", "key2"}, - []string{"value", "value2"}), + []string{"value", "value2"}, + 0, + ), }, { name: "double gauge", @@ -132,7 +167,7 @@ func Test_ParseMessageToMetric(t *testing.T) { "test.metric", 42, false, - "g", 0, nil, nil), + "g", 0, nil, nil, 0), }, { name: "int gauge", @@ -141,7 +176,7 @@ func Test_ParseMessageToMetric(t *testing.T) { "test.metric", 42, false, - "g", 0, nil, nil), + "g", 0, nil, nil, 0), }, { name: "invalid gauge metric value", @@ -158,7 +193,9 @@ func Test_ParseMessageToMetric(t *testing.T) { "g", 0.1, []string{"key"}, - []string{"value"}), + []string{"value"}, + 0, + ), }, { name: "gauge metric with sample rate and two tags", @@ -170,7 +207,23 @@ func Test_ParseMessageToMetric(t *testing.T) { "g", 0.8, []string{"key", "key2"}, - []string{"value", "value2"}), + []string{"value", "value2"}, + 0, + ), + }, + { + name: "gauge metric with timestamp", + input: "test.metric:11|g|T1656581400", + wantMetric: testStatsDMetric( + "test.metric", + 11, + false, + "g", + 0, + nil, + nil, + 1656581400000000000, // Transformed to nanoseconds + ), }, { name: "double gauge plus", @@ -179,7 +232,7 @@ func Test_ParseMessageToMetric(t *testing.T) { "test.metric", 42, true, - "g", 0, nil, nil), + "g", 0, nil, nil, 0), }, { name: "double gauge minus", @@ -188,7 +241,7 @@ func Test_ParseMessageToMetric(t *testing.T) { "test.metric", -42, true, - "g", 0, nil, nil), + "g", 0, nil, nil, 0), }, { name: "int gauge plus", @@ -197,7 +250,7 @@ func Test_ParseMessageToMetric(t *testing.T) { "test.metric", 42, true, - "g", 0, nil, nil), + "g", 0, nil, nil, 0), }, { name: "int gauge minus", @@ -206,13 +259,18 @@ func Test_ParseMessageToMetric(t *testing.T) { "test.metric", -42, true, - "g", 0, nil, nil), + "g", 0, nil, nil, 0), }, { name: "invalid histogram metric value", input: "test.metric:42.abc|h", err: errors.New("parse metric value string: 42.abc"), }, + { + name: "invalid histogram with timestamp", + input: "test.metric:42|h|T1656581400", + err: errors.New("only GAUGE and COUNT metrics support a timestamp"), + }, { name: "int timer", input: "test.metric:-42|ms", @@ -220,7 +278,7 @@ func Test_ParseMessageToMetric(t *testing.T) { "test.metric", -42, true, - "ms", 0, nil, nil), + "ms", 0, nil, nil, 0), }, { name: "int histogram", @@ -229,7 +287,7 @@ func Test_ParseMessageToMetric(t *testing.T) { "test.metric", 42, false, - "h", 0, nil, nil), + "h", 0, nil, nil, 0), }, } @@ -263,7 +321,9 @@ func Test_ParseMessageToMetricWithMetricType(t *testing.T) { false, "c", 0, []string{"metric_type"}, - []string{"counter"}), + []string{"counter"}, + 0, + ), }, { name: "counter metric with sample rate and tag", @@ -275,7 +335,9 @@ func Test_ParseMessageToMetricWithMetricType(t *testing.T) { "c", 0.1, []string{"key", "metric_type"}, - []string{"value", "counter"}), + []string{"value", "counter"}, + 0, + ), }, { name: "counter metric with sample rate(not divisible) and tag", @@ -287,7 +349,9 @@ func Test_ParseMessageToMetricWithMetricType(t *testing.T) { "c", 0.8, []string{"key", "metric_type"}, - []string{"value", "counter"}), + []string{"value", "counter"}, + 0, + ), }, { name: "counter metric with sample rate(not divisible) and two tags", @@ -299,7 +363,9 @@ func Test_ParseMessageToMetricWithMetricType(t *testing.T) { "c", 0.8, []string{"key", "key2", "metric_type"}, - []string{"value", "value2", "counter"}), + []string{"value", "value2", "counter"}, + 0, + ), }, { name: "double gauge", @@ -310,7 +376,9 @@ func Test_ParseMessageToMetricWithMetricType(t *testing.T) { false, "g", 0, []string{"metric_type"}, - []string{"gauge"}), + []string{"gauge"}, + 0, + ), }, { name: "int gauge", @@ -321,7 +389,9 @@ func Test_ParseMessageToMetricWithMetricType(t *testing.T) { false, "g", 0, []string{"metric_type"}, - []string{"gauge"}), + []string{"gauge"}, + 0, + ), }, { name: "invalid gauge metric value", @@ -338,7 +408,9 @@ func Test_ParseMessageToMetricWithMetricType(t *testing.T) { "g", 0.1, []string{"key", "metric_type"}, - []string{"value", "gauge"}), + []string{"value", "gauge"}, + 0, + ), }, { name: "gauge metric with sample rate and two tags", @@ -350,7 +422,9 @@ func Test_ParseMessageToMetricWithMetricType(t *testing.T) { "g", 0.8, []string{"key", "key2", "metric_type"}, - []string{"value", "value2", "gauge"}), + []string{"value", "value2", "gauge"}, + 0, + ), }, { name: "double gauge plus", @@ -361,7 +435,9 @@ func Test_ParseMessageToMetricWithMetricType(t *testing.T) { true, "g", 0, []string{"metric_type"}, - []string{"gauge"}), + []string{"gauge"}, + 0, + ), }, { name: "double gauge minus", @@ -372,7 +448,9 @@ func Test_ParseMessageToMetricWithMetricType(t *testing.T) { true, "g", 0, []string{"metric_type"}, - []string{"gauge"}), + []string{"gauge"}, + 0, + ), }, { name: "int gauge plus", @@ -383,7 +461,9 @@ func Test_ParseMessageToMetricWithMetricType(t *testing.T) { true, "g", 0, []string{"metric_type"}, - []string{"gauge"}), + []string{"gauge"}, + 0, + ), }, { name: "int gauge minus", @@ -394,7 +474,9 @@ func Test_ParseMessageToMetricWithMetricType(t *testing.T) { true, "g", 0, []string{"metric_type"}, - []string{"gauge"}), + []string{"gauge"}, + 0, + ), }, { name: "int timer", @@ -405,7 +487,9 @@ func Test_ParseMessageToMetricWithMetricType(t *testing.T) { true, "ms", 0, []string{"metric_type"}, - []string{"timing"}), + []string{"timing"}, + 0, + ), }, { name: "int histogram", @@ -416,7 +500,9 @@ func Test_ParseMessageToMetricWithMetricType(t *testing.T) { false, "h", 0, []string{"metric_type"}, - []string{"histogram"}), + []string{"histogram"}, + 0, + ), }, { name: "int distribution", @@ -427,7 +513,9 @@ func Test_ParseMessageToMetricWithMetricType(t *testing.T) { false, "d", 0, []string{"metric_type"}, - []string{"distribution"}), + []string{"distribution"}, + 0, + ), }, } @@ -462,7 +550,9 @@ func Test_ParseMessageToMetricWithSimpleTags(t *testing.T) { "c", 0.1, []string{"key"}, - []string{"value"}), + []string{"value"}, + 0, + ), }, { name: "counter metric with sample rate and (simple) tag", @@ -474,7 +564,9 @@ func Test_ParseMessageToMetricWithSimpleTags(t *testing.T) { "c", 0.1, []string{"key"}, - []string{""}), + []string{""}, + 0, + ), }, { name: "counter metric with sample rate and two (simple) tags", @@ -486,7 +578,9 @@ func Test_ParseMessageToMetricWithSimpleTags(t *testing.T) { "c", 0.1, []string{"key", "key2"}, - []string{"", ""}), + []string{"", ""}, + 0, + ), }, } @@ -508,7 +602,7 @@ func testStatsDMetric( name string, asFloat float64, addition bool, metricType MetricType, sampleRate float64, labelKeys []string, - labelValue []string, + labelValue []string, timestamp uint64, ) statsDMetric { if len(labelKeys) > 0 { var kvs []attribute.KeyValue @@ -526,6 +620,7 @@ func testStatsDMetric( addition: addition, unit: "", sampleRate: sampleRate, + timestamp: timestamp, } } return statsDMetric{ @@ -537,6 +632,7 @@ func testStatsDMetric( addition: addition, unit: "", sampleRate: sampleRate, + timestamp: timestamp, } } @@ -593,9 +689,29 @@ func TestStatsDParser_Aggregate(t *testing.T) { }, expectedGauges: map[statsDMetricDescription]pmetric.ScopeMetrics{ testDescription("statsdTestMetric1", "g", - []string{"mykey"}, []string{"myvalue"}): buildGaugeMetric(testStatsDMetric("statsdTestMetric1", 10102, false, "g", 0, []string{"mykey"}, []string{"myvalue"}), time.Unix(711, 0)), + []string{"mykey"}, []string{"myvalue"}): buildGaugeMetric( + testStatsDMetric( + "statsdTestMetric1", + 10102, + false, + "g", + 0, + []string{"mykey"}, + []string{"myvalue"}, + 0, + ), time.Unix(711, 0)), testDescription("statsdTestMetric2", "g", - []string{"mykey"}, []string{"myvalue"}): buildGaugeMetric(testStatsDMetric("statsdTestMetric2", 507, false, "g", 0, []string{"mykey"}, []string{"myvalue"}), time.Unix(711, 0)), + []string{"mykey"}, []string{"myvalue"}): buildGaugeMetric( + testStatsDMetric( + "statsdTestMetric2", + 507, + false, + "g", + 0, + []string{"mykey"}, + []string{"myvalue"}, + 0, + ), time.Unix(711, 0)), }, expectedCounters: map[statsDMetricDescription]pmetric.ScopeMetrics{}, }, @@ -615,9 +731,29 @@ func TestStatsDParser_Aggregate(t *testing.T) { }, expectedGauges: map[statsDMetricDescription]pmetric.ScopeMetrics{ testDescription("statsdTestMetric1", "g", - []string{"mykey"}, []string{"myvalue"}): buildGaugeMetric(testStatsDMetric("statsdTestMetric1", 4885, false, "g", 0, []string{"mykey"}, []string{"myvalue"}), time.Unix(711, 0)), + []string{"mykey"}, []string{"myvalue"}): buildGaugeMetric( + testStatsDMetric( + "statsdTestMetric1", + 4885, + false, + "g", + 0, + []string{"mykey"}, + []string{"myvalue"}, + 0, + ), time.Unix(711, 0)), testDescription("statsdTestMetric2", "g", - []string{"mykey"}, []string{"myvalue"}): buildGaugeMetric(testStatsDMetric("statsdTestMetric2", 5, false, "g", 0, []string{"mykey"}, []string{"myvalue"}), time.Unix(711, 0)), + []string{"mykey"}, []string{"myvalue"}): buildGaugeMetric( + testStatsDMetric( + "statsdTestMetric2", + 5, + false, + "g", + 0, + []string{"mykey"}, + []string{"myvalue"}, + 0, + ), time.Unix(711, 0)), }, expectedCounters: map[statsDMetricDescription]pmetric.ScopeMetrics{}, }, @@ -637,9 +773,29 @@ func TestStatsDParser_Aggregate(t *testing.T) { }, expectedGauges: map[statsDMetricDescription]pmetric.ScopeMetrics{ testDescription("statsdTestMetric1", "g", - []string{"mykey"}, []string{"myvalue"}): buildGaugeMetric(testStatsDMetric("statsdTestMetric1", 4101, false, "g", 0, []string{"mykey"}, []string{"myvalue"}), time.Unix(711, 0)), + []string{"mykey"}, []string{"myvalue"}): buildGaugeMetric( + testStatsDMetric( + "statsdTestMetric1", + 4101, + false, + "g", + 0, + []string{"mykey"}, + []string{"myvalue"}, + 0, + ), time.Unix(711, 0)), testDescription("statsdTestMetric2", "g", - []string{"mykey"}, []string{"myvalue"}): buildGaugeMetric(testStatsDMetric("statsdTestMetric2", 200, false, "g", 0, []string{"mykey"}, []string{"myvalue"}), time.Unix(711, 0)), + []string{"mykey"}, []string{"myvalue"}): buildGaugeMetric( + testStatsDMetric( + "statsdTestMetric2", + 200, + false, + "g", + 0, + []string{"mykey"}, + []string{"myvalue"}, + 0, + ), time.Unix(711, 0)), }, expectedCounters: map[statsDMetricDescription]pmetric.ScopeMetrics{}, }, @@ -654,9 +810,29 @@ func TestStatsDParser_Aggregate(t *testing.T) { expectedGauges: map[statsDMetricDescription]pmetric.ScopeMetrics{}, expectedCounters: map[statsDMetricDescription]pmetric.ScopeMetrics{ testDescription("statsdTestMetric1", "c", - []string{"mykey"}, []string{"myvalue"}): buildCounterMetric(testStatsDMetric("statsdTestMetric1", 7000, false, "c", 0, []string{"mykey"}, []string{"myvalue"}), false), + []string{"mykey"}, []string{"myvalue"}): buildCounterMetric( + testStatsDMetric( + "statsdTestMetric1", + 7000, + false, + "c", + 0, + []string{"mykey"}, + []string{"myvalue"}, + 0, + ), false), testDescription("statsdTestMetric2", "c", - []string{"mykey"}, []string{"myvalue"}): buildCounterMetric(testStatsDMetric("statsdTestMetric2", 50, false, "c", 0, []string{"mykey"}, []string{"myvalue"}), false), + []string{"mykey"}, []string{"myvalue"}): buildCounterMetric( + testStatsDMetric( + "statsdTestMetric2", + 50, + false, + "c", + 0, + []string{"mykey"}, + []string{"myvalue"}, + 0, + ), false), }, }, { @@ -674,13 +850,43 @@ func TestStatsDParser_Aggregate(t *testing.T) { }, expectedGauges: map[statsDMetricDescription]pmetric.ScopeMetrics{ testDescription("statsdTestMetric1", "g", - []string{"mykey"}, []string{"myvalue"}): buildGaugeMetric(testStatsDMetric("statsdTestMetric1", 421, false, "g", 0, []string{"mykey"}, []string{"myvalue"}), time.Unix(711, 0)), + []string{"mykey"}, []string{"myvalue"}): buildGaugeMetric( + testStatsDMetric( + "statsdTestMetric1", + 421, + false, + "g", + 0, + []string{"mykey"}, + []string{"myvalue"}, + 0, + ), time.Unix(711, 0)), }, expectedCounters: map[statsDMetricDescription]pmetric.ScopeMetrics{ testDescription("statsdTestMetric1", "c", - []string{"mykey"}, []string{"myvalue"}): buildCounterMetric(testStatsDMetric("statsdTestMetric1", 7000, false, "c", 0, []string{"mykey"}, []string{"myvalue"}), false), + []string{"mykey"}, []string{"myvalue"}): buildCounterMetric( + testStatsDMetric( + "statsdTestMetric1", + 7000, + false, + "c", + 0, + []string{"mykey"}, + []string{"myvalue"}, + 0, + ), false), testDescription("statsdTestMetric2", "c", - []string{"mykey"}, []string{"myvalue"}): buildCounterMetric(testStatsDMetric("statsdTestMetric2", 50, false, "c", 0, []string{"mykey"}, []string{"myvalue"}), false), + []string{"mykey"}, []string{"myvalue"}): buildCounterMetric( + testStatsDMetric( + "statsdTestMetric2", + 50, + false, + "c", + 0, + []string{"mykey"}, + []string{"myvalue"}, + 0, + ), false), }, }, { @@ -699,15 +905,55 @@ func TestStatsDParser_Aggregate(t *testing.T) { }, expectedGauges: map[statsDMetricDescription]pmetric.ScopeMetrics{ testDescription("statsdTestMetric1", "g", - []string{"mykey"}, []string{"myvalue"}): buildGaugeMetric(testStatsDMetric("statsdTestMetric1", 319, false, "g", 0, []string{"mykey"}, []string{"myvalue"}), time.Unix(711, 0)), + []string{"mykey"}, []string{"myvalue"}): buildGaugeMetric( + testStatsDMetric( + "statsdTestMetric1", + 319, + false, + "g", + 0, + []string{"mykey"}, + []string{"myvalue"}, + 0, + ), time.Unix(711, 0)), testDescription("statsdTestMetric1", "g", - []string{"mykey"}, []string{"myvalue1"}): buildGaugeMetric(testStatsDMetric("statsdTestMetric1", 399, false, "g", 0, []string{"mykey"}, []string{"myvalue1"}), time.Unix(711, 0)), + []string{"mykey"}, []string{"myvalue1"}): buildGaugeMetric( + testStatsDMetric( + "statsdTestMetric1", + 399, + false, + "g", + 0, + []string{"mykey"}, + []string{"myvalue1"}, + 0, + ), time.Unix(711, 0)), }, expectedCounters: map[statsDMetricDescription]pmetric.ScopeMetrics{ testDescription("statsdTestMetric1", "c", - []string{"mykey"}, []string{"myvalue"}): buildCounterMetric(testStatsDMetric("statsdTestMetric1", 215, false, "c", 0, []string{"mykey"}, []string{"myvalue"}), false), + []string{"mykey"}, []string{"myvalue"}): buildCounterMetric( + testStatsDMetric( + "statsdTestMetric1", + 215, + false, + "c", + 0, + []string{"mykey"}, + []string{"myvalue"}, + 0, + ), false), testDescription("statsdTestMetric2", "c", - []string{"mykey"}, []string{"myvalue"}): buildCounterMetric(testStatsDMetric("statsdTestMetric2", 75, false, "c", 0, []string{"mykey"}, []string{"myvalue"}), false), + []string{"mykey"}, []string{"myvalue"}): buildCounterMetric( + testStatsDMetric( + "statsdTestMetric2", + 75, + false, + "c", + 0, + []string{"mykey"}, + []string{"myvalue"}, + 0, + ), false), }, }, { @@ -723,12 +969,72 @@ func TestStatsDParser_Aggregate(t *testing.T) { expectedGauges: map[statsDMetricDescription]pmetric.ScopeMetrics{}, expectedCounters: map[statsDMetricDescription]pmetric.ScopeMetrics{}, expectedTimer: []pmetric.ScopeMetrics{ - buildGaugeMetric(testStatsDMetric("statsdTestMetric1", 500, false, "ms", 0, []string{"mykey"}, []string{"myvalue"}), time.Unix(711, 0)), - buildGaugeMetric(testStatsDMetric("statsdTestMetric1", 400, false, "h", 0, []string{"mykey"}, []string{"myvalue"}), time.Unix(711, 0)), - buildGaugeMetric(testStatsDMetric("statsdTestMetric1", 300, false, "ms", 0, []string{"mykey"}, []string{"myvalue"}), time.Unix(711, 0)), - buildGaugeMetric(testStatsDMetric("statsdTestMetric1", 10, false, "h", 0, []string{"mykey"}, []string{"myvalue"}), time.Unix(711, 0)), - buildGaugeMetric(testStatsDMetric("statsdTestMetric1", 100, false, "d", 0, []string{"mykey"}, []string{"myvalue"}), time.Unix(711, 0)), - buildGaugeMetric(testStatsDMetric("statsdTestMetric1", 200, false, "d", 0, []string{"mykey"}, []string{"myvalue"}), time.Unix(711, 0)), + buildGaugeMetric( + testStatsDMetric( + "statsdTestMetric1", + 500, + false, + "ms", + 0, + []string{"mykey"}, + []string{"myvalue"}, + 0, + ), time.Unix(711, 0)), + buildGaugeMetric( + testStatsDMetric( + "statsdTestMetric1", + 400, + false, + "h", + 0, + []string{"mykey"}, + []string{"myvalue"}, + 0, + ), time.Unix(711, 0)), + buildGaugeMetric( + testStatsDMetric( + "statsdTestMetric1", + 300, + false, + "ms", + 0, + []string{"mykey"}, + []string{"myvalue"}, + 0, + ), time.Unix(711, 0)), + buildGaugeMetric( + testStatsDMetric( + "statsdTestMetric1", + 10, + false, + "h", + 0, + []string{"mykey"}, + []string{"myvalue"}, + 0, + ), time.Unix(711, 0)), + buildGaugeMetric( + testStatsDMetric( + "statsdTestMetric1", + 100, + false, + "d", + 0, + []string{"mykey"}, + []string{"myvalue"}, + 0, + ), time.Unix(711, 0)), + buildGaugeMetric( + testStatsDMetric( + "statsdTestMetric1", + 200, + false, + "d", + 0, + []string{"mykey"}, + []string{"myvalue"}, + 0, + ), time.Unix(711, 0)), }, }, } @@ -789,15 +1095,55 @@ func TestStatsDParser_AggregateByAddress(t *testing.T) { expectedGauges: []map[statsDMetricDescription]pmetric.ScopeMetrics{ { testDescription("statsdTestMetric1", "g", - []string{"mykey", "metric_type"}, []string{"myvalue", "gauge"}): buildGaugeMetric(testStatsDMetric("statsdTestMetric1", 10102, false, "g", 0, []string{"mykey", "metric_type"}, []string{"myvalue", "gauge"}), time.Unix(711, 0)), + []string{"mykey", "metric_type"}, []string{"myvalue", "gauge"}): buildGaugeMetric( + testStatsDMetric( + "statsdTestMetric1", + 10102, + false, + "g", + 0, + []string{"mykey", "metric_type"}, + []string{"myvalue", "gauge"}, + 0, + ), time.Unix(711, 0)), testDescription("statsdTestMetric2", "g", - []string{"mykey", "metric_type"}, []string{"myvalue", "gauge"}): buildGaugeMetric(testStatsDMetric("statsdTestMetric2", 507, false, "g", 0, []string{"mykey", "metric_type"}, []string{"myvalue", "gauge"}), time.Unix(711, 0)), + []string{"mykey", "metric_type"}, []string{"myvalue", "gauge"}): buildGaugeMetric( + testStatsDMetric( + "statsdTestMetric2", + 507, + false, + "g", + 0, + []string{"mykey", "metric_type"}, + []string{"myvalue", "gauge"}, + 0, + ), time.Unix(711, 0)), }, { testDescription("statsdTestMetric1", "g", - []string{"mykey", "metric_type"}, []string{"myvalue", "gauge"}): buildGaugeMetric(testStatsDMetric("statsdTestMetric1", 10102, false, "g", 0, []string{"mykey", "metric_type"}, []string{"myvalue", "gauge"}), time.Unix(711, 0)), + []string{"mykey", "metric_type"}, []string{"myvalue", "gauge"}): buildGaugeMetric( + testStatsDMetric( + "statsdTestMetric1", + 10102, + false, + "g", + 0, + []string{"mykey", "metric_type"}, + []string{"myvalue", "gauge"}, + 0, + ), time.Unix(711, 0)), testDescription("statsdTestMetric2", "g", - []string{"mykey", "metric_type"}, []string{"myvalue", "gauge"}): buildGaugeMetric(testStatsDMetric("statsdTestMetric2", 507, false, "g", 0, []string{"mykey", "metric_type"}, []string{"myvalue", "gauge"}), time.Unix(711, 0)), + []string{"mykey", "metric_type"}, []string{"myvalue", "gauge"}): buildGaugeMetric( + testStatsDMetric( + "statsdTestMetric2", + 507, + false, + "g", + 0, + []string{"mykey", "metric_type"}, + []string{"myvalue", "gauge"}, + 0, + ), time.Unix(711, 0)), }, }, }, @@ -845,9 +1191,29 @@ func TestStatsDParser_AggregateWithMetricType(t *testing.T) { }, expectedGauges: map[statsDMetricDescription]pmetric.ScopeMetrics{ testDescription("statsdTestMetric1", "g", - []string{"mykey", "metric_type"}, []string{"myvalue", "gauge"}): buildGaugeMetric(testStatsDMetric("statsdTestMetric1", 10102, false, "g", 0, []string{"mykey", "metric_type"}, []string{"myvalue", "gauge"}), time.Unix(711, 0)), + []string{"mykey", "metric_type"}, []string{"myvalue", "gauge"}): buildGaugeMetric( + testStatsDMetric( + "statsdTestMetric1", + 10102, + false, + "g", + 0, + []string{"mykey", "metric_type"}, + []string{"myvalue", "gauge"}, + 0, + ), time.Unix(711, 0)), testDescription("statsdTestMetric2", "g", - []string{"mykey", "metric_type"}, []string{"myvalue", "gauge"}): buildGaugeMetric(testStatsDMetric("statsdTestMetric2", 507, false, "g", 0, []string{"mykey", "metric_type"}, []string{"myvalue", "gauge"}), time.Unix(711, 0)), + []string{"mykey", "metric_type"}, []string{"myvalue", "gauge"}): buildGaugeMetric( + testStatsDMetric( + "statsdTestMetric2", + 507, + false, + "g", + 0, + []string{"mykey", "metric_type"}, + []string{"myvalue", "gauge"}, + 0, + ), time.Unix(711, 0)), }, expectedCounters: map[statsDMetricDescription]pmetric.ScopeMetrics{}, }, @@ -863,9 +1229,29 @@ func TestStatsDParser_AggregateWithMetricType(t *testing.T) { expectedGauges: map[statsDMetricDescription]pmetric.ScopeMetrics{}, expectedCounters: map[statsDMetricDescription]pmetric.ScopeMetrics{ testDescription("statsdTestMetric1", "c", - []string{"mykey", "metric_type"}, []string{"myvalue", "counter"}): buildCounterMetric(testStatsDMetric("statsdTestMetric1", 7000, false, "c", 0, []string{"mykey", "metric_type"}, []string{"myvalue", "counter"}), false), + []string{"mykey", "metric_type"}, []string{"myvalue", "counter"}): buildCounterMetric( + testStatsDMetric( + "statsdTestMetric1", + 7000, + false, + "c", + 0, + []string{"mykey", "metric_type"}, + []string{"myvalue", "counter"}, + 0, + ), false), testDescription("statsdTestMetric2", "c", - []string{"mykey", "metric_type"}, []string{"myvalue", "counter"}): buildCounterMetric(testStatsDMetric("statsdTestMetric2", 50, false, "c", 0, []string{"mykey", "metric_type"}, []string{"myvalue", "counter"}), false), + []string{"mykey", "metric_type"}, []string{"myvalue", "counter"}): buildCounterMetric( + testStatsDMetric( + "statsdTestMetric2", + 50, + false, + "c", + 0, + []string{"mykey", "metric_type"}, + []string{"myvalue", "counter"}, + 0, + ), false), }, }, } @@ -913,9 +1299,29 @@ func TestStatsDParser_AggregateWithIsMonotonicCounter(t *testing.T) { expectedGauges: map[statsDMetricDescription]pmetric.ScopeMetrics{}, expectedCounters: map[statsDMetricDescription]pmetric.ScopeMetrics{ testDescription("statsdTestMetric1", "c", - []string{"mykey"}, []string{"myvalue"}): buildCounterMetric(testStatsDMetric("statsdTestMetric1", 7000, false, "c", 0, []string{"mykey"}, []string{"myvalue"}), true), + []string{"mykey"}, []string{"myvalue"}): buildCounterMetric( + testStatsDMetric( + "statsdTestMetric1", + 7000, + false, + "c", + 0, + []string{"mykey"}, + []string{"myvalue"}, + 0, + ), true), testDescription("statsdTestMetric2", "c", - []string{"mykey"}, []string{"myvalue"}): buildCounterMetric(testStatsDMetric("statsdTestMetric2", 50, false, "c", 0, []string{"mykey"}, []string{"myvalue"}), true), + []string{"mykey"}, []string{"myvalue"}): buildCounterMetric( + testStatsDMetric( + "statsdTestMetric2", + 50, + false, + "c", + 0, + []string{"mykey"}, + []string{"myvalue"}, + 0, + ), true), }, }, } @@ -1084,12 +1490,52 @@ func TestStatsDParser_GetMetricsWithMetricType(t *testing.T) { assert.NoError(t, p.Initialize(true, false, false, []TimerHistogramMapping{{StatsdType: "timer", ObserverType: "gauge"}, {StatsdType: "histogram", ObserverType: "gauge"}})) instrument := newInstruments(nil) instrument.gauges[testDescription("statsdTestMetric1", "g", - []string{"mykey", "metric_type"}, []string{"myvalue", "gauge"})] = buildGaugeMetric(testStatsDMetric("testGauge1", 1, false, "g", 0, []string{"mykey", "metric_type"}, []string{"myvalue", "gauge"}), time.Unix(711, 0)) + []string{"mykey", "metric_type"}, []string{"myvalue", "gauge"})] = buildGaugeMetric( + testStatsDMetric( + "testGauge1", + 1, + false, + "g", + 0, + []string{"mykey", "metric_type"}, + []string{"myvalue", "gauge"}, + 0, + ), time.Unix(711, 0)) instrument.gauges[testDescription("statsdTestMetric1", "g", - []string{"mykey2", "metric_type"}, []string{"myvalue2", "gauge"})] = buildGaugeMetric(testStatsDMetric("statsdTestMetric1", 10102, false, "g", 0, []string{"mykey2", "metric_type"}, []string{"myvalue2", "gauge"}), time.Unix(711, 0)) + []string{"mykey2", "metric_type"}, []string{"myvalue2", "gauge"})] = buildGaugeMetric( + testStatsDMetric( + "statsdTestMetric1", + 10102, + false, + "g", + 0, + []string{"mykey2", "metric_type"}, + []string{"myvalue2", "gauge"}, + 0, + ), time.Unix(711, 0)) instrument.counters[testDescription("statsdTestMetric1", "g", - []string{"mykey", "metric_type"}, []string{"myvalue", "gauge"})] = buildCounterMetric(testStatsDMetric("statsdTestMetric1", 10102, false, "g", 0, []string{"mykey", "metric_type"}, []string{"myvalue", "gauge"}), false) - instrument.timersAndDistributions = append(instrument.timersAndDistributions, buildGaugeMetric(testStatsDMetric("statsdTestMetric1", 10102, false, "ms", 0, []string{"mykey2", "metric_type"}, []string{"myvalue2", "gauge"}), time.Unix(711, 0))) + []string{"mykey", "metric_type"}, []string{"myvalue", "gauge"})] = buildCounterMetric( + testStatsDMetric( + "statsdTestMetric1", + 10102, + false, + "g", + 0, + []string{"mykey", "metric_type"}, + []string{"myvalue", "gauge"}, + 0, + ), false) + instrument.timersAndDistributions = append(instrument.timersAndDistributions, buildGaugeMetric( + testStatsDMetric( + "statsdTestMetric1", + 10102, + false, + "ms", + 0, + []string{"mykey2", "metric_type"}, + []string{"myvalue2", "gauge"}, + 0, + ), time.Unix(711, 0))) instrument.summaries = map[statsDMetricDescription]summaryMetric{ testDescription("statsdTestMetric1", "h", []string{"mykey"}, []string{"myvalue"}): { diff --git a/receiver/statsdreceiver/metadata.yaml b/receiver/statsdreceiver/metadata.yaml index d11d7b216244..c0e649588670 100644 --- a/receiver/statsdreceiver/metadata.yaml +++ b/receiver/statsdreceiver/metadata.yaml @@ -7,6 +7,3 @@ status: distributions: [contrib, splunk, sumo, aws] codeowners: active: [jmacd, dmitryax] - -tests: - config: diff --git a/receiver/syslogreceiver/generated_component_test.go b/receiver/syslogreceiver/generated_component_test.go index 33db6c7bef17..0d7b3f75ad5d 100644 --- a/receiver/syslogreceiver/generated_component_test.go +++ b/receiver/syslogreceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/syslogreceiver/go.mod b/receiver/syslogreceiver/go.mod index 4ffedff633e8..d4124092bf59 100644 --- a/receiver/syslogreceiver/go.mod +++ b/receiver/syslogreceiver/go.mod @@ -58,7 +58,7 @@ require ( go.opentelemetry.io/otel/sdk v1.23.1 // indirect go.opentelemetry.io/otel/sdk/metric v1.23.1 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.26.0 // indirect + go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.20.0 // indirect golang.org/x/sys v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/receiver/syslogreceiver/go.sum b/receiver/syslogreceiver/go.sum index 596d9bde4eea..290d7b0d0462 100644 --- a/receiver/syslogreceiver/go.sum +++ b/receiver/syslogreceiver/go.sum @@ -126,8 +126,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/tcplogreceiver/generated_component_test.go b/receiver/tcplogreceiver/generated_component_test.go index cb9c44caf806..269bac37a152 100644 --- a/receiver/tcplogreceiver/generated_component_test.go +++ b/receiver/tcplogreceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/tcplogreceiver/go.mod b/receiver/tcplogreceiver/go.mod index 468ba1eb3344..056cf50afde2 100644 --- a/receiver/tcplogreceiver/go.mod +++ b/receiver/tcplogreceiver/go.mod @@ -58,7 +58,7 @@ require ( go.opentelemetry.io/otel/sdk v1.23.1 // indirect go.opentelemetry.io/otel/sdk/metric v1.23.1 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.26.0 // indirect + go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.20.0 // indirect golang.org/x/sys v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/receiver/tcplogreceiver/go.sum b/receiver/tcplogreceiver/go.sum index 596d9bde4eea..290d7b0d0462 100644 --- a/receiver/tcplogreceiver/go.sum +++ b/receiver/tcplogreceiver/go.sum @@ -126,8 +126,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/udplogreceiver/generated_component_test.go b/receiver/udplogreceiver/generated_component_test.go index 3453cfe681ed..ac60549b2d55 100644 --- a/receiver/udplogreceiver/generated_component_test.go +++ b/receiver/udplogreceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/udplogreceiver/go.mod b/receiver/udplogreceiver/go.mod index 7810dad1d736..0bb28dd8589f 100644 --- a/receiver/udplogreceiver/go.mod +++ b/receiver/udplogreceiver/go.mod @@ -54,7 +54,7 @@ require ( go.opentelemetry.io/otel/sdk v1.23.1 // indirect go.opentelemetry.io/otel/sdk/metric v1.23.1 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.26.0 // indirect + go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.20.0 // indirect golang.org/x/sys v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/receiver/udplogreceiver/go.sum b/receiver/udplogreceiver/go.sum index d9c873e7c09f..3e81d70c7d47 100644 --- a/receiver/udplogreceiver/go.sum +++ b/receiver/udplogreceiver/go.sum @@ -118,8 +118,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/vcenterreceiver/README.md b/receiver/vcenterreceiver/README.md index 5b55ee2d4951..3a4a0f83e791 100644 --- a/receiver/vcenterreceiver/README.md +++ b/receiver/vcenterreceiver/README.md @@ -6,7 +6,7 @@ | Stability | [alpha]: metrics | | Distributions | [contrib], [observiq], [sumo] | | Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Areceiver%2Fvcenter%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Areceiver%2Fvcenter) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Areceiver%2Fvcenter%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Areceiver%2Fvcenter) | -| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@djaglowski](https://www.github.com/djaglowski), [@schmikei](https://www.github.com/schmikei) | +| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@djaglowski](https://www.github.com/djaglowski), [@schmikei](https://www.github.com/schmikei) \| Seeking more code owners! | [alpha]: https://github.com/open-telemetry/opentelemetry-collector#alpha [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib diff --git a/receiver/vcenterreceiver/generated_component_test.go b/receiver/vcenterreceiver/generated_component_test.go index fd2036a45bde..fec61aef1064 100644 --- a/receiver/vcenterreceiver/generated_component_test.go +++ b/receiver/vcenterreceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/vcenterreceiver/go.mod b/receiver/vcenterreceiver/go.mod index 61d49ff6c7c9..0708c352195f 100644 --- a/receiver/vcenterreceiver/go.mod +++ b/receiver/vcenterreceiver/go.mod @@ -22,7 +22,7 @@ require ( go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/vcenterreceiver/go.sum b/receiver/vcenterreceiver/go.sum index 077a558bf4e8..6bd38a9e5d9e 100644 --- a/receiver/vcenterreceiver/go.sum +++ b/receiver/vcenterreceiver/go.sum @@ -189,8 +189,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/vcenterreceiver/metadata.yaml b/receiver/vcenterreceiver/metadata.yaml index 55cfebf3095b..c7c462c84857 100644 --- a/receiver/vcenterreceiver/metadata.yaml +++ b/receiver/vcenterreceiver/metadata.yaml @@ -7,6 +7,7 @@ status: distributions: [contrib, observiq, sumo] codeowners: active: [djaglowski, schmikei] + seeking_new: true resource_attributes: vcenter.cluster.name: @@ -421,6 +422,3 @@ metrics: gauge: value_type: double attributes: [] - -tests: - config: diff --git a/receiver/wavefrontreceiver/generated_component_test.go b/receiver/wavefrontreceiver/generated_component_test.go index ff0b98638dc4..0351479be02b 100644 --- a/receiver/wavefrontreceiver/generated_component_test.go +++ b/receiver/wavefrontreceiver/generated_component_test.go @@ -8,23 +8,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,22 +44,5 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - require.NoError(t, err) - require.NoError(t, firstRcvr.Start(context.Background(), host)) - require.NoError(t, firstRcvr.Shutdown(context.Background())) - secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - require.NoError(t, secondRcvr.Start(context.Background(), host)) - require.NoError(t, secondRcvr.Shutdown(context.Background())) - }) } } diff --git a/receiver/wavefrontreceiver/go.mod b/receiver/wavefrontreceiver/go.mod index c6f69a425bb3..81aa64e8edf7 100644 --- a/receiver/wavefrontreceiver/go.mod +++ b/receiver/wavefrontreceiver/go.mod @@ -50,7 +50,7 @@ require ( go.opentelemetry.io/otel/sdk v1.23.1 // indirect go.opentelemetry.io/otel/sdk/metric v1.23.1 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.26.0 // indirect + go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.20.0 // indirect golang.org/x/sys v0.16.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/receiver/wavefrontreceiver/go.sum b/receiver/wavefrontreceiver/go.sum index 0d9804408d4c..1df6fac2c6d4 100644 --- a/receiver/wavefrontreceiver/go.sum +++ b/receiver/wavefrontreceiver/go.sum @@ -100,8 +100,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/wavefrontreceiver/metadata.yaml b/receiver/wavefrontreceiver/metadata.yaml index d6829633cbf2..a4e833962661 100644 --- a/receiver/wavefrontreceiver/metadata.yaml +++ b/receiver/wavefrontreceiver/metadata.yaml @@ -8,6 +8,6 @@ status: codeowners: active: [samiura] +# TODO: Update the receiver to pass the tests tests: - config: skip_lifecycle: true diff --git a/receiver/webhookeventreceiver/generated_component_test.go b/receiver/webhookeventreceiver/generated_component_test.go index 8403a1689658..24fb011d6c0a 100644 --- a/receiver/webhookeventreceiver/generated_component_test.go +++ b/receiver/webhookeventreceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/webhookeventreceiver/go.mod b/receiver/webhookeventreceiver/go.mod index e56c87e22dc2..dad1f9945616 100644 --- a/receiver/webhookeventreceiver/go.mod +++ b/receiver/webhookeventreceiver/go.mod @@ -16,7 +16,7 @@ require ( go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/webhookeventreceiver/go.sum b/receiver/webhookeventreceiver/go.sum index 8b4fc6eddc55..9b9fe7720baa 100644 --- a/receiver/webhookeventreceiver/go.sum +++ b/receiver/webhookeventreceiver/go.sum @@ -128,8 +128,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/windowseventlogreceiver/generated_component_test.go b/receiver/windowseventlogreceiver/generated_component_test.go new file mode 100644 index 000000000000..5f007a661ca7 --- /dev/null +++ b/receiver/windowseventlogreceiver/generated_component_test.go @@ -0,0 +1,62 @@ +// Code generated by mdatagen. DO NOT EDIT. +//go:build !darwin && !linux + +package windowseventlogreceiver + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/consumer/consumertest" + "go.opentelemetry.io/collector/receiver" + "go.opentelemetry.io/collector/receiver/receivertest" +) + +func TestComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "logs", + createFn: func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateLogsReceiver(ctx, set, cfg, consumertest.NewNop()) + }, + }, + } + + cm, err := confmaptest.LoadConf("metadata.yaml") + require.NoError(t, err) + cfg := factory.CreateDefaultConfig() + sub, err := cm.Sub("tests::config") + require.NoError(t, err) + require.NoError(t, component.UnmarshalConfig(sub, cfg)) + + for _, test := range tests { + t.Run(test.name+"-shutdown", func(t *testing.T) { + c, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + t.Run(test.name+"-lifecycle", func(t *testing.T) { + firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := componenttest.NewNopHost() + require.NoError(t, err) + require.NoError(t, firstRcvr.Start(context.Background(), host)) + require.NoError(t, firstRcvr.Shutdown(context.Background())) + secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + require.NoError(t, secondRcvr.Start(context.Background(), host)) + require.NoError(t, secondRcvr.Shutdown(context.Background())) + }) + } +} diff --git a/receiver/windowseventlogreceiver/go.mod b/receiver/windowseventlogreceiver/go.mod index 0a7fd5cc7611..de88d8e5af8d 100644 --- a/receiver/windowseventlogreceiver/go.mod +++ b/receiver/windowseventlogreceiver/go.mod @@ -55,7 +55,7 @@ require ( go.opentelemetry.io/otel/sdk v1.23.1 // indirect go.opentelemetry.io/otel/sdk/metric v1.23.1 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.26.0 // indirect + go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.20.0 // indirect golang.org/x/text v0.14.0 // indirect gonum.org/v1/gonum v0.14.0 // indirect diff --git a/receiver/windowseventlogreceiver/go.sum b/receiver/windowseventlogreceiver/go.sum index d9c873e7c09f..3e81d70c7d47 100644 --- a/receiver/windowseventlogreceiver/go.sum +++ b/receiver/windowseventlogreceiver/go.sum @@ -118,8 +118,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/windowseventlogreceiver/metadata.yaml b/receiver/windowseventlogreceiver/metadata.yaml index ab5ea991d73c..5f2451759758 100644 --- a/receiver/windowseventlogreceiver/metadata.yaml +++ b/receiver/windowseventlogreceiver/metadata.yaml @@ -6,4 +6,8 @@ status: alpha: [logs] distributions: [contrib, splunk, observiq, sumo] codeowners: - active: [djaglowski, armstrmi, pjanotti] \ No newline at end of file + active: [djaglowski, armstrmi, pjanotti] + unsupported_platforms: [darwin, linux] + +tests: + config: diff --git a/receiver/windowsperfcountersreceiver/generated_component_test.go b/receiver/windowsperfcountersreceiver/generated_component_test.go new file mode 100644 index 000000000000..347f5b63d2fd --- /dev/null +++ b/receiver/windowsperfcountersreceiver/generated_component_test.go @@ -0,0 +1,62 @@ +// Code generated by mdatagen. DO NOT EDIT. +//go:build !darwin && !linux + +package windowsperfcountersreceiver + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/consumer/consumertest" + "go.opentelemetry.io/collector/receiver" + "go.opentelemetry.io/collector/receiver/receivertest" +) + +func TestComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "metrics", + createFn: func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateMetricsReceiver(ctx, set, cfg, consumertest.NewNop()) + }, + }, + } + + cm, err := confmaptest.LoadConf("metadata.yaml") + require.NoError(t, err) + cfg := factory.CreateDefaultConfig() + sub, err := cm.Sub("tests::config") + require.NoError(t, err) + require.NoError(t, component.UnmarshalConfig(sub, cfg)) + + for _, test := range tests { + t.Run(test.name+"-shutdown", func(t *testing.T) { + c, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + t.Run(test.name+"-lifecycle", func(t *testing.T) { + firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := componenttest.NewNopHost() + require.NoError(t, err) + require.NoError(t, firstRcvr.Start(context.Background(), host)) + require.NoError(t, firstRcvr.Shutdown(context.Background())) + secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + require.NoError(t, secondRcvr.Start(context.Background(), host)) + require.NoError(t, secondRcvr.Shutdown(context.Background())) + }) + } +} diff --git a/receiver/windowsperfcountersreceiver/go.mod b/receiver/windowsperfcountersreceiver/go.mod index 219ff03d4985..53b2d397ef52 100644 --- a/receiver/windowsperfcountersreceiver/go.mod +++ b/receiver/windowsperfcountersreceiver/go.mod @@ -16,7 +16,7 @@ require ( go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/windowsperfcountersreceiver/go.sum b/receiver/windowsperfcountersreceiver/go.sum index dce80dc70e96..213c963f8055 100644 --- a/receiver/windowsperfcountersreceiver/go.sum +++ b/receiver/windowsperfcountersreceiver/go.sum @@ -94,8 +94,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/windowsperfcountersreceiver/metadata.yaml b/receiver/windowsperfcountersreceiver/metadata.yaml index 482a82cefcb1..872aecf325b9 100644 --- a/receiver/windowsperfcountersreceiver/metadata.yaml +++ b/receiver/windowsperfcountersreceiver/metadata.yaml @@ -7,3 +7,7 @@ status: distributions: [contrib, splunk, observiq, sumo] codeowners: active: [dashpole] + unsupported_platforms: [darwin, linux] + +tests: + config: diff --git a/receiver/zipkinreceiver/generated_component_test.go b/receiver/zipkinreceiver/generated_component_test.go index 71addaeb63a9..c7ea198e355c 100644 --- a/receiver/zipkinreceiver/generated_component_test.go +++ b/receiver/zipkinreceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/zipkinreceiver/go.mod b/receiver/zipkinreceiver/go.mod index 2174521de3e0..6b437e1bd93e 100644 --- a/receiver/zipkinreceiver/go.mod +++ b/receiver/zipkinreceiver/go.mod @@ -68,7 +68,7 @@ require ( go.opentelemetry.io/otel/sdk v1.23.1 // indirect go.opentelemetry.io/otel/sdk/metric v1.23.1 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.26.0 // indirect + go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.21.0 // indirect golang.org/x/sys v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/receiver/zipkinreceiver/go.sum b/receiver/zipkinreceiver/go.sum index c8467cbc057a..272babf594b9 100644 --- a/receiver/zipkinreceiver/go.sum +++ b/receiver/zipkinreceiver/go.sum @@ -136,8 +136,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/zipkinreceiver/metadata.yaml b/receiver/zipkinreceiver/metadata.yaml index e0c7eadb0b3d..0228140f6fb5 100644 --- a/receiver/zipkinreceiver/metadata.yaml +++ b/receiver/zipkinreceiver/metadata.yaml @@ -16,6 +16,3 @@ status: - liatrio codeowners: active: [MovieStoreGuy, astencel-sumo, crobert-1] - -tests: - config: diff --git a/receiver/zookeeperreceiver/README.md b/receiver/zookeeperreceiver/README.md index 8930591c7bd4..62f62ff2f065 100644 --- a/receiver/zookeeperreceiver/README.md +++ b/receiver/zookeeperreceiver/README.md @@ -6,7 +6,7 @@ | Stability | [development]: metrics | | Distributions | [contrib], [observiq], [sumo] | | Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Areceiver%2Fzookeeper%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Areceiver%2Fzookeeper) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Areceiver%2Fzookeeper%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Areceiver%2Fzookeeper) | -| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@djaglowski](https://www.github.com/djaglowski) | +| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@djaglowski](https://www.github.com/djaglowski) \| Seeking more code owners! | [development]: https://github.com/open-telemetry/opentelemetry-collector#development [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib diff --git a/receiver/zookeeperreceiver/generated_component_test.go b/receiver/zookeeperreceiver/generated_component_test.go index 933fc8ef36f9..ebc3a3e52748 100644 --- a/receiver/zookeeperreceiver/generated_component_test.go +++ b/receiver/zookeeperreceiver/generated_component_test.go @@ -9,22 +9,12 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -var _ component.Host = (*assertNoErrorHost)(nil) - func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -55,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/zookeeperreceiver/go.mod b/receiver/zookeeperreceiver/go.mod index 1f96868eb329..bb98bb2997f4 100644 --- a/receiver/zookeeperreceiver/go.mod +++ b/receiver/zookeeperreceiver/go.mod @@ -19,7 +19,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/goleak v1.3.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( diff --git a/receiver/zookeeperreceiver/go.sum b/receiver/zookeeperreceiver/go.sum index 45200f869f25..9a7accdaebca 100644 --- a/receiver/zookeeperreceiver/go.sum +++ b/receiver/zookeeperreceiver/go.sum @@ -179,8 +179,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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= diff --git a/receiver/zookeeperreceiver/metadata.yaml b/receiver/zookeeperreceiver/metadata.yaml index 9d86b310e2e1..bf071d7724d9 100644 --- a/receiver/zookeeperreceiver/metadata.yaml +++ b/receiver/zookeeperreceiver/metadata.yaml @@ -7,6 +7,7 @@ status: distributions: [contrib, observiq, sumo] codeowners: active: [djaglowski] + seeking_new: true resource_attributes: server.state: diff --git a/reports/distributions/contrib.yaml b/reports/distributions/contrib.yaml index ecb70ffa69b1..70309c62f875 100644 --- a/reports/distributions/contrib.yaml +++ b/reports/distributions/contrib.yaml @@ -25,7 +25,6 @@ components: - dataset - dynatrace - elasticsearch - - f5cloud - file - googlecloud - googlecloudpubsub @@ -67,7 +66,6 @@ components: - headers_setter - health_check - host_observer - - http_forwarder - jaegerremotesampling - k8s_observer - oauth2client @@ -91,7 +89,6 @@ components: - resourcedetection - routing - span - - spanmetrics - sumologic - tail_sampling - transform diff --git a/reports/distributions/grafana.yaml b/reports/distributions/grafana.yaml index a5d8add005d8..16445803bfc7 100644 --- a/reports/distributions/grafana.yaml +++ b/reports/distributions/grafana.yaml @@ -19,6 +19,7 @@ components: - attributes - k8sattributes - probabilistic_sampler + - resourcedetection - span - tail_sampling - transform diff --git a/reports/distributions/observiq.yaml b/reports/distributions/observiq.yaml index edcc9522076c..0ffbb50473ed 100644 --- a/reports/distributions/observiq.yaml +++ b/reports/distributions/observiq.yaml @@ -15,7 +15,6 @@ components: - datadog - dynatrace - elasticsearch - - f5cloud - file - googlecloud - googlecloudpubsub @@ -54,7 +53,6 @@ components: - resourcedetection - routing - span - - spanmetrics - tail_sampling - transform receiver: diff --git a/reports/distributions/splunk.yaml b/reports/distributions/splunk.yaml index 8cd7d81c7901..3c1ef06b978f 100644 --- a/reports/distributions/splunk.yaml +++ b/reports/distributions/splunk.yaml @@ -32,7 +32,6 @@ components: - file_storage - health_check - host_observer - - http_forwarder - k8s_observer - pprof processor: @@ -47,7 +46,6 @@ components: - resourcedetection - routing - span - - spanmetrics - tail_sampling - transform receiver: diff --git a/reports/distributions/sumo.yaml b/reports/distributions/sumo.yaml index 586a09756347..b0f494ae78df 100644 --- a/reports/distributions/sumo.yaml +++ b/reports/distributions/sumo.yaml @@ -32,7 +32,6 @@ components: - headers_setter - health_check - host_observer - - http_forwarder - jaegerremotesampling - k8s_observer - oauth2client @@ -58,7 +57,6 @@ components: - routing - schema - span - - spanmetrics - sumologic - tail_sampling - transform diff --git a/testbed/go.mod b/testbed/go.mod index 8fc467f1b184..dbbc17772f8e 100644 --- a/testbed/go.mod +++ b/testbed/go.mod @@ -29,7 +29,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/receiver/syslogreceiver v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver v0.95.0 github.com/open-telemetry/opentelemetry-collector-contrib/testbed/mockdatasenders/mockdatadogagentexporter v0.95.0 - github.com/prometheus/common v0.46.0 + github.com/prometheus/common v0.48.0 github.com/prometheus/prometheus v0.48.1 github.com/shirou/gopsutil/v3 v3.24.1 github.com/stretchr/testify v1.8.4 @@ -60,7 +60,7 @@ require ( go.opentelemetry.io/collector/semconv v0.95.0 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 golang.org/x/text v0.14.0 google.golang.org/grpc v1.61.0 ) @@ -74,7 +74,7 @@ require ( github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v4 v4.2.1 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2 v2.2.1 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1 // indirect - github.com/DataDog/datadog-agent/pkg/proto v0.50.2 // indirect + github.com/DataDog/datadog-agent/pkg/proto v0.51.1-0.20240301173728-334e775e420a // indirect github.com/DataDog/datadog-agent/pkg/trace/exportable v0.0.0-20201016145401-4646cf596b02 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect @@ -154,7 +154,7 @@ require ( github.com/josharian/intern v1.0.0 // indirect github.com/jpillora/backoff v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.17.6 // indirect + github.com/klauspost/compress v1.17.7 // 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.0 // indirect @@ -195,7 +195,7 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect - github.com/prometheus/client_golang v1.18.0 // indirect + github.com/prometheus/client_golang v1.19.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/common/sigv4 v0.1.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect diff --git a/testbed/go.sum b/testbed/go.sum index 8165939f3910..65c9a7023aa6 100644 --- a/testbed/go.sum +++ b/testbed/go.sum @@ -57,8 +57,8 @@ github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1 h1:WpB/QDNLpMw github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/DataDog/datadog-agent/pkg/proto v0.50.2 h1:dDg+U7ERLvir5D/TkJ6xA/RvU1hXcujTjCJoZG03KZE= -github.com/DataDog/datadog-agent/pkg/proto v0.50.2/go.mod h1:HvK26YCxg6MfYvPJgpHC7nSjw6DTpNhd75Wlb0GAvis= +github.com/DataDog/datadog-agent/pkg/proto v0.51.1-0.20240301173728-334e775e420a h1:vN5cl8mKqADznzz6cnz/lgoBfHVs4zDgz0fr0ZkeXa4= +github.com/DataDog/datadog-agent/pkg/proto v0.51.1-0.20240301173728-334e775e420a/go.mod h1:wjr5YlVvGip6VmAGzHrdBaGUu1LaA9B6gHvInm5kHiY= github.com/DataDog/datadog-agent/pkg/trace/exportable v0.0.0-20201016145401-4646cf596b02 h1:N2BRKjJ/c+ipDwt5b+ijqEc2EsmK3zXq2lNeIPnSwMI= github.com/DataDog/datadog-agent/pkg/trace/exportable v0.0.0-20201016145401-4646cf596b02/go.mod h1:EalMiS87Guu6PkLdxz7gmWqi+dRs9sjYLTOyTrM/aVU= github.com/DataDog/datadog-agent/pkg/util/log v0.0.0-20201009091607-ce4e57cdf8f4/go.mod h1:cRy7lwapA3jcjnX74kU6NFkXaRGQyB0l/QZA0IwYGEQ= @@ -405,8 +405,8 @@ github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8 github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= 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.6 h1:60eq2E/jlfwQXtvZEeBUYADs+BwKBWURIY+Gj2eRGjI= -github.com/klauspost/compress v1.17.6/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLAKQQg= +github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= @@ -535,8 +535,8 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= -github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= +github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= +github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -548,8 +548,8 @@ github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8b github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.29.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.46.0 h1:doXzt5ybi1HBKpsZOL0sSkaNHJJqkyfEWZGGqqScV0Y= -github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1BTn+g2pa/hQ= +github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE= +github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= github.com/prometheus/common/sigv4 v0.1.0 h1:qoVebwtwwEhS85Czm2dSROY5fTo2PAPEVdDeppTwGX4= github.com/prometheus/common/sigv4 v0.1.0/go.mod h1:2Jkxxk9yYvCkE5G1sQT7GuEXm57JrvHu9k5YwTjsNtI= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= @@ -790,8 +790,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +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-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= diff --git a/versions.yaml b/versions.yaml index 9d438626e772..2e44c661b020 100644 --- a/versions.yaml +++ b/versions.yaml @@ -40,7 +40,6 @@ module-sets: - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/datasetexporter - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/dynatraceexporter - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/elasticsearchexporter - - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/f5cloudexporter - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/googlecloudexporter - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/googlemanagedprometheusexporter @@ -83,7 +82,6 @@ module-sets: - github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension - github.com/open-telemetry/opentelemetry-collector-contrib/extension/headerssetterextension - github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension - - github.com/open-telemetry/opentelemetry-collector-contrib/extension/httpforwarder - github.com/open-telemetry/opentelemetry-collector-contrib/extension/httpforwarderextension - github.com/open-telemetry/opentelemetry-collector-contrib/extension/jaegerremotesampling - github.com/open-telemetry/opentelemetry-collector-contrib/extension/oauth2clientauthextension @@ -166,7 +164,6 @@ module-sets: - github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor - github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor - github.com/open-telemetry/opentelemetry-collector-contrib/processor/schemaprocessor - - github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanmetricsprocessor - github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanprocessor - github.com/open-telemetry/opentelemetry-collector-contrib/processor/sumologicprocessor - github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor